org.apache.jetspeed.page.psml
Class CastorXmlPageManager

java.lang.Object
  extended by org.apache.jetspeed.page.AbstractPageManager
      extended by org.apache.jetspeed.page.psml.CastorXmlPageManager
All Implemented Interfaces:
FileCacheEventListener, PageManager

public class CastorXmlPageManager
extends AbstractPageManager
implements PageManager, FileCacheEventListener

This service is responsible for loading and saving PSML pages serialized to disk

Version:
$Id: CastorXmlPageManager.java 516448 2007-03-09 16:25:47Z ate $
Author:
Rapha???l Luta , Scott T Weaver

Field Summary
 
Fields inherited from class org.apache.jetspeed.page.AbstractPageManager
folderClass, folderMenuDefinitionClass, folderMenuExcludeDefinitionClass, folderMenuIncludeDefinitionClass, folderMenuOptionsDefinitionClass, folderMenuSeparatorDefinitionClass, folderSecurityConstraintClass, fragmentClass, fragmentPreferenceClass, fragmentSecurityConstraintClass, linkClass, linkSecurityConstraintClass, pageClass, pageMenuDefinitionClass, pageMenuExcludeDefinitionClass, pageMenuIncludeDefinitionClass, pageMenuOptionsDefinitionClass, pageMenuSeparatorDefinitionClass, pageSecurityClass, pageSecurityConstraintClass, pageSecuritySecurityConstraintClass, propertyClass, securityConstraintsClass, securityConstraintsDefClass
 
Fields inherited from interface org.apache.jetspeed.page.PageManager
SERVICE_NAME
 
Constructor Summary
CastorXmlPageManager(IdGenerator generator, DocumentHandlerFactory handlerFactory, FolderHandler folderHandler, FileCache fileCache, boolean permissionsEnabled, boolean constraintsEnabled)
           
 
Method Summary
 int addPages(Page[] pages)
           
 boolean checkConstraint(java.lang.String securityConstraintName, java.lang.String actions)
          For a given security constraint definition name, and the given action(s), make a constraint check for the current user subject
 Page copy(Page source)
           
 void evict(FileCacheEntry entry)
           evict file cache entry
 NodeSet getAll(Folder folder)
           getAll
 ContentPage getContentPage(java.lang.String path)
           ContentPage
 Folder getFolder(Folder folder, java.lang.String name)
           getFolder
 Folder getFolder(java.lang.String folderPath)
           getFolder
 NodeSet getFolders(Folder folder)
           getFolders
 Link getLink(Folder folder, java.lang.String name)
           getLink
 Link getLink(java.lang.String path)
           getLink
 NodeSet getLinks(Folder folder)
           getLinks
 Page getPage(Folder folder, java.lang.String name)
           getPage
 Page getPage(java.lang.String path)
           getPage
 NodeSet getPages(Folder folder)
           getPages
 PageSecurity getPageSecurity()
           getPageSecurity
 PageSecurity getPageSecurity(Folder folder)
           getPageSecurity
 Fragment newFragment()
           newFragment
 Fragment newPortletFragment()
          Creates a new empty Portlet Fragment instance
 void refresh(FileCacheEntry entry)
           refresh file cache entry
 void removeFolder(Folder folder)
           removeFolder
 void removeLink(Link link)
           removeLink
 void removePage(Page page)
           removePage
 void removePageSecurity(PageSecurity pageSecurity)
          Remove a page security document.
 void reset()
          reset - force subsequent refresh from persistent store
 void updateFolder(Folder folder)
           updateFolder
 void updateFolder(Folder folder, boolean deep)
          Update a folder in persistent storage
 void updateLink(Link link)
           updateLink
 void updatePage(Page page)
           updatePage
 void updatePageSecurity(PageSecurity pageSecurity)
          Update a page security document in persistent storage
 
