@ProviderType public interface Page extends Adaptable, LabeledResource
Modifier and Type | Method and Description |
---|---|
boolean |
canUnlock()
Return a flag indicating whether the current user can unlock a page.
|
Page |
getAbsoluteParent(int level)
Returns the absolute parent page.
|
Resource |
getContentResource()
Returns the resource of the page's content or
null if
the page has no content. |
Resource |
getContentResource(java.lang.String relPath)
Returns the addressed resource of the page's content or
null
if the respective resource does not exist. |
java.util.Calendar |
getDeleted()
Checks if the page is in a deletion process
|
java.lang.String |
getDeletedBy()
Return the user id that triggered the deletion of page
or
null if the page was not deleted. |
int |
getDepth()
Returns the hierarchical depth of the page.
|
java.util.Locale |
getLanguage()
Returns the content language of the page.
|
java.util.Locale |
getLanguage(boolean ignoreContent)
Returns the content language of the page.
|
java.util.Calendar |
getLastModified()
Returns the time when the page was last modified or
null if
this information is not available or if the page has no content. |
java.lang.String |
getLastModifiedBy()
Return the user id that last modified the page or
null if this
information is not available or if the page has no content. |
java.lang.String |
getLockOwner()
Return the lock owner of a page.
|
java.lang.String |
getName()
Returns the name of the page.
|
java.lang.String |
getNavigationTitle()
Returns the navigation title of the page or
null if none
defined. |
java.util.Calendar |
getOffTime()
Returns the
offTime of the page. |
java.util.Calendar |
getOnTime()
Returns the
onTime of the page. |
PageManager |
getPageManager()
Convenience method that returns the manager of this page.
|
java.lang.String |
getPageTitle()
Returns the page title of the page or
null if none defined. |
Page |
getParent()
Returns the parent page if it's resource adapts to page.
|
Page |
getParent(int level)
Returns the relative parent page.
|
java.lang.String |
getPath()
Returns the path of the page.
|
ValueMap |
getProperties()
Returns a value map of the page content.
|
ValueMap |
getProperties(java.lang.String relPath)
Returns a value map of the address content of the page.
|
Tag[] |
getTags()
Returns the tags set on this page.
|
Template |
getTemplate()
Returns the template that was used to create this page or
null
if none defined or the current user does not have read access to the
template resource specified by the path in the page's template property. |
java.lang.String |
getTitle()
Returns the title of the page or
null if none defined. |
java.lang.String |
getVanityUrl()
Returns the vanity url.
|
boolean |
hasChild(java.lang.String name)
Checks if the page has a child page named
name |
boolean |
hasContent()
Checks if the page has content attached.
|
boolean |
isHideInNav()
Returns the "hideInNav" flag or
false if non defined. |
boolean |
isLocked()
Checks if this page is locked.
|
boolean |
isValid()
Checks if the page is valid.
|
java.util.Iterator<Page> |
listChildren()
Returns an iterator over all child resources that adapt to a page.
|
java.util.Iterator<Page> |
listChildren(Filter<Page> filter)
Returns an iterator over all child resources that adapt to a page and
that are included in the given filter.
|
java.util.Iterator<Page> |
listChildren(Filter<Page> filter,
boolean deep)
Returns an iterator over descendant resources that adapt to a page and
that are included in the given filter.
|
void |
lock()
Lock a page.
|
long |
timeUntilValid()
Returns the number of milliseconds when this page gets valid.
|
void |
unlock()
Unlock a page.
|
getDescription
java.lang.String getPath()
getPath
in interface LabeledResource
PageManager getPageManager()
Resource getContentResource()
null
if
the page has no content.null
hasContent()
Resource getContentResource(java.lang.String relPath)
null
if the respective resource does not exist. If relPath
is
null
or an empty string the toplevel content resource is
returned.relPath
- relative path into contentnull
java.lang.IllegalArgumentException
- if path is not relative.java.util.Iterator<Page> listChildren()
java.util.Iterator<Page> listChildren(Filter<Page> filter)
filter
- for iteration. may be null
java.util.Iterator<Page> listChildren(Filter<Page> filter, boolean deep)
filter
- for iteration. may be null
deep
- false traverses only children; true traverses all descendantsboolean hasChild(java.lang.String name)
name
name
- Name of the childtrue
if the page has this child;
false
otherwise.int getDepth()
getParent()
calls would be needed to reach the root node.Page getParent()
null
Page getParent(int level)
null
is returned.
Example (this path == /content/geometrixx/en/products)
| level | returned | | 0 | /content/geometrixx/en/products | | 1 | /content/geometrixx/en | | 2 | /content/geometrixx | | 3 | /content | | 4 | null |
level
- hierarchy level of the parent page to retrievenull
Page getAbsoluteParent(int level)
null
is returned.
Example (this path == /content/geometrixx/en/products)
| level | returned | | 0 | /content | | 1 | /content/geometrixx | | 2 | /content/geometrixx/en | | 3 | /content/geometrixx/en/products | | 4 | null |
level
- hierarchy level of the parent page to retrievenull
ValueMap getProperties()
hasContent()
ValueMap getProperties(java.lang.String relPath)
null
is returned. If relPath
is
null
or an empty string the toplevel content properties are
returned.relPath
- relative path to the contentnull
java.lang.IllegalArgumentException
- of the given path is not relative.java.lang.String getName()
getName
in interface LabeledResource
java.lang.String getTitle()
null
if none defined.
The title is a short form of the page title, usually displayed in the
site admin.getTitle
in interface LabeledResource
java.lang.String getPageTitle()
null
if none defined.java.lang.String getNavigationTitle()
null
if none
defined. The navigation title is usually used when drawing navigation
links.boolean isHideInNav()
false
if non defined.
The hideInNav flag is usually used to control if a page should be
displayed in a navigation.boolean hasContent()
true
if the page has content;
false
otherwise.boolean isValid()
true
if the page is valid;
false
otherwise.long timeUntilValid()
0
is returned. If the page is out dated,
i.e. the offTime is in the past, a negative number is returned. If this
page has no content Long.MIN_VALUE
is returned.java.util.Calendar getOnTime()
onTime
of the page. The onTime defines after
which time it is valid. If no onTime is specified null
is
returned and the onTime is not respected in the isValid()
calculation.null
java.util.Calendar getOffTime()
offTime
of the page. The offTime defines before
which time it is valid. If no offTime is specified null
is
returned and the offTime is not respected in the isValid()
calculation.null
java.util.Calendar getDeleted()
modification date
if the page is in process to be deleted
null
otherwise.java.lang.String getDeletedBy()
null
if the page was not deleted.null
java.lang.String getLastModifiedBy()
null
if this
information is not available or if the page has no content.null
java.util.Calendar getLastModified()
null
if
this information is not available or if the page has no content.null
java.lang.String getVanityUrl()
null
Tag[] getTags()
void lock() throws WCMException
WCMException
- if an error during this operation occurs.boolean isLocked()
true
if this page is locked.java.lang.String getLockOwner()
null
if the page is not lockedboolean canUnlock()
true
if the page can be unlocked;
false
otherwisevoid unlock() throws WCMException
WCMException
- if an error during this operation occurs.Template getTemplate()
null
if none defined or the current user does not have read access to the
template resource specified by the path in the page's template property.
This is the case on publish instances using default ACL configuration
(anonymous cannot read templates).null
java.util.Locale getLanguage(boolean ignoreContent)
jcr:language
property containing
the iso codes for language and country. if the property is not defined
on this page all ancestors are search for such an property. If no language
is defined at all, the path is examined if it contains a iso label. If no
language can be found at all, the systems default locale is returned.
If ignoreConent
is true
, only the names of the
path is used to determine the language.
Note that this has nothing to do with i18n of the cq5 itself.ignoreContent
- if true
only the path is used to
determine the language.java.util.Locale getLanguage()
jcr:language
property containing
the iso codes for language and country. if the property is not defined
on this page all ancestors are search for such an property. If no language
is defined at all, the path is examined if it contains a iso label. If no
language can be found at all, the systems default locale is returned.
Note that this has nothing to do with i18n of the cq5 itself.Copyright © 2010 - 2020 Adobe. All Rights Reserved