org.jasig.portal.layout.alm
Class AggregatedLayoutManager

java.lang.Object
  extended by org.jasig.portal.layout.alm.AggregatedLayoutManager
All Implemented Interfaces:
IAggregatedUserLayoutManager, IUserLayoutManager

public class AggregatedLayoutManager
extends java.lang.Object
implements IAggregatedUserLayoutManager

An implementation of Aggregated User Layout Manager Interface defining common operations on user layout nodes, that is channels and folders. Prior to uPortal 2.5, this class existed in the package org.jasig.portal.layout. It was moved to its present package to reflect that it is part of Aggregated Layouts.

Version:
$Revision: 1.1.2.6 $
Author:
Michael Ivanov

Field Summary
private  IALNodeDescription addTargetsNodeDesc
           
private  java.lang.String cacheKey
           
private  java.lang.String fragmentId
           
private static GuidGenerator guid
           
private  AggregatedLayout layout
           
private  AggregatedUserLayoutStore layoutStore
           
private  java.util.Set listeners
           
private static org.apache.commons.logging.Log log
           
private  java.lang.String moveTargetsNodeId
           
private  IPerson person
           
private  IALRestrictionManager restrictionManager
           
private  UserProfile userProfile
           
 
Fields inherited from interface org.jasig.portal.layout.alm.IAggregatedUserLayoutManager
NEW_FRAGMENT, PRIORITY_COEFF
 
Constructor Summary
AggregatedLayoutManager(IPerson person, UserProfile userProfile)
           
AggregatedLayoutManager(IPerson person, UserProfile userProfile, IUserLayoutStore layoutStore)
           
 
Method Summary
 boolean addLayoutEventListener(LayoutEventListener l)
          Register a layout event listener
 IUserLayoutNodeDescription addNode(IUserLayoutNodeDescription nodeDesc, java.lang.String parentId, java.lang.String nextSiblingId)
          Add a new node to a current user layout.
 boolean canAddNode(IUserLayoutNodeDescription nodeDesc, 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 nodeDescription)
          Test if a certain node can be updated.
private  void changeDescendantsBooleanProperties(boolean hiddenValuesMatch, boolean immutableValuesMatch, boolean unremovableValuesMatch, IALNodeDescription nodeDesc, java.lang.String nodeId)
           
private  void changeDescendantsBooleanProperties(IALNodeDescription nodeDesc, IALNodeDescription oldNodeDesc, java.lang.String nodeId)
           
protected  boolean changeSiblingNodesOrder(java.lang.String firstNodeId)
          Change the sibling nodes order depending on their priority values
protected  boolean changeSiblingNodesPriorities(ALNode node, java.lang.String parentNodeId, java.lang.String nextNodeId)
          Change priority values for all the sibling nodes when trying to add a new node
protected  boolean changeSiblingNodesPriorities(java.lang.String nodeId)
          Change if it's possible priority values for all the sibling nodes
protected  boolean changeSiblingNodesPriorities(java.util.Vector nodes)
          Change if it's possible priority values for all the sibling nodes defined by the collection
private  void cleanLayoutData(java.lang.String nodeId, boolean result)
           
 java.lang.String createFragment(java.lang.String fragmentName, java.lang.String fragmentDesc, java.lang.String fragmentRootName)
          Creates a new fragment and loads it as an user layout
 IUserLayoutNodeDescription createNodeDescription(int nodeType)
          A factory method to create an empty IUserLayoutNodeDescription instance
 void deleteFragment()
          Deletes the current fragment if the layout is a fragment
 void deleteFragment(java.lang.String fragmentId)
          Removes the fragment
 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.
 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)
          Gets the tree depth for a given node
private  ALNode getFirstSiblingNode(java.lang.String nodeId)
           
 ILayoutFragment getFragment(java.lang.String fragmentId)
          Returns the fragment
 java.util.Collection getFragments()
          Returns the fragment Ids of the owner associated with the current layout
private  ALNode getLastSiblingNode(java.lang.String nodeId)
           
private  ALFolder getLayoutFolder(java.lang.String folderId)
           
 int getLayoutId()
          Returns an Id of the current user layout.
