org.jasig.portal.layout
Interface IUserLayoutManager

All Known Implementing Classes:
DistributedLayoutManager, ImmutableUserLayoutManagerWrapper, SimpleUserLayoutManager, TransientUserLayoutManagerWrapper

public interface IUserLayoutManager

An interface for abstracting operations performed on the user layout.

Version:
1.1
Author:
Peter Kharchenko pkharchenko@interactivebusiness.com", Michael Ivanov

Method Summary
 boolean addLayoutEventListener(LayoutEventListener l)
          Register a layout event listener
 IUserLayoutNodeDescription addNode(IUserLayoutNodeDescription node, String parentId, String nextSiblingId)
          Add a new node to a current user layout.
 boolean canAddNode(IUserLayoutNodeDescription node, String parentId, String nextSiblingId)
          Test if a particular node can be added at a given location.
 boolean canDeleteNode(String nodeId)
          Tests if a particular node can be deleted.
 boolean canMoveNode(String nodeId, String parentId, 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(String nodeId)
          Delete a node (folder or a channel) from a user layout.
 String getCacheKey()
          Return a cache key, uniqly corresponding to the composition and the structure of the user layout.
 Enumeration<String> getChildIds(String nodeId)
          Returns a list of child node Ids for a given node.
 int getDepth(String nodeId)
          Returns the depth of a node in the layout tree.
 int getLayoutId()
          Returns a layout Id associated with this manager/
 String getNextSiblingId(String nodeId)
          Determine an Id of a next sibling node.
 IUserLayoutNodeDescription getNode(String nodeId)
          Obtain a description of a node (channel or a folder) in a given user layout.
 String getParentId(String nodeId)
          Returns an Id of a parent user layout node.
 String getPreviousSiblingId(String nodeId)
          Determine an Id of a previous sibling node.
 String getRootFolderId()
          Returns an id of the root folder.
 String getSubscribeId(String fname)
          Returns a subscription id using the supplied functional name.
 IUserLayout getUserLayout()
          Gets a user layout (with appropriate markings).
 void getUserLayout(ContentHandler ch)
          Output user layout (with appropriate markings) into a ContentHandler
 void getUserLayout(String nodeId, ContentHandler ch)
          Output subtree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler
 Document getUserLayoutDOM()
          Deprecated. getUserLayout() should be used instead. Direct manipulation of the DOM can cause caching problems and issues where the layout manager doesn't know about DOM changes. Read https://lists.wisc.edu/read/messages?id=2167043 for more information.
 void loadUserLayout()
          Calls loadUserLayout(boolean) passing false.
 void loadUserLayout(boolean reload)
          Signal manager to load a user layout.
 void markAddTargets(IUserLayoutNodeDescription node)
          Ask manager to output markings at the locations where a given node can be added.
 void markMoveTargets(String nodeId)
          Ask manager to output markings at the locations where a given node can be moved.
 boolean moveNode(String nodeId, String parentId, String nextSiblingId)
          Move a node (channel or folder) from one location to another.
 void processLayoutParameters(IPerson person, UserPreferences userPrefs, HttpServletRequest req)
          Allows layout manager specific handling of user request parameter processing potentially including passing of specific parameters to the structure and theme transformations via the user preferences object.
 boolean removeLayoutEventListener(LayoutEventListener l)
          Remove a registered layout event listener.
 void saveUserLayout()
          Signal manager to persist user layout to a database
 void setLayoutStore(IUserLayoutStore ls)
          Set a user layout store implementation.
 void setUserLayout(IUserLayout userLayout)
          Sets a user layout (with appropriate markings).
 boolean updateNode(IUserLayoutNodeDescription node)
          Update a given node.
 

Method Detail

getUserLayout

IUserLayout getUserLayout()
                          throws PortalException
Gets a user layout (with appropriate markings).

Returns:
the user layout
Throws:
PortalException - if an error occurs

setUserLayout

void setUserLayout(IUserLayout userLayout)
                   throws PortalException
Sets a user layout (with appropriate markings).

Parameters:
userLayout - the user layout
Throws:
PortalException - if an error occurs

getUserLayout

void getUserLayout(ContentHandler ch)
                   throws PortalException
Output user layout (with appropriate markings) into a ContentHandler

Parameters:
ch - a ContentHandler value
Throws:
PortalException - if an error occurs

getUserLayout

void getUserLayout(String nodeId,
                   ContentHandler ch)
                   throws PortalException
Output subtree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler

Parameters:
nodeId - a String a node determining a user layout subtree.
ch - a ContentHandler value
Throws:
PortalException - if an error occurs

setLayoutStore

void setLayoutStore(IUserLayoutStore ls)
Set a user layout store implementation.

Parameters:
ls - an IUserLayoutStore value

loadUserLayout

void loadUserLayout()
                    throws PortalException
Calls loadUserLayout(boolean) passing false.

Throws:
PortalException

loadUserLayout

void loadUserLayout(boolean reload)
                    throws PortalException
Signal manager to load a user layout.

Parameters:
reload - If true the reload will be forced, purging any cached data.
Throws:
PortalException - PortalException if an error occurs

saveUserLayout

void saveUserLayout()
                    throws PortalException
Signal manager to persist user layout to a database

Throws:
PortalException - if an error occurs

getNode

IUserLayoutNodeDescription getNode(String nodeId)
                                   throws PortalException
Obtain a description of a node (channel or a folder) in a given user layout.

Parameters:
nodeId - a String channel subscribe id or folder id.
Returns:
an UserLayoutNodeDescription value
Throws:
PortalException - if an error occurs

addNode

IUserLayoutNodeDescription addNode(IUserLayoutNodeDescription node,
                                   String parentId,
                                   String nextSiblingId)
                                   throws PortalException
Add a new node to a current user layout.

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

boolean moveNode(String nodeId,
                 String parentId,
                 String nextSiblingId)
                 throws PortalException
Move a node (channel or folder) from one location to another.

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

boolean deleteNode(String nodeId)
                   throws PortalException
Delete a node (folder or a channel) from a user layout.

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

boolean updateNode(IUserLayoutNodeDescription node)
                   throws PortalException
Update a given node.

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

boolean canAddNode(IUserLayoutNodeDescription node,
                   String parentId,
                   String nextSiblingId)
                   throws PortalException
Test if a particular node can be added at a given location.

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

boolean canMoveNode(String nodeId,
                    String parentId,
                    String nextSiblingId)
                    throws PortalException
Test if a particular node can be moved to a given location.

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

boolean canDeleteNode(String nodeId)
                      throws PortalException
Tests if a particular node can be deleted.

Parameters:
nodeId - a String node id.
Returns:
a boolean value
Throws:
PortalException - if an error occurs

canUpdateNode

boolean canUpdateNode(IUserLayoutNodeDescription node)
                      throws PortalException
Test if a certain node can be updated.

Parameters:
node - a IUserLayoutNodeDescription node id.
Returns:
a boolean value
Throws:
PortalException - if an error occurs

markAddTargets

void markAddTargets(IUserLayoutNodeDescription node)
                    throws PortalException
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.

Parameters:
node - an UserLayoutNodeDescription value or null to stop outputting add markings.
Throws:
PortalException - if an error occurs

markMoveTargets

void markMoveTargets(String nodeId)
                     throws PortalException
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.

Parameters:
nodeId - a String value or null to stop outputting move markings.
Throws:
PortalException - if an error occurs

getParentId

String getParentId(String nodeId)
                   throws PortalException
Returns an Id of a parent user layout node. The user layout root node always has ID= IUserLayout.ROOT_NODE_NAME

Parameters:
nodeId - a String value
Returns:
a String value
Throws:
PortalException - if an error occurs

getChildIds

Enumeration<String> getChildIds(String nodeId)
                                throws PortalException
Returns a list of child node Ids for a given node.

Parameters:
nodeId - a String value
Returns:
a List of String child node Ids.
Throws:
PortalException - if an error occurs

getNextSiblingId

String getNextSiblingId(String nodeId)
                        throws PortalException
Determine an Id of a next sibling node.

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

String getPreviousSiblingId(String nodeId)
                            throws PortalException
Determine an Id of a previous sibling node.

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

String getCacheKey()
                   throws PortalException
Return a cache key, uniqly corresponding to the composition and the structure of the user layout.

Returns:
a String value
Throws:
PortalException - if an error occurs

addLayoutEventListener

boolean addLayoutEventListener(LayoutEventListener l)
Register a layout event listener

Parameters:
l - a LayoutEventListener object
Returns:
a boolean success status

removeLayoutEventListener

boolean removeLayoutEventListener(LayoutEventListener l)
Remove a registered layout event listener.

Parameters:
l - a LayoutEventListener object
Returns:
a boolean success status

getUserLayoutDOM

@Deprecated
Document getUserLayoutDOM()
                          throws PortalException
Deprecated. getUserLayout() should be used instead. Direct manipulation of the DOM can cause caching problems and issues where the layout manager doesn't know about DOM changes. Read https://lists.wisc.edu/read/messages?id=2167043 for more information.

Throws:
PortalException

getLayoutId

int getLayoutId()
Returns a layout Id associated with this manager/

Returns:
an int layout Id value;

getSubscribeId

String getSubscribeId(String fname)
                      throws PortalException
Returns a subscription id using the supplied functional name.

Parameters:
fname - the functional name to lookup
Returns:
a String subscription id
Throws:
PortalException

getRootFolderId

String getRootFolderId()
Returns an id of the root folder.

Returns:
a String value

getDepth

int getDepth(String nodeId)
             throws PortalException
Returns the depth of a node in the layout tree.

Parameters:
nodeId - a String value
Returns:
a depth value
Throws:
PortalException - if an error occurs

createNodeDescription

IUserLayoutNodeDescription createNodeDescription(int nodeType)
                                                 throws PortalException
A factory method to create an empty IUserLayoutNodeDescription instance

Parameters:
nodeType - a node type constant from IUserLayoutNodeDescription interface
Returns:
an IUserLayoutNodeDescription instance
Throws:
PortalException - if the error occurs.

processLayoutParameters

void processLayoutParameters(IPerson person,
                             UserPreferences userPrefs,
                             HttpServletRequest req)
                             throws PortalException
Allows layout manager specific handling of user request parameter processing potentially including passing of specific parameters to the structure and theme transformations via the user preferences object.

Throws:
PortalException


Copyright © 2010 Jasig. All Rights Reserved.