org.apache.jetspeed.om.page
Interface ContentPage


public interface ContentPage

ContentPage is a read-only version of the Page object for use in rendering. Page objects are persistent, single-instance metadata objects that should not be used to hold per-request content. ContentPage solves this by providing a parallel interface that can be used for rendering requested content associated with the current user-request.

Author:
weaver@apache.org

Method Summary
 ContentFragment addFragmentAtRowColumn(ContentFragment fragment, int row, int column)
          Add fragment to page at specified row column layout position.
 ContentFragment addFragmentReference(java.lang.String id)
          Add fragment reference to page returning associated content fragment.
 ContentFragment addPortlet(java.lang.String type, java.lang.String name)
          Add portlet to page returning associated content fragment.
 void checkAccess(java.lang.String actions)
          Check security access to page.
 void decrementFolderInDocumentOrder()
          Decrement position of folder in parent folder document order.
 void decrementInDocumentOrder()
          Decrement position of page in folder document order.
 java.lang.String getContentType()
          Get the content type name that applies to this page.
 java.lang.String getDefaultDecorator(java.lang.String fragmentType)
          Returns the name of the default decorator that applies in this page to fragments of the specified type
 java.lang.String getDefId()
          Returns the id of the defined root fragment element.
 java.lang.String getEffectiveDefaultDecorator(java.lang.String fragmentType)
          Returns the name of the default decorator as set here or in parent folders that applies in this page to fragments of the specified type.
 ContentFragment getFragmentByFragmentId(java.lang.String id)
          Returns a ContentFragment represented by the underlying PSML Fragment fragment.
 ContentFragment getFragmentByFragmentId(java.lang.String id, boolean nonTemplate)
          Returns a ContentFragment represented by the underlying PSML Fragment fragment.
 ContentFragment getFragmentById(java.lang.String id)
          Returns a ContentFragment represented by the fragment id argument.
 java.util.Map getFragmentDefinitions()
          Access underlying concrete persistent fragment definitions map or null if page is transient or constructed dynamically.
 int getFragmentNestingLevel(java.lang.String fragmentId)
          Compute fragment nesting level of fragment by id.
 java.util.List getFragmentsByName(java.lang.String name)
          Returns a list of ContentFragment fragments represented by the name argument.
 java.util.List getFragmentsByName(java.lang.String name, boolean nonTemplate)
          Returns a list of ContentFragment fragments represented by the name argument.
 java.lang.String getId()
          Returns the unique Id of this element.
 GenericMetadata getMetadata()
          Return page metadata.
 java.lang.String getName()
          Returns the name of this page.
 ContentFragment getNonTemplateRootFragment()
          Returns the root layout fragment which is not merged from a page template.
 PageLayoutComponent getPageLayoutComponent()
          Returns the PageLayoutComponent that generated this ContentPage
 BaseFragmentsElement getPageOrTemplate()
          Access underlying concrete persistent page, template, or null if page is transient or constructed dynamically.
 PageTemplate getPageTemplate()
          Access underlying concrete persistent page template or null if page is transient or constructed dynamically.
 java.lang.String getPath()
          Returns the path of this page.
 ContentFragment getRootFragment()
          Provides access to a per-request safe ContentFragment.
 java.lang.String getShortTitle()
          Returns the short title in the default Locale
 java.lang.String getShortTitle(java.util.Locale locale)
          Returns the short title for the specified locale.
 java.lang.String getSkin()
          Returns the name of the default skin that applies to this page.
 java.lang.String getTitle()
          Returns the title in the default Locale
 java.lang.String getTitle(java.util.Locale locale)
          Returns the title for the specified locale.
 java.lang.String getUrl()
          Returns URL of page.
 void incrementFolderInDocumentOrder()
          Increment position of folder in parent folder document order.
 void incrementInDocumentOrder()
          Increment position of page in folder document order.
 boolean isHidden()
          Whether or not this Node should be hidden in terms of the view.
 boolean isInheritable()
          Get inheritable flag that indicates whether this dynamic page can be inherited for child content pages.
 void moveFragment(java.lang.String fragmentId, java.lang.String fromFragmentId, java.lang.String toFragmentId)
          Move fragment from current parent layout fragment to another layout fragment in the same page.
 void newSiblingDynamicPage(java.lang.String pageName, java.lang.String contentType, java.lang.String layoutName, java.lang.String pageTitle, java.lang.String pageShortTitle)
          Create new sibling dynamic page with specified configuration.
 void newSiblingFolder(java.lang.String folderName, java.lang.String folderTitle, java.lang.String folderShortTitle, java.lang.String defaultPageLayoutName)
          Create a new sibling folder with specified configuration and new default page.
 void newSiblingFragmentDefinition(java.lang.String definitionName, java.lang.String defId, java.lang.String portletName, java.lang.String definitionTitle, java.lang.String definitionShortTitle)
          Create new sibling fragment definition with specified configuration.
 void newSiblingPage(java.lang.String pageName, java.lang.String layoutName, java.lang.String pageTitle, java.lang.String pageShortTitle)
          Create new sibling page with specified configuration and add new page at end of folder document order list.
 void newSiblingPageTemplate(java.lang.String templateName, java.lang.String layoutName, java.lang.String templateTitle, java.lang.String templateShortTitle)
          Create new sibling page template with specified configuration.
 void overrideDefaultDecorator(java.lang.String decoratorName, java.lang.String fragmentType)
          Override page default decorator.
 void remove()
          Remove page and remove from folder document order list.
 void removeFolder()
          Remove folder and remove from parent folder document order list.
 void removeFragment(java.lang.String fragmentId)
          Remove fragment from page by id.
 void updateContent(java.lang.String contentType, java.lang.Boolean inheritable)
          Update dynamic page content type and inheritable flag.
 void updateDefaultDecorator(java.lang.String decoratorName, java.lang.String fragmentType)
          Update page default decorator.
 void updateFolderTitles(java.lang.String title, java.lang.String shortTitle)
          Update folder titles.
 void updateTitles(java.lang.String title, java.lang.String shortTitle)
          Update page titles.
 

