Thursday, October 28, 2010

Oracle WebCenter Interaction: Getting Around Adaptive Layout Stylesheet Conflict

In BEA AquaLogic UserInteraction 6.5 the concept of Adaptive Layouts was established to allow for simplified customization to general areas of the portal such as the search results pane, and portlet windows.
Unfortunately one detail they neglected to take into account was that some customers might like to also modify the corresponding adaptive layout stylesheet, which is an entirely different css than those generated by the CSS mill.

After making some modifications to our adaptive layout files and the corresponding CSS, I was disappointed to see that the default layouts were mucked up by my changes.  A support ticket confirmed that nothing had been done around this and there wasn't a solution in place.

Some options were available at this point:
  1. Don't modify the css...
  2. Assuming only one new css file is needed, forgo the original adaptive layouts and stick with the new changes
  3. Create all new css labels corresponding to the layout modifications, then either add them to the original css or as an addition to the standard css
  4. Redo the customizations so that they don't step on the toe's of the old customizations
  5. Blank out the entire mainstyle.css file and add new stylesheet paths into each adaptive layout (original and new)
Naturally, none of these reactive solutions appealed to me and just when I was about to throw in the towel and go with option #5 it dawned on me that there was an option #6!

6. Change the customized basepagelayout.html files to include the new stylesheet! Then you just need to call the basepagelayout associated with the stylesheet you want!

Ta-da!

Wednesday, October 27, 2010

Oracle WebCenter Interaction Studio Input Field Black Hole

Studio is a dated product, but one that a lot of WebCenter Interaction customers probably still use.

Recently I was informed about an error in a Record Browser portlet where users where being presented with an error that says "An error occurred processing this Studio request."  The browser title says "Studio: Runtime Error".

The screenshot accompanying our help desk ticket indicated that the user was on Firefox in a Mac environment.  A quick scan of the Studio log file showed the following error:
ERROR [Processor4] GatewayServlet: An error occurred processing this Studio request.
19:29:00 | - Error processing request (handler apprun.doPostEntryForm).
19:29:00 | - Error inserting record in user database Self Assessment Database.
19:29:00 | - [<server>]String or binary data would be truncated.
19:29:00 | java.sql.SQLException: [<server>]String or binary data would be truncated.
In an effort to reproduce the problem I counted out 10 digits (1234567890) and copied and pasted their string (including a space) into the form field in Firefox until I had about 900 characters.  Immediately I received a handled exception error telling me that I'd gone over the character limit and that my input would be truncated (a not so friendly feature).

Next I began reducing the number by 20, and by the time I hit 850 I was able to reproduce the error.  Removing only another 30 characters and the entry submitted without problem.

Inputting the same data into the same field in IE8 caused no such problems, and I even went through the same addition/subtraction process to verify in both rich text and non-rich text fields.

