org.jasig.portal.portlet.registry
Interface IPortletWindowRegistry

All Known Subinterfaces:
ITransientPortletWindowRegistry
All Known Implementing Classes:
PortletWindowRegistryImpl, TransientPortletWindowRegistryImpl

public interface IPortletWindowRegistry

Provides methods for creating and accessing IPortletWindow and related objects. Methods require a HttpServletRequest object due to the nature of IPortletWindows and how they are tracked.

Version:
$Revision$
Author:
Eric Dalquist

Method Summary
 IPortletWindow convertPortletWindow(HttpServletRequest request, org.apache.pluto.PortletWindow portletWindow)
          Converts a Pluto PortletWindow object to a uPortal IPortletWindow.
 IPortletWindow createDefaultPortletWindow(HttpServletRequest request, IPortletEntityId portletEntityId)
          Creates a new portlet window that will have the ID returned by getDefaultPortletWindowId(IPortletEntityId) from the specified parent entity id.
 IPortletWindow createDelegatePortletWindow(HttpServletRequest request, IPortletEntityId portletEntityId, IPortletWindowId delegationParentId)
          Creates a delegating portlet window
 IPortletWindow createPortletWindow(HttpServletRequest request, String windowInstanceId, IPortletEntityId portletEntityId)
          Creates a new portlet window for the window instance id and parent entity id.
 IPortletWindowId createTransientPortletWindowId(HttpServletRequest request, IPortletWindowId sourcePortletWindowId)
          Creates an ID for a transient portlet window
 IPortletWindowId getDefaultPortletWindowId(IPortletEntityId portletEntityId)
          Creates the default portlet window ID given the ID of the entity the window is based on.
 IPortletWindow getOrCreateDefaultPortletWindow(HttpServletRequest request, IPortletEntityId portletEntityId)
          Get an existing portlet window for the default window id and parent entity id.
 IPortletWindow getOrCreateDelegatePortletWindow(HttpServletRequest request, IPortletWindowId portletWindowId, IPortletEntityId portletEntityId, IPortletWindowId delegationParentId)
          Gets or Creates a delegating portlet window.
 IPortletWindow getOrCreatePortletWindow(HttpServletRequest request, String windowInstanceId, IPortletEntityId portletEntityId)
          Get an existing portlet window for the window instance id and parent entity id.
 IPortletEntity getParentPortletEntity(HttpServletRequest request, IPortletWindowId portletWindowId)
          Gets the parent portlet entity for the window specified by the window id.
 IPortletWindow getPortletWindow(HttpServletRequest request, IPortletWindowId portletWindowId)
          Get an existing portlet window for the window id.
 IPortletWindow getPortletWindow(HttpServletRequest request, String windowInstanceId, IPortletEntityId portletEntityId)
          Get an existing portlet window for the channel window instance id and entity id.
 IPortletWindowId getPortletWindowId(String portletWindowId)
          Creates an IPortletWindowId for the specified string identifier
 boolean isTransient(HttpServletRequest request, IPortletWindowId portletWindowId)
           
 

Method Detail

getPortletWindow

IPortletWindow getPortletWindow(HttpServletRequest request,
                                IPortletWindowId portletWindowId)
Get an existing portlet window for the window id. If no window exists for the id null will be returned.

Parameters:
request - The current request.
portletWindowId - The ID of the IPortletWindow to return.
Returns:
The requested IPortletWindow, if no window exists for the ID null will be returned.
Throws:
IllegalArgumentException - if request or portletWindowId are null.

getPortletWindow

IPortletWindow getPortletWindow(HttpServletRequest request,
                                String windowInstanceId,
                                IPortletEntityId portletEntityId)
Get an existing portlet window for the channel window instance id and entity id. If no window exists for the parameters null will be returned.

Parameters:
request - The current request.
windowInstanceId - The identifier for the instance of the window, such as an id for an inline window and an id for a detached window.
portletEntityId - The parent entity id.
Returns:
The existing window, if no window exists for the instance id and entity id null will be returned.
Throws:
IllegalArgumentException - If request, windowInstanceId or portletEntityId are null.

createPortletWindow

IPortletWindow createPortletWindow(HttpServletRequest request,
                                   String windowInstanceId,
                                   IPortletEntityId portletEntityId)
Creates a new portlet window for the window instance id and parent entity id. If the parent IPortletEntity for the portletEntityId can't be found or a window already exists for the window instance id and entity id an exception will be thrown.

Parameters:
request - The current request.
windowInstanceIdThe - identifier for the instance of the window, such as an id for an inline window and an id for a detached window.
portletEntityId - The parent entity id.
Returns:
A new window for the parameters
Throws:
IllegalArgumentException - If request, windowInstanceId or portletEntityId are null, if no org.jasig.portal.ChannelDefinition exists for the channelPublishId or if an entity already exists for the subscribe id & person.

getOrCreatePortletWindow

IPortletWindow getOrCreatePortletWindow(HttpServletRequest request,
                                        String windowInstanceId,
                                        IPortletEntityId portletEntityId)