private  ALNode getLayoutNode(java.lang.String nodeId)
           
 java.lang.String getLostFolderXML()
           
 java.lang.String getNextSiblingId(java.lang.String nodeId)
          Determine an Id of a next sibling node.
 IUserLayoutNodeDescription getNode(java.lang.String nodeId)
          Obtain a description of a node (channel or a folder) in a given user layout.
 IALNodeDescription getNodeBeingAdded()
          Returns the description of the node currently being added to the layout
 IALNodeDescription getNodeBeingMoved()
          Returns the description of the node currently being moved in the layout
 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.
static PriorityRestriction getPriorityRestriction(ALNode node)
          Return a priority restriction for the given node.
private static PriorityRestriction getPriorityRestriction(ALNode node, java.lang.String restrictionPath)
          Return a priority restriction for the given node.
 java.util.Collection getPublishGroups(java.lang.String fragmentId)
          Returns the user group keys which the fragment is published to
private static IUserLayoutRestriction getRestriction(ALNode node, java.lang.String restrictionName, java.lang.String restrictionPath)
          Gets the restriction specified by the parameters below
 java.lang.String getRootFolderId()
          Returns an id of the root folder.
 java.util.Collection getSubscribableFragments()
          Returns the list of Ids of the fragments that the user can subscribe to
 java.lang.String getSubscribeId(java.lang.String fname)
          Returns a subscription id given a functional name.
 IUserLayout getUserLayout()
          Gets a user layout (with appropriate markings).
 void getUserLayout(org.xml.sax.ContentHandler contentHandler)
          Output a tree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler
 void getUserLayout(java.lang.String nodeId, org.xml.sax.ContentHandler contentHandler)
          Output subtree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler
 org.w3c.dom.Document getUserLayoutDOM()
           
 boolean isFragmentLoaded()
          Returns true if any fragment is currently loaded into the layout manager, false - otherwise
private  boolean isLayoutFragment()
           
private  boolean isNodeFolderOrChannel(org.w3c.dom.Element node)
           
 void loadFragment(java.lang.String fragmentId)
          Loads the fragment as an user layout given by fragmentId
 void loadUserLayout()
          Signal manager to load a user layout from a database
 void markAddTargets(IUserLayoutNodeDescription nodeDesc)
          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)
          Moves a node to a place in the tree denoted by parent and next sibling.
private  boolean moveNodeToLostFolder(java.lang.String nodeId)
          Moves the node to the lost folder
private  void moveWrongFragmentsToLostFolder()
           
protected  void moveWrongNodesToLostFolder()
          Moves the nodes to the lost folder if they don't satisfy their restrictions
private  void moveWrongNodesToLostFolder(java.lang.String nodeId, int depth)
          Moves the nodes to the lost folder if they don't satisfy their restrictions
 boolean removeLayoutEventListener(LayoutEventListener l)
          Remove a registered layout event listener.
 void saveFragment()
          Saves the current fragment if the layout is a fragment
 void saveFragment(ILayoutFragment fragment)
          Saves the fragment in the store
 void saveUserLayout()
          Signal manager to persist user layout to a database
 void setAutoCommit(boolean autoCommit)
          Deprecated. this method no longer has any effect
 void setLayoutStore(IUserLayoutStore layoutStore)
          Set a user layout store implementation.
 void setPublishGroups(IGroupMember[] groups, java.lang.String fragmentId)
          Persists the user groups which the fragment is published to
 void setUserLayout(IUserLayout layout)
          Sets a user layout (with appropriate markings).
 void setUserLayoutDOM(org.w3c.dom.Document domLayout)
           
private  void setUserLayoutDOM(org.w3c.dom.Node n, java.lang.String parentNodeId, java.util.Hashtable layoutData)
           
private  void updateCacheKey()
           
 boolean updateNode(IUserLayoutNodeDescription nodeDesc)
          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

restrictionManager

private IALRestrictionManager restrictionManager

layoutStore

private AggregatedUserLayoutStore layoutStore

layout

private AggregatedLayout layout

userProfile

private UserProfile userProfile

person

private IPerson person

listeners

private java.util.Set listeners

addTargetsNodeDesc

private IALNodeDescription addTargetsNodeDesc

moveTargetsNodeId

private java.lang.String moveTargetsNodeId

fragmentId

private java.lang.String fragmentId

guid

private static GuidGenerator guid

cacheKey

private java.lang.String cacheKey
Constructor Detail

AggregatedLayoutManager

public AggregatedLayoutManager(IPerson person,
                               UserProfile userProfile)
                        throws PortalException
