Class Draft

    • Constructor Detail

      • Draft

        public Draft()
    • Method Detail

      • sharedAccessAllowed

        @Deprecated
        public boolean sharedAccessAllowed​(String shareId)
        Deprecated.
        since 5.10
        Checks if this draft can be accessed by users other than the creator (shared access)

        IMPORTANT NOTE: if shared access is disallowed it prevails over permissions (only creator has access), BUT if it is allowed normal permissions still need to be checked

        All legacy drafts are private

        Overrides:
        sharedAccessAllowed in class ContentEntityObject
        Parameters:
        shareId - Used to check for access if needed
        Returns:
        true if this draft can be accessed given a share id, false otherwise
        See Also:
        TODO: delete this method after 6.0
      • sharedAccessAllowed

        public boolean sharedAccessAllowed​(com.atlassian.user.User user)
        Checks if this draft can be accessed by users other than the creator (shared access)

        All legacy drafts are private

        Overrides:
        sharedAccessAllowed in class ContentEntityObject
        Parameters:
        user - User to check access for
        Returns:
        true if this draft can be accessed by the user, false otherwise
        See Also:
        ContentEntityObject.sharedAccessAllowed(User)
      • isNewPage

        public boolean isNewPage()
        Returns true if the draft is for a new piece of content, otherwise false.
      • isIndexable

        public boolean isIndexable()
        Description copied from class: ContentEntityObject
        Content entity objects that are historical versions should not be indexed.
        Specified by:
        isIndexable in interface com.atlassian.bonnie.Searchable
        Overrides:
        isIndexable in class ContentEntityObject
      • isBlank

        public boolean isBlank()
        Returns:
        true if this draft has a an empty title and content that is null or empty string
      • getNameForComparison

        public String getNameForComparison()
        Description copied from class: ContentEntityObject
        Subclasses should implement this method, giving a String back so that the content can be alphabetically sorted in a mixed-type list of content-entities.
        Specified by:
        getNameForComparison in class ContentEntityObject
      • getType

        public String getType()
        Description copied from class: ContentEntityObject
        An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

        This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

        Specified by:
        getType in interface ContentTypeAware
        Specified by:
        getType in class ContentEntityObject
        Returns:
        the content type
      • getDraftSpaceKey

        public String getDraftSpaceKey()
      • setDraftSpaceKey

        public void setDraftSpaceKey​(String draftSpaceKey)
      • setPageVersion

        public void setPageVersion​(int pageVersion)
      • getPageVersion

        public int getPageVersion()
      • getPageId

        public String getPageId()
        Gets the id of the AbstractPage which this is a draft of, as a String. Note that it's currently stored as a String in the database, but the String always represents the id of a page, which is always representable as a long.
      • getPageIdAsLong

        public Long getPageIdAsLong()
      • setPageId

        public void setPageId​(String pageId)
      • setPageId

        public void setPageId​(Long pageId)
      • getDraftType

        public String getDraftType()
      • setDraftType

        public void setDraftType​(String draftType)