Archive for the ‘Knowledge Directory’ Category
Sunday, June 20th, 2010
*sigh*. You’ve upgraded from ALUI to WCI 10gR3, and your Knowledge Directory links got all screwed up, didn’t they? HTML files now throw an open/save dialog, some documents don’t open, you can’t copy links by just right-clicking them and choosing “Copy Shortcut”, and IE throws a popup blocker when you click a link in the Knowledge Directory, doesn’t it?

You got the “To help protect your security, Internet Explorer blocked this site from downloading files to your computer” blues, huh?
I’ve tried creating a Plumtree Filter, and that worked pretty well, but not quite enough.
I’ve tried tweaking the Portal’s Javascript files, and THAT worked pretty well, but again, not quite well enough.
So, today, my friend’s, third time’s a charm: rather than trying to fix this on the server side, we’re going to knock out this issue once and for all on the client side. Check out those previous blog entries for a more detailed description of the problem, but basically, it’s because the portal uses a crazy convoluted way of opening documents via javascript.
What we’re going to do today is stick some javascript in the footer of the page. This JavaScript is going to simply find all those back-asswards links and replace them with NORMAL <a href=xxx target=_new> links. If you add it to the footer of your site (specifically, the footer used for the KD, but the code is smart enough not to do anything if it’s on all pages), it should be able to take care of the rest. Just make sure you add it to the Presentation Template and not the Content Item, because you-know-who only knows what a mess the out-of-the-box rich text editor is with javascript and adaptive tags.
The code after the break should be self-explanatory, but as always, if you’ve got a question or comment, feel free to post it here. Also note that this code only fixes the download links; it doesn’t kill that “Open/Save” dialog box for things like HTML files. For that you’ll still need the Plumtree Filter. (more…)
Tags: Bug, Code Samples, hack, javascript, Knowledge Directory Posted in Bug, Coding Tricks, Knowledge Directory | Comments Off
Monday, May 3rd, 2010
Last week I provided portal filter code to fix some elements of opening documents in WebCenter Interaction’s Knowledge Directory (and Search and Snapshot Queries). This week is another follow-up on that theme, and I’ll provide another piece of code to continue cleaning up the mess that is the Knowledge Directory Downloading Clusterf*ck (in IE at least).
Ever gotten this little present after doing an upgrade to 10gR3, when trying to open a document in the Knowledge Directory using IE7 or IE8?

Ah, the old “To help protect your security, Internet Explorer blocked this site from downloading files to your computer.” What’s even more ridiculous, if you “accept” the download, it STILL doesn’t work because IE tries to reload the page, and WCI is very stupid about how it opens this popup window (see how that address bar shows “about:blank”?). It seems this only happens in IE, and only if you have adaptive layouts disabled with “open documents in new window” enabled, so it doesn’t affect everyone. But I die a little on the inside every time I see that stupid thing: yes, my friends, I am an empty, hollow shell of a consultant.
Fortunately, I decided to seek redemption for WCI and myself by proxy, and checked out the HTML source for a typical file open link. It’s kinda hilarious:
<a href="#" onclick="var currentWin = PTCommonOpener.openInNewWindow('', 'Opener_18_1322446', 800, 600, true); currentWin.location= 'http://server/portal/server.pt/document/1322446/slide_1'; return false;">Doc Name</a>
Whhaaaaaaa…!? Sure I know there are dozens of ways you can open a document in a popup window, and many have their advantages (for example, by using JavaScript you can control the size and layout of the window), but I’d be hard-pressed to come up with a worse way to open a document. I’ve always hated the fact that you can’t just hover over the link to see the URL, and can’t right-click and copy the shortcut to mail to someone later. (Tip: use adaptive layouts and these problems go away!). Or they could have at least just done a window.open method in that onclick event. OK, so they wanted to use a wrapper method – that’s fine – but the PTCommonOpener.openInNewWindow actually takes a URL paramater, so they could have just passed the URL into that function, rather than creating a new, EMPTY document and then trying to use Javascript to load the document into that window. At very least they could have put the document URL in the “href” parameter so it’d work without JavaScript (and be 508-compliant) and users could copy the links with a simple right-click.
OK enough rambling. On to a solution: (more…)
Tags: Bug, Code Samples, hack, javascript, Knowledge Directory Posted in Bug, Coding Tricks, Knowledge Directory | Comments Off
Thursday, April 29th, 2010
Wow, was WebCenter Interaction 10gR3 a step backwards in opening documents, or what? I’ve seen wide-spread problems opening docs in the Knowledge Directory, Search Results, and Snapshot Queries, and even written two posts on the topic already.
There are two main problems: poorly implemented document open handlers (which I’ll discuss in my next post), and that pesky Content-Disposition header that tries to force the browser to throw up an “Open/Save” dialog instead of just opening inline (which is definitely useful for HTML and Office files in particular, where users just want to view the documents in their browser without having to save ‘em first). A third but ancillary issue is that occasionally the portal gets the MIME type of the document wrong in the Content-Type header, which is typically using application/octet-stream and doesn’t give the browser any clue about what type of file it is.
In the past posts I’ve described using BigIP iRules to remove the Content-Disposition header, but I ran into another client issue recently where just killing this header isn’t enough. Take the following response headers for a document transfer that is NOT using the iRule to kill the Content-Disposition header:

