com.ibm.portal.portlet.service.url
Interface PortalURLWriter

All Superinterfaces:
Disposable

public interface PortalURLWriter
extends Disposable

This portlet service provides the portlet with the capability to generate render URLs to other portlets or other content nodes (e.g. pages). Render URLs do not trigger any server side state changes, they only modify navigational state.
This API may also be used to set the portal with the current portlet into SOLO mode or return from SOLO mode.

NOTE:Don't use this API for transfering data to other portlets and change the selection to the receiving portlet. Sending data to other portlets should be done via the property broker infrastructure, which avoids hard-coding the portal site topology into the portlets.

If you require functionality beyond the one provided in this interface please take a look at the more complex state handling SPI at com.ibm.portal.state.

 javax.naming.Context ctx = new javax.naming.InitialContext();
 PortletServiceHome psh;
 psh = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.portlet.service.url.PortalURLGenerationService");

 PortalURLGenerationService portalUrlGenerationService = (PortalURLGenerationService) psh.getPortletService(PortalURLGenerationService.class);
 PortalURLWriter portalUrlWriter = portalUrlGenerationService.getPortalURLWriter(request,response);
 try {
     ... // write URLs etc.
 } finally {
     portalUrlWriter.dispose();
 }
 

This service extends the Disposable interface thus callers must ensure to dispose the PortalURLWriter at the end of the request.

Since:
6.0

Method Summary
 boolean isInPortalState(Constants.PortalState portalState)
          Returns true, if the given portal state is the same as the portal state of the current request.
 java.io.Writer writeContentNodeRenderURL(java.io.Writer writer, ObjectID contentNode)
          Creates a render URL that points to the specified content node (e.g.
 java.io.Writer writeContentNodeRenderURL(java.io.Writer writer, java.lang.String contentNode)
          Creates a render URL that points to the specified content node (e.g.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, Constants.PortalState portalState)
          Creates a render URL that points to the current portlet window with the given portal state.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow)
          Creates a render URL that points to the specified portlet window.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow, Constants.PortalState portalState)
          Creates a render URL that points to the specified portlet window with the given portal state.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow, java.util.Locale newLocale)
          Creates a render URL that points to the specified portlet window with the given locale.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow, java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters)
          Creates a render URL that points to the specified portlet window with the given render parameters.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow, javax.portlet.PortletMode newPortletMode)
          Creates a render URL that points to the specified portlet window with the specified portlet mode.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow, javax.portlet.PortletMode newPortletMode, javax.portlet.WindowState newWindowState, Constants.PortalState portalState, java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters, java.util.Locale newLocale)
          Creates a render URL that points to the specified portlet window.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, ObjectID contentNode, ObjectID portletWindow, javax.portlet.WindowState newWindowState)
          Creates a render URL that points to the specified portlet window with the new window state.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow)
          Creates a render URL that points to the specified portlet window.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow, Constants.PortalState portalState)
          Creates a render URL that points to the specified portlet window with the given portal state.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow, java.util.Locale newLocale)
          Creates a render URL that points to the specified portlet window with the given locale.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow, java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters)
          Creates a render URL that points to the specified portlet window with the given render parameters.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow, javax.portlet.PortletMode newPortletMode)
          Creates a render URL that points to the specified portlet window with the specified portlet mode.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow, javax.portlet.PortletMode newPortletMode, javax.portlet.WindowState newWindowState, Constants.PortalState portalState, java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters, java.util.Locale newLocale)
          Creates a render URL that points to the specified portlet window.
 java.io.Writer writePortletRenderURL(java.io.Writer writer, java.lang.String contentNode, java.lang.String portletWindow, javax.portlet.WindowState newWindowState)
          Creates a render URL that points to the specified portlet window with the new window state.
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Method Detail

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow,
                                     javax.portlet.PortletMode newPortletMode,
                                     javax.portlet.WindowState newWindowState,
                                     Constants.PortalState portalState,
                                     java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters,
                                     java.util.Locale newLocale)
                                     throws java.io.IOException,
                                            javax.portlet.PortletModeException,
                                            javax.portlet.WindowStateException
