org.jasig.portal.layout.simple
Class SimpleLayout

java.lang.Object
  extended by org.jasig.portal.layout.simple.SimpleLayout
All Implemented Interfaces:
IUserLayout

public class SimpleLayout
extends Object
implements IUserLayout

The simple user layout implementation. This layout is based on a Document. Prior to uPortal 2.5, this class existed in the org.jasig.portal.layout package. It was moved to its present package to reflect that it is part of the Simple Layout Management implementation.

Version:
$Revision: 19776 $
Author:
Ken Weiner, kweiner@unicon.net

Field Summary
 
Fields inherited from interface org.jasig.portal.layout.IUserLayout
ROOT_NODE_NAME
 
Constructor Summary
SimpleLayout(String layoutId, Document layout)
           
 
Method Summary
 boolean addLayoutEventListener(LayoutEventListener l)
          Register a layout event listener
 String findNodeId(XPathExpression xpathExpression)
          Returns a node id as resolved by the supplied XPathExpression
 String getCacheKey()
          Return a cache key, uniqly corresponding to the composition and the structure of the user layout.
 Enumeration getChildIds(String nodeId)
          Returns a list of child node Ids for a given node.
 String getId()
          Returns a layout Id associated with this manager/
 String getNextSiblingId(String nodeId)
          Determine an Id of a next sibling node.
 IUserLayoutNodeDescription getNodeDescription(String nodeId)
          Obtain a description of a node (channel or a folder) in a given user layout.
 String getNodeId(String fname)
          Returns a node id associated with the supplied functional name.
 Enumeration getNodeIds()
          Returns a list of node Ids in the 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 getRootId()
          Returns an id of the root node.
 boolean removeLayoutEventListener(LayoutEventListener l)
          Remove a registered layout event listener.
 void writeTo(ContentHandler ch)
          Writes user layout content (with appropriate markings) into a ContentHandler
 void writeTo(Document document)
          Writes user layout content (with appropriate markings) into a Document object
 void writeTo(String nodeId, ContentHandler ch)
          Writes subtree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler
 void writeTo(String nodeId, Document document)
          Writes subtree of a user layout (with appropriate markings) defined by a particular node into a Document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLayout

public SimpleLayout(String layoutId,
                    Document layout)
Method Detail

writeTo

public void writeTo(ContentHandler ch)
             throws PortalException
Description copied from interface: IUserLayout
Writes user layout content (with appropriate markings) into a ContentHandler

Specified by:
writeTo in interface IUserLayout
Parameters:
ch - a ContentHandler value
Throws:
PortalException - if an error occurs

writeTo

public void writeTo(String nodeId,
                    ContentHandler ch)
             throws PortalException
Description copied from interface: IUserLayout
Writes subtree of a user layout (with appropriate markings) defined by a particular node into a ContentHandler

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

writeTo

public void writeTo(Document document)
             throws PortalException
Description copied from interface: IUserLayout
Writes user layout content (with appropriate markings) into a Document object

Specified by:
writeTo in interface IUserLayout
Parameters:
document - a Document value
Throws:
PortalException - if an error occurs

writeTo

public void writeTo(String nodeId,
                    Document document)
             throws PortalException
Description copied from interface: IUserLayout
Writes subtree of a user layout (with appropriate markings) defined by a particular node into a Document

Specified by:
writeTo in interface IUserLayout
Parameters:
nodeId - a String a node determining a user layout subtree.
document - a Document object
Throws:
PortalException - if an error occurs

getNodeDescription

public IUserLayoutNodeDescription getNodeDescription(String nodeId)
                                              throws PortalException
Description copied from interface: IUserLayout
Obtain a description of a node (channel or a folder) in a given user layout.

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

getParentId

public String getParentId(String nodeId)
                   throws PortalException
Description copied from interface: IUserLayout
Returns an Id of a parent user layout node. The user layout root node always has ID="root"

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

getChildIds

public Enumeration getChildIds(String nodeId)
                        throws PortalException
Description copied from interface: IUserLayout
Returns a list of child node Ids for a given node.

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

getNextSiblingId

public String getNextSiblingId(String nodeId)
                        throws PortalException
Description copied from interface: IUserLayout
Determine an Id of a next sibling node.

Specified by:
getNextSiblingId in interface IUserLayout
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 String getPreviousSiblingId(String nodeId)
                            throws PortalException
Description copied from interface: IUserLayout
Determine an Id of a previous sibling node.

Specified by:
getPreviousSiblingId in interface IUserLayout
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 String getCacheKey()
                   throws PortalException
Description copied from interface: IUserLayout
Return a cache key, uniqly corresponding to the composition and the structure of the user layout.

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

addLayoutEventListener

public boolean addLayoutEventListener(LayoutEventListener l)
Description copied from interface: IUserLayout
Register a layout event listener

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

removeLayoutEventListener

public boolean removeLayoutEventListener(LayoutEventListener l)
Description copied from interface: IUserLayout
Remove a registered layout event listener.

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

getId

public String getId()
Description copied from interface: IUserLayout
Returns a layout Id associated with this manager/

Specified by:
getId in interface IUserLayout
Returns:
an String layout Id value;

getNodeId

public String getNodeId(String fname)
                 throws PortalException
Description copied from interface: IUserLayout
Returns a node id associated with the supplied functional name.

Specified by:
getNodeId in interface IUserLayout
Parameters:
fname - the functional name to lookup
Returns:
a String subscription id
Throws:
PortalException - if an error occurs

findNodeId

public String findNodeId(XPathExpression xpathExpression)
                  throws PortalException
Description copied from interface: IUserLayout
Returns a node id as resolved by the supplied XPathExpression

Specified by:
findNodeId in interface IUserLayout
Parameters:
xpathExpression - The expression to execute against the layout DOM
Returns:
The ID of the resolved node, null if there is no match
Throws:
PortalException

getNodeIds

public Enumeration getNodeIds()
                       throws PortalException
Description copied from interface: IUserLayout
Returns a list of node Ids in the layout.

Specified by:
getNodeIds in interface IUserLayout
Returns:
a Enumeration of node Ids
Throws:
PortalException - if an error occurs

getRootId

public String getRootId()
Description copied from interface: IUserLayout
Returns an id of the root node.

Specified by:
getRootId in interface IUserLayout
Returns:
a String value


Copyright © 2010 Jasig. All Rights Reserved.