Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.layout
Class TransientUserLayoutManagerWrapper

    java.lang.Object
      org.jasig.portal.layout.TransientUserLayoutManagerWrapper

All Implemented Interfaces:
  IUserLayoutManager

    public class TransientUserLayoutManagerWrapper

extends java.lang.Object
implements IUserLayoutManager

Wraps `IUserLayoutManager` interface to provide ability to incorporate channels into a user layout that are not part of their layout structure (persistent). The channels are incorporated upon request (functional name) and remain part of the layout structure only as long as they are the target channel.

Version:
  $Revision: 1.28 $
Author:
  Keith Stacks

Nested Class Summary
`(package private) class` | `TransientUserLayoutManagerWrapper.TransientUserLayoutManagerSAXFilter` This filter incorporates transient channels into a layout.

Field Summary
`private static org.apache.commons.logging.Log` | `log`
`private IUserLayoutManager` | `man`
`private java.util.Map` | `mChanMap`
`private java.util.Map` | `mFnameMap`
`private java.lang.String` | `mFocusedId`
`private int` | `mSubId`
`private java.util.Map` | `mSubIdMap`
`static java.lang.String` | `SUBSCRIBE_PREFIX`
`static java.lang.String` | `TRANSIENT_FOLDER_ID`

Constructor Summary
`TransientUserLayoutManagerWrapper(IUserLayoutManager manager)`

Method Summary
`boolean` | `addLayoutEventListener(LayoutEventListener l)` Register a layout event listener
`IUserLayoutNodeDescription` | `addNode(IUserLayoutNodeDescription node, java.lang.String parentId, java.lang.String nextSiblingId)` Add a new node to a current user layout.
`boolean` | `canAddNode(IUserLayoutNodeDescription node, java.lang.String parentId, java.lang.String nextSiblingId)` Test if a particular node can be added at a given location.
`boolean` | `canDeleteNode(java.lang.String nodeId)` Tests if a particular node can be deleted.
`boolean` | `canMoveNode(java.lang.String nodeId, java.lang.String parentId, java.lang.String nextSiblingId)` Test if a particular node can be moved to a given location.
`boolean` | `canUpdateNode(IUserLayoutNodeDescription node)` Test if a certain node can be updated.
`IUserLayoutNodeDescription` | `createNodeDescription(int nodeType)` A factory method to create an empty `IUserLayoutNodeDescription` instance
`boolean` | `deleteNode(java.lang.String nodeId)` Delete a node (folder or a channel) from a user layout.
`java.lang.String` | `getCacheKey()` Return a cache key, uniqly corresponding to the composition and the structure of the user layout.
`protected ChannelDefinition` | `getChannelDefinition(java.lang.String subId)` Given a subscribe Id, return a ChannelDefinition.
`java.util.Enumeration` | `getChildIds(java.lang.String nodeId)` Returns a list of child node Ids for a given node.
`int` | `getDepth(java.lang.String nodeId)` Returns the depth of a node in the layout tree.
`java.lang.String` | `getFname(java.lang.String subId)` Given a subscribe Id, return its functional name.
`java.lang.String` | `getFocusedId()` Get the current focused layout subscribe id.
`int` | `getLayoutId()` Returns a layout Id associated with this manager/
`java.lang.String` | `getNextSiblingId(java.lang.String nodeId)` Determine an Id of a next sibling node.
`private java.lang.String` | `getNextSubscribeId()` Return the next sequential subscription id.
`IUserLayoutNodeDescription` | `getNode(java.lang.String nodeId)` Obtain a description of a node (channel or a folder) in a given user layout.
`IUserLayoutManager` | `getOriginalLayoutManager()`
`java.lang.String` | `getParentId(java.lang.String nodeId)` Returns an Id of a parent user layout node.
`java.lang.String` | `getPreviousSiblingId(java.lang.String nodeId)` Determine an Id of a previous sibling node.
`java.lang.String` | `getRootFolderId()` Returns an id of the root folder.
`java.lang.String` | `getSubscribeId(java.lang.String fname)` Given an functional name, return its subscribe id.
`private IUserLayoutChannelDescription` | `getTransientNode(java.lang.String nodeId)` Return an IUserLayoutChannelDescription by way of nodeId
`IUserLayout` | `getUserLayout()` Gets a user layout (with appropriate markings).
`void` | `getUserLayout(org.xml.sax.ContentHandler ch)` Output user layout (with appropriate markings) into a `ContentHandler`
`void` | `getUserLayout(java.lang.String nodeId, org.xml.sax.ContentHandler ch)` Output subtree of a user layout (with appropriate markings) defined by a particular node into a `ContentHandler`
`org.w3c.dom.Document` | `getUserLayoutDOM()`
`void` | `loadUserLayout()` Signal manager to load a user layout from a database
`void` | `markAddTargets(IUserLayoutNodeDescription node)` Ask manager to output markings at the locations where a given node can be added.
`void` | `markMoveTargets(java.lang.String nodeId)` Ask manager to output markings at the locations where a given node can be moved.
`boolean` | `moveNode(java.lang.String nodeId, java.lang.String parentId, java.lang.String nextSiblingId)` Move a node (channel or folder) from one location to another.
`boolean` | `removeLayoutEventListener(LayoutEventListener l)` Remove a registered layout event listener.
`void` | `saveUserLayout()` Signal manager to persist user layout to a database
`void` | `setFocusedId(java.lang.String subscribeId)` Set the current focused layout subscribe id.
`void` | `setLayoutStore(IUserLayoutStore ls)` Set a user layout store implementation.
`void` | `setOriginalLayoutManager(IUserLayoutManager man)`
`void` | `setUserLayout(IUserLayout userLayout)` Sets a user layout (with appropriate markings).
`boolean` | `updateNode(IUserLayoutNodeDescription node)` Update a given node.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    private static final org.apache.commons.logging.Log log

