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 using
conref
attribute.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ContextKeyManagerProvider
The context-aware key manager provider used to resolve keyrefs. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DITAConRefResolver
(ContextKeyManager keyManager) Deprecated.DITAConRefResolver
(ContextKeyManagerProvider keyManagerProvider) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkTarget
(AuthorNode node, AuthorDocument targetDocument) Check if the referenced target can be inserted in the source documentgetCacheKey
(AuthorNode node) Get an unique cache key for a node which references content which will be expanded.getDisplayName
(AuthorNode node) Returns the value of theconref
attribute.getReferenceSystemID
(AuthorNode node, AuthorAccess authorAccess) Return the systemID of the referred content.The value ofconref
attribute is used as the unique identifier.protected String[]
getTopicPath
(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, String attributeName) Returnstrue
when the attribute name is equal to'conref'
.resolveReference
(AuthorNode node, String systemID, AuthorAccess authorAccess, EntityResolver entityResolver) Resolve the content referred byconref
attribute.void
setResolveKeyrefsToMetaContentAsConrefs
(boolean resolveKeyrefsAsConrefs) Set totrue
to resolve all keyrefs as conrefsMethods 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 Details
-
keyManagerProvider
The context-aware key manager provider used to resolve keyrefs.
-
-
Constructor Details
-
DITAConRefResolver
Deprecated.useDITAConRefResolver(ContextKeyManagerProvider)
instead.Constructor.- Parameters:
keyManager
- The context-aware key manager.
-
DITAConRefResolver
public DITAConRefResolver()Constructor. -
DITAConRefResolver
Constructor.- Parameters:
keyManagerProvider
- The context-aware key manager provider.
-
-
Method Details
-
hasReferences
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:
-
getDisplayName
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:
-
resolveReference
public SAXSource resolveReference(AuthorNode node, String systemID, AuthorAccess authorAccess, 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:
-
getTopicPath
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
- Specified by:
getDescription
in interfaceExtension
- Returns:
- The description of the extension.
- See Also:
-
getReferenceUniqueID
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:
-
isReferenceChanged
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:
-
getReferenceSystemID
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:
-
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:
-
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:
-
getCacheKey
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:
-
DITAConRefResolver(ContextKeyManagerProvider)
instead.