Methods inherited from class org.apache.jetspeed.page.AbstractPageManager
addListener, copyConstraint, copyFolder, copyFragment, copyLink, copyMenuDefinitions, copyMenuElement, copyPage, copyPageSecurity, copySecurityConstraints, createUserHomePagesFromRoles, deepCopyFolder, folderExists, getConstraintsEnabled, getPermissionsEnabled, getUserFolder, getUserPage, linkExists, newFolder, newFolderMenuDefinition, newFolderMenuExcludeDefinition, newFolderMenuIncludeDefinition, newFolderMenuOptionsDefinition, newFolderMenuSeparatorDefinition, newFolderSecurityConstraint, newFragmentPreference, newFragmentSecurityConstraint, newLink, newLinkSecurityConstraint, newPage, newPageMenuDefinition, newPageMenuExcludeDefinition, newPageMenuIncludeDefinition, newPageMenuOptionsDefinition, newPageMenuSeparatorDefinition, newPageSecurity, newPageSecurityConstraint, newPageSecuritySecurityConstraint, newSecurityConstraints, newSecurityConstraintsDef, notifyNewNode, notifyRemovedNode, notifyUpdatedNode, pageExists, removeListener, userFolderExists, userPageExists
 
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
addListener, copyFolder, copyFragment, copyLink, copyPage, copyPageSecurity, createUserHomePagesFromRoles, deepCopyFolder, folderExists, getConstraintsEnabled, getPermissionsEnabled, getUserFolder, getUserPage, linkExists, newFolder, newFolderMenuDefinition, newFolderMenuExcludeDefinition, newFolderMenuIncludeDefinition, newFolderMenuOptionsDefinition, newFolderMenuSeparatorDefinition, newFolderSecurityConstraint, newFragmentPreference, newFragmentSecurityConstraint, newLink, newLinkSecurityConstraint, newPage, newPageMenuDefinition, newPageMenuExcludeDefinition, newPageMenuIncludeDefinition, newPageMenuOptionsDefinition, newPageMenuSeparatorDefinition, newPageSecurity, newPageSecurityConstraint, newPageSecuritySecurityConstraint, newSecurityConstraints, newSecurityConstraintsDef, pageExists, removeListener, userFolderExists, userPageExists
 

Constructor Detail

CastorXmlPageManager

public CastorXmlPageManager(IdGenerator generator,
                            DocumentHandlerFactory handlerFactory,
                            FolderHandler folderHandler,
                            FileCache fileCache,
                            boolean permissionsEnabled,
                            boolean constraintsEnabled)
                     throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

newFragment

public Fragment newFragment()

newFragment

Specified by:
newFragment in interface PageManager
Overrides:
newFragment in class AbstractPageManager
Returns:
fragment
See Also:
PageManager.newFragment()

newPortletFragment

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

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

getPage

public Page getPage(java.lang.String path)
             throws PageNotFoundException,
                    NodeException

getPage

Specified by:
getPage in interface PageManager
Parameters:
path -
Returns:
page
Throws:
PageNotFoundException
NodeException
FolderNotFoundException
See Also:
PageManager.getPage(java.lang.String)

updatePage

public void updatePage(Page page)
                throws NodeException

updatePage

Specified by:
updatePage in interface PageManager
Parameters:
page - The page to be updated.
Throws:
NodeException
See Also:
org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)

removePage

public void removePage(Page page)
                throws NodeException

removePage

Specified by:
removePage in interface PageManager
Parameters:
page - The page to be removed.
Throws:
NodeException
See Also:
org.apache.jetspeed.services.page.PageManagerService#removePage(org.apache.jetspeed.om.page.Page)

getLink

public Link getLink(java.lang.String path)
             throws DocumentNotFoundException,
                    UnsupportedDocumentTypeException,
                    NodeException

getLink

Specified by:
getLink in interface PageManager
Parameters:
path -
Returns:
link
Throws:
DocumentNotFoundException
UnsupportedDocumentTypeException
NodeException
PageNotFoundException - if the page cannot be found
See Also:
PageManager.getLink(java.lang.String)

updateLink

public void updateLink(Link link)
                throws NodeException

updateLink

Specified by:
updateLink in interface PageManager
Parameters:
link - The link to be updated.
Throws:
NodeException
See Also:
org.apache.jetspeed.services.page.PageManagerService#updateLink(org.apache.jetspeed.om.page.Link)

removeLink

public void removeLink(Link link)
                throws NodeException

removeLink

Specified by:
removeLink in interface PageManager
Parameters:
link - The link to be removed.
Throws:
NodeException
See Also:
org.apache.jetspeed.services.page.PageManagerService#removeLink(org.apache.jetspeed.om.page.Link)

checkConstraint

public boolean checkConstraint(java.lang.String securityConstraintName,
                               java.lang.String actions)
Description copied from interface: PageManager
For a given security constraint definition name, and the given action(s), make a constraint check for the current user subject

Specified by:
checkConstraint in interface PageManager
Parameters:
securityConstraintName - the name of the security constraint definition
actions - one or more portlet actions (view,edit,help,..)
Returns:

getPageSecurity