Throws:
PortalException

AggregatedLayoutManager

public AggregatedLayoutManager(IPerson person,
                               UserProfile userProfile,
                               IUserLayoutStore layoutStore)
                        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

updateCacheKey

private void updateCacheKey()

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 layout)
                   throws PortalException
Description copied from interface: IUserLayoutManager
Sets a user layout (with appropriate markings).

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

createNodeDescription

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

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

setAutoCommit

public void setAutoCommit(boolean autoCommit)
Deprecated. this method no longer has any effect

Sets a layout manager to auto-commit mode that allows to update the database immediately

Specified by:
setAutoCommit in interface IAggregatedUserLayoutManager
Parameters:
autoCommit - a boolean value

getLayoutId

public int getLayoutId()
Returns an Id of the current user layout.

Specified by:
getLayoutId in interface IUserLayoutManager
Returns:
a int value

getParentId

public java.lang.String getParentId(java.lang.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

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
Returns a list of child node Ids for a given node.

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

getPreviousSiblingId

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

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

getNextSiblingId

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

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

moveWrongFragmentsToLostFolder

private void moveWrongFragmentsToLostFolder()
                                     throws PortalException
Throws:
PortalException

moveWrongNodesToLostFolder

protected void moveWrongNodesToLostFolder()
                                   throws PortalException
Moves the nodes to the lost folder if they don't satisfy their restrictions

Throws:
PortalException - if an error occurs

moveWrongNodesToLostFolder

private void moveWrongNodesToLostFolder(java.lang.String nodeId,
                                        int depth)
                                 throws PortalException
Moves the nodes to the lost folder if they don't satisfy their restrictions

Parameters:
nodeId - a String node ID
depth - a depth of the given node
Throws:
PortalException - if an error occurs

getLostFolderXML

public java.lang.String getLostFolderXML()
                                  throws PortalException
Throws:
PortalException

getDepth

public int getDepth(java.lang.String nodeId)
             throws PortalException
Gets the tree depth for a given node

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

moveNodeToLostFolder

private boolean moveNodeToLostFolder(java.lang.String nodeId)
                              throws PortalException
Moves the node to the lost folder

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

getRestriction

private static IUserLayoutRestriction getRestriction(ALNode node,
                                                     java.lang.String restrictionName,
                                                     java.lang.String restrictionPath)
                                              throws PortalException
Gets the restriction specified by the parameters below

Parameters:
node - a ALNode node
restrictionName - a restriction name
restrictionPath - a String restriction path
Returns:
a IUserLayoutRestriction instance
Throws:
PortalException - if an error occurs

getPriorityRestriction

public static PriorityRestriction getPriorityRestriction(ALNode node)
                                                  throws PortalException
Return a priority restriction for the given node.

Returns:
a PriorityRestriction object
Throws:
PortalException - if an error occurs

getPriorityRestriction

private static PriorityRestriction getPriorityRestriction(ALNode node,
                                                          java.lang.String restrictionPath)
                                                   throws PortalException
Return a priority restriction for the given node.

Returns:
a PriorityRestriction object
Throws:
PortalException - if an error occurs

changeSiblingNodesPriorities

protected boolean changeSiblingNodesPriorities(java.lang.String nodeId)
                                        throws PortalException
Change if it's possible priority values for all the sibling nodes

Parameters:
nodeId - a String any node ID from the sibling line to be checked
Returns:
a boolean value
Throws:
PortalException - if an error occurs

changeSiblingNodesPriorities

protected boolean changeSiblingNodesPriorities(java.util.Vector nodes)
                                        throws PortalException
Change if it's possible priority values for all the sibling nodes defined by the collection

Parameters:
nodes - a Vector instance with ALNode objects
Returns:
a boolean value
Throws:
PortalException - if an error occurs

changeSiblingNodesPriorities

protected boolean changeSiblingNodesPriorities(ALNode node,
                                               java.lang.String parentNodeId,
                                               java.lang.String nextNodeId)
                                        throws PortalException
Change priority values for all the sibling nodes when trying to add a new node

Parameters:
node - a ALNode a node to be added
parentNodeId - a String parent node ID
nextNodeId - a String next sibling node ID
Returns:
a boolean value
Throws:
PortalException - if an error occurs

changeSiblingNodesOrder

protected boolean changeSiblingNodesOrder(java.lang.String firstNodeId)
                                   throws PortalException
Change the sibling nodes order depending on their priority values

Parameters:
firstNodeId - a String first node ID in the sibling line
Returns:
a boolean value
Throws:
PortalException - if an error occurs

getCacheKey

public java.lang.String getCacheKey()
                             throws PortalException
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

getUserLayout

public void getUserLayout(org.xml.sax.ContentHandler contentHandler)
                   throws PortalException
Output a tree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler

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

getUserLayout

public void getUserLayout(java.lang.String nodeId,
                          org.xml.sax.ContentHandler contentHandler)
                   throws PortalException
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.
contentHandler - a ContentHandler value
Throws:
PortalException - if an error occurs

getLayoutNode

private ALNode getLayoutNode(java.lang.String nodeId)

getLayoutFolder

private ALFolder getLayoutFolder(java.lang.String folderId)

getLastSiblingNode

private ALNode getLastSiblingNode(java.lang.String nodeId)

getFirstSiblingNode

private ALNode getFirstSiblingNode(java.lang.String nodeId)

getUserLayoutDOM

public org.w3c.dom.Document getUserLayoutDOM()
                                      throws PortalException
Specified by:
getUserLayoutDOM in interface IUserLayoutManager
Throws:
PortalException

setUserLayoutDOM

private void setUserLayoutDOM(org.w3c.dom.Node n,
                              java.lang.String parentNodeId,
                              java.util.Hashtable layoutData)
                       throws PortalException
Throws:
PortalException

setUserLayoutDOM

public void setUserLayoutDOM(org.w3c.dom.Document domLayout)
                      throws PortalException
Throws:
PortalException

isNodeFolderOrChannel

private boolean isNodeFolderOrChannel(org.w3c.dom.Element node)

setLayoutStore

public void setLayoutStore(IUserLayoutStore layoutStore)
Description copied from interface: IUserLayoutManager
Set a user layout store implementation.

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

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

isFragmentLoaded

public boolean isFragmentLoaded()
                         throws PortalException
Returns true if any fragment is currently loaded into the layout manager, false - otherwise

Specified by:
isFragmentLoaded in interface IAggregatedUserLayoutManager
Returns:
a boolean value
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

saveFragment

public void saveFragment(ILayoutFragment fragment)
                  throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Saves the fragment in the store

Specified by:
saveFragment in interface IAggregatedUserLayoutManager
Parameters:
fragment - a ILayoutFragment instance
Throws:
PortalException - if an error occurs

deleteFragment

public void deleteFragment(java.lang.String fragmentId)
                    throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Removes the fragment

Specified by:
deleteFragment in interface IAggregatedUserLayoutManager
Parameters:
fragmentId - a fragment ID
Throws:
PortalException - if an error occurs

getSubscribableFragments

public java.util.Collection getSubscribableFragments()
                                              throws PortalException
Returns the list of Ids of the fragments that the user can subscribe to

Specified by:
getSubscribableFragments in interface IAggregatedUserLayoutManager
Returns:
Collection a set of the fragment IDs
Throws:
PortalException - if an error occurs

getFragments

public java.util.Collection getFragments()
                                  throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Returns the fragment Ids of the owner associated with the current layout

Specified by:
getFragments in interface IAggregatedUserLayoutManager
Returns:
Collection a set of the fragment IDs
Throws:
PortalException - if an error occurs

getPublishGroups

public java.util.Collection getPublishGroups(java.lang.String fragmentId)
                                      throws PortalException
Returns the user group keys which the fragment is published to

Specified by:
getPublishGroups in interface IAggregatedUserLayoutManager
Parameters:
fragmentId - a String value
Returns:
a Collection object containing the group keys
Throws:
PortalException - if an error occurs

setPublishGroups

public void setPublishGroups(IGroupMember[] groups,
                             java.lang.String fragmentId)
                      throws PortalException
Persists the user groups which the fragment is published to

Specified by:
setPublishGroups in interface IAggregatedUserLayoutManager
Parameters:
groups - an array of IGroupMember objects
fragmentId - a String value
Throws:
PortalException - if an error occurs

getFragment

public ILayoutFragment getFragment(java.lang.String fragmentId)
                            throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Returns the fragment

Specified by:
getFragment in interface IAggregatedUserLayoutManager
Parameters:
fragmentId - a fragment ID
Returns:
ILayoutFragment a fragment
Throws:
PortalException - if an error occurs

createFragment

public java.lang.String createFragment(java.lang.String fragmentName,
                                       java.lang.String fragmentDesc,
                                       java.lang.String fragmentRootName)
                                throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Creates a new fragment and loads it as an user layout

Specified by:
createFragment in interface IAggregatedUserLayoutManager
Parameters:
fragmentName - a fragment name
fragmentDesc - a fragment description
fragmentRootName - a fragment root node name
Returns:
a new generated fragment ID
Throws:
PortalException - if an error occurs

loadFragment

public void loadFragment(java.lang.String fragmentId)
                  throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Loads the fragment as an user layout given by fragmentId

Specified by:
loadFragment in interface IAggregatedUserLayoutManager
Parameters:
fragmentId - a fragment ID
Throws:
PortalException - if an error occurs

saveFragment

public void saveFragment()
                  throws PortalException
Description copied from interface: IAggregatedUserLayoutManager
Saves the current fragment if the layout is a fragment

Specified by:
saveFragment in interface IAggregatedUserLayoutManager
Throws:
PortalException - if an error occurs

deleteFragment

public void deleteFragment()
                    throws PortalException
Deletes the current fragment if the layout is a fragment

Specified by:
deleteFragment in interface IAggregatedUserLayoutManager
Throws:
PortalException - if an error occurs

isLayoutFragment

private boolean isLayoutFragment()

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

moveNode

public boolean moveNode(java.lang.String nodeId,
                        java.lang.String parentId,
                        java.lang.String nextSiblingId)
                 throws PortalException
Moves a node to a place in the tree denoted by parent and next sibling.

Specified by:
moveNode in interface IUserLayoutManager
Parameters:
nodeId - node to be moved
parentId - parent of where nodeId should be moved
nextSiblingId - nextSibling of where nodeId should be moved
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

cleanLayoutData

private void cleanLayoutData(java.lang.String nodeId,
                             boolean result)
                      throws PortalException
Throws:
PortalException

addNode

public IUserLayoutNodeDescription addNode(IUserLayoutNodeDescription nodeDesc,
                                          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:
nodeDesc - 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

changeDescendantsBooleanProperties

private void changeDescendantsBooleanProperties(IALNodeDescription nodeDesc,
                                                IALNodeDescription oldNodeDesc,
                                                java.lang.String nodeId)
                                         throws PortalException
Throws:
PortalException

changeDescendantsBooleanProperties

private void changeDescendantsBooleanProperties(boolean hiddenValuesMatch,
                                                boolean immutableValuesMatch,
                                                boolean unremovableValuesMatch,
                                                IALNodeDescription nodeDesc,
                                                java.lang.String nodeId)
                                         throws PortalException
Throws:
PortalException

updateNode

public boolean updateNode(IUserLayoutNodeDescription nodeDesc)
                   throws PortalException
Description copied from interface: IUserLayoutManager
Update a given node.

Specified by:
updateNode in interface IUserLayoutManager
Parameters:
nodeDesc - 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 nodeDesc,
                          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:
nodeDesc - 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 nodeDescription)
                      throws PortalException
Description copied from interface: IUserLayoutManager
Test if a certain node can be updated.

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

markAddTargets

public void markAddTargets(IUserLayoutNodeDescription nodeDesc)
                    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:
nodeDesc - 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

getNodeBeingAdded

public IALNodeDescription getNodeBeingAdded()
                                     throws PortalException
Returns the description of the node currently being added to the layout

Specified by:
getNodeBeingAdded in interface IAggregatedUserLayoutManager
Returns:
node an IALNodeDescription object
Throws:
PortalException - if an error occurs

getNodeBeingMoved

public IALNodeDescription getNodeBeingMoved()
                                     throws PortalException
Returns the description of the node currently being moved in the layout

Specified by:
getNodeBeingMoved in interface IAggregatedUserLayoutManager
Returns:
node an IALNodeDescription object
Throws:
PortalException - if an 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

getRootFolderId

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

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

getSubscribeId

public java.lang.String getSubscribeId(java.lang.String fname)
                                throws PortalException
Returns a subscription id given a functional name.

Specified by:
getSubscribeId in interface IUserLayoutManager
Parameters:
fname - the functional name to lookup.
Returns:
a String subscription id.
Throws:
PortalException