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.
    • 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 id
        targetClass - the wrapper class that should be instantiated.
        Returns:
        the wrapper object.
      • getPageVersion

        PageVersion getPageVersion()
        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.
        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 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.
        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 the Page, which is a page section, within the current request scope which was the most recent one used to render a presentation with, or null 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, or null if none has been used
      • getPageSectionVersion

        PageVersion getPageSectionVersion()
        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, or null 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, or null 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 a MediaItemArticleVersion, 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 is null the mediaItemVersion is also set to null.
        Parameters:
        mediaItem - The MediaItem object which is set
      • setMediaItemVersion

        void setMediaItemVersion​(MediaItemVersion mediaItemVersion)
        Sets the given mediaItemVersion. If the MediaItem the mediaItemVersion belongs to differs from the currently set mediaItem, it will be updated with the given mediaItemVersion's MediaItem. If the given mediaItemVersion is null, but a mediaItem is set, the mediaItemVersion will be set to the current version of the currently set mediaItem.
        Parameters:
        mediaItemVersion - The MediaItemVersion 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) the getInContextTime() property is disabled and isInContextTimeLocked() 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, or null 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. The isInContextTimeLocked() property is also reset to false if the in-context time is disabled using this method.
        Parameters:
        inContextTime - the new in-context time or null to disable the functionality
      • isInContextTimeLocked

        boolean isInContextTimeLocked()
        Returns true if the in-context time is locked to a specific time as opposed to false which means the "default time" is used.
        Returns:
        true if and only if the in-context time is locked
      • 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 used
        value - 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