Class DITAConRefResolver
- java.lang.Object
-
- ro.sync.ecss.extensions.api.DITAConrefsResolverBase
-
- ro.sync.ecss.extensions.dita.conref.DITAConRefResolver
-
- All Implemented Interfaces:
AuthorReferenceResolver
,CacheableAuthorReferencesResolver
,Extension
,ValidatingAuthorReferenceResolver
- Direct Known Subclasses:
DITAMapRefResolver
@API(type=INTERNAL, src=PUBLIC) public class DITAConRefResolver extends DITAConrefsResolverBase implements CacheableAuthorReferencesResolver
Resolver for content referred usingconref
attribute.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContextKeyManagerProvider
keyManagerProvider
The context-aware key manager provider used to resolve keyrefs.
-
Constructor Summary
Constructors Constructor Description DITAConRefResolver()
Constructor.DITAConRefResolver(ContextKeyManager keyManager)
Deprecated.useDITAConRefResolver(ContextKeyManagerProvider)
instead.DITAConRefResolver(ContextKeyManagerProvider keyManagerProvider)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkTarget(AuthorNode node, AuthorDocument targetDocument)
Check if the referenced target can be inserted in the source documentjava.lang.String
getCacheKey(AuthorNode node)
Get an unique cache key for a node which references content which will be expanded.java.lang.String
getDescription()
java.lang.String
getDisplayName(AuthorNode node)
Returns the value of theconref
attribute.java.lang.String
getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess)
Return the systemID of the referred content.java.lang.String
getReferenceUniqueID(AuthorNode node)
The value ofconref
attribute is used as the unique identifier.protected java.lang.String[]
getTopicPath(java.lang.String value)
Gets the topic IDs as an array of strings.boolean
hasReferences(AuthorNode node)
An element that hasconref
attribute is an element with references.boolean
isReferenceChanged(AuthorNode node, java.lang.String attributeName)
Returnstrue
when the attribute name is equal to'conref'
.javax.xml.transform.sax.SAXSource
resolveReference(AuthorNode node, java.lang.String systemID, AuthorAccess authorAccess, org.xml.sax.EntityResolver entityResolver)
Resolve the content referred byconref
attribute.void
setResolveKeyrefsToMetaContentAsConrefs(boolean resolveKeyrefsAsConrefs)
Set totrue
to resolve all keyrefs as conrefs-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ro.sync.ecss.extensions.api.AuthorReferenceResolver
allowsValidatationForEditableReference, hasEditableReference, replaceReference
-
-
-
-
Field Detail
-
keyManagerProvider
protected final ContextKeyManagerProvider keyManagerProvider
The context-aware key manager provider used to resolve keyrefs.
-
-
Constructor Detail
-
DITAConRefResolver
@Deprecated public DITAConRefResolver(ContextKeyManager keyManager)
Deprecated.useDITAConRefResolver(ContextKeyManagerProvider)
instead.Constructor.- Parameters:
keyManager
- The context-aware key manager.
-
DITAConRefResolver
public DITAConRefResolver()
Constructor.
-
DITAConRefResolver
public DITAConRefResolver(ContextKeyManagerProvider keyManagerProvider)
Constructor.- Parameters:
keyManagerProvider
- The context-aware key manager provider.
-
-
Method Detail
-
hasReferences
public boolean hasReferences(AuthorNode node)
An element that hasconref
attribute is an element with references.- 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)
-
getDisplayName
public java.lang.String getDisplayName(AuthorNode node)
Returns the value of theconref
attribute.- 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)
-
resolveReference
public javax.xml.transform.sax.SAXSource resolveReference(AuthorNode node, java.lang.String systemID, AuthorAccess authorAccess, org.xml.sax.EntityResolver entityResolver) throws ReferenceResolverException
Resolve the content referred byconref
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. - Throws:
ReferenceResolverException
- If something goes wrong when resolving the references.- See Also:
AuthorReferenceResolver.resolveReference( ro.sync.ecss.extensions.api.node.AuthorNode, java.lang.String, AuthorAccess, EntityResolver)
-
getTopicPath
protected java.lang.String[] getTopicPath(java.lang.String value)
Gets the topic IDs as an array of strings.- Parameters:
value
- Theconref
attribute value.- Returns:
- The path of IDs as an array of strings.
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceExtension
- Returns:
- The description of the extension.
- See Also:
Extension.getDescription()
-
getReferenceUniqueID
public java.lang.String getReferenceUniqueID(AuthorNode node)
The value ofconref
attribute is used 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)
-
isReferenceChanged
public boolean isReferenceChanged(AuthorNode node, java.lang.String attributeName)
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)
-
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, AuthorAccess)
-
checkTarget
public void checkTarget(AuthorNode node, AuthorDocument targetDocument) throws ValidatingReferenceResolverException
Description copied from interface:ValidatingAuthorReferenceResolver
Check if the referenced target can be inserted in the source document- Specified by:
checkTarget
in interfaceValidatingAuthorReferenceResolver
- Parameters:
node
- The source node for which the target node was resolved.targetDocument
- The target document- Throws:
ValidatingReferenceResolverException
- If the source does not accept the target expanded in place.- See Also:
ValidatingAuthorReferenceResolver.checkTarget(ro.sync.ecss.extensions.api.node.AuthorNode, ro.sync.ecss.extensions.api.node.AuthorDocument)
-
setResolveKeyrefsToMetaContentAsConrefs
public void setResolveKeyrefsToMetaContentAsConrefs(boolean resolveKeyrefsAsConrefs)
Description copied from class:DITAConrefsResolverBase
Set totrue
to resolve all keyrefs as conrefs- Specified by:
setResolveKeyrefsToMetaContentAsConrefs
in classDITAConrefsResolverBase
- Parameters:
resolveKeyrefsAsConrefs
- If true, will resolve keyword keyrefs as conrefs.- See Also:
DITAConrefsResolverBase.setResolveKeyrefsToMetaContentAsConrefs(boolean)
-
getCacheKey
public java.lang.String getCacheKey(AuthorNode node)
Description copied from interface:CacheableAuthorReferencesResolver
Get an unique cache key for a node which references content which will be expanded.- Specified by:
getCacheKey
in interfaceCacheableAuthorReferencesResolver
- Parameters:
node
- The node.- Returns:
- an unique cache key for a node which references expanded content. Can be
null
if the node should not be cached. - See Also:
CacheableAuthorReferencesResolver.getCacheKey(ro.sync.ecss.extensions.api.node.AuthorNode)
-
-