Method Detail

checkAccess

void checkAccess(java.lang.String actions)
                 throws java.lang.SecurityException
Check security access to page.

Parameters:
actions - list to be checked against in CSV string form
Throws:
java.lang.SecurityException

getId

java.lang.String getId()
Returns the unique Id of this element. This id is guaranteed to be unique from the complete portal and is suitable to be used as a unique key.

Returns:
the unique id of this element.

getTitle

java.lang.String getTitle()
Returns the title in the default Locale

Returns:
the page title

getShortTitle

java.lang.String getShortTitle()
Returns the short title in the default Locale

Returns:
the page short title

getMetadata

GenericMetadata getMetadata()
Return page metadata.

Returns:
page metadata

getName

java.lang.String getName()
Returns the name of this page.

Returns:
page name

getPath

java.lang.String getPath()
Returns the path of this page.

Returns:
page path

getShortTitle

java.lang.String getShortTitle(java.util.Locale locale)
Returns the short title for the specified locale.

Parameters:
locale -
Returns:
localized title of this Node.

getTitle

java.lang.String getTitle(java.util.Locale locale)
Returns the title for the specified locale.

Parameters:
locale -
Returns:
localized title of this Node.

getUrl

java.lang.String getUrl()
Returns URL of page.

Returns:
page URL

isHidden

boolean isHidden()
Whether or not this Node should be hidden in terms of the view.

Returns:
hidden flag

getSkin

java.lang.String getSkin()
Returns the name of the default skin that applies to this page.

Returns:
the page default skin name

getDefaultDecorator

java.lang.String getDefaultDecorator(java.lang.String fragmentType)
Returns the name of the default decorator that applies in this page to fragments of the specified type

Parameters:
fragmentType - the type of fragment considered
Returns:
the decorator name for the selected type

getRootFragment

ContentFragment getRootFragment()
Provides access to a per-request safe ContentFragment. ContentFragments add the additional ability to temporarily store rendered content of the current request along with original.

Returns:
root ContentFragment fragment.

getFragmentById

ContentFragment getFragmentById(java.lang.String id)
Returns a ContentFragment represented by the fragment id argument.

Parameters:
id - unique id of the ContentFragment we want to retrieve.
Returns:

getFragmentByFragmentId

ContentFragment getFragmentByFragmentId(java.lang.String id)
Returns a ContentFragment represented by the underlying PSML Fragment fragment.