Summary: It seems there is a 50 character blackhole that non-IE users will encounter.
Our solution at this time is going to be avoiding using Studio for those groups that are on Macs (since they don't support IE), and for any groups that have a browser choice (extranet users).

Wednesday, October 20, 2010

Performing a Redirect in Oracle WebCenter Interaction

Recently we implemented a jquery flyout page navigation (look for a blog post about that soon) within our Oracle WebCenter Interaction install.
One issue that it wasn't coded to handle was related and sub communities.

Currently users navigate to these related communities by going to the home page of the parent community and clicking the link there.  We have an issue where we don't want these related communities to clutter the "My Communities" dropdown, yet feel they need to be represented in some way in the flyout page navigation because with the new navigation folks are more sensitive to the titles of things and expect appropriate representation.

To illustrate the point, here is the layout with the problem being showing Conference A and B on the Conferences and Meetings Community:
  1. My Communities
    1. Conferences and Meetings Community
      1. Home page
        1. Conference A Community
          1. Home page
          2. Agenda page
          3. Registration page
        2. Conference B Community
          1. Home page
          2. Agenda page
          3. Registration page
I looked into DNS and web server redirecting and neither seemed able to handle this issue (if you think or know otherwise I'd be all ears!!!), so my ugly solution is to simply create stub pages on the Conferences and Meetings community with portlets on each that have simple javascript redirects.
It isn't pretty, but it gets the job done.

Here is the snippet that does the redirect within the stub page portlet:

<script type="text/javascript">
window.location = "http://website/portal/server.pt/community/conference_A/111"
</script>

Yes, yes, I know this isn't anything you couldn't figure out in 1/2 a second by going to google, or probably you already know off the top of your head. It was a slow day for me!
<!--409551bd517c4e7ba493f12ff3a6530d-->

Friday, October 8, 2010

Screen Scraping Content To Excel via Web Connectors

My friends love to tease me for being a "spreadsheet guy" because I make spreadsheets for nearly everything under the sun.  Mostly product comparisons, financial analysis(ish), stuff like that.

One spreadsheet that I work on very frequently deals with 401k fund options from my employer.  Due diligence on 150 funds is a time consuming process.  To help me make semi-educated picks I browse finance.yahoo.com to look at stats such as the beta, expense ratio, manager tenure, turnover, yield, (1, 3, 5, 10) year load adjusted returns, etc.

The problem? These stats change constantly, and manually updating a spreadsheet is a chore!

Recently I was investigating data streams for a keystroke biometric project that I'm working on and came across some information that led me to believe that creating data connections through Excel would be a snap. 

If you open MS Excel 2007+ and go to the Data tab you'll notice there are several external data connection options (Access, Web, Text).

If you jab the "Web" button it'll open your default IE home page within a window with Yellow boxes and black arrows all over.  These boxes identify html table structures.  By selecting one (or more) of these tables you are indicating to the web connector that you'd like to import that content. Click ok and it'll give you the option to import that content into an existing worksheet or a new one. 

Rather than creating unique connections via the UI, you could create and point to saved data connectors (.iqy files).  Click the "Existing Connections" button and you'll uncover 3 examples from MSN Money, 2 of which are templates that once connected allow you to map your variables. 
I've set my connections to update upon file open and that process takes approximately 1.5 minutes for 24 connectors, so just under 4 seconds per record.  I'm assuming that I can extrapolate that number out to 9 minutes for the 150 connectors I'll eventually need (based upon a template using a single .iqy file I wrote).  While I'm not very patient when it comes to waiting for files to open, the reality is that having to do this manually would take me about 2 hours, so 9 minutes doesn't seem all that bad.

I wish Access had a feature where I could schedule the imports! But then again I'm sure there is a more elegant solution to my problem here.  So with that said, if anyone has suggestions for alternate ways to extract mutual fund data for analysis (to a database, XML, excel or whatever) I'd be all ears!

Tuesday, October 5, 2010

Using iCalendar Files to Enhance Content Items in WCI Publisher

Registering for events using Go2Meeting and WebEx is easy as can be.  But when those tools aren't available, and you need to rely on out of the box functionality from Oracle's WebCenter Interaction, the registration process leaves something to be desired.

Where I work we do more conference calls than webinars.  Creating announcements on our intranet about these events is great for spreading the word but the problem is that if there isn't a reminder the day of the event most folks will have forgotten about it. Sure, folks should just create calendar appointments and manage their own time, but getting them to setup meetings in Outlook can be difficult enough.

How then, can one remind an employee of a pending conference call or event?
Enter the .ics file!

Attaching an .ics file via a link is straight forward.  Attaching one to a content item in WebCenter Interaction Publisher is slightly more involved.

The easiest way is to add a property of type "file" to the Data Entry Template (DET) which will allow users to upload their saved .ics files.  On the positive side this allows for template control over where the .ics files are linked in a content item, and for consistent verbiage such as "Add this event to your Outlook Calendar".
For more advanced content managers, they could go into Publisher Explorer and upload their .ics files and then control where their links are placed - a far too complicated approach for many.

So now, you've gone ahead and setup your DET and called it in your Presentation Template (PT).  Created an .ics file for testing (either in Notepad or saved out of Outlook or another tool), created a new content item and attached the file, and then you open the published content item, click the .ics link and ~fizzle~! 

Why is it opening in a text editor? and not popping open the familiar "Open/Save" dialog?


When file don't behave in an expected way over the web, the problem usually lies with mime type declarations.  But there are about a half dozen mime settings in a WCI install - web servers, portal utilities, publisher, etc.  I'll spare you all the mindless trouble-shooting I went through to figure this out and instead just pull the rabbit out of the hat for you...

~ drum roll please  ~

If you guessed \bea\alui\ptcs\6.5\container\deploy\jbossweb-tomcat50.sar\conf\web.xml then you win your choice of the hat or the rabbit!

1. Backup the web.xml file to a different folder
2. Add the following to the MIME mapping section:
< mime-mapping >
  < extension > ics < /extension >
  < mime-type > application/octet-stream < /mime-type >
< /mime-mapping >
3. Save file and restart publisher

At this point if you retry your content item you should find that the behavior for the .ics file is now different and will open the expected dialog window with the "Open/Save" options.