### TRANSIENT_FOLDER_ID

    public static final java.lang.String TRANSIENT_FOLDER_ID

See Also:
  Constant Field Values

### SUBSCRIBE_PREFIX

    public static final java.lang.String SUBSCRIBE_PREFIX

See Also:
  Constant Field Values

### man

    private IUserLayoutManager man

### mFnameMap

    private java.util.Map mFnameMap

### mSubIdMap

    private java.util.Map mSubIdMap

### mChanMap

    private java.util.Map mChanMap

### mFocusedId

    private java.lang.String mFocusedId

### mSubId

    private int mSubId

Constructor Detail

### TransientUserLayoutManagerWrapper

    public TransientUserLayoutManagerWrapper(IUserLayoutManager manager)
                                      throws PortalException

Throws:
  `PortalException`

Method Detail

### getOriginalLayoutManager

    public IUserLayoutManager getOriginalLayoutManager()
                                                throws PortalException

  Throws:
    `PortalException`

### setOriginalLayoutManager

    public void setOriginalLayoutManager(IUserLayoutManager man)
                                  throws PortalException

  Throws:
    `PortalException`

### getUserLayout

    public IUserLayout getUserLayout()
                              throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Gets a user layout (with appropriate markings).

  Specified by:
    `getUserLayout` in interface `IUserLayoutManager`
  Returns:
    the user layout
  Throws:
    `PortalException` - if an error occurs

### setUserLayout

    public void setUserLayout(IUserLayout userLayout)
                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Sets a user layout (with appropriate markings).

  Specified by:
    `setUserLayout` in interface `IUserLayoutManager`
  Parameters:
    `userLayout` - the user layout
  Throws:
    `PortalException` - if an error occurs

### getUserLayout

    public void getUserLayout(org.xml.sax.ContentHandler ch)
                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Output user layout (with appropriate markings) into a `ContentHandler`

  Specified by:
    `getUserLayout` in interface `IUserLayoutManager`
  Parameters:
    `ch` - a `ContentHandler` value
  Throws:
    `PortalException` - if an error occurs

