com.sapportals.portal.prt.pom
Interface INode

All Superinterfaces:
IPOMConstants, IReleasable
All Known Subinterfaces:
IComponentNode, IPortalNode
All Known Implementing Classes:
AbstractNode

public interface INode
extends IPOMConstants, IReleasable

The INode interface describes nodes in the Portal DOM,
namely the representation of the current portal hierarchy for a specific request.

Note: Instead of implementing this interface - if it is desired to implement application specific nodes - it is strongly recommended to derive from AbstractNode, which provides a default implementation.


Fields inherited from interface com.sapportals.portal.prt.pom.IPOMConstants
ABOUT_MODE, ABOUT_REQUEST_EVENT, ACTION_EVENT, AFTER_CONTENT_EVENT, BEFORE_CONTENT_EVENT, COMPONENT_EVENT, COMPONENT_NODE, DEFAULT_MODE, EDIT_ACKNOWLEDGE_EVENT, EDIT_MODE, EDIT_REQUEST_EVENT, HELP_MODE, HELP_REQUEST_EVENT, LOGON_EVENT, LOGON_MODE, LOGOUT_EVENT, ON_NODE_READY_EVENT, ON_NODE_REMOVE_EVENT, ON_POM_READY_EVENT, PORTAL_NODE, PREVIEW_MODE, PREVIEW_REQUEST_EVENT, REFRESH_MODE, REFRESH_REQUEST_EVENT, REQUEST_EVENT, TEST_MODE
 
Method Summary
 INode addChildNode(INode node)
          Adds a node as a children of this node. after the adding procedure has been completed.
 INodeList getChildNodes()
          All the children that have been added to this node using addChildNode
 INodeList getChildNodesByName(java.lang.String name)
          Finds direct children by Name
 IPortalComponent getComponent()
          the IPortalComponent object associated with the current node.
 INode getFirstChild()
          The first child of this node
 INode getLastChild()
          The last child of this node
 INode getNextSibling()
          The next node in the children list of this node's parent
 INode getNextSiblingOfChild(INode childNode)
          The next sibling of any specified child node of this node
 java.lang.String getNodeMark()
          Retrieves the mark set on this node.
 NodeMode getNodeMode()
          Gets the mode to be used for the associated component during this request.
 java.lang.String getNodeName()
          All nodes have a name that is used to identify it within the Portal Object Model.
 NodeType getNodeType()
          Each INode implementation belongs to a certain node type.
 INode getParentNode()
          The parent node of this node.
 IPortalNode getPortalNode()
          The Portal Node, in other words, the root node of the Portal Object Model
 INode getPreviousSibling()
          The previous node in the children list of this node's parent
 INode getPreviousSiblingOfChild(INode childNode)
          The previous sibling of any specified child node of this node
 java.lang.Object getValue(java.lang.String name)
          Retrieves an object from this node according to its name.
 boolean hasChildNodes()
          If this node has children
 void putValue(java.lang.String name, java.lang.Object value)
          Enables to register an object value associated with this node.
 void removeChildNode(INode node)
          Removes a child node from this node.
 void removeValue(java.lang.String name)
          remove an object from this node
 void setNodeMark(java.lang.String mark)
          Sets a mark on this node.
 void setNodeMode(NodeMode mode)
          Sets the mode to be used for the associated component during this request.
 void setParentNode(INode parent)
          Sets the parent node of this node.
 void setPortalNode(IPortalNode node)
          Sets the portal node of this node
 
Methods inherited from interface com.sapportals.portal.prt.util.IReleasable
release
 

Method Detail

getNodeType

public NodeType getNodeType()
Each INode implementation belongs to a certain node type.
The current known Node types are:
COMPONENT_NODE , LAYOUT_NODE , PORTAL_NODE ,
Returns:
The type of this node.

getNodeName

public java.lang.String getNodeName()
All nodes have a name that is used to identify it within the Portal Object Model.
This name does not have to be unique within the POM.
It's recommended to have uniqueness between children of the same node.
Returns:
the name of this node

getChildNodes

public INodeList getChildNodes()
All the children that have been added to this node using addChildNode
Returns:
a list of the children of this node

getFirstChild

public INode getFirstChild()
The first child of this node
Returns:
The first node of all children of this node, null if no children exists.

getLastChild

public INode getLastChild()
The last child of this node
Returns:
The last node of all children of this node, null if no children exists

