Displaying Universal Worklist Items in Microsoft SharePoint
My colleagues recently published a paper that describes the integration of the Universal Worklist into Microsoft SharePoint. The described method consists of swallowing the Universal Worklist as it’s delivered by the portal rendering engine in SharePoint.
Another method of displaying UWL items in SharePoint is by extracting them from the UWL and creating an RSS feed that can be displayed in SharePoint, either by using the predelivered RSS WebPart or developing an WebPart to do custom rendering. This involves a relatively small amount of code in the NetWeaver Portal. I’ll describe what I did to get this to work.
Motivation and Approach
The basic idea is to implement a simple integration of the NetWeaver Portal UWL and the SharePoint UI, allowing SharePoint end users to see and interact with a UWL task list.
Here is the result as it looks in my SharePoint UI:
Along with this blog, I’m providing a code sample of the UWL RSS iView on the snippets wiki. More on what it does later.
This code sample originated with a request to expose BPM tasks in SharePoint. For now, this is the easiest way to do that (that I can think of). With the next release of NetWeaver, it will be possible to access a list of a user’s BPM items without going through the UWL API. The benefit of going through the UWL API, of course, is that task items from all connected backends will be exposed, and not just BPM task items.
The UWL task data for the user is exposed as an RSS feed, and consumed within SharePoint using an out-of-the-box RSS WebPart. I did this with a small amount of custom code packaged as an iView in the portal. It sits on top of the UWL API and generates an RSS feed based on the user’s UWL data.
Single-Sign-On is set up between SharePoint and the NetWeaver Portal to make the end user experience straightforward.
My system setup looked like this:
Because I had three systems instead of two, I had to make sure that SSO was also set up between the SharePoint box and the BPM box. That way, no login is required when the user clicks on an item in the SharePoint UI. The user is brought directly to the task in the BPM backend, no login required.
Exposing UWL Data as an RSS Feed
Now let’s look at the code sample for the RSS iView.
This approach is very straightforward: UWL data is simple and can be easily represented using the RSS format. And RSS can easily be consumed by various clients, including SharePoint.
The only trick is to know how to generate an XML feed using an iView. A first attempt might be to do the content retrieval and generation process within the AbstractPortalComponent’s doContent method. This will not work, because at this point in the request flow, the content type of the output has already been set by the portal runtime (and it’s not “text/xml” or the equivalent for RSS, which is what we need).
Looking at the request flow, this potentially makes sense, since each iView represents a node in a tree of content being assembled by the portal – most likely HTML, not XML.
To get around this, do the content retrieval and output generation earlier in the request flow, before the content type has been set by the runtime. The doOnNodeReady method works well for this.
Single Sign On Between SharePoint and NetWeaver Portal
Nothing special was done to set up SSO between SharePoint and the NetWeaver Portal. We simply used the SPNego Wizard and followed the documentation.
Setting up the WebPart in SharePoint
The only trick here is to realize that (URL) domains come into play when trying to get SSO to work. In my environment, each box was in a slightly seperate domain, so in order to simplify things I used only the hostname and not the FQDN when configuring the RSS WebPart in SharePoint. This causes the browser to share the HTTP cookie issued by SharePoint with the NetWeaver backend.
Exercises Left to the Reader
Implement a more comfortable RSS WebPart for SharePoint. The out-of-the-box WebPart is very basic and might not suit your needs.