org.apache.jetspeed.om.folder.psml
Class FolderImpl

java.lang.Object
  extended by org.apache.jetspeed.om.page.psml.AbstractBaseElement
      extended by org.apache.jetspeed.page.document.psml.AbstractNode
          extended by org.apache.jetspeed.om.folder.psml.FolderImpl
All Implemented Interfaces:
java.io.Serializable, SecuredResource, Folder, Reset, BaseElement, Node

public class FolderImpl
extends AbstractNode
implements Folder, Reset

FolderImpl

Version:
$Id: FolderImpl.java 595429 2007-11-15 20:20:41Z smilek $
Author:
David Sean Taylor , Jeremy Ford , Scott T. Weaver
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.jetspeed.om.folder.Folder
COUNTRY_FOLDER, FALLBACK_DEFAULT_PAGE, FOLDER_TYPE, GROUP_FOLDER, LANGUAGE_FOLDER, MEDIATYPE_FOLDER, PAGE_NOT_FOUND_PAGE, RESERVED_COUNTRY_FOLDER_NAME, RESERVED_FOLDER_COUNTRY, RESERVED_FOLDER_GROUPS, RESERVED_FOLDER_LANGUAGE, RESERVED_FOLDER_MEDIATYPE, RESERVED_FOLDER_NONE, RESERVED_FOLDER_OTHER, RESERVED_FOLDER_PREFIX, RESERVED_FOLDER_ROLES, RESERVED_FOLDER_SUBSITES, RESERVED_FOLDER_USERS, RESERVED_GROUP_FOLDER_NAME, RESERVED_LANGUAGE_FOLDER_NAME, RESERVED_MEDIATYPE_FOLDER_NAME, RESERVED_ROLE_FOLDER_NAME, RESERVED_SUBSITE_FOLDER_PREFIX, RESERVED_USER_FOLDER_NAME, ROLE_FOLDER, USER_FOLDER
 
Fields inherited from interface org.apache.jetspeed.page.document.Node
PATH_SEPARATOR, PATH_SEPARATOR_CHAR
 
Constructor Summary
FolderImpl()
           
FolderImpl(java.lang.String path, DocumentHandlerFactory handlerFactory, FolderHandler folderHandler)
           
FolderImpl(java.lang.String path, FolderMetaDataImpl metadata, DocumentHandlerFactory handlerFactory, FolderHandler folderHandler)
           
 
Method Summary
 void checkPermissions(java.lang.String path, int mask, boolean checkNodeOnly, boolean checkParentsOnly)
           checkPermissions
 NodeSet getAll()
           getAll
 NodeSet getAllNodes()
           getAllNodes
