Interface DocumentAuthors


  • @Unstable
    public interface DocumentAuthors
    Define the different authors information that are related to an XWikiDocument. Note that since this API uses UserReference the getters should never returns null but should return GuestUserReference instead when needed.
    Since:
    14.0RC1
    Version:
    $Id: 1df5f0fdb9ae904772842f01dd289ab332b6ef4d $
    • Method Detail

      • getContentAuthor

        UserReference getContentAuthor()
        The last user that has changed the document's content (ie not object, attachments). The Content author is only changed when the document content changes. Note that Content Author is used to check programming rights on a document and this is the reason we need to know the last author who's modified the content since programming rights depend on this. Note that this should never return null.
        Returns:
        the reference of the user who authored latest content of the document.
      • setContentAuthor

        void setContentAuthor​(UserReference contentAuthor)
        Specify the author of the content of the document: this author is only responsible to the content, and not to other information of the document such as xobjects. The last user that has changed the document's content (ie not object, attachments). The Content author is only changed when the document content changes. Note that Content Author is used to check programming rights on a document and this is the reason we need to know the last author who's modified the content since programming rights depend on this.
        Parameters:
        contentAuthor - the author of the content of the document.
        See Also:
        getContentAuthor()
      • getEffectiveMetadataAuthor

        UserReference getEffectiveMetadataAuthor()
        The effective metadata author is the author responsible of any change but the content: e.g. saving a new xobject in a document update the metadata auhor but not the content author. It's effective, as it is the actual author who holds the responsibility of the changes in terms of rights. Note that this should never return null.
        Returns:
        the reference of the user who saved metadata of the document, or who was used to save it.
      • setEffectiveMetadataAuthor

        void setEffectiveMetadataAuthor​(UserReference metadataAuthor)
        Specify the metadata author of the document: this author is not responsible to the content, but responsible to the xobjects and other metadata.
        Parameters:
        metadataAuthor - the author of the metadata of the document.
        See Also:
        getEffectiveMetadataAuthor()
      • getOriginalMetadataAuthor

        UserReference getOriginalMetadataAuthor()
        The original metadata author is the author who have triggered a save on the document, but who does not hold responsibility for those changes in terms of rights. It should be different from the getEffectiveMetadataAuthor() when the save is performed through a mechanism which prevent users to need edit rights for saving the document (e.g. adding a new comment in a page). Note that this should never return null.
        Returns:
        the reference of the user who originally triggers the save.
      • setOriginalMetadataAuthor

        void setOriginalMetadataAuthor​(UserReference originalMetadataAuthor)
        Specify the original metadata author of the document: the author who have triggered a save on the document, but who does not hold responsibility for those changes in terms of rights.
        Parameters:
        originalMetadataAuthor - the author to display.
        See Also:
        getOriginalMetadataAuthor()
      • getCreator

        UserReference getCreator()
        The creator of the document is the first author of the document when it has been created. Note that this should never return null.
        Returns:
        the reference of the user who authored the first version of the document.
      • setCreator

        void setCreator​(UserReference creator)
        Specify the original creator of the document.
        Parameters:
        creator - the creator of the document.
      • copyAuthors

        void copyAuthors​(DocumentAuthors documentAuthors)
        Copy all authors from the given document authors.
        Parameters:
        documentAuthors - the authors to copy value from.