com.nurelm.nucontent.model
Class Node

java.lang.Object
  extended bycom.nurelm.nucontent.model.Node
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
File, Link, Page

public abstract class Node
extends java.lang.Object
implements java.io.Serializable

The parent object of Page, Link, and File objects.

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_NAME
           
static java.lang.String DEFAULT_SHORT_DESC
           
protected  java.lang.String id
           
protected  boolean isNewWindow
           
protected  Site site
           
protected  int transientGeneration
           
protected  boolean transientIsBottomChildNode
           
protected  boolean transientIsChildNode
           
protected  boolean transientIsSelected
           
protected  boolean transientIsTopChildNode
           
protected  int version
           
 
Constructor Summary
protected Node()
           
protected Node(boolean dummy)
          This constructor does nothing.
protected Node(java.lang.String id)
          The id (pk) is set to the supplied value.
 
Method Summary
abstract  boolean canBreed()
          Returns true if the node can generate child nodes.
 java.lang.String getId()
          Returns this object's unique NuContent ID.
 boolean getIsNewWindow()
          Determines if this object will open in new window.
abstract  java.lang.String getName()
          Gets this Node's name.
abstract  java.lang.String getShortDesc()
          Gets this Node's short description.
 int getTransientGeneration()
          The transient variables are not stored in the db.
 boolean getTransientIsBottomChildNode()
           
 boolean getTransientIsChildNode()
           
 boolean getTransientIsSelected()
           
 boolean getTransientIsTopChildNode()
           
 java.lang.String getURI(java.lang.String parentTemplateFile)
          Same as getURI(parentTemplateFile, "")
abstract  java.lang.String getURI(java.lang.String parentTemplateFile, java.lang.String contextPath)
          Gets this Node's URI.
 int getVersion()
          Gets this object's version.
abstract  boolean hasChildren()
          Returns true if this Node has children nodes.
abstract  boolean isChildLinkEditable(UserValueObject userVo, boolean isParentEditable)
          Returns true if the user represented by the supplied UserValueObject can edit a link to this node.
abstract  boolean isChildLinkViewable(UserValueObject userVo, boolean isParentEditable)
          Returns true if the user represented by the supplied UserValueObject can view a link to this node.
 void setIsNewWindow(boolean isNewWindow)
          Sets new window property.
abstract  void setName(java.lang.String name)
          Sets this Node's name.
abstract  void setShortDesc(java.lang.String shortDesc)
          Sets this Node's short description.
 void setTransientGeneration(int transientGeneration)
           
 void setTransientIsBottomChildNode(boolean transientIsBottomChildNode)
           
 void setTransientIsChildNode(boolean transientIsChildNode)
           
 void setTransientIsSelected(boolean transientIsSelected)
           
 void setTransientIsTopChildNode(boolean transientIsTopChildNode)
           
 void setVersion(int version)
          Sets this object's version number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final java.lang.String DEFAULT_NAME
See Also:
Constant Field Values

DEFAULT_SHORT_DESC

public static final java.lang.String DEFAULT_SHORT_DESC
See Also:
Constant Field Values

id

protected java.lang.String id

version

protected int version

isNewWindow

protected boolean isNewWindow

site

protected Site site

transientGeneration

protected transient int transientGeneration

transientIsSelected

protected transient boolean transientIsSelected

transientIsChildNode

protected transient boolean transientIsChildNode

transientIsTopChildNode

protected transient boolean transientIsTopChildNode

transientIsBottomChildNode

protected transient boolean transientIsBottomChildNode
Constructor Detail

Node

protected Node(boolean dummy)
This constructor does nothing. Its purpose is to be used from the no-args constructor of Page (which extends Node), prevending JDO from calling the real constructor when just populating a HashMap of root Pages, thereby greatly speeding up sites with a large number root Pages.


Node

protected Node()

Node

protected Node(java.lang.String id)
The id (pk) is set to the supplied value. This is used in the ejbToJdo data transformation tool. Keeping the same ID prevents links to the pages from breaking after the transformation. In general, however, the other constructor should be used, and the pk will be generated automatically.

