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 ContextKeyManagerProviderThe context-aware key manager provider used to resolve keyrefs. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DITAConRefResolver(ContextKeyManager keyManager) Deprecated.DITAConRefResolver(ContextKeyManagerProvider keyManagerProvider) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckTarget(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 theconrefattribute.getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess) Return the systemID of the referred content.The value ofconrefattribute is used as the unique identifier.protected String[]getTopicPath(String value) Gets the topic IDs as an array of strings.booleanhasReferences(AuthorNode node) An element that hasconrefattribute is an element with references.booleanisReferenceChanged(AuthorNode node, String attributeName) Returnstruewhen the attribute name is equal to'conref'.resolveReference(AuthorNode node, String systemID, AuthorAccess authorAccess, EntityResolver entityResolver) Resolve the content referred byconrefattribute.voidsetResolveKeyrefsToMetaContentAsConrefs(boolean resolveKeyrefsAsConrefs) Set totrueto resolve all keyrefs as conrefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 hasconrefattribute is an element with references.- Specified by:
hasReferencesin interfaceAuthorReferenceResolver- Parameters:
node- The node to be analyzed.- Returns:
trueif it has references.- See Also:
-
getDisplayName
Returns the value of theconrefattribute.- Specified by:
getDisplayNamein 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 byconrefattribute.- Specified by:
resolveReferencein 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
InputSourcewill contain the editor content. - Resources resolved through XML catalog.
- Resources that are already opened in editor.
For this case the
- Returns:
- The
SAXSourceincluding 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- Theconrefattribute value.- Returns:
- The path of IDs as an array of strings.
-
getDescription
- Specified by:
getDescriptionin interfaceExtension- Returns:
- The description of the extension.
- See Also:
-
getReferenceUniqueID
The value ofconrefattribute is used as the unique identifier.- Specified by:
getReferenceUniqueIDin interfaceAuthorReferenceResolver- Parameters:
node- The node that has reference.- Returns:
- An unique identifier for the reference node.
- See Also:
-
isReferenceChanged
Returnstruewhen the attribute name is equal to'conref'.- Specified by:
isReferenceChangedin interfaceAuthorReferenceResolver- Parameters:
node- TheAuthorNodewith the references.attributeName- The name of the changed attribute.- Returns:
trueif the references must be refreshed.- See Also:
-
getReferenceSystemID
Description copied from interface:AuthorReferenceResolverReturn the systemID of the referred content.- Specified by:
getReferenceSystemIDin 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:ValidatingAuthorReferenceResolverCheck if the referenced target can be inserted in the source document- Specified by:
checkTargetin 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:DITAConrefsResolverBaseSet totrueto resolve all keyrefs as conrefs- Specified by:
setResolveKeyrefsToMetaContentAsConrefsin classDITAConrefsResolverBase- Parameters:
resolveKeyrefsAsConrefs- If true, will resolve keyword keyrefs as conrefs.- See Also:
-
getCacheKey
Description copied from interface:CacheableAuthorReferencesResolverGet an unique cache key for a node which references content which will be expanded.- Specified by:
getCacheKeyin interfaceCacheableAuthorReferencesResolver- Parameters:
node- The node.- Returns:
- an unique cache key for a node which references expanded content. Can be
nullif the node should not be cached. - See Also:
-
DITAConRefResolver(ContextKeyManagerProvider)instead.