Posts Tagged ‘hack’

There’s a WCI App For That 9: OpenerFilter (aka Office 2010 MIME Types)

Thursday, November 3rd, 2011

By now you’re probably tired of the Knowledge Directory saga related to opening KD documents in WebCenter Interaction, but it’s a pretty serious problem. I’ve posted several solutions, but have come across a new problem with the original OpenerFilter configuration. Specifically, for some IE and Office configurations, Office 2007 and Office 2010 documents don’t open properly because the original configuration file used non-specific MIME types.

You can view the original post for the source code and a description of how this filter works, but recently I’ve discovered that the MIME types in the original post should be updated for recent Office documents (.docx and .xlsx). Instead of “application/msword”, the config file should use the MIME types provided by Microsoft. Specifically, the configuration file for OpenerFilter should look more like the following:

<?xml version="1.0"?>
<IntegrystOpener>
 <default>
  <removeContentDisposition value="0" />
  <replaceContentDispositionWithInline value="1" />
  <fixContentType value="1" />
 </default>
 <extension-map>

  <doc value="application/msword" />
  <dot value="application/msword" />
  <dotx value="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
  <docx value="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
  <xlt value="application/vnd.ms-excel" />
  <xls value="application/vnd.ms-excel" />
  <xlst value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
  <xlsx value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />

  <pdf value="application/pdf" />
  <gif value="application/octet-stream" />
  <jpg value="application/octet-stream" />
  <png value="application/octet-stream" />

 </extension-map>
</IntegrystOpener>

Change the Unchangeable in AquaLogic Studio

Monday, October 31st, 2011

I don’t think Oracle even bothered renaming Aqualogic Studio to WebCenter Studio – hell, even BEA never touched Studio after it acquired Plumtree – so whatever you call it, Studio is dead and has long been abandoned. I made a case to Oracle once it should just be open-sourced, and was laughed out of the (virtual) room….

Today’s post is about this long-dead product that a surprising number of Plumtree customers just can’t seem to shake – it provides just enough functionality to be functional for end users.

First of all: Migrate to Frevvo. Even if you don’t use Integryst’s Frevvo integration, Frevvo is how form building and workflows should have been implemented. Maybe Studio would have become this if it hadn’t been abandoned so many years ago, but really, if you have serious electronic forms and workflow needs you shouldn’t be using Plumtree Studio any more.

BUT, if you absolutely INSIST on clinging to Studio, let’s take a trip down memory lane. My very first blog post discussed an Easter Egg in Studio, but it’s worth mentioning that this Easter Egg isn’t just for playing Tetris.

Let’s say you want to change the text of a button to a different language. When you’re editing any Studio portlet, hit CTRL-ALT-? (Or, CTRL-ALT-SHIFT-/. You’ll figure it out.) to bring up the popup:

From here, click “Edit XML”, find the text of the button you want to change and update it:

Now no text in your form is out of reach. The above warning is pretty clear about being careful here, but editing the text is pretty straight-forward.

Parlez-Vous Français?

Bug Blog 13: Fix Broken File Downloads in 10gR3 (Part Quatre)

Tuesday, October 25th, 2011

When WebCenter Interaction 10gR3 was released, it was a complete train wreck for documents in the Knowledge Directory – the content headers were wrong, docs wouldn’t download in Internet Explorer due to the comical back-asswards Javascript file open mechanism, and links couldn’t be copied or viewed because the anchor tags were malformed.

In our last post in this painful series, I shared some code that will resolve the ALUI / WCI Knowledge Directory links so that users can right-click and copy the links, and the files open as expected when clicked.

Since then, I’ve found that when an admin is in EDIT mode in the Knowledge Directory, the link calamity continues, and a completely different and incomprehensible linking mechanism is used. So for your reading pleasure today, I’ll update that post to handle edit mode as well as browse mode. Again, just add the following HTML to the footer used in your Knowledge Directory (depending on Experience Definition, there may be more than one):
(more…)

Increasing the Character Limit for ALI Studio in SQL Server

Sunday, May 22nd, 2011

By now you’re aware of our stated problem – we need to increase the size of text fields in Aqualogic Studio. We’ve already found the file used for the JavaScript, and used a new Cool Tool (HxD) to assist in the recompile, but there’s still a problem: when Studio creates new forms, it also creates a separate table in MS SQL Server. And the size of text fields in those tables that already exist is still 1,000. So if we just update the Javascript, our existing forms aren’t going to have the proper error checking, because our JavaScript is preventing field sizes of, say, 10,000 characters, but at the database layer, the size of those fields is still 1,000 characters. Even worse, if you try to increase the size of the table in the code to >4,000 characters, SQL Server will reject it because the regular nvarchar data type doesn’t go over that limit:

