Deployment Example: Deploying and Customizing the Documentum Portlet

Jsr168Environment Class

The Jsr168Environment class inherits from PortalEnvironment. You can extend Jsr168Environment to integrate WDK portlets into a JSR-168 compliant portal server that does not have an environment supplied by Documentum. The following methods are implemented:

Lifecycle events

The onRequestStart() and onRequestFinish() methods provide access to the request events

Session access

The getUsername(), getUserPassword(), getDomain(), getDocbaseName(), getUserPrincipal(), and getLocale() methods provide access to the user's portal session.

Pre-processing

The preProcess() method turns on pre-processing.

URL encoding

The encodeUrl() method returns a JSR-168 action URL.

JavaScript rewriting

The namespaceJsMethodName() method changes the supplied JavaScript function name to a name unique within the generated web page by prefixing that function with the portlet ID. The rewriteScriptTag() method prefixes the portlet ID to a supplied JavaScript function name.

Link rewriting methods

The rewriteATag() method rewrites the href and onclick attributes in a JavaScript call to prefix the call with the portlet ID. This gives the JavaScript call a unique name in the scope of the whole web page that is generated.

Preferences methods

Several methods enumerate preferences and look up or write preference values (user-level or portlet-level, or application-level). The Jsr168Environment class handles the writing of Portlet level preferences through the writePortletLevelPreference() method. The writing of user level preferences is not covered by the JSR-168 specification: They are written by vendor-specific environment classes.

Error methods

The getErrorUrl() method handles errors in a JSR-168 environment, passing the error to the stack trace.