Interface DocumentModelBridge


  • public interface DocumentModelBridge
    Exposes methods for accessing Documents. This is temporary until we remodel the Model classes and the Document services. The implementation is actually the XWikiDocument class, so this is just a light interface that hides the old xwiki-core.
    Since:
    1.6M1
    Version:
    $Id: 3efdce445606ff568320e01133a2734d8c49343c $
    • Method Detail

      • getFullName

        @Deprecated
        String getFullName()
        Deprecated.
        Retrieve the full name of the document, in the Space.Name format, for example Main.WebHome.
        Returns:
        A String representation of the document's full name.
      • getDocumentReference

        DocumentReference getDocumentReference()
        Returns:
        the document's reference (without the document locale)
        Since:
        2.2M1
      • getRealLanguage

        String getRealLanguage()
        Retrieve the actual language of the document variant. If this is a translation, then it is the language of the translation. If this is the original variant of the document, then it it is the default language of the document.
        Returns:
        The document's language in a 2-letter code.
      • getContent

        String getContent()
        Retrieves the textual content of the document.
        Returns:
        The document's content.
      • getOriginalDocument

        DocumentModelBridge getOriginalDocument()
        Retrieves a copy of the document before it was changed.
        Returns:
        the copy of this Document instance before any modification was made to it.
      • getSyntaxId

        @Deprecated
        String getSyntaxId()
        Deprecated.
        since 3.0M1 use getSyntax() instead
        Returns:
        the Syntax id representing the syntax used for the current document. For example "xwiki/1.0" represents the first version XWiki syntax while "xwiki/2.0" represents version 2.0 of the XWiki Syntax.
      • getSyntax

        org.xwiki.rendering.syntax.Syntax getSyntax()
        Returns:
        the Syntax id representing the syntax used for the current document. For example "xwiki/1.0" represents the first version XWiki syntax while "xwiki/2.0" represents version 2.0 of the XWiki Syntax.
        Since:
        3.0M1
      • getSpaceName

        @Deprecated
        String getSpaceName()
        Deprecated.
        since 2.2M1 use getDocumentReference() instead
        Return the full local space reference. For example a document located in sub-space space11 of space space1 will return space1.space11.
        Returns:
        the space to which the document belongs to (eg "Main")
      • getWikiName

        @Deprecated
        String getWikiName()
        Deprecated.
        since 2.2M1 use getDocumentReference() instead
        Retrieve the name of the virtual wiki this document belongs to.
        Returns:
        A String representation of the document's wiki name.
      • getTitle

        String getTitle()
        Returns:
        the document's title or null if not set
      • getVersion

        String getVersion()
        Returns:
        a string identifying the current version of this document
      • getXDOM

        org.xwiki.rendering.block.XDOM getXDOM()
        Returns:
        the XDOM for the document
        Since:
        3.0M3
      • getContentAuthorReference

        @Deprecated
        DocumentReference getContentAuthorReference()
        Deprecated.
        since 14.0RC1 rely on getAuthors().
        Returns:
        the document's content author user reference
        Since:
        7.2M1
      • getAuthors

        @Unstable
        default DocumentAuthors getAuthors()
        Returns:
        the various authors information of a document.
        Since:
        14.0RC1
      • getCreationDate

        default Date getCreationDate()
        Returns:
        the creation date of the current document.
        Since:
        12.8RC1, 12.6.3
      • isHidden

        default Boolean isHidden()
        Returns:
        true if the document is hidden.
        Since:
        13.1, 12.10.5, 12.6.8
      • getDate

        @Unstable
        default Date getDate()
        Returns:
        the last save date of the current document.
        Since:
        14.0RC1
      • isRestricted

        @Unstable
        default boolean isRestricted()
        Returns:
        true if the document is restricted, i.e., transformations should be executed in restricted mode
        Since:
        15.2RC1, 14.10.7