protected  NodeSet getAllNodes(boolean folderExistenceRequired)
           
 java.lang.String getDefaultDecorator(java.lang.String fragmentType)
          Returns the name of the default decorator that applies to page fragments in this folder or subfolders.
 java.lang.String getDefaultPage()
           getDefaultPage
 java.util.List getDocumentOrder()
          getDocumentOrder
 java.lang.String getEffectiveDefaultDecorator(java.lang.String fragmentType)
          Returns the name of the default decorator as set here or in parent folders that applies to page fragments in this folder or subfolders.
 PageSecurity getEffectivePageSecurity()
          getEffectivePageSecurity
 Folder getFolder(java.lang.String name)
           getFolder
 Folder getFolder(java.lang.String name, boolean checkAccess)
           getFolder
 FolderMetaDataImpl getFolderMetaData()
           getFolderMetaData
 NodeSet getFolders()
           getFolders
 NodeSet getFolders(boolean checkAccess)
           getFolders
 Link getLink(java.lang.String name)
           getLink
 Link getLink(java.lang.String name, boolean checkAccess)
           getLink
 NodeSet getLinks()
           getLinks
 NodeSet getLinks(boolean checkAccess)
           getLinks
 java.util.List getMenuDefinitions()
          getMenuDefinitions - get list of menu definitions
 GenericMetadata getMetadata()
           getMetadata
 Page getPage(java.lang.String name)
           getPage
 Page getPage(java.lang.String name, boolean checkAccess)
           getPage
 NodeSet getPages()
           getPages
 NodeSet getPages(boolean checkAccess)
           getPages
 PageSecurity getPageSecurity()
           getPageSecurity
 PageSecurity getPageSecurity(boolean checkAccess)
           getPageSecurity
 int getReservedType()
          Returns a valid reserved folder type: RESERVED_FOLDER_SUBSITES RESERVED_FOLDER_USERS RESERVED_FOLDER_ROLES RESERVED_FOLDER_GROUPS RESERVED_FOLDER_MEDIATYPE RESERVED_FOLDER_LANGUAGE RESERVED_FOLDER_COUNTRY
 SecurityConstraints getSecurityConstraints()
           getSecurityConstraints
 java.lang.String getShortTitle()
           getShortTitle
 java.lang.String getShortTitle(java.util.Locale locale)
           getShortTitle
 java.lang.String getSkin()
          Returns the name of the skin that applies to this folder.
 java.lang.String getTitle()
           getTitle
 java.lang.String getTitle(java.util.Locale locale)
           getTitle
 java.lang.String getType()
           getType
 boolean isHidden()
           isHidden
 boolean isReserved()
          Determines if a folder is a reserved folder.
 MenuDefinition newMenuDefinition()
          newMenuDefinition - creates a new empty menu definition
 MenuExcludeDefinition newMenuExcludeDefinition()
          newMenuExcludeDefinition - creates a new empty menu exclude definition
 MenuIncludeDefinition newMenuIncludeDefinition()
          newMenuIncludeDefinition - creates a new empty menu include definition
 MenuOptionsDefinition newMenuOptionsDefinition()
          newMenuOptionsDefinition - creates a new empty menu options definition
 MenuSeparatorDefinition newMenuSeparatorDefinition()
          newMenuSeparatorDefinition - creates a new empty menu separator definition
 void reset()
           
 void setDefaultDecorator(java.lang.String decoratorName, java.lang.String fragmentType)
          Modifies the default decorator for the specified fragment type.
 void setDefaultPage(java.lang.String defaultPage)
           setDefaultPage
 void setDocumentOrder(java.util.List docIndexes)
          setDocumentOrder
 void setFolderHandler(FolderHandler handler)
           setFolderHandler
 void setHidden(boolean hidden)
           setHidden
 void setMenuDefinitions(java.util.List definitions)
          setMenuDefinitions - set list of menu definitions
 void setSecurityConstraints(SecurityConstraints constraints)
           setSecurityConstraints
 void setShortTitle(java.lang.String title)
           setShortTitle
 void setSkin(java.lang.String skinName)
          Modifies the skin for this folder.
 void setTitle(java.lang.String title)
           setTitle
 void unmarshalled()
          unmarshalled - notification that this instance has been loaded from the persistent store
 
Methods inherited from class org.apache.jetspeed.page.document.psml.AbstractNode
checkConstraints, getLogicalPermissionPath, getMetadataFields, getName, getParent, getParent, getPath, getPhysicalPermissionPath, getProfiledPath, getTitleName, getUrl, isDirty, setDirty, setMetadata, setMetadataFields, setParent, setPath, setProfiledPath, setUrl
 
Methods inherited from class org.apache.jetspeed.om.page.psml.AbstractBaseElement
checkAccess, checkAccess, checkConstraints, checkPermissions, checkPermissions, equals, getConstraintsEnabled, getHandlerFactory, getId, getPermissionsEnabled, grantViewActionAccess, hashCode, marshalling, newSecurityConstraint, newSecurityConstraints, setConstraintsEnabled, setHandlerFactory, setId, setPermissionsEnabled, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.page.document.Node
getName, getParent, getPath, getUrl, setParent, setPath
 
Methods inherited from interface org.apache.jetspeed.om.page.BaseElement
getId
 
Methods inherited from interface org.apache.jetspeed.om.common.SecuredResource
checkAccess, checkConstraints, checkPermissions, getConstraintsEnabled, getPermissionsEnabled, newSecurityConstraint, newSecurityConstraints
 

Constructor Detail

FolderImpl

public FolderImpl(java.lang.String path,
                  FolderMetaDataImpl metadata,
                  DocumentHandlerFactory handlerFactory,
                  FolderHandler folderHandler)

FolderImpl

public FolderImpl(java.lang.String path,
                  DocumentHandlerFactory handlerFactory,
                  FolderHandler folderHandler)

FolderImpl

public FolderImpl()
Method Detail

getSkin

public java.lang.String getSkin()
Description copied from interface: Folder
Returns the name of the skin that applies to this folder.

Specified by:
getSkin in interface Folder
Returns:
the page default skin name

setSkin

public void setSkin(java.lang.String skinName)
Description copied from interface: Folder
Modifies the skin for this folder.

