Package nl.gx.webmanager.cms.core
Interface Page
-
- All Superinterfaces:
ContentItem<PageVersion>
,Wrapper
@Indexable public interface Page extends Wrapper, ContentItem<PageVersion>
Representation of Page object.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATABASEPAGE_TYPE
page type for database pages.static String
PAGE_TYPE
Page type for normal pages.static String
PAGEMODEL_TYPE
Deprecated.static String
PAGESECTION_TYPE
Page type for page sections.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addBlock(Page pageSection)
Adds the given page section to the page in case the page uses its own page section configuration (so hasOwnBlockConfig() returns true).void
addBlockLabel(BlockLabel pageSectionLabel)
Appends a page section label to this page.BlockLabel
getBlockLabel()
Deprecated.usegetBlockLabels()
insteadBlockLabel[]
getBlockLabels()
Return page section labels associated with the page (if it is a page section) or null.Page[]
getBlocks()
Returns the page sections assigned to this page.Page[]
getBlocks(BlockLabel[] labels)
Returns the page sections assigned to this page with the given label(s).PageVersion
getCurrent()
Returns the current version of this content item.PageVersion
getCurrent(Language language)
Returns the current version of this content item in the specified language.Language
getDefaultEditingLanguage()
Deprecated.PageVersion
getEditVersion(javax.servlet.http.HttpServletRequest request)
Return version of the page you're currently editing.int
getId()
Returns the ID of the wrapped object.Link
getIncontextLink()
Returns the incontext Link to this pageRelatedInternalLink[]
getInternalLinksToPage()
Returns all internal links that refer to this page.Page
getLevel1Page()
Return a level 1 page (subpage from the homepage).Page
getLevelPage(int level)
Returns the page for specific level (level 0 is the homepage).MediaItemPageVersion
getMediaItemPageVersion()
If this page is stored in the content repository, this method returns the media item page version in the current editing language.String
getPageType()
Returns the page type of this page.Page
getParent()
Return the parent page.Page[]
getParents()
Return parent, parent's parent, etc.PageVersion
getPlanned()
Returns the planned version of this content item.PageVersion
getPlanned(Language language)
Returns the planned version of this content item.Page[]
getSubPages()
Return sub pages.boolean
getUseExpirationDate()
Indicates if the expiration date of this page should be taken into account to determine if the page is active.boolean
getUseHTTPS()
Indicates if this page should be served using the HTTPS protocol instead of HTTP.PageVersion[]
getVersions()
Returns allContentItemVersion
s this content item has.PageVersion[]
getVersions(Language language)
Returns all content items versions within the given language.Website
getWebsite()
Returns the website that owns this content item.WorkflowModel
getWorkflowModel()
Return the Workflow model assigned to this page or that is inherited from a parent page.boolean
hasInheritedWorkflowModel()
Returns if the Workflow model of this page was inherited from a super page or assigned directly to the page itself.boolean
hasOwnBasicConfig()
Returns if the option "Define other settings for this page" is enabled, which means that this page has its own general settings (for use expiration date, use HTTPS, language and any future enhancements).boolean
hasOwnBlockConfig()
Returns true if the page does not inherit the page sections from a other page.boolean
hasOwnOverruleConfig()
Returns if the design is inherited from a other pageboolean
isBlock()
Return true if the page is a page section.boolean
isStoredInContentRepository()
Returns true if this page is stored as media page in the content repository, false otherwise.void
removeAllBlocks()
Removes all page sections assigned to the page in case the page uses its own page section configuration (so hasOwnBlockConfig() returns true).void
removeBlock(Page pageSection)
Removes the given page section assigned to the page in case the page uses its own page section configuration (so hasOwnBlockConfig() returns true).void
removeBlockLabel(BlockLabel pageSectionLabel)
Removes the specified page section label from this page.void
setBlockLabels(BlockLabel[] pageSectionLabels)
Sets the page section labels for this page.void
setDefaultEditingLanguage(Language language)
Deprecated.void
setOwnBasicConfig(boolean ownBasicConfig)
Sets if this page should have its own basic configuration or that it should inherit those from its parent page.void
setOwnBlockConfig(boolean ownPageSectionConfig)
Sets if the page must use a own page section configuration.void
setOwnOverruleConfig(boolean ownOverruleConfig)
Sets if the page must use the design overrule option.void
setPresentationInheritedFrom(Page inheritFromPage)
Sets the presentation of the given page to this page object.void
setUseExpirationDate(boolean useExpirationDate)
Sets if the expiration date of this page should be taken into account to determine if the page is active.void
setUseHTTPS(boolean useHTTPS)
Sets if this page should be served using the HTTPS protocol instead of HTTP.void
setWorkflowModel(WorkflowModel workflowModel)
Sets the Workflow model of the page.-
Methods inherited from interface nl.gx.webmanager.cms.core.ContentItem
getEditVersion, getEditVersionInLanguage, getIdentifier, getInternalLink, getLink, getMostRelevantVersion, getOriginId, getVersion
-
-
-
-
Field Detail
-
PAGE_TYPE
static final String PAGE_TYPE
Page type for normal pages.- See Also:
- Constant Field Values
-
PAGESECTION_TYPE
static final String PAGESECTION_TYPE
Page type for page sections. Note that the names "block" and "page section" both refer to the same concept.- See Also:
- Constant Field Values
-
PAGEMODEL_TYPE
@Deprecated static final String PAGEMODEL_TYPE
Deprecated.Page type for page models.- See Also:
- Constant Field Values
-
DATABASEPAGE_TYPE
static final String DATABASEPAGE_TYPE
page type for database pages.- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
@ReferField int getId()
Description copied from interface:Wrapper
Returns the ID of the wrapped object.
-
getVersions
PageVersion[] getVersions()
Description copied from interface:ContentItem
Returns allContentItemVersion
s this content item has. AContentItem
must have at least oneContentItemVersion
.In exceptional cases like these, the method returns an empty array:
- The
ContentItem
and therefore its last version has just been deleted within the current session. - The
Content Type
is inactive.
- Specified by:
getVersions
in interfaceContentItem<PageVersion>
- Returns:
- all versions, in exceptional cases only an empty array, never
null
- The
-
getVersions
PageVersion[] getVersions(Language language)
Description copied from interface:ContentItem
Returns all content items versions within the given language. Fallback languages are ignored here, even if fallback languages are enabled. So returned versions are guaranteed to have the specified language.
A content item can have zero or more content item versions within a language, but there exists one language for which a version is available.- Specified by:
getVersions
in interfaceContentItem<PageVersion>
- Parameters:
language
- the language of the versions to be returned.- Returns:
- all versions, or an empty array if there are no versions for the given language. Never returns
null
.
-
getCurrent
PageVersion getCurrent()
Description copied from interface:ContentItem
Returns the current version of this content item. Returns the exact same result asgetCurrent(null)
.- Specified by:
getCurrent
in interfaceContentItem<PageVersion>
- Returns:
- the current version, or
null
if there is no current version - See Also:
ContentItem.getCurrent(Language)
-
getCurrent
PageVersion getCurrent(Language language)
Description copied from interface:ContentItem
Returns the current version of this content item in the specified language. This method returns the exact same result asgetVersion(null, language, false, showDate)
, where showDate equals the in context date/time if specified (can only be the case for in context requests) or the current date/time otherwise.- Specified by:
getCurrent
in interfaceContentItem<PageVersion>
- Returns:
- the current version for this language, or
null
if there is no current version - See Also:
#getVersion(Boolean, Language, boolean, Date)
-
getWebsite
Website getWebsite()
Description copied from interface:ContentItem
Returns the website that owns this content item.- Specified by:
getWebsite
in interfaceContentItem<PageVersion>
- Returns:
- website Owner website of the content item.
-
getPlanned
PageVersion getPlanned()
Description copied from interface:ContentItem
Returns the planned version of this content item. Returns the exact same result asgetPlanned(null)
.- Specified by:
getPlanned
in interfaceContentItem<PageVersion>
- Returns:
- the planned version, or
null
if there is no planned version - See Also:
ContentItem.getPlanned(Language)
-
getPlanned
PageVersion getPlanned(Language language)
Description copied from interface:ContentItem
Returns the planned version of this content item. The planned version is defined as;- null if
getCurrent(language)
returns not null - Otherwise,
getVersion(false, null, false, null)
if it is not null - Otherwise, the version of the first language returned by
Website.getLanguages()
for whichgetVersion(false, lang, false, null)
is not null
- Specified by:
getPlanned
in interfaceContentItem<PageVersion>
- Returns:
- the planned version for this language, or
null
if there is no planned version - See Also:
#getVersion(Boolean, Language, boolean, Date)
- null if
-
getParent
Page getParent()
Return the parent page. Return null if current page is the homepage or cut loose.- Returns:
- parent page.
-
getParents
Page[] getParents()
Return parent, parent's parent, etc. Useful for breadcrumps path.- Returns:
- parent, parent's parent, etc.
-
getSubPages
Page[] getSubPages()
Return sub pages. Order of these pages is arbitrary; it does not reflect the order as configured in WebManager. Note that sub pages are returned which are marked as invisible for navigation in WebManager. In order to return pages which do reflect the correct order and which are not marked invisible usegetSubPages
of classPageVersion
instead.- Returns:
- sub pages.
- See Also:
PageVersion.getSubPages()
,PageVersion.getSubPagesWithCurrent()
-
getIncontextLink
Link getIncontextLink()
Returns the incontext Link to this page- Returns:
- Incontext Link to this page.
-
getLevelPage
Page getLevelPage(int level)
Returns the page for specific level (level 0 is the homepage).- Parameters:
level
- the specific level- Returns:
- page for specific level.
-
getLevel1Page
Page getLevel1Page()
Return a level 1 page (subpage from the homepage). Which page is returned depends on the current page (which is the result of getPage() on the presentationcontext). As pages are structured tree-like the page node returned is the one in the parent node path (starting with the current page node) including itself and the one which exists on level 1. Return value is null if the current page is the homepage, or if the page or its parents is cut loose.- Returns:
- level 1 page of the current page's parent path.
-
getBlockLabels
BlockLabel[] getBlockLabels()
Return page section labels associated with the page (if it is a page section) or null. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- page section labels associated with the page (if it is a page section) or null.
-
getBlockLabel
@Deprecated BlockLabel getBlockLabel()
Deprecated.usegetBlockLabels()
insteadReturn the first page section label associated with the page (if it is a page section) or null.- Returns:
- the first page section label associated with the page (if it is a page section) or null.
-
setBlockLabels
void setBlockLabels(BlockLabel[] pageSectionLabels)
Sets the page section labels for this page. The provided array of page labels will overrule all page labels currently set on this page. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
pageSectionLabels
- The page section labels to set.
-
addBlockLabel
void addBlockLabel(BlockLabel pageSectionLabel)
Appends a page section label to this page. If the page section label is already assigned to this page, this method does nothing. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
pageSectionLabel
- The page section label to append to this page.
-
removeBlockLabel
void removeBlockLabel(BlockLabel pageSectionLabel)
Removes the specified page section label from this page. This method does nothing if this page section label is not assigned to this page. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
pageSectionLabel
- The page section label to remove from this page.
-
isBlock
boolean isBlock()
Return true if the page is a page section. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- true if the page is a page section.
-
getPageType
String getPageType()
Returns the page type of this page. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- page type of this page, one of
page
orblock
-
getInternalLinksToPage
RelatedInternalLink[] getInternalLinksToPage()
Returns all internal links that refer to this page.- Returns:
- Array of all internal links that refer to this page
-
hasOwnBasicConfig
boolean hasOwnBasicConfig()
Returns if the option "Define other settings for this page" is enabled, which means that this page has its own general settings (for use expiration date, use HTTPS, language and any future enhancements). If the page does not have its own settings but inherits them from another page (which is the parent page by default), this method returns false.- Returns:
- true if if the option "Define other settings for this page" is enabled
-
hasOwnBlockConfig
boolean hasOwnBlockConfig()
Returns true if the page does not inherit the page sections from a other page. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- true if the page has a own page section configuration
-
hasOwnOverruleConfig
boolean hasOwnOverruleConfig()
Returns if the design is inherited from a other page- Returns:
- true if the design is inherited from other page
-
setOwnBasicConfig
void setOwnBasicConfig(boolean ownBasicConfig)
Sets if this page should have its own basic configuration or that it should inherit those from its parent page. If true is passed, a new basic configuration is created and assigned to this page, if it was not present already. This will not effect any subpages of this page which did inherit its basic configuration from the parent of this page. If false is passed, any basic configuration that is assigned to this page is removed. Instead, this page will now inherit its basic configuration from its parent page. Any other (sub) pages that did inherit the basic configuration from this page will now also inherit the basic configuration of the parent page. If false is passed and this is a root page (for example the home page), this method logs a WAARNING but does nothing.- Parameters:
ownBasicConfig
-
-
setOwnOverruleConfig
void setOwnOverruleConfig(boolean ownOverruleConfig)
Sets if the page must use the design overrule option.- Parameters:
ownOverruleConfig
-
-
setOwnBlockConfig
void setOwnBlockConfig(boolean ownPageSectionConfig)
Sets if the page must use a own page section configuration. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
ownPageSectionConfig
-
-
setPresentationInheritedFrom
void setPresentationInheritedFrom(Page inheritFromPage)
Sets the presentation of the given page to this page object.- Parameters:
inheritFromPage
-
-
getDefaultEditingLanguage
@Deprecated Language getDefaultEditingLanguage()
Deprecated.This method is deprecated. Use Website#getDefaultContentLanguage instead. See issue https://connect.gxsoftware.com/jira/browse/GXWM-37863. Returns the default editing language of this page. This is the language that will be the default language in which content is being edited if the page is opened and the editor didn't specify the editing language.- Returns:
- the default editing language of this page
-
setDefaultEditingLanguage
@Deprecated void setDefaultEditingLanguage(Language language)
Deprecated.This method is deprecated. You can no longer set the default editing language with this method. For more information, see issue https://connect.gxsoftware.com/jira/browse/GXWM-37863- Parameters:
language
- the default editing language of this page to set
-
getUseExpirationDate
boolean getUseExpirationDate()
Indicates if the expiration date of this page should be taken into account to determine if the page is active. NB: it is left up to to the software component that determines the state to take this property into account or not, so changing this property may not always have the expected effect.- Returns:
- true if the expiration date of this page should be taken into account to determine if the page is active
-
setUseExpirationDate
void setUseExpirationDate(boolean useExpirationDate)
Sets if the expiration date of this page should be taken into account to determine if the page is active. NB: it is left up to to the software component that determines the state to take this property into account or not, so changing this property may not always have the expected effect. If this page does not have its own basic configuration (hasOwnBasicConfig returns false), this method will generate a WARNING message and do nothing. To set properties of the basic configuration, ensure that you set them from the page that owns it.- Parameters:
useExpirationDate
- true if the expiration date of this page should be taken into account to determine if the page is active
-
getUseHTTPS
boolean getUseHTTPS()
Indicates if this page should be served using the HTTPS protocol instead of HTTP. It is used to calculate proper links to this page, using the correct protocol. Note that this property is not available for page sections. Page sections will return false.- Returns:
- true if this page should be served using HTTPS, false if it should be served using HTTP
-
setUseHTTPS
void setUseHTTPS(boolean useHTTPS)
Sets if this page should be served using the HTTPS protocol instead of HTTP. It is used to calculate proper links to this page, using the correct protocol. If this page does not have its own basic configuration (hasOwnBasicConfig returns false), this method will generate a WARNING message and do nothing. To set properties of the basic configuration, ensure that you set them from the page that owns it. Note that setting this property on page sections will have no effect.- Parameters:
useHTTPS
-
-
getEditVersion
PageVersion getEditVersion(javax.servlet.http.HttpServletRequest request)
Return version of the page you're currently editing.- Parameters:
request
- Current http servlet request- Returns:
- version of the page you're currently editing
-
setWorkflowModel
void setWorkflowModel(WorkflowModel workflowModel)
Sets the Workflow model of the page.- Parameters:
workflowModel
- The Workflow model to assign to the page.
-
getWorkflowModel
WorkflowModel getWorkflowModel()
Return the Workflow model assigned to this page or that is inherited from a parent page.- Returns:
- Workflow model for this page
-
hasInheritedWorkflowModel
boolean hasInheritedWorkflowModel()
Returns if the Workflow model of this page was inherited from a super page or assigned directly to the page itself.- Returns:
true
if the Workflow model was iherited from a super page,false
otherwise
-
getMediaItemPageVersion
MediaItemPageVersion getMediaItemPageVersion()
If this page is stored in the content repository, this method returns the media item page version in the current editing language. If the page is not stored in the content repository or no media item page version exists in the current editing language, it returns null.- Returns:
- the associated
MediaItemPageVersion
in the currentediting language, ornull
if thisPage
is not stored in the content repository
-
isStoredInContentRepository
boolean isStoredInContentRepository()
Returns true if this page is stored as media page in the content repository, false otherwise.- Returns:
- true if this page is stored as media page in the content repository
- Since:
- 10.32.0
-
removeAllBlocks
void removeAllBlocks()
Removes all page sections assigned to the page in case the page uses its own page section configuration (so hasOwnBlockConfig() returns true). If the page inherits its page section configuration from another page (so hasOwnBlockConfig() returns false), invoking this method has no effect. Note that the names "block" and "page section" both refer to the same concept.
-
removeBlock
void removeBlock(Page pageSection)
Removes the given page section assigned to the page in case the page uses its own page section configuration (so hasOwnBlockConfig() returns true). If the page inherits its page section configuration from another page (so hasOwnBlockConfig() returns false), invoking this method has no effect. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
pageSection
- Page section to remove
-
getBlocks
Page[] getBlocks()
Returns the page sections assigned to this page. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- Page[] The page sections.
-
getBlocks
Page[] getBlocks(BlockLabel[] labels)
Returns the page sections assigned to this page with the given label(s). Note that the names "block" and "page section" both refer to the same concept.- Parameters:
labels
- The labels to filter the page sections.- Returns:
- Page[] The page sections.
-
addBlock
void addBlock(Page pageSection)
Adds the given page section to the page in case the page uses its own page section configuration (so hasOwnBlockConfig() returns true). If the page inherits its page section configuration from another page (so hasOwnBlockConfig() returns false), invoking this method has no effect. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
pageSection
- The page section to assign.
-
-