org.apache.jetspeed.page
Class AbstractPageManager

java.lang.Object
  extended by org.apache.jetspeed.page.AbstractPageManager
All Implemented Interfaces:
PageManager
Direct Known Subclasses:
CastorXmlPageManager, DelegatingPageManager

public abstract class AbstractPageManager
extends java.lang.Object
implements PageManager

AbstractPageManagerService

Version:
$Id: AbstractPageManager.java 517124 2007-03-12 08:10:25Z ate $
Author:
David Sean Taylor

Field Summary
protected  java.lang.Class folderClass
           
protected  java.lang.Class folderMenuDefinitionClass
           
protected  java.lang.Class folderMenuExcludeDefinitionClass
           
protected  java.lang.Class folderMenuIncludeDefinitionClass
           
protected  java.lang.Class folderMenuOptionsDefinitionClass
           
protected  java.lang.Class folderMenuSeparatorDefinitionClass
           
protected  java.lang.Class folderSecurityConstraintClass
           
protected  java.lang.Class fragmentClass
           
protected  java.lang.Class fragmentPreferenceClass
           
protected  java.lang.Class fragmentSecurityConstraintClass
           
protected  java.lang.Class linkClass
           
protected  java.lang.Class linkSecurityConstraintClass
           
protected  java.lang.Class pageClass
           
protected  java.lang.Class pageMenuDefinitionClass
           
protected  java.lang.Class pageMenuExcludeDefinitionClass
           
protected  java.lang.Class pageMenuIncludeDefinitionClass
           
protected  java.lang.Class pageMenuOptionsDefinitionClass
           
protected  java.lang.Class pageMenuSeparatorDefinitionClass
           
protected  java.lang.Class pageSecurityClass
           
protected  java.lang.Class pageSecurityConstraintClass
           
protected  java.lang.Class pageSecuritySecurityConstraintClass
           
protected  java.lang.Class propertyClass
           
protected  java.lang.Class securityConstraintsClass
           
protected  java.lang.Class securityConstraintsDefClass
           
 
Fields inherited from interface org.apache.jetspeed.page.PageManager
SERVICE_NAME
 
Constructor Summary
AbstractPageManager(boolean permissionsEnabled, boolean constraintsEnabled)
           
AbstractPageManager(boolean permissionsEnabled, boolean constraintsEnabled, java.util.Map modelClasses)
           
 
Method Summary
 void addListener(PageManagerEventListener listener)
          addListener - add page manager event listener
protected  void copyConstraint(SecurityConstraint srcConstraint, SecurityConstraint dstConstraint)
           
 Folder copyFolder(Folder source, java.lang.String path)
          Copy the source folder creating and returning a new copy of the folder with the same content as the source All subobjects are created with new ids
 Fragment copyFragment(Fragment source, java.lang.String name)
          Copy the source fragment creating and returning a new copy of the fragment with the parameter collection as the source The fragment is created with a new fragment id
 Link copyLink(Link source, java.lang.String path)
          Copy the source link creating and returning a new copy of the link
protected  java.util.List copyMenuDefinitions(java.lang.String type, java.util.List srcMenus)
           
protected  java.lang.Object copyMenuElement(java.lang.String type, java.lang.Object srcElement)
           
 Page copyPage(Page source, java.lang.String path)
          Copy the source page creating and returning a new copy of the page with the same portlet and fragment collection as the source All fragments are created with new fragment ids
 PageSecurity copyPageSecurity(PageSecurity source)
          Copy the source page security (both global constraints and constraint references) creating and returning a new copy of the page security definition.
protected  SecurityConstraints copySecurityConstraints(java.lang.String type, SecurityConstraints source)
           
 void createUserHomePagesFromRoles(javax.security.auth.Subject subject)
          Creates a user's home page from the roles of the current user.
 void deepCopyFolder(Folder srcFolder, java.lang.String destinationPath, java.lang.String owner)
          Deep copy a folder
 boolean folderExists(java.lang.String folderName)
          Check if a folder exists for the given folder name
 boolean getConstraintsEnabled()
           getConstraintsEnabled
 boolean getPermissionsEnabled()
           getPermissionsEnabled
 Folder getUserFolder(java.lang.String userName)
          Retrieve a user's folder
 Page getUserPage(java.lang.String userName, java.lang.String pageName)
          Retrieve a page for the given user name and page name
 boolean linkExists(java.lang.String linkName)
          Check if a link exists for the given link name
 Folder newFolder(java.lang.String path)
          Create a new empty Folder instance
 MenuDefinition newFolderMenuDefinition()
          newFolderMenuDefinition - creates a new empty menu definition
 MenuExcludeDefinition newFolderMenuExcludeDefinition()
          newFolderMenuExcludeDefinition - creates a new empty menu exclude definition
 MenuIncludeDefinition newFolderMenuIncludeDefinition()
          newFolderMenuIncludeDefinition - creates a new empty menu include definition
 MenuOptionsDefinition newFolderMenuOptionsDefinition()
          newFolderMenuOptionsDefinition - creates a new empty menu options definition
 MenuSeparatorDefinition newFolderMenuSeparatorDefinition()
          newFolderMenuSeparatorDefinition - creates a new empty menu separator definition
 SecurityConstraint newFolderSecurityConstraint()
          newFolderSecurityConstraint - creates a new security constraint definition
 Fragment newFragment()
          Creates a new empty Layout Fragment instance
 FragmentPreference newFragmentPreference()
          newFragmentPreference - creates a new security constraints definition
 SecurityConstraint newFragmentSecurityConstraint()
          newFragmentSecurityConstraint - creates a new security constraint definition
 Link newLink(java.lang.String path)
          Creates a new empty Link instance
 SecurityConstraint newLinkSecurityConstraint()
          newLinkSecurityConstraint - creates a new security constraint definition
 Page newPage(java.lang.String path)
          Creates a new empty Page instance
 MenuDefinition newPageMenuDefinition()
          newPageMenuDefinition - creates a new empty menu definition
 MenuExcludeDefinition newPageMenuExcludeDefinition()
          newPageMenuExcludeDefinition - creates a new empty menu exclude definition
 MenuIncludeDefinition newPageMenuIncludeDefinition()
          newPageMenuIncludeDefinition - creates a new empty menu include definition
 MenuOptionsDefinition newPageMenuOptionsDefinition()
          newPageMenuOptionsDefinition - creates a new empty menu options definition
 MenuSeparatorDefinition newPageMenuSeparatorDefinition()
          newPageMenuSeparatorDefinition - creates a new empty menu separator definition
 PageSecurity newPageSecurity()
          Creates a new empty PageSecurity instance
 SecurityConstraint newPageSecurityConstraint()
          newPageSecurityConstraint - creates a new security constraint definition
 SecurityConstraint newPageSecuritySecurityConstraint()
          newPageSecuritySecurityConstraint - creates a new security constraint definition
 Fragment newPortletFragment()
          Creates a new empty Portlet Fragment instance
 SecurityConstraints newSecurityConstraints()
          newSecurityConstraints - creates a new empty security constraints definition
 SecurityConstraintsDef newSecurityConstraintsDef()
          newSecurityConstraintsDef - creates a new security constraints definition
 void notifyNewNode(Node node)
          notifyNewNode - notify page manager event listeners of new node event
 void notifyRemovedNode(Node node)
          notifyRemovedNode - notify page manager event listeners of removed node event
 void notifyUpdatedNode(Node node)
          notifyUpdatedNode - notify page manager event listeners of updated node event
 boolean pageExists(java.lang.String pageName)
          Check if a page exists for the given page name
 void removeListener(PageManagerEventListener listener)
          removeListener - remove page manager event listener
 void reset()
          reset - force subsequent refresh from persistent store
 boolean userFolderExists(java.lang.String userName)
          Check if the root folder exists for a given user
 boolean userPageExists(java.lang.String userName, java.lang.String pageName)
          Check if a page exists for the given user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.page.PageManager
addPages, checkConstraint, getAll, getContentPage, getFolder, getFolder, getFolders, getLink, getLink, getLinks, getPage, getPage, getPages, getPageSecurity, getPageSecurity, removeFolder, removeLink, removePage, removePageSecurity, updateFolder, updateFolder, updateLink, updatePage, updatePageSecurity
 

Field Detail

fragmentClass

protected java.lang.Class fragmentClass

pageClass

protected java.lang.Class pageClass

folderClass

protected java.lang.Class folderClass

linkClass

protected java.lang.Class linkClass

pageSecurityClass

protected java.lang.Class pageSecurityClass

propertyClass

protected java.lang.Class propertyClass

folderMenuDefinitionClass

protected java.lang.Class folderMenuDefinitionClass

folderMenuExcludeDefinitionClass

protected java.lang.Class folderMenuExcludeDefinitionClass

folderMenuIncludeDefinitionClass

protected java.lang.Class folderMenuIncludeDefinitionClass

folderMenuOptionsDefinitionClass

protected java.lang.Class folderMenuOptionsDefinitionClass

folderMenuSeparatorDefinitionClass

protected java.lang.Class folderMenuSeparatorDefinitionClass

pageMenuDefinitionClass

protected java.lang.Class pageMenuDefinitionClass

pageMenuExcludeDefinitionClass

protected java.lang.Class pageMenuExcludeDefinitionClass

pageMenuIncludeDefinitionClass

protected java.lang.Class pageMenuIncludeDefinitionClass

pageMenuOptionsDefinitionClass

protected java.lang.Class pageMenuOptionsDefinitionClass

pageMenuSeparatorDefinitionClass

protected java.lang.Class pageMenuSeparatorDefinitionClass

securityConstraintsClass

protected java.lang.Class securityConstraintsClass

folderSecurityConstraintClass

protected java.lang.Class folderSecurityConstraintClass

pageSecurityConstraintClass

protected java.lang.Class pageSecurityConstraintClass

fragmentSecurityConstraintClass

protected java.lang.Class fragmentSecurityConstraintClass

linkSecurityConstraintClass

protected java.lang.Class linkSecurityConstraintClass

pageSecuritySecurityConstraintClass

protected java.lang.Class pageSecuritySecurityConstraintClass

securityConstraintsDefClass

protected java.lang.Class securityConstraintsDefClass

fragmentPreferenceClass

protected java.lang.Class fragmentPreferenceClass
Constructor Detail

AbstractPageManager

public AbstractPageManager(boolean permissionsEnabled,
                           boolean constraintsEnabled)

AbstractPageManager

public AbstractPageManager(boolean permissionsEnabled,
                           boolean constraintsEnabled,
                           java.util.Map modelClasses)
Method Detail

getPermissionsEnabled

public boolean getPermissionsEnabled()

getPermissionsEnabled

Specified by:
getPermissionsEnabled in interface PageManager
Returns:
See Also:
PageManager.getPermissionsEnabled()

getConstraintsEnabled

public boolean getConstraintsEnabled()

getConstraintsEnabled

Specified by:
getConstraintsEnabled in interface PageManager
Returns:
See Also:
PageManager.getConstraintsEnabled()

newPage

public Page newPage(java.lang.String path)
Description copied from interface: PageManager
Creates a new empty Page instance

Specified by:
newPage in interface PageManager
Returns:
a newly created Page object

newFolder

public Folder newFolder(java.lang.String path)
Description copied from interface: PageManager
Create a new empty Folder instance

Specified by:
newFolder in interface PageManager
Returns:
a newly created Folder object

newLink

public Link newLink(java.lang.String path)
Description copied from interface: PageManager
Creates a new empty Link instance

Specified by:
newLink in interface PageManager
Returns:
a newly created Link object

newPageSecurity

public PageSecurity newPageSecurity()
Description copied from interface: PageManager
Creates a new empty PageSecurity instance

Specified by:
newPageSecurity in interface PageManager
Returns:
a newly created PageSecurity object

newFragment

public Fragment newFragment()
Description copied from interface: PageManager
Creates a new empty Layout Fragment instance

Specified by:
newFragment in interface PageManager
Returns:
a newly created Fragment object

newPortletFragment

public Fragment newPortletFragment()
Description copied from interface: PageManager
Creates a new empty Portlet Fragment instance

Specified by:
newPortletFragment in interface PageManager
Returns:
a newly created Fragment object

newFolderMenuDefinition

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

Specified by:
newFolderMenuDefinition in interface PageManager
Returns:
a newly created MenuDefinition object

newFolderMenuExcludeDefinition

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

Specified by:
newFolderMenuExcludeDefinition in interface PageManager
Returns:
a newly created MenuExcludeDefinition object

newFolderMenuIncludeDefinition

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

Specified by:
newFolderMenuIncludeDefinition in interface PageManager
Returns:
a newly created MenuIncludeDefinition object

newFolderMenuOptionsDefinition

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

Specified by:
newFolderMenuOptionsDefinition in interface PageManager
Returns:
a newly created MenuOptionsDefinition object

newFolderMenuSeparatorDefinition

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

Specified by:
newFolderMenuSeparatorDefinition in interface PageManager
Returns:
a newly created MenuSeparatorDefinition object

newPageMenuDefinition

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

Specified by:
newPageMenuDefinition in interface PageManager
Returns:
a newly created MenuDefinition object

newPageMenuExcludeDefinition

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

Specified by:
newPageMenuExcludeDefinition in interface PageManager
Returns:
a newly created MenuExcludeDefinition object

newPageMenuIncludeDefinition

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

Specified by:
newPageMenuIncludeDefinition in interface PageManager
Returns:
a newly created MenuIncludeDefinition object

newPageMenuOptionsDefinition

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

Specified by:
newPageMenuOptionsDefinition in interface PageManager
Returns:
a newly created MenuOptionsDefinition object

newPageMenuSeparatorDefinition

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

Specified by:
newPageMenuSeparatorDefinition in interface PageManager
Returns:
a newly created MenuSeparatorDefinition object

newSecurityConstraints

public SecurityConstraints newSecurityConstraints()
newSecurityConstraints - creates a new empty security constraints definition

Specified by:
newSecurityConstraints in interface PageManager
Returns:
a newly created SecurityConstraints object

newFolderSecurityConstraint

public SecurityConstraint newFolderSecurityConstraint()
newFolderSecurityConstraint - creates a new security constraint definition

Specified by:
newFolderSecurityConstraint in interface PageManager
Returns:
a newly created SecurityConstraint object

newPageSecurityConstraint

public SecurityConstraint newPageSecurityConstraint()
newPageSecurityConstraint - creates a new security constraint definition

Specified by:
newPageSecurityConstraint in interface PageManager
Returns:
a newly created SecurityConstraint object

newFragmentSecurityConstraint

public SecurityConstraint newFragmentSecurityConstraint()
newFragmentSecurityConstraint - creates a new security constraint definition

Specified by:
newFragmentSecurityConstraint in interface PageManager
Returns:
a newly created SecurityConstraint object

newLinkSecurityConstraint

public SecurityConstraint newLinkSecurityConstraint()
newLinkSecurityConstraint - creates a new security constraint definition

Specified by:
newLinkSecurityConstraint in interface PageManager
Returns:
a newly created SecurityConstraint object

newPageSecuritySecurityConstraint

public SecurityConstraint newPageSecuritySecurityConstraint()
newPageSecuritySecurityConstraint - creates a new security constraint definition

Specified by:
newPageSecuritySecurityConstraint in interface PageManager
Returns:
a newly created SecurityConstraint object

newSecurityConstraintsDef

public SecurityConstraintsDef newSecurityConstraintsDef()
newSecurityConstraintsDef - creates a new security constraints definition

Specified by:
newSecurityConstraintsDef in interface PageManager
Returns:
a newly created SecurityConstraintsDef object

newFragmentPreference

public FragmentPreference newFragmentPreference()
newFragmentPreference - creates a new security constraints definition

Specified by:
newFragmentPreference in interface PageManager
Returns:
a newly created FragmentPreference object

addListener

public void addListener(PageManagerEventListener listener)
addListener - add page manager event listener

Specified by:
addListener in interface PageManager
Parameters:
listener - page manager event listener

removeListener

public void removeListener(PageManagerEventListener listener)
removeListener - remove page manager event listener

Specified by:
removeListener in interface PageManager
Parameters:
listener - page manager event listener

reset

public void reset()
Description copied from interface: PageManager
reset - force subsequent refresh from persistent store

Specified by:
reset in interface PageManager

notifyNewNode

public void notifyNewNode(Node node)
notifyNewNode - notify page manager event listeners of new node event

Parameters:
node - new managed node if known

notifyUpdatedNode

public void notifyUpdatedNode(Node node)
notifyUpdatedNode - notify page manager event listeners of updated node event

Parameters:
node - updated managed node if known

notifyRemovedNode

public void notifyRemovedNode(Node node)
notifyRemovedNode - notify page manager event listeners of removed node event

Parameters:
node - removed managed node if known

copyFolder

public Folder copyFolder(Folder source,
                         java.lang.String path)
                  throws NodeException
Description copied from interface: PageManager
Copy the source folder creating and returning a new copy of the folder with the same content as the source All subobjects are created with new ids

Specified by:
copyFolder in interface PageManager
Parameters:
source - The source Folder object to be copied
path - a PSML normalized path to the new folder to be created
Returns:
a new Folder object copied from the source, with new subobject ids
Throws:
NodeException

copyPage

public Page copyPage(Page source,
                     java.lang.String path)
              throws NodeException
Description copied from interface: PageManager
Copy the source page creating and returning a new copy of the page with the same portlet and fragment collection as the source All fragments are created with new fragment ids

Specified by:
copyPage in interface PageManager
Parameters:
source - The source Page object to be copied
path - a PSML normalized path to the new page to be created
Returns:
a new Page object copied from the source, with new fragment ids
Throws:
NodeException

copyFragment

public Fragment copyFragment(Fragment source,
                             java.lang.String name)
                      throws NodeException
Description copied from interface: PageManager
Copy the source fragment creating and returning a new copy of the fragment with the parameter collection as the source The fragment is created with a new fragment id

Specified by:
copyFragment in interface PageManager
Parameters:
source - The source Fragment object to be copied
Returns:
a new Fragment object copied from the source
Throws:
NodeException

copyLink

public Link copyLink(Link source,
                     java.lang.String path)
              throws NodeException
Description copied from interface: PageManager
Copy the source link creating and returning a new copy of the link

Specified by:
copyLink in interface PageManager
Parameters:
source - The source Link object to be copied
path - a PSML normalized path to the new link to be created
Returns:
a new Link object copied from the source
Throws:
NodeException

copyPageSecurity

public PageSecurity copyPageSecurity(PageSecurity source)
                              throws NodeException
Description copied from interface: PageManager
Copy the source page security (both global constraints and constraint references) creating and returning a new copy of the page security definition.

Specified by:
copyPageSecurity in interface PageManager
Parameters:
source - The source PageSecurity definitions
Returns:
the new page security object
Throws:
NodeException

copyMenuDefinitions

protected java.util.List copyMenuDefinitions(java.lang.String type,
                                             java.util.List srcMenus)

copyMenuElement

protected java.lang.Object copyMenuElement(java.lang.String type,
                                           java.lang.Object srcElement)

copyConstraint

protected void copyConstraint(SecurityConstraint srcConstraint,
                              SecurityConstraint dstConstraint)

copySecurityConstraints

protected SecurityConstraints copySecurityConstraints(java.lang.String type,
                                                      SecurityConstraints source)

deepCopyFolder

public void deepCopyFolder(Folder srcFolder,
                           java.lang.String destinationPath,
                           java.lang.String owner)
                    throws NodeException
Deep copy a folder

Specified by:
deepCopyFolder in interface PageManager
Parameters:
source - source folder
dest - destination folder
Throws:
NodeException

getUserPage

public Page getUserPage(java.lang.String userName,
                        java.lang.String pageName)
                 throws PageNotFoundException,
                        NodeException
Description copied from interface: PageManager
Retrieve a page for the given user name and page name

Specified by:
getUserPage in interface PageManager
Returns:
Throws:
PageNotFoundException
NodeException

getUserFolder

public Folder getUserFolder(java.lang.String userName)
                     throws FolderNotFoundException,
                            InvalidFolderException,
                            NodeException
Description copied from interface: PageManager
Retrieve a user's folder

Specified by:
getUserFolder in interface PageManager
Returns:
Throws:
FolderNotFoundException
InvalidFolderException
NodeException

folderExists

public boolean folderExists(java.lang.String folderName)
Description copied from interface: PageManager
Check if a folder exists for the given folder name

Specified by:
folderExists in interface PageManager
Returns:

pageExists

public boolean pageExists(java.lang.String pageName)
Description copied from interface: PageManager
Check if a page exists for the given page name

Specified by:
pageExists in interface PageManager
Returns:

linkExists

public boolean linkExists(java.lang.String linkName)
Description copied from interface: PageManager
Check if a link exists for the given link name

Specified by:
linkExists in interface PageManager
Returns:

userFolderExists

public boolean userFolderExists(java.lang.String userName)
Description copied from interface: PageManager
Check if the root folder exists for a given user

Specified by:
userFolderExists in interface PageManager
Returns:

userPageExists

public boolean userPageExists(java.lang.String userName,
                              java.lang.String pageName)
Description copied from interface: PageManager
Check if a page exists for the given user

Specified by:
userPageExists in interface PageManager
Returns:

createUserHomePagesFromRoles

public void createUserHomePagesFromRoles(javax.security.auth.Subject subject)
                                  throws NodeException
Creates a user's home page from the roles of the current user. The use case: when a portal is setup to use shared pages, but then the user attempts to customize. At this point, we create the new page(s) for the user.

Specified by:
createUserHomePagesFromRoles in interface PageManager
Parameters:
subject -
Throws:
NodeException


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