Specified by:
setSkin in interface Folder
Parameters:
skinName - the name of the new skin for the folder

getEffectiveDefaultDecorator

public java.lang.String getEffectiveDefaultDecorator(java.lang.String fragmentType)
Description copied from interface: Folder
Returns the name of the default decorator as set here or in parent folders that applies to page fragments in this folder or subfolders.

Specified by:
getEffectiveDefaultDecorator in interface Folder
Parameters:
fragmentType - the type of fragment considered
Returns:
the decorator name for the selected type

getDefaultDecorator

public java.lang.String getDefaultDecorator(java.lang.String fragmentType)
Description copied from interface: Folder
Returns the name of the default decorator that applies to page fragments in this folder or subfolders.

Specified by:
getDefaultDecorator in interface Folder
Parameters:
fragmentType - the type of fragment considered
Returns:
the decorator name for the selected type

setDefaultDecorator

public void setDefaultDecorator(java.lang.String decoratorName,
                                java.lang.String fragmentType)
Description copied from interface: Folder
Modifies the default decorator for the specified fragment type.

Specified by:
setDefaultDecorator in interface Folder
Parameters:
decoratorName - the name of the new decorator for the type
fragmentType - the type of fragment considered

getDocumentOrder

public java.util.List getDocumentOrder()
Description copied from interface: Folder
getDocumentOrder

Specified by:
getDocumentOrder in interface Folder
Returns:
list of ordered document names in folder

setDocumentOrder

public void setDocumentOrder(java.util.List docIndexes)
Description copied from interface: Folder
setDocumentOrder

Specified by:
setDocumentOrder in interface Folder
Parameters:
docIndexes - list of ordered document names in folder

getDefaultPage

public java.lang.String getDefaultPage()
Description copied from interface: Folder

getDefaultPage

Specified by:
getDefaultPage in interface Folder
Returns:
A String representing the default psml page for this folder

setDefaultPage

public void setDefaultPage(java.lang.String defaultPage)
Description copied from interface: Folder

setDefaultPage

Specified by:
setDefaultPage in interface Folder

getFolders

public NodeSet getFolders(boolean checkAccess)
                   throws DocumentException

getFolders

Parameters:
checkAccess - flag
Returns:
folders node set
Throws:
DocumentException

getFolders

public NodeSet getFolders()
                   throws DocumentException
Description copied from interface: Folder

getFolders

Specified by:
getFolders in interface Folder
Returns:
A NodeSet containing all sub-folders directly under this folder.
Throws:
DocumentException

getFolder

public Folder getFolder(java.lang.String name,
                        boolean checkAccess)
                 throws FolderNotFoundException,
                        DocumentException

getFolder

Parameters:
name -
checkAccess - flag
Returns:
folder
Throws:
FolderNotFoundException
DocumentException

getFolder

public Folder getFolder(java.lang.String name)
                 throws FolderNotFoundException,
                        DocumentException
Description copied from interface: Folder

getFolder

Specified by:
getFolder in interface Folder
Returns:
A Folder referenced by this folder.
Throws:
FolderNotFoundException
DocumentException

getPages

public NodeSet getPages(boolean checkAccess)
                 throws NodeException

getPages

Parameters:
checkAccess - flag
Returns:
pages node set
Throws:
NodeException

getPages

public NodeSet getPages()
                 throws NodeException
Description copied from interface: Folder

getPages

Specified by:
getPages in interface Folder
Returns:
NodeSet of all the Pages referenced by this Folder.
Throws:
NodeException

getPage

public Page getPage(java.lang.String name,
                    boolean checkAccess)
             throws PageNotFoundException,
                    NodeException

getPage

Parameters:
name -
checkAccess - flag
Returns:
page
Throws:
PageNotFoundException
NodeException

getPage

public Page getPage(java.lang.String name)
             throws PageNotFoundException,
                    NodeException
Description copied from interface: Folder

getPage

Specified by:
getPage in interface Folder
Returns:
A Page referenced by this folder.
Throws:
PageNotFoundException - if the Page requested could not be found.
DocumentException
NodeException

getLinks

public NodeSet getLinks(boolean checkAccess)
                 throws NodeException

getLinks

Parameters:
checkAccess - flag
Returns:
links node set
Throws:
NodeException

getLinks

public NodeSet getLinks()
                 throws NodeException
Description copied from interface: Folder

getLinks