public PageSecurity getPageSecurity()
                             throws DocumentNotFoundException,
                                    UnsupportedDocumentTypeException,
                                    NodeException

getPageSecurity

Specified by:
getPageSecurity in interface PageManager
Returns:
page security instance
Throws:
DocumentNotFoundException
UnsupportedDocumentTypeException
NodeException
See Also:
PageManager.getPageSecurity()

updatePageSecurity

public void updatePageSecurity(PageSecurity pageSecurity)
                        throws NodeException,
                               FailedToUpdateDocumentException
Description copied from interface: PageManager
Update a page security document in persistent storage

Specified by:
updatePageSecurity in interface PageManager
Parameters:
pageSecurity - The document to be updated.
Throws:
NodeException
FailedToUpdateDocumentException

removePageSecurity

public void removePageSecurity(PageSecurity pageSecurity)
                        throws NodeException,
                               FailedToDeleteDocumentException
Description copied from interface: PageManager
Remove a page security document.

Specified by:
removePageSecurity in interface PageManager
Parameters:
pageSecurity - The document to be removed.
Throws:
NodeException
FailedToDeleteDocumentException

getFolder

public Folder getFolder(java.lang.String folderPath)
                 throws FolderNotFoundException,
                        InvalidFolderException,
                        NodeException

getFolder

Specified by:
getFolder in interface PageManager
Parameters:
folderPath -
Returns:
folder instance
Throws:
FolderNotFoundException
NodeException
InvalidFolderException
See Also:
PageManager.getFolder(java.lang.String)

getFolders

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

getFolders

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

Specified by:
getFolders in interface PageManager
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

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

getFolder

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

Specified by:
getFolder in interface PageManager
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

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

getPages

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

Specified by:
getPages in interface PageManager
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

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

getPage

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

Specified by:
getPage in interface PageManager
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

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

getLinks

Specified by:
getLinks in interface PageManager
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

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

getLink

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

Specified by:
getLink in interface PageManager
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

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

getPageSecurity

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

Specified by:
getPageSecurity in interface PageManager
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

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

getAll

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

Specified by:
getAll in interface PageManager
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)

updateFolder

public void updateFolder(Folder folder)
                  throws NodeException,
                         FolderNotUpdatedException

updateFolder

Specified by:
updateFolder in interface PageManager
Parameters:
folder - The folder to be updated.
Throws:
NodeException
FolderNotUpdatedException
See Also:
org.apache.jetspeed.services.page.PageManagerService#updateFolder(org.apache.jetspeed.om.folder.Folder)

updateFolder

public void updateFolder(Folder folder,
                         boolean deep)
                  throws NodeException,
                         FolderNotUpdatedException
Description copied from interface: PageManager
Update a folder in persistent storage

Specified by:
updateFolder in interface PageManager
Parameters:
folder - The folder to be updated.
deep - Flag to control recursive deep updates.
Throws:
NodeException
FolderNotUpdatedException

removeFolder

public void removeFolder(Folder folder)
                  throws NodeException

removeFolder

Specified by:
removeFolder in interface PageManager
Throws:
NodeException
See Also:
org.apache.jetspeed.services.page.PageManagerService#removeFolder(org.apache.jetspeed.om.folder.Folder)

reset

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

Specified by:
reset in interface PageManager
Overrides:
reset in class AbstractPageManager

refresh

public void refresh(FileCacheEntry entry)
             throws java.lang.Exception

refresh file cache entry

Specified by:
refresh in interface FileCacheEventListener
Parameters:
entry -
Throws:
java.lang.Exception
See Also:
FileCacheEventListener.refresh(org.apache.jetspeed.cache.file.FileCacheEntry)

evict

public void evict(FileCacheEntry entry)
           throws java.lang.Exception

evict file cache entry

Specified by:
evict in interface FileCacheEventListener
Parameters:
entry -
Throws:
java.lang.Exception
See Also:
FileCacheEventListener.evict(org.apache.jetspeed.cache.file.FileCacheEntry)

getContentPage

public ContentPage getContentPage(java.lang.String path)
                           throws PageNotFoundException,
                                  NodeException
Description copied from interface: PageManager

ContentPage

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

Specified by:
getContentPage in interface PageManager
Throws:
PageNotFoundException - if the page cannot be found
NodeException
See Also:
ContentPage, Fragment

copy

public Page copy(Page source)

addPages

public int addPages(Page[] pages)
             throws NodeException
Specified by:
addPages in interface PageManager
Returns:
Throws:
NodeException


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