Class ViewPageAction

    • Constructor Detail

      • ViewPageAction

        public ViewPageAction()
    • Method Detail

      • getComment

        public Comment getComment()
        Gets the currently focused comment. Might be the comment from a permalink, a comment being replied to, or a comment being edited. Returns null if no comment is active.
        Specified by:
        getComment in interface CommentAware
        Returns:
        the comment which is focused
      • setComment

        public void setComment​(Comment comment)
        Sets the currently focused comment. Might be the comment from a permalink, a comment being replied to, or a comment being edited. Set to null if no comment is active.

        Used by the CommentAwareInterceptor.

        Specified by:
        setComment in interface CommentAware
        Parameters:
        comment - the comment which is to be focused
      • getParentPage

        public Page getParentPage()
        Returns the parent Page of the current Page or null if the current AbstractPage is a root page or a blogpost.
      • getExternalReferences

        public List getExternalReferences()
      • isPageRequired

        public boolean isPageRequired()
        Description copied from interface: PageAware
        If the action requires that the page be set before being run, then it should return true to this method. If the action requires a page, but no page is available, then the interceptor will automatically redirect to the 'pagenotfound' result
        Specified by:
        isPageRequired in interface PageAware
        Overrides:
        isPageRequired in class AbstractPageAwareAction
        Returns:
        true if the action requires a page in order to execute
      • isLatestVersionRequired

        public boolean isLatestVersionRequired()
        Description copied from interface: PageAware
        If the action can only work on the most recent version of a page, this will cause the interceptor to silently replace the version that it looks up with the most recent version, if necessary.
        Specified by:
        isLatestVersionRequired in interface PageAware
        Overrides:
        isLatestVersionRequired in class AbstractPageAwareAction
        Returns:
        true if the action requires the most recent version of a page
      • getEditingUser

        @Internal
        public String getEditingUser()
      • execute

        public String execute()
                       throws Exception
        Specified by:
        execute in interface com.opensymphony.xwork2.Action
        Overrides:
        execute in class com.opensymphony.xwork2.ActionSupport
        Throws:
        Exception
      • pageIsLatestVersionAndDoesNotHaveSpace

        protected boolean pageIsLatestVersionAndDoesNotHaveSpace()
      • getEventToPublish

        public ConfluenceEvent getEventToPublish​(String result)
        Description copied from interface: Evented
        Gets the event to publish.
        Specified by:
        getEventToPublish in interface Evented<ConfluenceEvent>
        Parameters:
        result - the result of the action executing.
        Returns:
        the event. Can be null, in which case no event will be published.
      • getPageXHtmlContent

        public String getPageXHtmlContent()
      • getChildrenShowing

        public Boolean getChildrenShowing()
      • setShowChildren

        public void setShowChildren​(Boolean showChildren)
      • setNotificationManager

        public void setNotificationManager​(NotificationManager notificationManager)
      • isThreadComments

        public boolean isThreadComments()
      • isUserWatchingPage

        public boolean isUserWatchingPage()
        Returns true if the user is watching the current page. Returns false otherwise, or if the user is anonymous.
      • isUserWatchingSpace

        public boolean isUserWatchingSpace()
        Returns true if the user is watching the page/blog's space for the respective ContentType. For example, if getPage returns a BlogPost and the user is only watching Pages in the Space, this method returns false.
      • getDateString

        public String getDateString​(Date date)
      • renderExternalLink

        public String renderExternalLink​(com.atlassian.renderer.links.Link link)
      • getReplyToComment

        public long getReplyToComment()
      • setReplyToComment

        public void setReplyToComment​(long replyToComment)
      • getFirstPostInNextMonth

        public BlogPost getFirstPostInNextMonth​(Calendar postingDate)
        Returns the first post in the month after the current postingDay

        This method is a duplication of the method in AbstractBlogPostsAction - they really shouldn't be here.

        Returns:
        BlogPost for the first post in the next month, null otherwise
        See Also:
        AbstractBlogPostsAction
      • getLastPostInPreviousMonth

        public BlogPost getLastPostInPreviousMonth​(Calendar postingDate)
        Returns the last post in the month before the current postingDay

        This method is a duplication of the method in AbstractBlogPostsAction - they really shouldn't be here.

        Returns:
        BlogPost for the last post in the previous month, null otherwise
        See Also:
        AbstractBlogPostsAction
      • getPageIdOfVersionBefore

        public long getPageIdOfVersionBefore​(AbstractPage page)
      • getPageIdOfVersionAfter

        public long getPageIdOfVersionAfter​(AbstractPage page)
      • hasPreviousVersion

        public boolean hasPreviousVersion​(AbstractPage page)
      • hasNextVersion

        public boolean hasNextVersion​(AbstractPage page)
      • isShowCommentArea

        public boolean isShowCommentArea()
      • setShowCommentArea

        public void setShowCommentArea​(boolean showCommentArea)
      • isEditComment

        public boolean isEditComment()
      • setEditComment

        public void setEditComment​(boolean editComment)
      • isNavigatingVersions

        public boolean isNavigatingVersions()
      • setNavigatingVersions

        public void setNavigatingVersions​(boolean navigatingVersions)
      • setCommentManager

        public void setCommentManager​(CommentManager commentManager)
      • getCommentAsXHtmlForWysiwyg

        public String getCommentAsXHtmlForWysiwyg()
      • setCaptchaManager

        public void setCaptchaManager​(CaptchaManager captchaManager)
      • getViewInheritedContentPermissionSets

        public List getViewInheritedContentPermissionSets()
      • hasAnyPermissions

        public boolean hasAnyPermissions()
        checks if the page has any direct contentpermissions or inherited ones
      • setEditRenderer

        public void setEditRenderer​(Renderer editRenderer)
      • setXhtmlContent

        public void setXhtmlContent​(XhtmlContent xhtmlContent)
      • setThemeManager

        public void setThemeManager​(ThemeManager themeManager)
      • isChildrenNotShown

        public boolean isChildrenNotShown()
        Used to hide the page children if we are using the left sidebar. It's necessary to do it like this because a theme may not override page.vmd.
        Returns:
        true if children are not shown, and false if it's the opposite.
      • setCollaborativeEditingHelper

        @ExperimentalApi
        public void setCollaborativeEditingHelper​(CollaborativeEditingHelper collaborativeEditingHelper)