Class DOTProjectAuthorReferenceResolver

  • All Implemented Interfaces:
    AuthorReferenceResolver, Extension

    @API(type=INTERNAL,
         src=PUBLIC)
    public class DOTProjectAuthorReferenceResolver
    extends java.lang.Object
    implements AuthorReferenceResolver
    Author Reference Resolver for DITA-OT Project files.
    It will resolve all
    <include href="includedProject.xml">
    references.
    • Constructor Detail

      • DOTProjectAuthorReferenceResolver

        public DOTProjectAuthorReferenceResolver()
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Specified by:
        getDescription in interface Extension
        Returns:
        The description of the extension.
      • resolveReference

        public javax.xml.transform.sax.SAXSource resolveReference​(AuthorNode node,
                                                                  java.lang.String systemID,
                                                                  AuthorAccess authorAccess,
                                                                  org.xml.sax.EntityResolver entityResolver)
                                                           throws ReferenceResolverException
        Description copied from interface: AuthorReferenceResolver
        Resolve the references of the node. The returning SAXSource will be used for creating the referred content using the parser and the source inside it.
        IMPORTANT: the SAXSource needs to have an XMLReader set to it.
        For example the DITA implementation resolves the content referred by the conref attribute.
        Specified by:
        resolveReference in interface AuthorReferenceResolver
        Parameters:
        node - The node which has references.
        systemID - The system ID of the node with references.
        authorAccess - The author access implementation. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        entityResolver - The entity resolver that can be used to resolve:
        • Resources that are already opened in editor. For this case the InputSource will contain the editor content.
        • Resources resolved through XML catalog.
        Returns:
        The SAXSource including the parser and the parser's InputSource.
        IMPORTANT: the SAXSource needs to have an XMLReader set to it.
        Throws:
        ReferenceResolverException - If something goes wrong when resolving the references.
      • isReferenceChanged

        public boolean isReferenceChanged​(AuthorNode node,
                                          java.lang.String attributeName)
        A reference is changed when the value of the href is changed.
        Specified by:
        isReferenceChanged in interface AuthorReferenceResolver
        Parameters:
        node - The AuthorNode with the references.
        attributeName - The name of the changed attribute.
        Returns:
        true if the references must be refreshed.
      • hasReferences

        public boolean hasReferences​(AuthorNode node)
        Only 'include' elements have references. The value of the HREF attribute should not be null.
        Specified by:
        hasReferences in interface AuthorReferenceResolver
        Parameters:
        node - The node we want to check for references.
        Returns:
        true if the node has references.
      • getReferenceUniqueID

        public java.lang.String getReferenceUniqueID​(AuthorNode node)
        Description copied from interface: AuthorReferenceResolver
        Get an unique identifier for the node reference. The unique identifier is used to avoid resolving the references recursively.
        For example the DITA implementation uses the value of the conref attribute as the unique identifier.
        Specified by:
        getReferenceUniqueID in interface AuthorReferenceResolver
        Parameters:
        node - The node that has reference.
        Returns:
        An unique identifier for the reference node.
      • getReferenceSystemID

        public java.lang.String getReferenceSystemID​(AuthorNode node,
                                                     AuthorAccess authorAccess)
        Description copied from interface: AuthorReferenceResolver
        Return the systemID of the referred content.
        Specified by:
        getReferenceSystemID in interface AuthorReferenceResolver
        Parameters:
        node - The reference node.
        authorAccess - The author access. It provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        Returns:
        The systemID of the referred content.
      • getDisplayName

        public java.lang.String getDisplayName​(AuthorNode node)
        Description copied from interface: AuthorReferenceResolver
        Returns the name of the node that contains the expanded referred content.
        For example the value of the conref attribute is returned by the DITA implementation.
        Specified by:
        getDisplayName in interface AuthorReferenceResolver
        Parameters:
        node - The node that contains references.
        Returns:
        The display name of the node.