2011-04-21 14:54:54,819 ERROR [rocessor25] AppDesignerHandler: Error processing wizard form post
Error creating new user database ‘Survey Database’.
– [XNRC39]The size (10000) given to the column ‘test_10000’ exceeds the maximum allowed for any data type (8000).
at com.plumtree. studio.model.data. access.TableDAOSQLServer.create (TableDAOSQLServer.java:220)
at com.plumtree. studio.model.app. Table._create (Table.java:585)
at com.plumtree. studio.model.app. Table.save (Table.java:618)

So, we have two problems: first, we need to tell Studio to create these fields with a type of NVARCHAR(MAX) rather than NVARCHAR(10000), and second, we need to update all existing tables.

The first problems is pretty straightforward – we just need to update the TableDAOSQLServer.java file (or, if you’re on Oracle, TableDAOOracle.java). Change:

      sqlBuffer.append(this.mUserColumnType).append("(").append(this.mUserColumnWidth).append(") ");

…to:

      sqlBuffer.append(this.mUserColumnType).append("(MAX) ");

… and recompile as mentioned in the last post.

The second problem requires some SQL Server voodoo – we need to write a SQL Script that generates a SQL Script. So, if you run this script as your studiodbuser:

SELECT 'ALTER TABLE ' +  syo.name 
    + ' ALTER COLUMN ' + syc.name + ' NVARCHAR(MAX);'
   FROM sysobjects syo
   JOIN syscolumns syc ON
     syc.id = syo.id
   JOIN systypes syt ON
     syt.xtype = syc.xtype
   WHERE 
     syt.name = 'nvarchar' 
    and syo.xtype='U'

… it will produce a SQL Script that looks like this:

ALTER TABLE PTU_SHPR2_Progress_Revi ALTER COLUMN Additional_Comments NVARCHAR(MAX);
ALTER TABLE PTU_SHPR2_Progress_Revi ALTER COLUMN U__Is_the_work_proceeding_i NVARCHAR(MAX);
ALTER TABLE PTU_SHPR2_Progress_Revi ALTER COLUMN U__Is_progress_towards_the_ NVARCHAR(MAX);

So basically, you’re using s script to find all the existing text fields, and creating a new one to actually increase the size limits on those fields.

Cool? Cool.

Cool Tools 18: HxD Hex Editor

Thursday, May 19th, 2011

Continuing our journey on increasing ALI Studio’s character limit, we’ve now identified the code that needs to change – it’s in com.plumtree. studio.model. data.access.TableDAO.java.

The problem is, Studio is ancient, so while we can easily update the following code:

  protected int mUserColumnWidth = 1000;
  protected int mUserColumnWidthChars = 1000;

… we can’t just recompile the file using the latest JDK without expecting problems.

So, we need to figure out what Java version was originally used to compile this file. To do this, we need today’s Cool Tool: HxD Hex Editor. Why? Because all Java .class files have the same set of bytes at the beginning identifying them as Java files, along with the JDK version used to compile.

HxD allows us to view the actual bytes, and and it does it well. Opening the TableDAO.class file in HxD, we see:

Bytes 6 and 7 are “00 2E”, which represent JDK 1.2.

Once we’ve made our changes and have the correct JDK downloaded, we rebuild the file, making sure to include the proper .jars in the CLASSPATH:

set CLASSPATH= %CLASSPATH%; C:\code\studio\ WEB-INF\lib\log4j-1.2.8.jar
set CLASSPATH= %CLASSPATH%; C:\code\studio\ WEB-INF\lib\jakartaRegexp1dot2.jar

C:\jdk1.2.2\bin\javac -classpath %CLASSPATH% com\plumtree\ studio\model\ data\access\ TableDAO.java

Take the TableDAO.class file, jam it back into your studio.war file, and you’re good to go – assuming you haven’t increased that value over 4,000 characters! There’s still one more glitch in this journey

Increase Plumtree Studio Character Limit

Monday, May 16th, 2011

We don’t write much about Aqualogic Interaction Studio ’round these here parts anymore. That’s because Studio has long since been end-of-life’d (by BEA, even before the Oracle acquisition!). But, that doesn’t mean it isn’t alive and gasping its last breath in many of your portal sites. Sure, it’s an over-the-hill product but it does serve a functional need: the ability to easily create forms, polls, and other data entry forms.