### getUserLayout

    public void getUserLayout(java.lang.String nodeId,
                              org.xml.sax.ContentHandler ch)
                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Output subtree of a user layout (with appropriate markings) defined by a particular node into a `ContentHandler`

  Specified by:
    `getUserLayout` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` a node determining a user layout subtree.
    `ch` - a `ContentHandler` value
  Throws:
    `PortalException` - if an error occurs

### setLayoutStore

    public void setLayoutStore(IUserLayoutStore ls)

  Description copied from interface: `IUserLayoutManager`
  Set a user layout store implementation.

  Specified by:
    `setLayoutStore` in interface `IUserLayoutManager`
  Parameters:
    `ls` - an `IUserLayoutStore` value

### getUserLayoutDOM

    public org.w3c.dom.Document getUserLayoutDOM()
                                          throws PortalException

  Specified by:
    `getUserLayoutDOM` in interface `IUserLayoutManager`
  Throws:
    `PortalException`

### loadUserLayout

    public void loadUserLayout()
                        throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Signal manager to load a user layout from a database

  Specified by:
    `loadUserLayout` in interface `IUserLayoutManager`
  Throws:
    `PortalException` - if an error occurs

### saveUserLayout

    public void saveUserLayout()
                        throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Signal manager to persist user layout to a database

  Specified by:
    `saveUserLayout` in interface `IUserLayoutManager`
  Throws:
    `PortalException` - if an error occurs

### getNode

    public IUserLayoutNodeDescription getNode(java.lang.String nodeId)
                                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Obtain a description of a node (channel or a folder) in a given user layout.

  Specified by:
    `getNode` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` channel subscribe id or folder id.
  Returns:
    an `UserLayoutNodeDescription` value
  Throws:
    `PortalException` - if an error occurs

