Gerald Nunn's Blog

« HTPC and Firewire Results | Main | Customizing the Portal Admin Tool (PAT) »

Renaming the appmanager in Portal

Tuesday, June 17, 2008

When you create a streaming desktop in portal it creates a URL that is formatted as follows:

http://server:port/context-root/appmanager/portal-name/desktop-name

This URL is configurable in the sense that developers and administrators can rename any part of the URL. The context-root portion is controlled from weblogic.xml while the portal-name and desktop-name portions are chosen by an administrator when the streaming desktop is created. The remaining portion of the URL, appmanager, can also be changed but it is not completely inituitive how to do it, hence this blog entry.

Changing this portion of URL is actually quite easy once you understand where it is defined. The appmanager portion of the URL is defined as a servlet in the Portal shared library BEA_HOME/wlserver_10.0/portal/lib/modules/wlp-framework-full-web-lib.war. Since this is a servlet, we can simply add a new servlet mapping to in order to make it accessible at a different location. For example:

<servlet-mapping>
    <servlet-name>AppManagerServlet</servlet-name>
    <url-pattern>/test/*</url-pattern>
</servlet-mapping> 

Adding this mapping makes the portal available at the location http://server:port/context-root/test/portal-name/desktop-name. Of course this doesn't remove the appmanager mapping and that is still accessible, but adding a mapping does allow you to access the portal under a different name.

One caveat though is that while in theory adding a new mapping for a servlet in a shared library should work, I have found that occasionally I get errors when deploying a Portal application with this declaration. Specifically the deployment complains that no servlet with the name AppManagerServlet could be found. To work around this issue, I typically re-create both the servlet definition and mapping in my web.xml. Here is a complete example:

<servlet>
    <servlet-name>MyAppManagerServlet</servlet-name>
    <servlet-class>com.bea.netuix.servlets.manager.PortalServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>MyAppManagerServlet</servlet-name>
    <url-pattern>/test/*</url-pattern>
</servlet-mapping> 

Posted by Gerald Nunn at 9:28 AM | Categories: WebLogic | | | Permalink