So, it’s with reluctant enthusiasm that I start the first of a three-part series on “How to increase the 1,000 character limit in Plumtree Studio”. Even if you don’t actually use Studio, hopefully you’ll find the journey interesting and informative for your other portal diagnostic needs. I’ll walk you through the process of identifying the code here, recompiling and reintegrating in Part dos, then some SQL Server diagnostics in Part tres.

The problem, as recently presented by a client, was that Studio has a 1,000 character limit on text fields. If an end user tries to type more than 1,000 characters, they get this lovely message:

But, we needed to increase that value. While it would be really nice if there was just some configuration file somewhere, sadly, the 1,000 character limit is hard-coded. So we first need to find the file that’s producing this alert. (more…)

Bug Blog 11: Analytics doesn’t export Document Details

Thursday, April 7th, 2011

We’ve discussed WCI Analytics many times in these posts, and have covered quite a few bugs and patches. This post has all of that drama; so join me! You’ll laugh, you’ll cry. You’ll buy the book.

Every now and then, products in the WebCenter Interaction stack have a bug. And occasionally, Oracle releases a fix for said bug, and things are right with the universe again. But, once in a blue moon, that patch disappears when then the next version of the product is introduced. Such is the case with the “WebCenter Analytics Documents Report Export May Return Different Report [ID 783591.1]” issue.  The patch addresses this problem:

If you choose to “Export User Detail” for the “Other Metrics” section, “Documents” tab report, the results from a different report will be exported.

Or, more succinctly: if you export the User Detail report in Analytics for Collab Documents, it will not actually include document details.  The feature worked in the Aqualogic days, so what’s the deal now?  Well, the story is that you used to be able to export that report properly, then it was broken in ALI Analytics 2.5.  Oracle released a hotfix in 2.5 to repair the issue last year, and their release notes for the patch say to install patch 8198674, or upgrade to Analytics 10.3.

Problem is: the patch that worked for Analytics 2.5 isn’t applicable to 10.3, and 10.3 doesn’t include the patch.

Solution?  I’ll spare you the details of this pretty complicated trick, but at a high level, you need to:

  1. Download this fixed version of BaseCollabServerDataProvider.class, add it to analytics-webui.jar, and put that back into analytics.war.
  2. Add this line to the ptanalytics\10.3.0\settings\config\wrapper.conf file:

    wrapper.java.additional.21=-Dcom.bea.analytics.CollabInfoAtDocumentLevel=true

  3. Reinstall the service (see the patch release notes)

As shown in this source code diff, this class just defines the original “dimensions” in Analytics that include the document details:

This will cause your “export user details” report to change from this:

… to this:

Release notes for the patch after the break…
(more…)

Office 2010 WebEdit Corrupts Document Downloads

Friday, March 18th, 2011

We’ve now discussed why Office 2010 doesn’t work with Oracle WebCenter Collaboration Server, how it can be patched, and even the enigmatic post about Office 2010 document formats.  So we know that Office 2010 WebDAV can work with Collab.  But even though the Apache/AJP hack fixes WebEdit for Office 2010, unfortunately it breaks something else.  Specifically, when you close a document that you’re “Web-Editing”, Office 2010 sends the file back to Collab, and it doesn’t seem to include a Content-Type header (damn headers…).

Because Collab isn’t told what the Content Type is, it has to guess, and as mentioned, the Office 2010 document format is a .zip file that contains XML.  What ends up happening is that, after a successful WebEdit operation, if you try a simple download of that document in the portal, you get a .zip file with all those .xml docs in there.  This threw me off for a bit, thinking that the original document was lost to this crazy .xml file.  But, once I realized that renaming the file to .docx and opening in Word 2010 still worked, it was clear the problem was with the MIME type of the document, not the bits themselves.

This is good news – it means that Collab’s not really broken, but Office 2010 is sending the wrong Content Type when the document is closed (strangely, this happens when the doc is closed, not when it’s saved), and Collab is recording that Content Type to its CSFILES table in the database.  Specifically, the ContentType field in the CSFILES gets set to text/xml; charset=”utf-8″:

 

The best fix (hack?) I’ve found here is to create a trigger on this table to cancel out any changes that set this content type to that value.  In other words, the MS SQL trigger looks for the value of “text/xml; charset=”utf-8″” during and update, and if it’s there, the trigger rolls back the value to the original value.  As usual, proceed at your own risk, and while I can’t foresee any problems – even when uploading XML files to Collab, which are likely to have a different Content Type – this is a high-risk DB update that Oracle definitely won’t support.