Creates a render URL that points to the specified portlet window. This method also allows to change different parts of the navigational state, like the portlet mode and window state of the targeted portlet, the portal state, the render parameters of the targeted portlet, and the locale.

If no new render parameters are specified the current render parameters of all portlets are preserved. If new render parameters for the target portlet are specified the render parameters of the target portlet are replaced with the specified render parameter and the render parameters of all other portlets are preserved.

Note: Instead of providing null as values of please use one of the other flavors of this method. This will produce a better performace as the checking for null values can be omitted.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
newPortletMode - New portlet mode of the target portlet (may be null)
newWindowState - New portlet window state of the target portlet (may be null)
portalState - New portal navigational state (e.g. SOLO mode or non-SOLO mode) (may be null)
newRenderParameters - New render parameters for the target portlet (may be null)
newLocale - New locale (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.PortletModeException - - if the target portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode.
javax.portlet.WindowStateException - - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state.
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given portal state is not supported
3. the given locale is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if the given content node or portlet window is not valid or not accessible

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow,
                                     javax.portlet.PortletMode newPortletMode)
                                     throws java.io.IOException,
                                            javax.portlet.PortletModeException
Creates a render URL that points to the specified portlet window with the specified portlet mode.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
newPortletMode - New portlet mode of the target portlet (must not be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.PortletModeException - - if the target portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode.
java.lang.IllegalArgumentException - - if the given content node or portlet window is not valid or not accessible

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow,
                                     javax.portlet.WindowState newWindowState)
                                     throws java.io.IOException,
                                            javax.portlet.WindowStateException