Parameters:
id - unique id of the ContentFragment we want to retrieve.
Returns:

getFragmentsByName

java.util.List getFragmentsByName(java.lang.String name)
Returns a list of ContentFragment fragments represented by the name argument.

Parameters:
name - name of the ContentFragments we want to retrieve.
Returns:
list of ContentFragment

getEffectiveDefaultDecorator

java.lang.String getEffectiveDefaultDecorator(java.lang.String fragmentType)
Returns the name of the default decorator as set here or in parent folders that applies in this page to fragments of the specified type.

Parameters:
fragmentType - the type of fragment considered
Returns:
the decorator name for the selected type

getContentType

java.lang.String getContentType()
Get the content type name that applies to this page.

Returns:
the page type name

isInheritable

boolean isInheritable()
Get inheritable flag that indicates whether this dynamic page can be inherited for child content pages.

Returns:
inheritable flag

getDefId

java.lang.String getDefId()
Returns the id of the defined root fragment element.

Returns:
the defined root fragment id

getPageOrTemplate

BaseFragmentsElement getPageOrTemplate()
Access underlying concrete persistent page, template, or null if page is transient or constructed dynamically.

Returns:
persistent page or null

getPageTemplate

PageTemplate getPageTemplate()
Access underlying concrete persistent page template or null if page is transient or constructed dynamically.

Returns:
persistent page template or null

getFragmentDefinitions

java.util.Map getFragmentDefinitions()
Access underlying concrete persistent fragment definitions map or null if page is transient or constructed dynamically.

Returns:
persistent fragment definitions or null

getPageLayoutComponent

PageLayoutComponent getPageLayoutComponent()
Returns the PageLayoutComponent that generated this ContentPage

Returns:
PageLayoutComponent instance.

overrideDefaultDecorator

void overrideDefaultDecorator(java.lang.String decoratorName,
                              java.lang.String fragmentType)
Override page default decorator.

Parameters:
decoratorName - decorator name
fragmentType - decorator fragment type

getFragmentByFragmentId

ContentFragment getFragmentByFragmentId(java.lang.String id,
                                        boolean nonTemplate)
Returns a ContentFragment represented by the underlying PSML Fragment fragment.

Parameters:
id - unique id of the content fragment we want to retrieve.
nonTemplate - return only non-template matching fragments
Returns:
first matching content fragment

getFragmentsByName

java.util.List getFragmentsByName(java.lang.String name,
                                  boolean nonTemplate)
Returns a list of ContentFragment fragments represented by the name argument.

Parameters:
name - name of the content fragments we want to retrieve.
nonTemplate - return only non-template matching fragments
Returns:
list of matching content fragments

getNonTemplateRootFragment

ContentFragment getNonTemplateRootFragment()
Returns the root layout fragment which is not merged from a page template.

Returns:
root non-template layout content fragment

addFragmentAtRowColumn

ContentFragment addFragmentAtRowColumn(ContentFragment fragment,
                                       int row,
                                       int column)
Add fragment to page at specified row column layout position.

Parameters:
fragment - externally constructed fragment to add
row - fragment row position
column - fragment column position

addFragmentReference

ContentFragment addFragmentReference(java.lang.String id)
Add fragment reference to page returning associated content fragment.

Parameters:
id - fragment definition id
Returns:
new content fragment added to page

addPortlet

ContentFragment addPortlet(java.lang.String type,
                           java.lang.String name)
Add portlet to page returning associated content fragment.

Parameters:
type - portlet type
name - portlet name
Returns:
new content fragment added to page

decrementFolderInDocumentOrder

void decrementFolderInDocumentOrder()
Decrement position of folder in parent folder document order.


decrementInDocumentOrder

void decrementInDocumentOrder()
Decrement position of page in folder document order.


getFragmentNestingLevel

int getFragmentNestingLevel(java.lang.String fragmentId)
Compute fragment nesting level of fragment by id. Fragment level returned is 0 if root fragment, 1 if in root fragment collection, etc.

Parameters:
fragmentId - target fragment id
Returns:
fragment nesting level or -1 if not found

incrementFolderInDocumentOrder

void incrementFolderInDocumentOrder()
Increment position of folder in parent folder document order.


incrementInDocumentOrder

void incrementInDocumentOrder()
Increment position of page in folder document order.


moveFragment