(more…)

A fix for WCI Collaboration WebEdit using Office 2010

Tuesday, March 15th, 2011

As we saw a couple days ago, WebCenter Collaboration Server doesn’t work with Office 2010. The problem is rooted in the fact that WebDAV calls to Collab from Office 2010 aren’t strictly RFC-compliant because they’re missing a Content-Length header, and Tomcat rejects them because of that – even before Collab gets the HTTP requests.

Which got me to thinking: what if we could create an intermediate server that would add this header for us?   Then Tomcat would accept the connection and we’d be able to tell if Collab was able to “do its thing”. I started down the path of creating an Apache ProxyPass to do just this, when a friend and fellow Hak’er (Brian Hak) – who has been fighting his own fires with Collab these days – suggested that I try AJP. Even better, he pointed out, Collab’s default configuration settings allow you to turn this on by just flipping a switch; with it, we could then use mod_headers to add the Content-Length header.

Tip o’ the the hat to Brian for the AJP idea – it turns out that if Apache and AJP are handling the HTTP requests rather than Tomcat and its embedded web server, we don’t even need to muck with HTTP headers, as the request does NOT get blocked:

… and WebEdit (mostly) works in Office 2010!

I should warn you before proceeding: While I can absolutely say that WebEdit works in my test environment with Office 2010, .NET WCI Portal 10.3.0, on IIS 6, your mileage may vary, and I can’t guarantee this will work. I’ve found that Office 2007 has its own quirks – it works with the Collab Office Tools plugin in the ribbon bar, but not the out-of-the-box “save” implementation using Office’s own WebDAV calls. Perhaps that’s a post for another day, but early results show that while this hack doesn’t hurt Office 2007 support, it doesn’t seem to help either. Obviously, do extensive testing before even considering moving to a production environment.  Stay tuned for the next update in these pages, as there’s yet another database hack needed to make it fully functional.

Disclaimers out of the way, let’s dig in. Basically, what we’re going to do is:

  1. Install Apache Web Server on the Collab Machine, with the AJP plugin
  2. Configure Collab to accept AJP calls
  3. Configure the portal to send requests to Apache instead of directly to Collab (Tomcat)

(more…)

WCI Collaboration Server Not Working in Office 2010

Tuesday, March 15th, 2011

I’ve blogged a LOT about Collaboration Server, and have spent countless hours fighting with the WebEdit features – it’s the “bane of my existence“, a term I used because I thought “crime against humanity” was a little too strong.  More often than not I’ve thrown up my hands and said “sorry, fella, nothing to see here – it just plain don’t work”.  The problem is there are a near-infinite number of combinations, between the different versions of:

  • Plumtree / ALUI / WebCenter Interaction Portal (6.1, 6.5, 10.3.0, 10.3.0.1, 10.3/Neo)
  • Collaboration Server (4.2, 4.5, 10.3.0, 10.3.0.1, 10.3/Neo)
  • Windows (XP, Vista, 7), plus various patches
  • Office (2003, 2007, 2010), plus various patches
  • Application Servers (IIS, WebLogic, Tomcat)
  • Web Browsers (IE7 and IE8 – good luck if you have IE9, FireFox or Chrome)

Officially, Oracle only supports the following for WebEdit with version 10.3.0.1 – the latest publicly available version: MS Office 2003 on Windows XP SP2; MS Office 2007 on Windows XP SP2. No Office 2010, no Windows 7. Even Office 2007 is patchy at best.

I’d heard enough complaints, and decided to dig in and try to figure out why one very specific combination doesn’t work: Office 2010 running on Windows 7 against an IIS 6 .NET portal running WebCenter Collaboration 10.3.0.  Here’s what the out-of-the-box install shows when trying to save a file opened through WebDAV:

Your changes were saved but could not be uploaded because of an error.  You may be able to upload this file using the server Web page.

Having not accepted that it was impossible to get WebDAV working in Office 2010, I’ve spent countless hours reverse-engineering Office’s WebDAV protocol, WebCenter Interaction gateway calls, Apache Tomcat protocol handling, and everything in between.

Based on my research, this hack may be helpful for other versions of Office, Windows, and Collab, but I can’t even guarantee the hack I’ll discuss in the next couple of days is perfect, even with these very specific versions.  Proceed at your own risk, and drop me a line if you’d like to discuss your specific situation.

(more…)