Creates a render URL that points to the specified portlet window with the new window state.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
newWindowState - New portlet window state of the target portlet (must not be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.WindowStateException - - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state.
java.lang.IllegalArgumentException - - if the given content node or portlet window is not valid or not accessible

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow,
                                     java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window with the given render parameters.

The render parameters of the target portlet are replaced with the specified render parameter and the render parameters of all other portlets and the portal state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
newRenderParameters - New render parameters for the target portlet (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.PortletModeException - - if the target portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode.
javax.portlet.WindowStateException - - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state.
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given portal state is not supported
3. the given locale is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow,
                                     Constants.PortalState portalState)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window with the given portal state.

The current render parameters of all portlets are preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
portalState - New portal navigational state (e.g. SOLO mode or non-SOLO mode) (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given portal state is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     Constants.PortalState portalState)
                                     throws java.io.IOException
Creates a render URL that points to the current portlet window with the given portal state.

The current render parameters of all portlets are preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
portalState - New portal navigational state (e.g. SOLO mode or non-SOLO mode) (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if the given portal state is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     java.lang.String contentNode,
                                     java.lang.String portletWindow,
                                     java.util.Locale newLocale)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window with the given locale.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - Unique name of the target portlet window (must not be null)
newLocale - New locale (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given locale is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow,
                                     javax.portlet.PortletMode newPortletMode,
                                     javax.portlet.WindowState newWindowState,
                                     Constants.PortalState portalState,
                                     java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters,
                                     java.util.Locale newLocale)
                                     throws java.io.IOException,
                                            javax.portlet.PortletModeException,
                                            javax.portlet.WindowStateException
Creates a render URL that points to the specified portlet window. This method also allows to change different parts of the navigational state, like the portlet mode and window state of the targeted portlet, the portal state, the render parameters of the targeted portlet, and the locale.

If no new render parameters are specified the current render parameters of all portlets are preserved. If new render parameters for the target portlet are specified the render parameters of the target portlet are replaced with the specified render parameter and the render parameters of all other portlets are preserved.

Note: Instead of providing null as values of please use one of the other flavors of this method. This will produce a better performace as the checking for null values can be omitted.

TBD INSERT CODE SAMPLE HERE

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
newPortletMode - New portlet mode of the target portlet (may be null)
newWindowState - New portlet window state of the target portlet (may be null)
portalState - New portal navigational state (e.g. SOLO mode or non-SOLO mode) (may be null)
newRenderParameters - New render parameters for the target portlet (may be null)
newLocale - New locale (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.PortletModeException - - if the target portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode.
javax.portlet.WindowStateException - - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state.
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given portal state is not supported
3. the given locale is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if the given content node or portlet window is not valid or not accessible

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow,
                                     javax.portlet.PortletMode newPortletMode)
                                     throws java.io.IOException,
                                            javax.portlet.PortletModeException
Creates a render URL that points to the specified portlet window with the specified portlet mode.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
newPortletMode - New portlet mode of the target portlet (must not be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.PortletModeException - - if the target portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode.
java.lang.IllegalArgumentException - - if the given content node or portlet window is not valid or not accessible

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow,
                                     javax.portlet.WindowState newWindowState)
                                     throws java.io.IOException,
                                            javax.portlet.WindowStateException
Creates a render URL that points to the specified portlet window with the new window state.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
newWindowState - New portlet window state of the target portlet (must not be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.WindowStateException - - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state.
java.lang.IllegalArgumentException - - if the given content node or portlet window is not valid or not accessible

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow,
                                     java.util.Map<java.lang.String,java.lang.String[]> newRenderParameters)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window with the given render parameters.

The render parameters of the target portlet are replaced with the specified render parameter and the render parameters of all other portlets and the portal state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
newRenderParameters - New render parameters for the target portlet (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
javax.portlet.PortletModeException - - if the target portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode.
javax.portlet.WindowStateException - - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state.
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given portal state is not supported
3. the given locale is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow,
                                     Constants.PortalState portalState)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window with the given portal state.

The current render parameters of all portlets are preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
portalState - New portal navigational state (e.g. SOLO mode or non-SOLO mode) (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given portal state is not supported

writePortletRenderURL

java.io.Writer writePortletRenderURL(java.io.Writer writer,
                                     ObjectID contentNode,
                                     ObjectID portletWindow,
                                     java.util.Locale newLocale)
                                     throws java.io.IOException
Creates a render URL that points to the specified portlet window with the given locale.

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null). The content node is needed in order to make the URL gneration operation less expensive.
portletWindow - ObjectID of the target portlet window (must not be null)
newLocale - New locale (may be null)
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if
1. the given content node or portlet window is not valid or not accessible for the current user
2. the given locale is not supported

writeContentNodeRenderURL

java.io.Writer writeContentNodeRenderURL(java.io.Writer writer,
                                         java.lang.String contentNode)
                                         throws java.io.IOException
Creates a render URL that points to the specified content node (e.g. portal page).

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - Unique name of the content node the portlet window belongs to (must not be null).
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if the given content node is not valid or not accessible for the current user

writeContentNodeRenderURL

java.io.Writer writeContentNodeRenderURL(java.io.Writer writer,
                                         ObjectID contentNode)
                                         throws java.io.IOException
Creates a render URL that points to the specified content node (e.g. portal page).

The current render parameters of all portlets and the current state is preserved.

Parameters:
writer - Destination stream that receives the character representation of the URL (must not be null)
contentNode - ObjectID of the content node the portlet window belongs to (must not be null).
Returns:
Reference to the writer
Throws:
java.io.IOException - - error occured on the underlying streams
java.lang.IllegalArgumentException - - if the given content node is not valid or not accessible for the current user

isInPortalState

boolean isInPortalState(Constants.PortalState portalState)
Returns true, if the given portal state is the same as the portal state of the current request.

Parameters:
portalState - Portal state against to check the current portal state (e.g. SOLO mode or non-SOLO mode) (may not be null)
Returns:
boolean true if the portalState equals the portal state of the current request
Throws:
java.lang.IllegalArgumentException - - if
the given portal state is not supported or null is provided as portal state.