### addNode

    public IUserLayoutNodeDescription addNode(IUserLayoutNodeDescription node,
                                              java.lang.String parentId,
                                              java.lang.String nextSiblingId)
                                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Add a new node to a current user layout.

  Specified by:
    `addNode` in interface `IUserLayoutManager`
  Parameters:
    `node` - an `UserLayoutNodeDescription` value of a node to be added (Id doesn't have to be set)
    `parentId` - a `String` id of a folder to which the new node (channel or folder) should be added.
    `nextSiblingId` - a `String` an id of a sibling node (channel or folder) prior to which the new node should be inserted.
  Returns:
    an `UserLayoutNodeDescription` value with a newly determined Id.
  Throws:
    `PortalException` - if an error occurs

### moveNode

    public boolean moveNode(java.lang.String nodeId,
                            java.lang.String parentId,
                            java.lang.String nextSiblingId)
                     throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Move a node (channel or folder) from one location to another.

  Specified by:
    `moveNode` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value of a node Id.
    `parentId` - a `String` id of a folder to which the node should be moved.
    `nextSiblingId` - a `String` id of a sibling node (folder or channel) prior to which the node should be placed. (`null` to append at the end)
  Returns:
    a `boolean` value noting if the operation was successful
  Throws:
    `PortalException` - if an error occurs

### deleteNode

    public boolean deleteNode(java.lang.String nodeId)
                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Delete a node (folder or a channel) from a user layout.

  Specified by:
    `deleteNode` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` id (channel subscribe id or folder id)
  Returns:
    a `boolean` value noting if the operation was successful
  Throws:
    `PortalException` - if an error occurs

### updateNode

    public boolean updateNode(IUserLayoutNodeDescription node)
                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Update a given node.

  Specified by:
    `updateNode` in interface `IUserLayoutManager`
  Parameters:
    `node` - an `UserLayoutNodeDescription` value with a valid id.
  Returns:
    a `boolean` value noting if the operation was successful
  Throws:
    `PortalException` - if an error occurs

### canAddNode

    public boolean canAddNode(IUserLayoutNodeDescription node,
                              java.lang.String parentId,
                              java.lang.String nextSiblingId)
                       throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Test if a particular node can be added at a given location.

  Specified by:
    `canAddNode` in interface `IUserLayoutManager`
  Parameters:
    `node` - an `UserLayoutNodeDescription` value describing the node to be added.
    `parentId` - a `String` id of a parent to which the node to be added.
    `nextSiblingId` - a `String` id of a sibling prior to which the node to be inserted. (`null` to append at the end)
  Returns:
    a `boolean` value
  Throws:
    `PortalException` - if an error occurs

### canMoveNode

    public boolean canMoveNode(java.lang.String nodeId,
                               java.lang.String parentId,
                               java.lang.String nextSiblingId)
                        throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Test if a particular node can be moved to a given location.

  Specified by:
    `canMoveNode` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` id of a node to be moved.
    `parentId` - a `String` id of a parent to which the node to be moved.
    `nextSiblingId` - a `String` id of a sibling prior to which the node is to be inserted (`null` to append at the end)
  Returns:
    a `boolean` value
  Throws:
    `PortalException` - if an error occurs

### canDeleteNode

    public boolean canDeleteNode(java.lang.String nodeId)
                          throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Tests if a particular node can be deleted.

  Specified by:
    `canDeleteNode` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` node id.
  Returns:
    a `boolean` value
  Throws:
    `PortalException` - if an error occurs

### canUpdateNode

    public boolean canUpdateNode(IUserLayoutNodeDescription node)
                          throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Test if a certain node can be updated.

  Specified by:
    `canUpdateNode` in interface `IUserLayoutManager`
  Parameters:
    `node` - a `IUserLayoutNodeDescription` node id.
  Returns:
    a `boolean` value
  Throws:
    `PortalException` - if an error occurs

### markAddTargets

    public void markAddTargets(IUserLayoutNodeDescription node)
                        throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Ask manager to output markings at the locations where a given node can be added. The marks will appear next time `getUserLayout` method is called.

  Specified by:
    `markAddTargets` in interface `IUserLayoutManager`
  Parameters:
    `node` - an `UserLayoutNodeDescription` value or `null` to stop outputting add markings.
  Throws:
    `PortalException` - if an error occurs

### markMoveTargets

    public void markMoveTargets(java.lang.String nodeId)
                         throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Ask manager to output markings at the locations where a given node can be moved. The marks will appear next time `getUserLayout` method is called.

  Specified by:
    `markMoveTargets` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value or `null` to stop outputting move markings.
  Throws:
    `PortalException` - if an error occurs

### getParentId

    public java.lang.String getParentId(java.lang.String nodeId)
                                 throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Returns an Id of a parent user layout node. The user layout root node always has ID= `IUserLayout.ROOT_NODE_NAME`

  Specified by:
    `getParentId` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value
  Returns:
    a `String` value
  Throws:
    `PortalException` - if an error occurs

### getChildIds

    public java.util.Enumeration getChildIds(java.lang.String nodeId)
                                      throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Returns a list of child node Ids for a given node.

  Specified by:
    `getChildIds` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value
  Returns:
    a `List` of `String` child node Ids.
  Throws:
    `PortalException` - if an error occurs

### getNextSiblingId

    public java.lang.String getNextSiblingId(java.lang.String nodeId)
                                      throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Determine an Id of a next sibling node.

  Specified by:
    `getNextSiblingId` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value
  Returns:
    a `String` Id value of a next sibling node, or `null` if this is the last sibling.
  Throws:
    `PortalException` - if an error occurs

### getPreviousSiblingId

    public java.lang.String getPreviousSiblingId(java.lang.String nodeId)
                                          throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Determine an Id of a previous sibling node.

  Specified by:
    `getPreviousSiblingId` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value
  Returns:
    a `String` Id value of a previous sibling node, or `null` if this is the first sibling.
  Throws:
    `PortalException` - if an error occurs

### getCacheKey

    public java.lang.String getCacheKey()
                                 throws PortalException

  Description copied from interface: `IUserLayoutManager`
  Return a cache key, uniqly corresponding to the composition and the structure of the user layout.

  Specified by:
    `getCacheKey` in interface `IUserLayoutManager`
  Returns:
    a `String` value
  Throws:
    `PortalException` - if an error occurs

### getLayoutId

    public int getLayoutId()

  Description copied from interface: `IUserLayoutManager`
  Returns a layout Id associated with this manager/

  Specified by:
    `getLayoutId` in interface `IUserLayoutManager`
  Returns:
    an `int` layout Id value;

### getRootFolderId

    public java.lang.String getRootFolderId()

  Description copied from interface: `IUserLayoutManager`
  Returns an id of the root folder.

  Specified by:
    `getRootFolderId` in interface `IUserLayoutManager`
  Returns:
    a `String` value

### getDepth

    public int getDepth(java.lang.String nodeId)
                 throws PortalException

  Returns the depth of a node in the layout tree.

  Specified by:
    `getDepth` in interface `IUserLayoutManager`
  Parameters:
    `nodeId` - a `String` value
  Returns:
    a depth value
  Throws:
    `PortalException` - if an error occurs

### createNodeDescription

    public IUserLayoutNodeDescription createNodeDescription(int nodeType)
                                                     throws PortalException

  Description copied from interface: `IUserLayoutManager`
  A factory method to create an empty `IUserLayoutNodeDescription` instance

  Specified by:
    `createNodeDescription` in interface `IUserLayoutManager`
  Parameters:
    `nodeType` - a node type constant from `IUserLayoutNodeDescription` interface
  Returns:
    an `IUserLayoutNodeDescription` instance
  Throws:
    `PortalException` - if the error occurs.

### addLayoutEventListener

    public boolean addLayoutEventListener(LayoutEventListener l)

  Description copied from interface: `IUserLayoutManager`
  Register a layout event listener

  Specified by:
    `addLayoutEventListener` in interface `IUserLayoutManager`
  Parameters:
    `l` - a `LayoutEventListener` object
  Returns:
    a `boolean` success status

### removeLayoutEventListener

    public boolean removeLayoutEventListener(LayoutEventListener l)

  Description copied from interface: `IUserLayoutManager`
  Remove a registered layout event listener.

  Specified by:
    `removeLayoutEventListener` in interface `IUserLayoutManager`
  Parameters:
    `l` - a `LayoutEventListener` object
  Returns:
    a `boolean` success status

### getChannelDefinition

    protected ChannelDefinition getChannelDefinition(java.lang.String subId)
                                              throws PortalException

  Given a subscribe Id, return a ChannelDefinition.

  Parameters:
    `subId` - the subscribe id for the ChannelDefinition.
  Returns:
    a `ChannelDefinition`
  Throws:
    `PortalException`

### getFname

    public java.lang.String getFname(java.lang.String subId)

  Given a subscribe Id, return its functional name.

  Parameters:
    `subId` - the subscribe id to lookup
  Returns:
    the subscribe id's functional name

### getSubscribeId

    public java.lang.String getSubscribeId(java.lang.String fname)
                                    throws PortalException

  Given an functional name, return its subscribe id.

  Specified by:
    `getSubscribeId` in interface `IUserLayoutManager`
  Parameters:
    `fname` - the functional name to lookup
  Returns:
    the fname's subscribe id.
  Throws:
    `PortalException`

### getFocusedId

    public java.lang.String getFocusedId()

  Get the current focused layout subscribe id.

### setFocusedId

    public void setFocusedId(java.lang.String subscribeId)

  Set the current focused layout subscribe id.

  Parameters:
    `subscribeId` - Id to be set as focused.

### getTransientNode

    private IUserLayoutChannelDescription getTransientNode(java.lang.String nodeId)
                                                    throws PortalException

  Return an IUserLayoutChannelDescription by way of nodeId

  Parameters:
    `nodeId` - the node (subscribe) id to get the channel for.
  Returns:
    a `IUserLayoutNodeDescription`
  Throws:
    `PortalException`

### getNextSubscribeId

    private java.lang.String getNextSubscribeId()

  Return the next sequential subscription id.

  Returns:
    a subscribe id

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD