org.apache.jetspeed.page
Interface PageManager


public interface PageManager

This service is responsible for loading and saving Pages into the selected persistent store.

Version:
$Id: PageManager.java 516448 2007-03-09 16:25:47Z ate $

Field Summary
static String SERVICE_NAME
          The name of the service
 
Method Summary
 void addListener(PageManagerEventListener listener)
          addListener - add page manager event listener
 int addPages(Page[] pages)
           
 boolean checkConstraint(String securityConstraintName, String actions)
          For a given security constraint definition name, and the given action(s), make a constraint check for the current user subject
 Folder copyFolder(Folder source, 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, 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, String path)
          Copy the source link creating and returning a new copy of the link
 Page copyPage(Page source, 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.
 void createUserHomePagesFromRoles(Subject subject)
          Creates a user's home page from the roles of the current user.
 void deepCopyFolder(Folder srcFolder, String destinationPath, String owner)
          Deep copy a folder.
 boolean folderExists(String folderName)
          Check if a folder exists for the given folder name
 NodeSet getAll(Folder folder)
           getAll
 boolean getConstraintsEnabled()
           getConstraintsEnabled
 ContentPage getContentPage(String path)
           ContentPage
 Folder getFolder(Folder folder, String name)
           getFolder
 Folder getFolder(String folderPath)
           getFolder
 NodeSet getFolders(Folder folder)
           getFolders
 Link getLink(Folder folder, String name)
           getLink
 Link getLink(String name)
           getLink
 NodeSet getLinks(Folder folder)
           getLinks
 Page getPage(Folder folder, String name)
           getPage
 Page getPage(String path)
           getPage
 NodeSet getPages(Folder folder)
           getPages
 PageSecurity getPageSecurity()
           getPageSecurity
 PageSecurity getPageSecurity(Folder folder)
           getPageSecurity
 boolean getPermissionsEnabled()
           getPermissionsEnabled
 Folder getUserFolder(String userName)
          Retrieve a user's folder
 Page getUserPage(String userName, String pageName)
          Retrieve a page for the given user name and page name
 boolean linkExists(String linkName)
          Check if a link exists for the given link name
 Folder newFolder(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 fragment preference
 SecurityConstraint newFragmentSecurityConstraint()
          newFragmentSecurityConstraint - creates a new security constraint definition
 Link newLink(String path)
          Creates a new empty Link instance
 SecurityConstraint newLinkSecurityConstraint()
          newLinkSecurityConstraint - creates a new security constraint definition
 Page newPage(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
 boolean pageExists(String pageName)
          Check if a page exists for the given page name
 void removeFolder(Folder folder)
          Remove a folder.
 void removeLink(Link link)
          Remove a link.
 void removeListener(PageManagerEventListener listener)
          removeListener - remove page manager event listener
 void removePage(Page page)
          Remove a document.
 void removePageSecurity(PageSecurity pageSecurity)
          Remove a page security document.
 void reset()
          reset - force subsequent refresh from persistent store
 void updateFolder(Folder folder)
          Update a folder and all child folders and documents in persistent storage
 void updateFolder(Folder folder, boolean deep)
          Update a folder in persistent storage
 void updateLink(Link link)
          Update a link in persistent storage
 void updatePage(Page page)
          Update a page in persistent storage
 void updatePageSecurity(PageSecurity pageSecurity)
          Update a page security document in persistent storage
 boolean userFolderExists(String userName)
          Check if the root folder exists for a given user
 boolean userPageExists(String userName, String pageName)
          Check if a page exists for the given user
 

Field Detail

SERVICE_NAME

static final String SERVICE_NAME
The name of the service

See Also:
Constant Field Values
Method Detail

getConstraintsEnabled

boolean getConstraintsEnabled()

getConstraintsEnabled

Returns:
enabled indicator

getPermissionsEnabled

boolean getPermissionsEnabled()

getPermissionsEnabled

Returns:
enabled indicator

newPage

Page newPage(String path)
Creates a new empty Page instance

Returns:
a newly created Page object

newFolder

Folder newFolder(String path)
Create a new empty Folder instance

Returns:
a newly created Folder object

newLink

Link newLink(String path)
Creates a new empty Link instance

Returns:
a newly created Link object

newPageSecurity

PageSecurity newPageSecurity()
Creates a new empty PageSecurity instance

Returns:
a newly created PageSecurity object

newFragment

Fragment newFragment()
Creates a new empty Layout Fragment instance

Returns:
a newly created Fragment object

newPortletFragment

Fragment newPortletFragment()
Creates a new empty Portlet Fragment instance

Returns:
a newly created Fragment object

newFolderMenuDefinition

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

Returns:
a newly created MenuDefinition object to be used in Folder

newFolderMenuExcludeDefinition

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

Returns:
a newly created MenuExcludeDefinition object to be used in Folder

newFolderMenuIncludeDefinition

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

Returns:
a newly created MenuIncludeDefinition object to be used in Folder

newFolderMenuOptionsDefinition

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

Returns:
a newly created MenuOptionsDefinition object to be used in Folder

newFolderMenuSeparatorDefinition

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

Returns:
a newly created MenuSeparatorDefinition object to be used in Folder

newPageMenuDefinition

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

Returns:
a newly created MenuDefinition object to be used in Page

newPageMenuExcludeDefinition

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

Returns:
a newly created MenuExcludeDefinition object to be used in Page

newPageMenuIncludeDefinition

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

Returns:
a newly created MenuIncludeDefinition object to be used in Page

newPageMenuOptionsDefinition

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

Returns:
a newly created MenuOptionsDefinition object to be used in Page

newPageMenuSeparatorDefinition

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

Returns:
a newly created MenuSeparatorDefinition object to be used in Page

newSecurityConstraints

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

Returns:
a newly created SecurityConstraints object

newFolderSecurityConstraint

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

Returns:
a newly created SecurityConstraint object to be used in Folder

newPageSecurityConstraint

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

Returns:
a newly created SecurityConstraint object to be used in Page

newFragmentSecurityConstraint

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

Returns:
a newly created SecurityConstraint object to be used in Fragment

newLinkSecurityConstraint

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

Returns:
a newly created SecurityConstraint object to be used in Link

newPageSecuritySecurityConstraint

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

Returns:
a newly created SecurityConstraint object to be used in PageSecurity

newSecurityConstraintsDef

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

Returns:
a newly created SecurityConstraintsDef object

newFragmentPreference

FragmentPreference newFragmentPreference()
newFragmentPreference - creates a new fragment preference

Returns:
a newly created FragmentPreference

getPage

Page getPage(String path)
             throws PageNotFoundException,
                    NodeException

getPage

Returns a Page based on its path

Parameters:
path -
Throws:
PageNotFoundException - if the page cannot be found
NodeException

getContentPage

ContentPage getContentPage(String path)
                           throws PageNotFoundException,
                                  NodeException

ContentPage

Returns a PSML document suitable for use in content rendering, for the given key

Parameters:
locator - The locator descriptor of the document to be retrieved.
Throws:
PageNotFoundException - if the page cannot be found
NodeException
See Also:
ContentPage, Fragment

getLink

Link getLink(String name)
             throws DocumentNotFoundException,
                    UnsupportedDocumentTypeException,
                    NodeException

getLink

Returns a Link document for the given path

Parameters:
name - The path of the document to be retrieved.
Throws:
PageNotFoundException - if the page cannot be found
NodeException
DocumentNotFoundException
UnsupportedDocumentTypeException

getPageSecurity

PageSecurity getPageSecurity()
                             throws DocumentNotFoundException,
                                    UnsupportedDocumentTypeException,
                                    NodeException

getPageSecurity

Returns the PageSecurity document

Throws:
DocumentNotFoundException - if the document cannot be found
UnsupportedDocumentTypeException
NodeException

getFolder

Folder getFolder(String folderPath)
                 throws FolderNotFoundException,
                        InvalidFolderException,
                        NodeException

getFolder

Locates a folder for the given path.

Parameters:
folderPath -
Returns:
Folder object represented by the folderPath
Throws:
FolderNotFoundException
NodeException
InvalidFolderException

getFolders

NodeSet getFolders(Folder folder)
                   throws DocumentException

getFolders

Locates folders within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
Returns:
A NodeSet containing all sub-folders directly under this folder.
Throws:
DocumentException
See Also:
org.apache.jetspeed.om.folder.Folder#getFolders(org.apache.jetspeed.om.folder.Folder)

getFolder

Folder getFolder(Folder folder,
                 String name)
                 throws FolderNotFoundException,
                        DocumentException

getFolder

Locates folders within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
name - The name of folder to retrieve.
Returns:
A Folder referenced by this folder.
Throws:
FolderNotFoundException
DocumentException
See Also:
org.apache.jetspeed.om.folder.Folder#getFolder(org.apache.jetspeed.om.folder.Folder,java.lang.String)

getPages

NodeSet getPages(Folder folder)
                 throws NodeException

getPages

Locates documents within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
Returns:
A NodeSet of all the Pages referenced by this Folder.
Throws:
NodeException
See Also:
org.apache.jetspeed.om.folder.Folder#getPages(org.apache.jetspeed.om.folder.Folder)

getPage

Page getPage(Folder folder,
             String name)
             throws PageNotFoundException,
                    NodeException

getPage

Locates documents within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
name - The name of page to retrieve.
Returns:
A Page referenced by this folder.
Throws:
PageNotFoundException - if the Page requested could not be found.
NodeException
See Also:
org.apache.jetspeed.om.folder.Folder#getPage(org.apache.jetspeed.om.folder.Folder,java.lang.String)

getLinks

NodeSet getLinks(Folder folder)
                 throws NodeException

getLinks

Parameters:
folder - The parent folder.
Returns:
NodeSet of all the Links referenced by this Folder.
Throws:
NodeException
See Also:
Locates documents within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

getLink

Link getLink(Folder folder,
             String name)
             throws DocumentNotFoundException,
                    NodeException

getLink

Locates documents within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
name - The name of page to retrieve.
Returns:
A Link referenced by this folder.
Throws:
DocumentNotFoundException - if the document requested could not be found.
NodeException
See Also:
org.apache.jetspeed.om.folder.Folder#getLink(org.apache.jetspeed.om.folder.Folder,java.lang.String)

getPageSecurity

PageSecurity getPageSecurity(Folder folder)
                             throws DocumentNotFoundException,
                                    NodeException

getPageSecurity

Locates documents within a specified parent folder. Returned documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
Returns:
A PageSecurity referenced by this folder.
Throws:
DocumentNotFoundException - if the document requested could not be found.
NodeException
See Also:
org.apache.jetspeed.om.folder.Folder#getPageSecurity(org.apache.jetspeed.om.folder.Folder)

getAll

NodeSet getAll(Folder folder)
               throws DocumentException

getAll

Locates folders and documents within a specified parent folder. Returned folders and documents are filtered according to security constraints and/or permissions.

Parameters:
folder - The parent folder.
Returns:
A NodeSet containing all sub-folders and documents directly under this folder.
Throws:
DocumentException
See Also:
org.apache.jetspeed.om.folder.Folder#getAll(org.apache.jetspeed.om.folder.Folder)

updatePage

void updatePage(Page page)
                throws NodeException,
                       PageNotUpdatedException
Update a page in persistent storage

Parameters:
page - The page to be updated.
Throws:
NodeException
PageNotUpdatedException

removePage

void removePage(Page page)
                throws NodeException,
                       PageNotRemovedException
Remove a document.

Parameters:
page - The page to be removed.
Throws:
NodeException
PageNotRemovedException

updateFolder

void updateFolder(Folder folder)
                  throws NodeException,
                         FolderNotUpdatedException
Update a folder and all child folders and documents in persistent storage

Parameters:
folder - The folder to be updated.
Throws:
NodeException
FolderNotUpdatedException

updateFolder

void updateFolder(Folder folder,
                  boolean deep)
                  throws NodeException,
                         FolderNotUpdatedException
Update a folder in persistent storage

Parameters:
folder - The folder to be updated.
deep - Flag to control recursive deep updates.
Throws:
NodeException
FolderNotUpdatedException

removeFolder

void removeFolder(Folder folder)
                  throws NodeException,
                         FolderNotRemovedException
Remove a folder.

Parameters:
page - The folder to be removed.
Throws:
NodeException
FolderNotRemovedException

updateLink

void updateLink(Link link)
                throws NodeException,
                       LinkNotUpdatedException
Update a link in persistent storage

Parameters:
link - The link to be updated.
Throws:
NodeException
LinkNotUpdatedException

removeLink

void removeLink(Link link)
                throws NodeException,
                       LinkNotRemovedException
Remove a link.

Parameters:
link - The link to be removed.
Throws:
NodeException
LinkNotRemovedException

updatePageSecurity

void updatePageSecurity(PageSecurity pageSecurity)
                        throws NodeException,
                               FailedToUpdateDocumentException
Update a page security document in persistent storage

Parameters:
pageSecurity - The document to be updated.
Throws:
NodeException
FailedToUpdateDocumentException

removePageSecurity

void removePageSecurity(PageSecurity pageSecurity)
                        throws NodeException,
                               FailedToDeleteDocumentException
Remove a page security document.

Parameters:
pageSecurity - The document to be removed.
Throws:
NodeException
FailedToDeleteDocumentException

addListener

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

Parameters:
listener - page manager event listener

removeListener

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

Parameters:
listener - page manager event listener

reset

void reset()
reset - force subsequent refresh from persistent store


copyPage

Page copyPage(Page source,
              String path)
              throws NodeException
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

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

copyLink

Link copyLink(Link source,
              String path)
              throws NodeException
Copy the source link creating and returning a new copy of the link

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

copyFolder

Folder copyFolder(Folder source,
                  String path)
                  throws NodeException
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

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

copyFragment

Fragment copyFragment(Fragment source,
                      String name)
                      throws NodeException
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

Parameters:
source - The source Fragment object to be copied
the - new fragment name, can be the same as source fragment name
Returns:
a new Fragment object copied from the source
Throws:
NodeException

copyPageSecurity

PageSecurity copyPageSecurity(PageSecurity source)
                              throws NodeException
Copy the source page security (both global constraints and constraint references) creating and returning a new copy of the page security definition.

Parameters:
source - The source PageSecurity definitions
Returns:
the new page security object
Throws:
NodeException

deepCopyFolder

void deepCopyFolder(Folder srcFolder,
                    String destinationPath,
                    String owner)
                    throws NodeException
Deep copy a folder. Copies a folder and all subcontents including other folders, subpages, links, menus, security, fragments.

Parameters:
source - source folder
dest - destination folder
owner - set owner of the new folder(s), or null for no owner
Throws:
NodeException

getUserPage

Page getUserPage(String userName,
                 String pageName)
                 throws PageNotFoundException,
                        NodeException
Retrieve a page for the given user name and page name

Parameters:
userName -
pageName -
Returns:
Throws:
PageNotFoundException
NodeException

getUserFolder

Folder getUserFolder(String userName)
                     throws FolderNotFoundException,
                            InvalidFolderException,
                            NodeException
Retrieve a user's folder

Parameters:
userName -
Returns:
Throws:
FolderNotFoundException
InvalidFolderException
NodeException

folderExists

boolean folderExists(String folderName)
Check if a folder exists for the given folder name

Parameters:
folderName -
Returns:

pageExists

boolean pageExists(String pageName)
Check if a page exists for the given page name

Parameters:
pageName -
Returns:

linkExists

boolean linkExists(String linkName)
Check if a link exists for the given link name

Parameters:
linkName -
Returns:

userFolderExists

boolean userFolderExists(String userName)
Check if the root folder exists for a given user

Parameters:
userName -
Returns:

userPageExists

boolean userPageExists(String userName,
                       String pageName)
Check if a page exists for the given user

Parameters:
userName -
pageName -
Returns:

createUserHomePagesFromRoles

void createUserHomePagesFromRoles(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.

Parameters:
subject - The full user Java Security subject.
Throws:
NodeException

addPages

int addPages(Page[] pages)
             throws NodeException
Parameters:
pages -
Returns:
Throws:
NodeException

checkConstraint

boolean checkConstraint(String securityConstraintName,
                        String actions)
For a given security constraint definition name, and the given action(s), make a constraint check for the current user subject

Parameters:
securityConstraintName - the name of the security constraint definition
actions - one or more portlet actions (view,edit,help,..)
Returns:


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