Class ContributionStatus


  • public final class ContributionStatus
    extends Object
    A record of a recent contribution made by a user to a specific piece of content. A contribution can be either a change to a never published draft ('draft'), an unpublished change on a page's draft ('unpublished') or a page which does not contain any unpublished changes by the user ('current').
    Since:
    6.4.0
    • Constructor Detail

      • ContributionStatus

        public ContributionStatus()
      • ContributionStatus

        public ContributionStatus​(Long contentId,
                                  Long latestVersionId,
                                  Long relationId,
                                  String contentStatus,
                                  Date lastModifiedDate)
    • Method Detail

      • getContentId

        public long getContentId()
        Returns:
        Id of the content or draft, if unpublished.
      • getLatestVersionId

        public long getLatestVersionId()
        Returns:
        The latest published version of the content. If this is null, it means the content has never been published.
      • getRelationId

        public long getRelationId()
        Returns:
        The collaborator relation on the draft for the content. A non-null value here indicates the presence of contributions to the content by the current user. Null means that user hasn't made any contributions.
      • getContentStatus

        public String getContentStatus()
        Returns:
        'DRAFT' if the current user has unpublished contributions on the draft, otherwise the status of the latest version of the content (could be 'DRAFT' or 'CURRENT').
      • getLastModifiedDate

        public Date getLastModifiedDate()
        Returns:
        The last date the user has contributed to the content, or the latest updated date of the content if the user hasn't made any contributions.
      • getStatus

        public String getStatus()
        DRAFT_STATUS: Indicates a draft which has never been published before, i.e. latestVersionId will be null, and contentStatus will be 'DRAFT'. UNPUBLISHED_CHANGES: A published version of the page exists. The current user has started making additional changes to the draft of the page, but has not published their changes. For this to be true the contentStatus should be 'DRAFT' since the current user has contributed to the shared draft, latestVersionId must be non-null because it needs to point to the published page version, and relationid is non-null to indicate that a contribution is present on the draft content. CURRENT: The content has been published before and there are no unpublished contributions by the user on the draft, i.e. the latest version of content has a contentStatus of 'CURRENT'.
        Returns:
        one of DRAFT_STATUS, CURRENT_STATUS, UNPUBLISHED_CHANGES_STATUS, UNKNOWN_STATUS
        See Also:
        for a detailed explanation of the query.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object