com.nurelm.nucontent.model
Class Link

java.lang.Object
  extended bycom.nurelm.nucontent.model.Node
      extended bycom.nurelm.nucontent.model.Link
All Implemented Interfaces:
java.io.Serializable

public class Link
extends Node
implements java.io.Serializable

Represents a NuContent link.

Corresponds to the tag

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  java.lang.String shortDesc
           
 
Fields inherited from class com.nurelm.nucontent.model.Node
DEFAULT_NAME, DEFAULT_SHORT_DESC, id, isNewWindow, site, transientGeneration, transientIsBottomChildNode, transientIsChildNode, transientIsSelected, transientIsTopChildNode, version
 
Constructor Summary
protected Link()
          Does nothing, used nowhere, but eliminates JDO complie-time warning about not having a zero-args constructor.
  Link(java.lang.String name, java.lang.String shortDesc, java.lang.String link)
          Creates a new Link object.
 
Method Summary
 boolean canBreed()
          Returns true if the node can generate child nodes.
 java.lang.String getId()
          Gets the NuContent ID associated with this link.
 java.lang.String getLink()
          Gets the URL associated with this link.
 java.lang.String getName()
          Gets the name of this link.
 java.lang.String getShortDesc()
          Gets this link's short description.
 java.lang.String getURI(java.lang.String parentTemplateFile, java.lang.String contextPath)
          Gets this Node's URI.
 boolean hasChildren()
          Indicates if this link (which extends Node has children, which it never does (links don't have sublinks, unlike Page objects.
 boolean isChildLinkEditable(UserValueObject userVo, boolean isParentEditable)
          Returns true if the user represented by the supplied UserValueObject can edit a link to this node.
 boolean isChildLinkViewable(UserValueObject userVo, boolean isParentViewable)
          Returns true if the user represented by the supplied UserValueObject can view a link to this node.
 void setLink(java.lang.String link)
          Sets the URL associated with this link.
 void setName(java.lang.String name)
          Sets the name of this link.
 void setShortDesc(java.lang.String shortDesc)
          Sets this link's short description.
 
Methods inherited from class com.nurelm.nucontent.model.Node
getIsNewWindow, getTransientGeneration, getTransientIsBottomChildNode, getTransientIsChildNode, getTransientIsSelected, getTransientIsTopChildNode, getURI, getVersion, setIsNewWindow, setTransientGeneration, setTransientIsBottomChildNode, setTransientIsChildNode, setTransientIsSelected, setTransientIsTopChildNode, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

shortDesc

protected java.lang.String shortDesc
Constructor Detail

Link

protected Link()
Does nothing, used nowhere, but eliminates JDO complie-time warning about not having a zero-args constructor. Calls Node's dummy constructor, which makes a huge speed difference in large sites with long lists of links.


Link

public Link(java.lang.String name,
            java.lang.String shortDesc,
            java.lang.String link)
Creates a new Link object.

Parameters:
name - Name of the link, which is displayed when the link is shown in a list of subsections.
shortDesc - Displayed when the link is shown in a long list of subsections.
link - The URL of the link.
Method Detail

setLink

public void setLink(java.lang.String link)
Sets the URL associated with this link.

Parameters:
link - The URL corresponding to this link.

getLink

public java.lang.String getLink()
Gets the URL associated with this link.

Returns:
The URL corresponding to this link.

getId

public java.lang.String getId()
Gets the NuContent ID associated with this link. Only really useful for software migration purposes.

Overrides:
getId in class Node
Returns:
NuContent ID associated with this link.

setName

public void setName(java.lang.String name)
Sets the name of this link.

Specified by:
setName in class Node
Parameters:
name - The name to be set.

getName

public java.lang.String getName()
Gets the name of this link.

Specified by:
getName in class Node
Returns:
This link's name.

setShortDesc

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

Specified by:
setShortDesc in class Node
Parameters:
shortDesc - This link's short description.

getShortDesc

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

Specified by:
getShortDesc in class Node
Returns:
This link's short description.

getURI

public java.lang.String getURI(java.lang.String parentTemplateFile,
                               java.lang.String contextPath)
Description copied from class: Node
Gets this Node's URI.

Specified by:
getURI in class Node
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.

hasChildren

public boolean hasChildren()
Indicates if this link (which extends Node has children, which it never does (links don't have sublinks, unlike Page objects.

Specified by:
hasChildren in class Node
Returns:
Always returns false.

isChildLinkEditable

public boolean isChildLinkEditable(UserValueObject userVo,
                                   boolean isParentEditable)
Description copied from class: Node
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.

Specified by:
isChildLinkEditable in class Node
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 boolean isChildLinkViewable(UserValueObject userVo,
                                   boolean isParentViewable)
Description copied from class: Node
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.

Specified by:
isChildLinkViewable in class Node
Parameters:
userVo - Represents the user who will be editing children.
isParentViewable - True if parent is editable.
Returns:
True if child link is viewable by the specified User

canBreed

public boolean canBreed()
Description copied from class: Node
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.

Specified by:
canBreed in class Node
Returns:
True if this element can have sub-elements.