Class DITAMapRefResolver
- java.lang.Object
-
- ro.sync.ecss.extensions.api.DITAConrefsResolverBase
-
- ro.sync.ecss.extensions.dita.conref.DITAConRefResolver
-
- ro.sync.ecss.extensions.dita.map.topicref.DITAMapRefResolver
-
- All Implemented Interfaces:
AuthorReferenceResolver
,CacheableAuthorReferencesResolver
,DITAMapReferencesResolver
,Extension
,ValidatingAuthorReferenceResolver
@API(type=INTERNAL, src=PUBLIC) public class DITAMapRefResolver extends DITAConRefResolver implements DITAMapReferencesResolver
Resolves the hrefs to other maps.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXPAND_PSEUDO_CLASS
Reference elements (like topicref, mapref, etc) will be expanded if: have this pseudo class this pseudo class is set on root See alsosetResolveAllTopicReferences(boolean)
.-
Fields inherited from class ro.sync.ecss.extensions.dita.conref.DITAConRefResolver
keyManagerProvider
-
-
Constructor Summary
Constructors Constructor Description DITAMapRefResolver()
Deprecated.useDITAMapRefResolver(ContextKeyManagerProvider)
instead, otherwise key resolution will not work in Web Author.DITAMapRefResolver(ContextKeyManager keyManager)
Deprecated.useDITAMapRefResolver(ContextKeyManagerProvider)
instead.DITAMapRefResolver(ContextKeyManagerProvider keyManagerProvider)
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.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
getDisplayName(AuthorNode node)
Returns the value of thehref
attribute.java.lang.Object
getGrammarCache()
Get the grammar cache to be reused in another references resolver.java.lang.String
getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess)
Get the reference System IDjava.lang.String
getReferenceUniqueID(AuthorNode node)
The value ofconref
attribute is used as the unique identifier.boolean
hasEditableReference(java.lang.String systemID, AuthorNode referenceNodeParent)
Check if the node is editable.boolean
hasReferences(AuthorNode node)
An element that hashref
attribute is an element with references.boolean
isReferenceChanged(AuthorNode node, java.lang.String attributeName)
Returnstrue
when the attribute name is equal to'conref'
.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 content referred byconref
attribute.void
setExpandMapReferences(boolean isExpand)
Decide whether to expand or not the references of DITA maps.void
setGrammarCache(java.lang.Object grammarCache)
Set the grammar cache to be reused in another references resolver.void
setResolveAllTopicReferences(boolean resolveAllTopicRefs)
Try to resolve all topic references-
Methods inherited from class ro.sync.ecss.extensions.dita.conref.DITAConRefResolver
getDescription, getTopicPath, setResolveKeyrefsToMetaContentAsConrefs
-
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.Extension
getDescription
-
-
-
-
Field Detail
-
EXPAND_PSEUDO_CLASS
public static final java.lang.String EXPAND_PSEUDO_CLASS
Reference elements (like topicref, mapref, etc) will be expanded if:- have this pseudo class
- this pseudo class is set on root
setResolveAllTopicReferences(boolean)
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DITAMapRefResolver
@Deprecated public DITAMapRefResolver(ContextKeyManager keyManager)
Deprecated.useDITAMapRefResolver(ContextKeyManagerProvider)
instead.Constructor.- Parameters:
keyManager
- The context-aware key manager.
-
DITAMapRefResolver
public DITAMapRefResolver(ContextKeyManagerProvider keyManagerProvider)
Constructor.- Parameters:
keyManagerProvider
- The context-aware key manager provider.
-
DITAMapRefResolver
@Deprecated public DITAMapRefResolver()
Deprecated.useDITAMapRefResolver(ContextKeyManagerProvider)
instead, otherwise key resolution will not work in Web Author.Constructor.
-
-
Method Detail
-
hasReferences
public boolean hasReferences(AuthorNode node)
An element that hashref
attribute is an element with references.- Specified by:
hasReferences
in interfaceAuthorReferenceResolver
- Overrides:
hasReferences
in classDITAConRefResolver
- 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 thehref
attribute.- Specified by:
getDisplayName
in interfaceAuthorReferenceResolver
- Overrides:
getDisplayName
in classDITAConRefResolver
- 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)
Resolve the content referred byconref
attribute.- Specified by:
resolveReference
in interfaceAuthorReferenceResolver
- Overrides:
resolveReference
in classDITAConRefResolver
- 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, AuthorAccess, EntityResolver)
-
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)
-
getReferenceSystemID
public java.lang.String getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess)
Get the reference System ID- Specified by:
getReferenceSystemID
in interfaceAuthorReferenceResolver
- Overrides:
getReferenceSystemID
in classDITAConRefResolver
- 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
- Overrides:
checkTarget
in classDITAConRefResolver
- 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)
-
getReferenceUniqueID
public java.lang.String getReferenceUniqueID(AuthorNode node)
The value ofconref
attribute is used as the unique identifier.- Specified by:
getReferenceUniqueID
in interfaceAuthorReferenceResolver
- Overrides:
getReferenceUniqueID
in classDITAConRefResolver
- 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
- Overrides:
isReferenceChanged
in classDITAConRefResolver
- 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)
-
setResolveAllTopicReferences
public void setResolveAllTopicReferences(boolean resolveAllTopicRefs)
Description copied from interface:DITAMapReferencesResolver
Try to resolve all topic references- Specified by:
setResolveAllTopicReferences
in interfaceDITAMapReferencesResolver
- Parameters:
resolveAllTopicRefs
- If true, will resolve both map references and topic references. If false, will resolve only map references, defaults to false- See Also:
DITAMapReferencesResolver.setResolveAllTopicReferences(boolean)
-
setExpandMapReferences
public void setExpandMapReferences(boolean isExpand)
Description copied from interface:DITAMapReferencesResolver
Decide whether to expand or not the references of DITA maps.- Specified by:
setExpandMapReferences
in interfaceDITAMapReferencesResolver
- Parameters:
isExpand
-true
to expand the references.- See Also:
DITAMapReferencesResolver.setExpandMapReferences(boolean)
-
getGrammarCache
public java.lang.Object getGrammarCache()
Description copied from interface:DITAMapReferencesResolver
Get the grammar cache to be reused in another references resolver.- Specified by:
getGrammarCache
in interfaceDITAMapReferencesResolver
- Returns:
- the grammar cache to be reused in another references resolver.
- See Also:
DITAMapReferencesResolver.getGrammarCache()
-
setGrammarCache
public void setGrammarCache(java.lang.Object grammarCache)
Description copied from interface:DITAMapReferencesResolver
Set the grammar cache to be reused in another references resolver.- Specified by:
setGrammarCache
in interfaceDITAMapReferencesResolver
- Parameters:
grammarCache
- The grammar cache to be used.- See Also:
DITAMapReferencesResolver.setGrammarCache(java.lang.Object)
-
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
- Overrides:
getCacheKey
in classDITAConRefResolver
- 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.getCacheKey(ro.sync.ecss.extensions.api.node.AuthorNode)
-
-