Parameters:
id - A unique NuContent ID.
Method Detail

getId

public java.lang.String getId()
Returns this object's unique NuContent ID.

Returns:
This object's NuContent ID.

getVersion

public int getVersion()
Gets this object's version.

Returns:
This object's version.

setVersion

public void setVersion(int version)
Sets this object's version number.


getIsNewWindow

public boolean getIsNewWindow()
Determines if this object will open in new window.

Returns:
True if object will open in new window.

setIsNewWindow

public void setIsNewWindow(boolean isNewWindow)
Sets new window property.

Parameters:
isNewWindow - True if this Node object should open in a new window.

getName

public abstract java.lang.String getName()
Gets this Node's name.

Returns:
This Node's name.

setName

public abstract void setName(java.lang.String name)
Sets this Node's name.

Parameters:
name - This Node's name.

getShortDesc

public abstract java.lang.String getShortDesc()
Gets this Node's short description.

Returns:
This Node's short description.

setShortDesc

public abstract void setShortDesc(java.lang.String shortDesc)
Sets this Node's short description.

Parameters:
shortDesc - This Node's short description.

getURI

public abstract java.lang.String getURI(java.lang.String parentTemplateFile,
                                        java.lang.String contextPath)
Gets this Node's URI.

Parameters:
parentTemplateFile - The URI of the parent document's template file, with no context path included.
contextPath - The current webapp's context path as returned from request.getContextPath().
Returns:
This Node's URI.

getURI

public java.lang.String getURI(java.lang.String parentTemplateFile)
Same as getURI(parentTemplateFile, "")


hasChildren

public abstract boolean hasChildren()
Returns true if this Node has children nodes.

Returns:
True if this Node has children.

isChildLinkEditable

public abstract boolean isChildLinkEditable(UserValueObject userVo,
                                            boolean isParentEditable)
Returns true if the user represented by the supplied UserValueObject can edit a link to this node. This method is used by com.nurelm.nucontent.TagSubsections when generating the subsections list. At the moment, LinkNodes and FileNodes always return isParentEditable, since their parent "owns" them.

Parameters:
userVo - Represents the user who will be editing children.
isParentEditable - True if parent is editable.
Returns:
True if child link is editable by the specified User

isChildLinkViewable

public abstract boolean isChildLinkViewable(UserValueObject userVo,
                                            boolean isParentEditable)
Returns true if the user represented by the supplied UserValueObject can view a link to this node. This method is used by com.nurelm.nucontent.TagSubsections when generating the subsections list. At the moment, LinkNodes and FileNodes always return isParentEditable, since their parent "owns" them.

Parameters:
userVo - Represents the user who will be editing children.
isParentEditable - True if parent is editable.
Returns:
True if child link is viewable by the specified User

canBreed

public abstract boolean canBreed()
Returns true if the node can generate child nodes. At the moment, only Pages can breed. FileNodes and LinkNodes cannot. This method is used by com.nurelm.nucontent.TagSubsections when generating the subsections list.

Returns:
True if this element can have sub-elements.

getTransientGeneration

public int getTransientGeneration()
The transient variables are not stored in the db. The generation is not calculated, this method simply returns a property value (if you are expecting to get an actual generation, it probably will not return what you need!


setTransientGeneration

public void setTransientGeneration(int transientGeneration)

getTransientIsSelected

public boolean getTransientIsSelected()

setTransientIsSelected

public void setTransientIsSelected(boolean transientIsSelected)

getTransientIsChildNode

public boolean getTransientIsChildNode()

setTransientIsChildNode

public void setTransientIsChildNode(boolean transientIsChildNode)

getTransientIsTopChildNode

public boolean getTransientIsTopChildNode()

setTransientIsTopChildNode

public void setTransientIsTopChildNode(boolean transientIsTopChildNode)

getTransientIsBottomChildNode

public boolean getTransientIsBottomChildNode()

setTransientIsBottomChildNode

public void setTransientIsBottomChildNode(boolean transientIsBottomChildNode)