Specified by:
getLinks in interface Folder
Returns:
NodeSet of all the Links referenced by this Folder.
Throws:
DocumentException
NodeException

getLink

public Link getLink(java.lang.String name,
                    boolean checkAccess)
             throws DocumentNotFoundException,
                    NodeException

getLink

Parameters:
name -
checkAccess - flag
Returns:
link
Throws:
DocumentNotFoundException
NodeException

getLink

public Link getLink(java.lang.String name)
             throws DocumentNotFoundException,
                    NodeException
Description copied from interface: Folder

getLink

Specified by:
getLink in interface Folder
Returns:
A Link referenced by this folder.
Throws:
DocumentNotFoundException - if the document requested could not be found.
NodeException

getPageSecurity

public PageSecurity getPageSecurity(boolean checkAccess)
                             throws DocumentNotFoundException,
                                    NodeException

getPageSecurity

Parameters:
checkAccess - flag
Returns:
page security
Throws:
DocumentNotFoundException
NodeException

getPageSecurity

public PageSecurity getPageSecurity()
                             throws DocumentNotFoundException,
                                    NodeException
Description copied from interface: Folder

getPageSecurity

Specified by:
getPageSecurity in interface Folder
Returns:
A PageSecurity referenced by this folder.
Throws:
DocumentNotFoundException - if the document requested could not be found.
NodeException

getAll

public NodeSet getAll()
               throws DocumentException
Description copied from interface: Folder

getAll

Specified by:
getAll in interface Folder
Returns:
A NodeSet containing all sub-folders and documents directly under this folder.
Throws:
DocumentException

getAllNodes

public NodeSet getAllNodes()
                    throws DocumentException

getAllNodes

Returns:
all nodes immediatley under this
Throws:
DocumentException

getAllNodes

protected NodeSet getAllNodes(boolean folderExistenceRequired)
                       throws DocumentException
Throws:
DocumentException

getFolderMetaData

public FolderMetaDataImpl getFolderMetaData()

getFolderMetaData

Returns:
implementation specific folder metadata

setFolderHandler

public void setFolderHandler(FolderHandler handler)

setFolderHandler

Parameters:
handler - folder handler

getMetadata

public GenericMetadata getMetadata()

getMetadata

Specified by:
getMetadata in interface Node
Overrides:
getMetadata in class AbstractNode
Returns:
metadata
See Also:
org.apache.jetspeed.page.document.AbstractNode#getMetadata()

getSecurityConstraints

public SecurityConstraints getSecurityConstraints()

getSecurityConstraints

Specified by:
getSecurityConstraints in interface SecuredResource
Overrides:
getSecurityConstraints in class AbstractBaseElement
Returns:
See Also:
org.apache.jetspeed.om.common.SecureResource#getSecurityConstraints()

setSecurityConstraints

public void setSecurityConstraints(SecurityConstraints constraints)

setSecurityConstraints

Specified by:
setSecurityConstraints in interface SecuredResource
Overrides:
setSecurityConstraints in class AbstractBaseElement
Parameters:
constraints -
See Also:
org.apache.jetspeed.om.common.SecureResource#setSecurityConstraints(org.apache.jetspeed.om.common.SecurityConstraints)

getEffectivePageSecurity

public PageSecurity getEffectivePageSecurity()
getEffectivePageSecurity

Overrides:
getEffectivePageSecurity in class AbstractNode
Returns:
effective page security object
See Also:
org.apache.jetspeed.om.page.psml.AbstractElementImpl#getEffectivePageSecurity()

checkPermissions

public void checkPermissions(java.lang.String path,
                             int mask,
                             boolean checkNodeOnly,
                             boolean checkParentsOnly)
                      throws java.lang.SecurityException

checkPermissions

Overrides:
checkPermissions in class AbstractNode
Parameters:
path -
mask -
checkNodeOnly -
checkParentsOnly -
Throws:
java.lang.SecurityException

getTitle

public java.lang.String getTitle(java.util.Locale locale)

getTitle

Specified by:
getTitle in interface Node
Overrides:
getTitle in class AbstractNode
Parameters:
locale -
Returns:
title in specified locale
See Also:
Node.getTitle(java.util.Locale)

getTitle

public java.lang.String getTitle()

getTitle

Specified by:
getTitle in interface BaseElement
Overrides:
getTitle in class AbstractBaseElement
Returns:
title
See Also:
BaseElement.getTitle()

setTitle

public void setTitle(java.lang.String title)

setTitle