void moveFragment(java.lang.String fragmentId,
                  java.lang.String fromFragmentId,
                  java.lang.String toFragmentId)
Move fragment from current parent layout fragment to another layout fragment in the same page.

Parameters:
fragmentId - fragment id of fragment to move
fromFragmentId - fragment id of current parent layout fragment
toFragmentId - fragment id of new parent layout fragment

newSiblingFolder

void newSiblingFolder(java.lang.String folderName,
                      java.lang.String folderTitle,
                      java.lang.String folderShortTitle,
                      java.lang.String defaultPageLayoutName)
Create a new sibling folder with specified configuration and new default page. Also, adds folder to end of page folder document order list. The default page is added to the new folder document order list. Both title and short title parameters default to page name if not specified. The layout fragment name for the default page is cloned from this content page if not specified. Default decorators are cloned from this content page.

Parameters:
folderName - unique new folder name, (also used as default page title)
folderTitle - new folder title or null
folderShortTitle - new folder short title or null
defaultPageLayoutName - root level layout fragment name for default page

newSiblingPage

void newSiblingPage(java.lang.String pageName,
                    java.lang.String layoutName,
                    java.lang.String pageTitle,
                    java.lang.String pageShortTitle)
Create new sibling page with specified configuration and add new page at end of folder document order list. Both title and short title parameters default to page name if not specified. The layout fragment name is cloned from this content page if not specified. Default decorators are cloned from this content page.

Parameters:
pageName - unique new page name
layoutName - root level layout fragment name or null
pageTitle - new page title or null
pageShortTitle - new page short title or null

newSiblingDynamicPage

void newSiblingDynamicPage(java.lang.String pageName,
                           java.lang.String contentType,
                           java.lang.String layoutName,
                           java.lang.String pageTitle,
                           java.lang.String pageShortTitle)
Create new sibling dynamic page with specified configuration. Both title and short title parameters default to page name if not specified. The layout fragment name is cloned from this content page if not specified. Default decorators are cloned from this content page.

Parameters:
pageName - unique new dynamic page name
contentType - dynamic page content type
layoutName - root level layout fragment name or null
pageTitle - new page title or null
pageShortTitle - new page short title or null

newSiblingPageTemplate

void newSiblingPageTemplate(java.lang.String templateName,
                            java.lang.String layoutName,
                            java.lang.String templateTitle,
                            java.lang.String templateShortTitle)
Create new sibling page template with specified configuration. The layout fragment name is cloned from this content page if not specified. Default decorators are cloned from this content page.

Parameters:
templateName - unique new page template name
layoutName - root level layout fragment name or null
templateTitle - new page title or null
templateShortTitle - new page short title or null

newSiblingFragmentDefinition

void newSiblingFragmentDefinition(java.lang.String definitionName,
                                  java.lang.String defId,
                                  java.lang.String portletName,
                                  java.lang.String definitionTitle,
                                  java.lang.String definitionShortTitle)
Create new sibling fragment definition with specified configuration.

Parameters:
definitionName - unique new fragment definition name
defId - unique new fragment definition id or null
portletName - root level portlet fragment name or null
definitionTitle - new page title or null
definitionShortTitle - new page short title or null

removeFragment

void removeFragment(java.lang.String fragmentId)
Remove fragment from page by id.

Parameters:
fragmentId - id of fragment to remove

remove

void remove()
Remove page and remove from folder document order list.


removeFolder

void removeFolder()
Remove folder and remove from parent folder document order list.


updateContent

void updateContent(java.lang.String contentType,
                   java.lang.Boolean inheritable)
Update dynamic page content type and inheritable flag.

Parameters:
contentType - dynamic page content type
contentType - dynamic page content type

updateDefaultDecorator

void updateDefaultDecorator(java.lang.String decoratorName,
                            java.lang.String fragmentType)
Update page default decorator.

Parameters:
decoratorName - decorator name
fragmentType - decorator fragment type

updateFolderTitles

void updateFolderTitles(java.lang.String title,
                        java.lang.String shortTitle)
Update folder titles.

Parameters:
title - folder title
shortTitle - folder short title

updateTitles

void updateTitles(java.lang.String title,
                  java.lang.String shortTitle)
Update page titles.

Parameters:
title - page title
shortTitle - page short title


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.