Package nl.gx.webmanager.cms.core
Interface PresentationContext
-
- All Known Implementing Classes:
PresentationContextImpl
public interface PresentationContext
Representation of the PresentationContext. The presentation context provides the context in which webmanager jsps are executed and provides access to lots of information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PresentationContext.InContextViewMode
Contains possible modes in which the views in the in-context mode are rendered.
-
Field Summary
Fields Modifier and Type Field Description static String
PRESENTATION_CONTEXT_KEY
The default location for the presentation context in the http request.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
decrementEditableTagCount()
Decrement the nested editable tag count.Object
getAttribute(String name)
Returns the object associated with the name in the attribute map of the presentation context.Object
getBaseObject()
Return object at the top of the stack.Page
getBlock()
Return Last rendered page section.String
getChannel()
Return the channel for this presentationcontext.Element
getElement()
Return Element of this PresentationContext.ElementHolder
getElementHolder()
Return the last elementHolder from the stack.Date
getInContextTime()
Returns the selected in-context time if one has been selected, ornull
if none has been selected.PresentationContext.InContextViewMode
getInContextViewMode()
Returns thePresentationContext.InContextViewMode
for the current contextObject
getInstance(int id, Class targetClass)
Return a wrapper of class targetClass for a particular object.Mailing
getMailing()
Return Mailing of this PresentationContext.MediaItem
getMediaItem()
Return MediaItem of this PresentationContext.Language
getMediaItemLanguage()
Gets the language object associated with the mediaitemversion of this context.MediaItemVersion
getMediaItemVersion()
Return MediaItem metadata of this PresentationContext.Page
getPage()
Returns thePage
, which is not a page section, within the current request scope which was the most recent one used to render a presentation with.nl.gx.webmanager.cms.pagemodel.PageModel
getPageModel()
Deprecated.PagePart
getPagePart()
Return PagePart of this PresentationContext.Page
getPageSection()
Returns thePage
, which is a page section, within the current request scope which was the most recent one used to render a presentation with, ornull
if none has been used.PageVersion
getPageSectionVersion()
Returns thePageVersion
, which is a page section version, within the current request scope which was the most recent one used to render a presentation with, ornull
if none has been used.PageVersion
getPageVersion()
Returns thePageVersion
, which is not a version of a page section, within the current request scope which was the most recent one used to render a presentation with.Presentable
getPresentable()
Return Presentable of this PresentationContext.Presentation
getPresentation()
Return Presentation of this PresentationContext.String
getPresentationQs()
Return History of objects and thier presentation, separated by _ and #.PageVersion
getPreviewPageSectionVersion()
Return Page section to which is navigated to in "in context mode".ResourceEntity
getResourceEntity()
Return ResourceEntity of this PresentationContext.ResourceInstance
getResourceInstance()
Return ResourceInstance of this PresentationContext.Website
getWebsite()
Return Website of this PresentationContext.void
incrementEditableTagCount()
Increment the nested editable tag count.boolean
isAuthorized()
Return true if the user may view the page in the preview mode.boolean
isDumpRequest()
Return true if the request is from the WebManager dumper.boolean
isInContextRequest()
Check whether the current request is an edit side request (="in context") or a frontend request.boolean
isInContextTimeLocked()
Returnstrue
if the in-context time is locked to a specific time as opposed tofalse
which means the "default time" is used.boolean
isInlineRequest()
Return true if the user is using the webmanager inline editing mode.boolean
isInsideEditableTag()
Is an editable tag active.boolean
isPersonaRequest()
boolean
isPreviewRequest()
Return true if the user is using the webmanager preview mode.boolean
isSecureRequest()
Return true if the request is from https.boolean
isTextVersionRequest()
Return true if a textversion is requested.boolean
isUseAbsoluteUrl()
Returns whether URLs on the front-end should be absoluteboolean
isWebsiteRequest()
Return true if the request is a website request (starting with /web).void
pop()
Pop the top object and presentation.void
push(Object object, Presentation presentation)
Add an object and a presentation to the stack.void
restorePageVersion()
Undoes the last setPageVersion() call.void
setAttribute(String name, Object value)
Registers the name and value specified in the attribute map of the presentation context.void
setInContextRequest(boolean isInContextRequest)
Set whether the current request is an edit side request (="in context") or a frontend request.void
setInContextTime(Date inContextTime)
Sets the in-context time on to the given value.void
setInContextViewMode(PresentationContext.InContextViewMode inContextViewMode)
Sets thePresentationContext.InContextViewMode
for the current context.void
setMailing(Mailing mailing)
Return set the mailing.void
setMediaItem(MediaItem mediaItem)
Sets the given mediaItem and sets the mediaItemVersion too by invoking the getCurrent method on the given mediaItem.void
setMediaItemLanguage(Language language)
Sets the language object associated with the mediaitemversion in this context.void
setMediaItemVersion(MediaItemVersion mediaItemVersion)
Sets the given mediaItemVersion.void
setPageModel(nl.gx.webmanager.cms.pagemodel.PageModel pageModel)
Deprecated.void
setPageVersion(PageVersion pageVersion, Presentation presentation)
Return set the pageVersion and page and adds the presentation to the stack.void
setPreviewPageSectionVersion(PageVersion pageSectionVersion)
Sets the page section version to which is navigated to in "in context" mode in the presentation context.void
setResourceReference(ResourceEntity resourceEntity, ResourceInstance resourceInstance)
Return set the resourceEntity and resourceInstance.void
setUseAbsoluteUrl(boolean useAbsolute)
Set whether a URLs on the front-end should be absolute.
-
-
-
Field Detail
-
PRESENTATION_CONTEXT_KEY
static final String PRESENTATION_CONTEXT_KEY
The default location for the presentation context in the http request.- See Also:
- Constant Field Values
-
-
Method Detail
-
push
void push(Object object, Presentation presentation)
Add an object and a presentation to the stack.- Parameters:
object
-presentation
-
-
pop
void pop()
Pop the top object and presentation.
-
getBaseObject
Object getBaseObject()
Return object at the top of the stack.- Returns:
- object at the top of the stack.
-
getInstance
Object getInstance(int id, Class targetClass)
Return a wrapper of class targetClass for a particular object.- Parameters:
id
- object idtargetClass
- the wrapper class that should be instantiated.- Returns:
- the wrapper object.
-
getPageVersion
PageVersion getPageVersion()
Returns thePageVersion
, which is not a version of a page section, within the current request scope which was the most recent one used to render a presentation with.- Returns:
- the
PageVersion
, which is not a version of a page section, within the current request scope which was the most recent one used to render a presentation with
-
getPageModel
@Deprecated nl.gx.webmanager.cms.pagemodel.PageModel getPageModel()
Deprecated.Return PageModel of this PresentationContext.- Returns:
- PageModel of this PresentationContext.
-
getPage
Page getPage()
Returns thePage
, which is not a page section, within the current request scope which was the most recent one used to render a presentation with.- Returns:
- the
Page
, which is not a page section, within the current request scope which was the most recent one used to render a presentation with
-
getPageSection
Page getPageSection()
Returns thePage
, which is a page section, within the current request scope which was the most recent one used to render a presentation with, ornull
if none has been used. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- the
Page
, which is a page section, within the current request scope which was the most recent one used to render a presentation with, ornull
if none has been used
-
getPageSectionVersion
PageVersion getPageSectionVersion()
Returns thePageVersion
, which is a page section version, within the current request scope which was the most recent one used to render a presentation with, ornull
if none has been used. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- the
PageVersion
, which is a page section version, within the current request scope which was the most recent one used to render a presentation with, ornull
if none has been used
-
getPagePart
PagePart getPagePart()
Return PagePart of this PresentationContext.- Returns:
- PagePart of this PresentationContext.
-
getPresentation
Presentation getPresentation()
Return Presentation of this PresentationContext.- Returns:
- Presentation of this PresentationContext.
-
getPresentable
Presentable getPresentable()
Return Presentable of this PresentationContext.- Returns:
- Presentable of this PresentationContext.
-
getElementHolder
ElementHolder getElementHolder()
Return the last elementHolder from the stack. If this is aMediaItemArticleVersion
, the element holder assigned to this article actually holding the elements is returned.- Returns:
- the last elementHolder from the stack.
-
getElement
Element getElement()
Return Element of this PresentationContext.- Returns:
- Element of this PresentationContext.
-
getMediaItem
MediaItem getMediaItem()
Return MediaItem of this PresentationContext.- Returns:
- MediaItem of this PresentationContext.
-
getMediaItemVersion
MediaItemVersion getMediaItemVersion()
Return MediaItem metadata of this PresentationContext.- Returns:
- MediaItem metadata of this PresentationContext.
-
getWebsite
Website getWebsite()
Return Website of this PresentationContext.- Returns:
- Website of this PresentationContext.
-
getMailing
Mailing getMailing()
Return Mailing of this PresentationContext.- Returns:
- Mailing of this PresentationContext.
-
getResourceInstance
ResourceInstance getResourceInstance()
Return ResourceInstance of this PresentationContext.- Returns:
- ResourceInstance of this PresentationContext.
-
getResourceEntity
ResourceEntity getResourceEntity()
Return ResourceEntity of this PresentationContext.- Returns:
- ResourceEntity of this PresentationContext.
-
getBlock
Page getBlock()
Return Last rendered page section. Note that the names "block" and "page section" both refer to the same concept.- Returns:
- Last rendered page section.
-
getPreviewPageSectionVersion
PageVersion getPreviewPageSectionVersion()
Return Page section to which is navigated to in "in context mode". Note that the names "block" and "page section" both refer to the same concept.- Returns:
- Page section to which is navigated to in "in context mode".
-
setPreviewPageSectionVersion
void setPreviewPageSectionVersion(PageVersion pageSectionVersion)
Sets the page section version to which is navigated to in "in context" mode in the presentation context. Note that the names "block" and "page section" both refer to the same concept.- Parameters:
pageSectionVersion
- the page section version to navigate to.
-
getPresentationQs
String getPresentationQs()
Return History of objects and thier presentation, separated by _ and #.- Returns:
- History of objects and thier presentation.
-
isDumpRequest
boolean isDumpRequest()
Return true if the request is from the WebManager dumper.- Returns:
- true if the request is from the WebManager dumper.
-
isSecureRequest
boolean isSecureRequest()
Return true if the request is from https.- Returns:
- true if the request is from https.
-
isPreviewRequest
boolean isPreviewRequest()
Return true if the user is using the webmanager preview mode.- Returns:
- true if the user is using the webmanager preview mode.
-
isInlineRequest
boolean isInlineRequest()
Return true if the user is using the webmanager inline editing mode.- Returns:
- true if the user is using the webmanager inline editing mode.
-
getChannel
String getChannel()
Return the channel for this presentationcontext.- Returns:
- the channel for this presentationcontext.
-
isWebsiteRequest
boolean isWebsiteRequest()
Return true if the request is a website request (starting with /web).- Returns:
- true if this is a website request
-
isTextVersionRequest
boolean isTextVersionRequest()
Return true if a textversion is requested.- Returns:
- true if a textversion is requested.
-
isAuthorized
boolean isAuthorized()
Return true if the user may view the page in the preview mode.- Returns:
- true if the user may view the page in the preview mode
-
setPageVersion
void setPageVersion(PageVersion pageVersion, Presentation presentation)
Return set the pageVersion and page and adds the presentation to the stack.
-
restorePageVersion
void restorePageVersion()
Undoes the last setPageVersion() call. Restoring the previous page version.
-
setPageModel
@Deprecated void setPageModel(nl.gx.webmanager.cms.pagemodel.PageModel pageModel)
Deprecated.Sets the pageModel for this PresentationContext.
-
setMediaItem
void setMediaItem(MediaItem mediaItem)
Sets the given mediaItem and sets the mediaItemVersion too by invoking the getCurrent method on the given mediaItem. If the given mediaItem isnull
the mediaItemVersion is also set tonull
.- Parameters:
mediaItem
- TheMediaItem
object which is set
-
setMediaItemVersion
void setMediaItemVersion(MediaItemVersion mediaItemVersion)
Sets the given mediaItemVersion. If theMediaItem
the mediaItemVersion belongs to differs from the currently set mediaItem, it will be updated with the given mediaItemVersion's MediaItem. If the given mediaItemVersion isnull
, but a mediaItem is set, the mediaItemVersion will be set to the current version of the currently set mediaItem.- Parameters:
mediaItemVersion
- TheMediaItemVersion
object which is set
-
setMailing
void setMailing(Mailing mailing)
Return set the mailing.
-
setResourceReference
void setResourceReference(ResourceEntity resourceEntity, ResourceInstance resourceInstance)
Return set the resourceEntity and resourceInstance.
-
isInContextRequest
boolean isInContextRequest()
Check whether the current request is an edit side request (="in context") or a frontend request.- Returns:
- true if and only if the request is an edit side request
-
setInContextRequest
void setInContextRequest(boolean isInContextRequest)
Set whether the current request is an edit side request (="in context") or a frontend request. In the case of a frontend request (false) thegetInContextTime()
property is disabled andisInContextTimeLocked()
set to false.- Parameters:
isInContextRequest
- true for edit side request, false for frontend request- Since:
- 10.31.0
-
isPersonaRequest
boolean isPersonaRequest()
- Returns:
- True if the current request has a persona specified.
-
isInsideEditableTag
boolean isInsideEditableTag()
Is an editable tag active.- Returns:
- True if an editable tag being rendered.
-
incrementEditableTagCount
void incrementEditableTagCount()
Increment the nested editable tag count. This call must be matched with a call to decrementEditableTagCount().
-
decrementEditableTagCount
void decrementEditableTagCount()
Decrement the nested editable tag count.
-
getInContextTime
Date getInContextTime()
Returns the selected in-context time if one has been selected, ornull
if none has been selected.- Returns:
- the selected in-context time if one has been selected, or
null
if none has been selected
-
setInContextTime
void setInContextTime(Date inContextTime)
Sets the in-context time on to the given value. TheisInContextTimeLocked()
property is also reset tofalse
if the in-context time is disabled using this method.- Parameters:
inContextTime
- the new in-context time ornull
to disable the functionality
-
isInContextTimeLocked
boolean isInContextTimeLocked()
Returnstrue
if the in-context time is locked to a specific time as opposed tofalse
which means the "default time" is used.- Returns:
true
if and only if the in-context time is locked
-
getInContextViewMode
PresentationContext.InContextViewMode getInContextViewMode()
Returns thePresentationContext.InContextViewMode
for the current context- Returns:
- the
PresentationContext.InContextViewMode
for the current context
-
setInContextViewMode
void setInContextViewMode(PresentationContext.InContextViewMode inContextViewMode)
Sets thePresentationContext.InContextViewMode
for the current context.- Parameters:
inContextViewMode
- thePresentationContext.InContextViewMode
to be set- Since:
- 10.31.0
-
isUseAbsoluteUrl
boolean isUseAbsoluteUrl()
Returns whether URLs on the front-end should be absolute- Returns:
- true if absolute URLs should be emitted in front-end HTML.
-
setUseAbsoluteUrl
void setUseAbsoluteUrl(boolean useAbsolute)
Set whether a URLs on the front-end should be absolute.- Parameters:
useAbsolute
- true if absolute URLs should be emitted in front-end HTML, otherwise URLs may be relative.
-
setAttribute
void setAttribute(String name, Object value)
Registers the name and value specified in the attribute map of the presentation context.- Parameters:
name
- the name that is usedvalue
- the value to associate with the name, or null if the attribute is to be removed from the scope
-
getAttribute
Object getAttribute(String name)
Returns the object associated with the name in the attribute map of the presentation context.- Parameters:
name
- the name of the attribute to get- Returns:
- the object associated with the name in the attribute map of the presentation context or null if not found.
-
setMediaItemLanguage
void setMediaItemLanguage(Language language)
Sets the language object associated with the mediaitemversion in this context.- Parameters:
language
-
-
getMediaItemLanguage
Language getMediaItemLanguage()
Gets the language object associated with the mediaitemversion of this context.- Returns:
- language object
-
-