This PowerPoint file, when clicked on in the portal, will throw the open/save dialog, but what if we wanted it to give the browser the option to open in-line? We’d get rid of that Content-Disposition header. Here’s the problem: if we do that, the portal is returning a Content-Type of application/octet-stream. Which means, without the file extension in Content-Disposition, the browser has no idea what type of document this is, so it throws up a “FIND PROGRAM/Save” dialog box instead of an “OPEN/Save” dialog box.
The solution to this problem would be to drop the Content-Disposition header, but use the file extension to fix the Content-Type while we’re at it (to application/vnd.ms-powerpoint). But now our iRules are getting complicated, and not everyone has BigIP anyway. Fortunately, my love/hate relationship with support.oracle.com shifted much more to the former when i found this: How to Eliminate the ‘Save/Open with’ Prompt when Opening HTML Files [ID 971003.1]. Then, of course, it shifted back to the latter when I realized that I found this article by complete dumb luck navigating the terrible interface, and the article is nowhere to be found searching through Google. But that’s another story.
At any rate, a solution was clear: you can write a .NET or Java FILTER to manipulate headers before they’re returned to the browser! As such, I took the code from that article and expanded on it with a .NET filter of my own, which will:
- Remove the Content-Disposition header selectively on different file types
- Change the Content-Disposition header to use “inline” instead of “attachment” instead of just deleting the header (this seems to work with some browsers; a brief discussion on the differences is here)
- Fix the Content-Type header if the file name extension doesn’t map the MIME type the portal thinks it is
- Do all this through a filter and a dynamically loadable varpack that allows different configurations based on the type of file being served.
So while it’s a bit optimized in the sense that it only looks at responses being gatewayed through the portal, it’s still kind of a hack because personally, I think this should be an option in the portal in the first place rather than adding the additional overhead of a filter.
But, nonetheless, it seems to work well, and you can download the code here and the varPack file here.
If you’d like assistance with actually building and deploying this, or porting to Java – drop me a line.
Tags: Bug, Code Samples, hack, javascript, Knowledge Directory Posted in Bug, Coding Tricks, Knowledge Directory | 1 Comment »
Monday, March 1st, 2010
Ross Brodbeck has written some excellent posts on how the Document Repository works in the ALUI / Plumtree portal (which is still accurate in WebCenter Interaction 10gR3), so I won’t rehash those details here.
Instead, I’ll give you a quick tip to answer what should be a relatively simple question: How do I replace an existing document that has been uploaded to the WCI Knowledge Directory? At first glance, it’d seem you should just upload a new document and delete the old one. The problem is, especially if your site is large or exposed publicly on the Internet, someone may have linked to the original URL. This URL contains the Object ID of the card in there, so the new file – even if it has the same name – will have a different link. This is even true, for the most part, with Friendly URLs that were introduced in ALUI 6.5 and expanded in WCI 10gR3.
The bad news is that there is no way through the UI to change the file itself; the good news it’s an easy file swap that can be done on the server containing the Document Repository. Just open the properties page for the file, and look at the “Document Upload DocID” field (and the “Document Upload Repository Server”). Then, take your new document, rename it exactly as shown in the properties, and put replace the file in that directory. In the example below, this file would need to be called “D004783E.ACT” in the DR folder at “documents/ptupload/active/F0080AF6/”:

