Package com.ibm.portal.portlet.service.url

This package provides an API to generate portal URLs inside of Java Portlets.

See:
          Description

Interface Summary
Constants This interface contains all constants of the portlet URL generation service.
Constants.PortalState Constants defining the portal state.
PortalURLGenerationService An interface to retrieve a PortalURLWriter based on the current state information encoded in the request.
PortalURLWriter This portlet service provides the portlet with the capability to generate render URLs to other portlets or other content nodes (e.g.
 

Class Summary
Constants.NormalStateConstant Normal portal state constant.
Constants.SoloStateConstant Solo portal state constant.
 

Package com.ibm.portal.portlet.service.url Description

This package provides an API to generate portal URLs inside of Java Portlets.

Package Specification

Some portlets may need to generate links to other portal pages or portlets, or want to change the current state of the portal (e.g. want to set the portal into SOLO state or back into NORMAL state). Note: Use this API with care. Do not hard code your site topology into your portlets with this API. Do not use this API as a replacement for property broker use cases. Sending portlets events and change the page selection to the event receiving portlet should be done via the property broker API.

Example

The following example creates a link to put the portal into SOLO state with the current portlet as the selected portlet.

        // execute this code in the init method of the portlet
        javax.naming.Context ctx = new javax.naming.InitialContext();
        PortletServiceHome psh;
        psh = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.portlet.service.url.PortalURLGenerationService");

        // the following code needs to run per request, e.g. in processAction or render
        PortalURLGenerationService portalUrlGenerationService = (PortalURLGenerationService) psh.getPortletService(PortalURLGenerationService.class);
        PortalURLWriter portalUrlWriter = portalUrlGenerationService.getPortalURLWriter(request,response);

        portletUrlWriter.writePortletRenderURL(OutputWriter, PortalState.SOLO);