com.nurelm.nucontent.model
Class File

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

public class File
extends Node
implements java.io.Serializable

Contains information corresponding to a file on the server's filesystem. This object, based on Node, can be part of either a Site object's rootPageList, or a Page object's childNodeList

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 File()
          Does nothing, used nowhere, but eliminates JDO complie-time warning about not having a zero-args constructor.
  File(java.lang.String name, java.lang.String shortDesc, java.lang.String fileName)
          Creates a new File object.
 
Method Summary
 boolean canBreed()
          Indicates if this object can have children, which it never will.
 java.lang.String getFileName()
           
 java.lang.String getName()
          Get this object's descriptive name.
 java.lang.String getShortDesc()
          Get this object's short description.
 java.lang.String getURI(java.lang.String parentTemplateFile, java.lang.String contextPath)
          Get this object's URI.
 boolean hasChildren()
          Indicates if this object has children, which it never will.
 boolean isChildLinkEditable(UserValueObject userVo, boolean isParentEditable)
          Used to check if child links are editable.
 boolean isChildLinkViewable(UserValueObject userVo, boolean isParentViewable)
          Used to check if child links are editable.
 void setFileName(java.lang.String fileName)
          Set this object's filesystem filename.
 void setName(java.lang.String name)
          Set this object's descriptive name.
 void setShortDesc(java.lang.String shortDesc)
          Set this object's short description.
 
Methods inherited from class com.nurelm.nucontent.model.Node
getId, 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

File

protected File()
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 files.


File

public File(java.lang.String name,
            java.lang.String shortDesc,
            java.lang.String fileName)
Creates a new File object.

Parameters:
name - This object's name.
shortDesc - A short description of this file.
fileName - The name of the actual file on the filesystem.
Method Detail

setFileName

public void setFileName(java.lang.String fileName)
Set this object's filesystem filename.

Parameters:
fileName - The name of the actual file on the filesystem.

getFileName

public java.lang.String getFileName()

setName

public void setName(java.lang.String name)
Set this object's descriptive name.

Specified by:
setName in class Node
Parameters:
name - This file's descriptive name.

getName

public java.lang.String getName()
Get this object's descriptive name.

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

setShortDesc

public void setShortDesc(java.lang.String shortDesc)
Set this object's short description.

Specified by:
setShortDesc in class Node
Parameters:
shortDesc - A short description of this file.

getShortDesc

public java.lang.String getShortDesc()
Get this object's short description.

Specified by:
getShortDesc in class Node
Returns:
A short description of this file.

getURI

public java.lang.String getURI(java.lang.String parentTemplateFile,
                               java.lang.String contextPath)
Get this object's URI. Overrides the parent object's corresponding method.

Specified by:
getURI in class Node
Parameters:
parentTemplateFile - DOCUMENT ME!
contextPath - The current webapp's context path as returned from request.getContextPath().
Returns:
This object's URI, which referrs to a location on the server's filesystem.

isChildLinkEditable

public boolean isChildLinkEditable(UserValueObject userVo,
                                   boolean isParentEditable)
Used to check if child links are editable. Overrides the parent object's corresponding method.

Specified by:
isChildLinkEditable in class Node
Parameters:
userVo - DOCUMENT ME!
isParentEditable - DOCUMENT ME!
Returns:
True if child links are editable, false if not.

isChildLinkViewable

public boolean isChildLinkViewable(UserValueObject userVo,
                                   boolean isParentViewable)
Used to check if child links are editable. Overrides the parent object's corresponding method.

Specified by:
isChildLinkViewable in class Node
Parameters:
userVo - DOCUMENT ME!
isParentViewable - DOCUMENT ME!
Returns:
True if child links are editable, false if not.

hasChildren

public boolean hasChildren()
Indicates if this object has children, which it never will. Overrides the parent object's corresponding method.

Specified by:
hasChildren in class Node
Returns:
Always returns false, since File objects never have children.

canBreed

public boolean canBreed()
Indicates if this object can have children, which it never will. Overrides the parent object's

Specified by:
canBreed in class Node
Returns:
Always returns false, since File objects never have children.