Package ro.sync.ecss.component.resolvers
Class AuthorReferenceResolverWrapper
- java.lang.Object
-
- ro.sync.ecss.component.resolvers.AuthorReferenceResolverWrapper
-
- All Implemented Interfaces:
AuthorReferenceResolver
,Extension
@API(type=EXTENDABLE, src=PUBLIC) public class AuthorReferenceResolverWrapper extends java.lang.Object implements AuthorReferenceResolver
Adapter used to make wrappers overAuthorReferenceResolver
.- Since:
- 18.1
-
-
Constructor Summary
Constructors Constructor Description AuthorReferenceResolverWrapper(AuthorReferenceResolver wrappedResolver)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsValidatationForEditableReference(java.lang.String systemID, AuthorNode referenceNodeParent)
Check if the editable node reference can be validated by Oxygen on its own, when modified, based on its own schema information.java.lang.String
getDescription()
java.lang.String
getDisplayName(AuthorNode node)
Returns the name of the node that contains the expanded referred content.java.lang.String
getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess)
Return the systemID of the referred content.java.lang.String
getReferenceUniqueID(AuthorNode node)
Get an unique identifier for the node reference.AuthorReferenceResolver
getWrappedResolver()
boolean
hasEditableReference(java.lang.String systemID, AuthorNode referenceNodeParent)
Check if the node is editable.boolean
hasReferences(AuthorNode node)
Verifies if the handler considers the node to have references.boolean
isReferenceChanged(AuthorNode node, java.lang.String attributeName)
Verifies if the references of the given node must be refreshed when the attribute with the specified name has changed.void
replaceReference(AuthorDocumentProvider targetProvider, AuthorAccess authorAccess, AuthorReferenceNode referenceNode)
Replace the content of the referenced node from the target document with the modified content inside the reference node.javax.xml.transform.sax.SAXSource
resolveReference(AuthorNode node, java.lang.String systemID, AuthorAccess authorAccess, org.xml.sax.EntityResolver entityResolver)
Resolve the references of the node.
-
-
-
Constructor Detail
-
AuthorReferenceResolverWrapper
public AuthorReferenceResolverWrapper(AuthorReferenceResolver wrappedResolver)
Constructor.- Parameters:
wrappedResolver
- The wrapped resolver.
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceExtension
- Returns:
- The description of the extension.
- See Also:
Extension.getDescription()
-
hasReferences
public boolean hasReferences(AuthorNode node)
Description copied from interface:AuthorReferenceResolver
Verifies if the handler considers the node to have references.
For example the method should returntrue
for a DITA element that hasconref
attribute set.- Specified by:
hasReferences
in interfaceAuthorReferenceResolver
- Parameters:
node
- The node to be analyzed.- Returns:
true
if it has references.- See Also:
AuthorReferenceResolver.hasReferences(ro.sync.ecss.extensions.api.node.AuthorNode)
-
isReferenceChanged
public boolean isReferenceChanged(AuthorNode node, java.lang.String attributeName)
Description copied from interface:AuthorReferenceResolver
Verifies if the references of the given node must be refreshed when the attribute with the specified name has changed.
For example the DITA implementation returnstrue
when the attribute name is equal to'conref'
.- Specified by:
isReferenceChanged
in interfaceAuthorReferenceResolver
- Parameters:
node
- TheAuthorNode
with the references.attributeName
- The name of the changed attribute.- Returns:
true
if the references must be refreshed.- See Also:
AuthorReferenceResolver.isReferenceChanged(ro.sync.ecss.extensions.api.node.AuthorNode, java.lang.String)
-
resolveReference
public javax.xml.transform.sax.SAXSource resolveReference(AuthorNode node, java.lang.String systemID, AuthorAccess authorAccess, org.xml.sax.EntityResolver entityResolver)
Description copied from interface:AuthorReferenceResolver
Resolve the references of the node. The returningSAXSource
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 theconref
attribute.- Specified by:
resolveReference
in interfaceAuthorReferenceResolver
- 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.
- Resources that are already opened in editor.
For this case the
- Returns:
- The
SAXSource
including the parser and the parser'sInputSource
.
IMPORTANT: the SAXSource needs to have an XMLReader set to it. - See Also:
AuthorReferenceResolver.resolveReference(ro.sync.ecss.extensions.api.node.AuthorNode, java.lang.String, ro.sync.ecss.extensions.api.AuthorAccess, org.xml.sax.EntityResolver)
-
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 theconref
attribute is returned by the DITA implementation.- Specified by:
getDisplayName
in interfaceAuthorReferenceResolver
- Parameters:
node
- The node that contains references.- Returns:
- The display name of the node.
- See Also:
AuthorReferenceResolver.getDisplayName(ro.sync.ecss.extensions.api.node.AuthorNode)
-
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 theconref
attribute as the unique identifier.- Specified by:
getReferenceUniqueID
in interfaceAuthorReferenceResolver
- Parameters:
node
- The node that has reference.- Returns:
- An unique identifier for the reference node.
- See Also:
AuthorReferenceResolver.getReferenceUniqueID(ro.sync.ecss.extensions.api.node.AuthorNode)
-
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 interfaceAuthorReferenceResolver
- 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.
- See Also:
AuthorReferenceResolver.getReferenceSystemID(ro.sync.ecss.extensions.api.node.AuthorNode, ro.sync.ecss.extensions.api.AuthorAccess)
-
getWrappedResolver
public AuthorReferenceResolver getWrappedResolver()
- Returns:
- Returns the wrapped resolver.
-
hasEditableReference
public boolean hasEditableReference(java.lang.String systemID, AuthorNode referenceNodeParent)
Description copied from interface:AuthorReferenceResolver
Check if the node is editable.- Specified by:
hasEditableReference
in interfaceAuthorReferenceResolver
- Parameters:
systemID
- System ID of the document in which the current node is located.referenceNodeParent
- The parent of the future referene node- Returns:
true
if the node is editable.- See Also:
AuthorReferenceResolver.hasEditableReference(java.lang.String, ro.sync.ecss.extensions.api.node.AuthorNode)
-
allowsValidatationForEditableReference
public boolean allowsValidatationForEditableReference(java.lang.String systemID, AuthorNode referenceNodeParent)
Description copied from interface:AuthorReferenceResolver
Check if the editable node reference can be validated by Oxygen on its own, when modified, based on its own schema information.- Specified by:
allowsValidatationForEditableReference
in interfaceAuthorReferenceResolver
- Parameters:
systemID
- System ID of the document in which the current node is located.referenceNodeParent
- The parent of the future reference node- Returns:
true
if the editable node reference can be validated by Oxygen on its own, based on its own schema information.- See Also:
AuthorReferenceResolver.allowsValidatationForEditableReference(java.lang.String, ro.sync.ecss.extensions.api.node.AuthorNode)
-
replaceReference
public void replaceReference(AuthorDocumentProvider targetProvider, AuthorAccess authorAccess, AuthorReferenceNode referenceNode) throws java.io.IOException
Description copied from interface:AuthorReferenceResolver
Replace the content of the referenced node from the target document with the modified content inside the reference node.- Specified by:
replaceReference
in interfaceAuthorReferenceResolver
- Parameters:
targetProvider
- The provider if the target document.authorAccess
- Access to the current document.referenceNode
- The reference node to get the modified content from.- Throws:
java.io.IOException
- If the save process fails- See Also:
AuthorReferenceResolver.replaceReference(ro.sync.ecss.extensions.api.node.AuthorDocumentProvider, ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.node.AuthorReferenceNode)
-
-