Specified by:
setTitle in interface BaseElement
Overrides:
setTitle in class AbstractBaseElement
Parameters:
title -
See Also:
BaseElement.setTitle(java.lang.String)

getShortTitle

public java.lang.String getShortTitle(java.util.Locale locale)

getShortTitle

Specified by:
getShortTitle in interface Node
Overrides:
getShortTitle in class AbstractNode
Parameters:
locale -
Returns:
short title in supplied locate
See Also:
Node.getShortTitle(java.util.Locale)

getShortTitle

public java.lang.String getShortTitle()

getShortTitle

Specified by:
getShortTitle in interface BaseElement
Overrides:
getShortTitle in class AbstractBaseElement
Returns:
short title
See Also:
BaseElement.getShortTitle()

setShortTitle

public void setShortTitle(java.lang.String title)

setShortTitle

Specified by:
setShortTitle in interface BaseElement
Overrides:
setShortTitle in class AbstractBaseElement
Parameters:
title -
See Also:
BaseElement.setShortTitle(java.lang.String)

getType

public java.lang.String getType()

getType

Specified by:
getType in interface Node
Returns:
type string
See Also:
Node.getType()

isHidden

public boolean isHidden()

isHidden

Specified by:
isHidden in interface Node
Overrides:
isHidden in class AbstractNode
Returns:
whether folder is hidden
See Also:
Node.isHidden()

setHidden

public void setHidden(boolean hidden)

setHidden

Specified by:
setHidden in interface Node
Overrides:
setHidden in class AbstractNode
Parameters:
hidden -
See Also:
org.apache.jetspeed.page.document.AbstractNode#setHidden(boolean)

reset

public void reset()
Specified by:
reset in interface Reset

getMenuDefinitions

public java.util.List getMenuDefinitions()
getMenuDefinitions - get list of menu definitions

Specified by:
getMenuDefinitions in interface Folder
Returns:
definition list

newMenuDefinition

public MenuDefinition newMenuDefinition()
newMenuDefinition - creates a new empty menu definition

Specified by:
newMenuDefinition in interface Folder
Returns:
a newly created MenuDefinition object for use in Folder

newMenuExcludeDefinition

public MenuExcludeDefinition newMenuExcludeDefinition()
newMenuExcludeDefinition - creates a new empty menu exclude definition

Specified by:
newMenuExcludeDefinition in interface Folder
Returns:
a newly created MenuExcludeDefinition object for use in Folder

newMenuIncludeDefinition

public MenuIncludeDefinition newMenuIncludeDefinition()
newMenuIncludeDefinition - creates a new empty menu include definition

Specified by:
newMenuIncludeDefinition in interface Folder
Returns:
a newly created MenuIncludeDefinition object for use in Folder

newMenuOptionsDefinition

public MenuOptionsDefinition newMenuOptionsDefinition()
newMenuOptionsDefinition - creates a new empty menu options definition

Specified by:
newMenuOptionsDefinition in interface Folder
Returns:
a newly created MenuOptionsDefinition object for use in Folder

newMenuSeparatorDefinition

public MenuSeparatorDefinition newMenuSeparatorDefinition()
newMenuSeparatorDefinition - creates a new empty menu separator definition

Specified by:
newMenuSeparatorDefinition in interface Folder
Returns:
a newly created MenuSeparatorDefinition object for use in Folder

setMenuDefinitions

public void setMenuDefinitions(java.util.List definitions)
setMenuDefinitions - set list of menu definitions

Specified by:
setMenuDefinitions in interface Folder
Parameters:
definitions - definition list

unmarshalled

public void unmarshalled()
unmarshalled - notification that this instance has been loaded from the persistent store

Overrides:
unmarshalled in class AbstractNode

isReserved

public boolean isReserved()
Description copied from interface: Folder
Determines if a folder is a reserved folder. Reserved folders are special folders that can hold subsites, the root of user folders, and the root of role folders.

Specified by:
isReserved in interface Folder
Returns:

getReservedType

public int getReservedType()
Description copied from interface: Folder
Returns a valid reserved folder type: RESERVED_FOLDER_SUBSITES RESERVED_FOLDER_USERS RESERVED_FOLDER_ROLES RESERVED_FOLDER_GROUPS RESERVED_FOLDER_MEDIATYPE RESERVED_FOLDER_LANGUAGE RESERVED_FOLDER_COUNTRY

Specified by:
getReservedType in interface Folder
Returns:
one of the valid reserved folder types


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.