Get an existing portlet window for the window instance id and parent entity id. If no window exists for the parameters a new window will be created and returned. This is a convenience for getPortletWindow(HttpServletRequest, String, IPortletEntityId) and createPortletWindow(HttpServletRequest, String, IPortletEntityId)

Parameters:
request - The current request.
windowInstanceId - The identifier for the instance of the window, such as an id for an inline window and an id for a detached window.
portletEntityId - The parent entity id.
Returns:
An existing window if exists or a new window if not.
Throws:
IllegalArgumentException - If request, windowInstanceId or portletEntityId are null

createDefaultPortletWindow

IPortletWindow createDefaultPortletWindow(HttpServletRequest request,
                                          IPortletEntityId portletEntityId)
Creates a new portlet window that will have the ID returned by getDefaultPortletWindowId(IPortletEntityId) from the specified parent entity id. If the parent IPortletEntity for the portletEntityId can't be found or a window already exists for the default window id and entity id an exception will be thrown.

Parameters:
request - The current request.
portletEntityId - The parent entity id.
Returns:
A new window for the parameters
Throws:
IllegalArgumentException - If request or portletEntityId are null, if no org.jasig.portal.ChannelDefinition exists for the channelPublishId or if an entity already exists for the default window id & person.

getOrCreateDefaultPortletWindow

IPortletWindow getOrCreateDefaultPortletWindow(HttpServletRequest request,
                                               IPortletEntityId portletEntityId)
Get an existing portlet window for the default window id and parent entity id. If no window exists for the parameters a new window will be created and returned. This is a convenience for getDefaultPortletWindowId(IPortletEntityId), getPortletWindow(HttpServletRequest, IPortletWindowId) and createDefaultPortletWindow(HttpServletRequest, IPortletEntityId)

Parameters:
request - The current request.
portletEntityId - The parent entity id.
Returns:
An existing window if exists or a new window if not.
Throws:
IllegalArgumentException - If request, windowInstanceId or portletEntityId are null

createDelegatePortletWindow

IPortletWindow createDelegatePortletWindow(HttpServletRequest request,
                                           IPortletEntityId portletEntityId,
                                           IPortletWindowId delegationParentId)
Creates a delegating portlet window

Parameters:
portletEntityId - The parent entity id for the window if it doesn't already exist
delegationParentId - The ID of the parent portlet window
Returns:
The IPortletWindow that is a delegate of the parent
Throws:
IllegalArgumentException - If any argument is null

getOrCreateDelegatePortletWindow

IPortletWindow getOrCreateDelegatePortletWindow(HttpServletRequest request,
                                                IPortletWindowId portletWindowId,
                                                IPortletEntityId portletEntityId,
                                                IPortletWindowId delegationParentId)
Gets or Creates a delegating portlet window.

Parameters:
portletWindowId - The ID of the delegate portlet window
portletEntityId - The parent entity id for the window if it doesn't already exist
delegationParentId - The ID of the parent portlet window
Returns:
The IPortletWindow that is a delegate of the parent
Throws:
IllegalArgumentException - If any argument is null

createTransientPortletWindowId

IPortletWindowId createTransientPortletWindowId(HttpServletRequest request,
                                                IPortletWindowId sourcePortletWindowId)
Creates an ID for a transient portlet window

Parameters:
portletWindowId - The string represenation of the portlet window ID.
Returns:
The IPortletWindowId for the string
Throws:
IllegalArgumentException - If portletWindowId is null

isTransient

boolean isTransient(HttpServletRequest request,
                    IPortletWindowId portletWindowId)
Parameters:
request - The current portal request
portletWindowId - The window ID to check
Returns:
true if the window id is for a transient window.

convertPortletWindow

IPortletWindow convertPortletWindow(HttpServletRequest request,
                                    org.apache.pluto.PortletWindow portletWindow)
Converts a Pluto PortletWindow object to a uPortal IPortletWindow.

Parameters:
request - The request related to the window objects
portletWindow - The Pluto PortletWindow to convert from
Returns:
The corresponding uPortal IPortletWindow, will not be null.
Throws:
IllegalArgumentException - if request or portletWindow are null

getPortletWindowId

IPortletWindowId getPortletWindowId(String portletWindowId)
Creates an IPortletWindowId for the specified string identifier

Parameters:
portletWindowId - The string represenation of the portlet window ID.
Returns:
The IPortletWindowId for the string
Throws:
IllegalArgumentException - If portletWindowId is null

getDefaultPortletWindowId

IPortletWindowId getDefaultPortletWindowId(IPortletEntityId portletEntityId)
Creates the default portlet window ID given the ID of the entity the window is based on.

Parameters:
portletEntityId - The id of the entity to base the window ID on
Returns:
The default window id for the entity
Throws:
IllegalArgumentException - If portletEntityId is null

getParentPortletEntity

IPortletEntity getParentPortletEntity(HttpServletRequest request,
                                      IPortletWindowId portletWindowId)
Gets the parent portlet entity for the window specified by the window id.

Parameters:
request - The request related to the window objects
portletWindowId - The window ID to get the parent entity for.
Returns:
The parent portlet entity for the window, null if no window exists for the id.


Copyright © 2010 Jasig. All Rights Reserved.