Tags: cards, document respository, files, Knowledge Directory Posted in Knowledge Directory | Comments Off
Wednesday, February 17th, 2010
The Guest user in the Plumtree – and ALUI, and now WCI portal – is a mixed bag. On the one hand, I usually advise my clients to never give this user – or the EVERYONE group – access to anything in your portal if you don’t want your information showing up somewhere it shouldn’t.
On the other hand, this advice can bite you. Have you ever gotten an “Error displaying Dropdown menu tabs” error in the nav bar when using the JS drop-down menus?

Well, in at least one case the problem is simple: Give that EVERYONE (or at least the respective GUEST users) access to the root directory of your Knowledge Directory. No need to give that user access to any cards or folders – just the root directory itself. It seems the code in 10gR3 chokes if it can’t read this directory when trying to display the Directory drop-downs. In fact, this is similar to Bill Benac’s Bug about missing footers in 10gR3 breaking the page (incidentally, I’ve run into the same problem with headers) – it seems 10gR3 isn’t quite as “forgiving” as previous versions were regarding error handling.
This quick fix should restore your menu:

… but there are other reasons you can run into this error. I’ve got another post pending on some other root causes of this problem (spoiler alert: give SELECT privileges to the EVERYONE group for your headers!); in it I’ll offer some instructional advice on how to diagnose the root cause of problems like this.
Tags: Bug, Guest User, Knowledge Directory, Navigation Posted in Bug, Knowledge Directory | Comments Off
Sunday, February 14th, 2010
I had a client report this strange issue with Excel file handling in IE7 and IE8 (and Office 2007). Basically, every time someone would open a document, it would get cached by IE. But the next time the person would try to open the same document, they’d get a “file is locked by user” message. It seemed IE was caching the file in the Temporary Files folder, then when the user would click the link a second time there was a conflict between the existing file in that folder and the new one IE was trying to bring in. I found some articles and discussions on the topic, but most came back to making changes on the client-side, which is never easy to do in an enterprise. Even if it’s a little trickier to execute, you should always try to make changes on the WebCenter Portal side.
In this case, after downloading the Excel file the first time, I confirmed it was in my Temporary Internet Files folder:

I was also able to verify that the portal was returning a “Not-Modified” header when the user tried to open this Excel document again:

The fix I applied here? Another BigIP iRule that turns off caching of Excel files – after the jump. (more…)
Tags: BigIP, Excel, Knowledge Directory Posted in Knowledge Directory | Comments Off
Thursday, January 21st, 2010
In ALUI 6.5, and following through to 10gR3 and the latest patches, Oracle changed the way documents are opened in the Knowledge Directory. This change was to get a little better browser compatibility so that when a user clicks on a document in the KD, the user is always presented with the usual Open/Save Dialog box.
Many WCI clients have HTML files in their Knowledge Directories, whether they’re crawled in from Publisher, Collaboration Server, or uploaded from some other source. In version 6.1 and before, the behavior of the portal was simply to open these files directly in the browser, but that changed with 6.5. Unfortunately, Oracle has asserted that this is “expected behavior” and while an enhancement request has been submitted, there are no promises about the behavior changing in 11g. The good news is that there’s a relatively simple fix for this behavior. Unfortunately, the “relatively simple” fix assumes you’ve got BigIP load balancing requests to your portal, but if not, hopefully this post will give you some ideas on how to resolve the problem in your environment.
The problem is caused by the portal returning an HTTP header called “Content-Disposition”:

- Content Disposition Header
The trick is to remove this header for HTML documents. I’ve tried writing ISAPI filters unsuccessfully, but for the clients that needed the fix, they had BigIP.
Hit the link to see the BigIP iRule to resolve this issue.
(more…)
Tags: BigIP, iRule, Knowledge Directory Posted in Knowledge Directory | 2 Comments »
|