getNextSibling

public INode getNextSibling()
The next node in the children list of this node's parent
Returns:
a node or null if not exists.

getPreviousSibling

public INode getPreviousSibling()
The previous node in the children list of this node's parent
Returns:
a node or null if not exists.

getParentNode

public INode getParentNode()
The parent node of this node.
Normally all nodes in the POM have a parent Node, except for the root node (IPortalNode).
A certain can have no children when it's just created or removed as child for its parent.
Returns:
a node or null if not exists

setParentNode

public void setParentNode(INode parent)
Sets the parent node of this node.
FIXME: Check if necessary
Note: This method should not be used directly, instead it will be called by the portal implementation to assign parent nodes.
Parameters:
parent - The node to set as parent of this node

getPortalNode

public IPortalNode getPortalNode()
The Portal Node, in other words, the root node of the Portal Object Model
Returns:
a portal node
can be null if the node has just been created and not asdded as a child in another node.

setPortalNode

public void setPortalNode(IPortalNode node)
Sets the portal node of this node
Parameters:
node - the portal node of this POM
Note: This method should not be used directly. Instead it will be used by the portal implementation to define a node's portal node.

hasChildNodes

public boolean hasChildNodes()
If this node has children
Returns:
A boolean indicating whether this node has children.

getChildNodesByName

public INodeList getChildNodesByName(java.lang.String name)
Finds direct children by Name
Parameters:
name - name to search chidren for
Returns:
List of children with the specified name

getNextSiblingOfChild

public INode getNextSiblingOfChild(INode childNode)
The next sibling of any specified child node of this node
Parameters:
childNode - the child node reference
Returns:
a node or null if not exists.

getPreviousSiblingOfChild

public INode getPreviousSiblingOfChild(INode childNode)
The previous sibling of any specified child node of this node
Parameters:
childNode - a node reference
Returns:
a node or null if not found.

addChildNode

public INode addChildNode(INode node)
                   throws PortalOMException
Adds a node as a children of this node. after the adding procedure has been completed. This procedure includes:
Parameters:
node - the node to add as a child
Returns:
the current node
Throws:
PortalOMException - If the child node is null or it already belong to another node

removeChildNode

public void removeChildNode(INode node)
                     throws PortalOMException
Removes a child node from this node.
Parameters:
node - The child node to remove
Throws:
PortalOMException - if an error occurs

getComponent

public IPortalComponent getComponent()
the IPortalComponent object associated with the current node.
Returns:
the IPortalComponent object associated with the current node.

setNodeMode

public void setNodeMode(NodeMode mode)
Sets the mode to be used for the associated component during this request. Valid values are DEFAULT_MODE, PREVIEW_MODE, EDIT_MODE,... Setting of this property can have an effect on the type of request to be handled by the associated Portal Component
Note: Implementation should be aware of side effects. It is safe to allow the transition from MODE_DEFAULT to any other mode, but not back.
Parameters:
mode -  

getNodeMode

public NodeMode getNodeMode()
Gets the mode to be used for the associated component during this request. Warning: If the node has no parent and setNodeMode has never been called on that node the returned value will be DEFAULT_MODE temporarily until the node is part of the POM (addChildNode is called with this node)
Returns:
the current node mode

putValue

public void putValue(java.lang.String name,
                     java.lang.Object value)
Enables to register an object value associated with this node.
Can be used as a generic store mechanism.
Parameters:
name - An identifier for the value put in this node
value -  

getValue

public java.lang.Object getValue(java.lang.String name)
Retrieves an object from this node according to its name.
This object value should have been registered with the putValue method
Parameters:
name - An identifier of the object
Returns:
The held object or null if not present.

removeValue

public void removeValue(java.lang.String name)
remove an object from this node
Parameters:
name - An identifier of the object

setNodeMark

public void setNodeMark(java.lang.String mark)
Sets a mark on this node. The mark up of the current Portal Object Model will be serialized during url generation, e.g. using IPortalComponentRequest.createComponentURL(com.sapportals.portal.prt.pom.INode, com.sapportals.portal.prt.event.IPortalRequestEvent). In order to keep generated urls short you should use the mark up mechanisms carefully.
Parameters:
mark - The mark to be put on this node

getNodeMark

public java.lang.String getNodeMark()
Retrieves the mark set on this node. This mark could be have been set in a previous request.