Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.dita.conref
Class DITAConRefResolver

java.lang.Object
  extended by ro.sync.ecss.extensions.api.DITAConrefsResolverBase
      extended by ro.sync.ecss.extensions.dita.conref.DITAConRefResolver
All Implemented Interfaces:
AuthorReferenceResolver, Extension, ValidatingAuthorReferenceResolver
Direct Known Subclasses:
DITAMapRefResolver

@API(type=INTERNAL,
     src=PUBLIC)
public class DITAConRefResolver
extends DITAConrefsResolverBase

Resolver for content referred using conref attribute.


Constructor Summary
DITAConRefResolver()
           
 
Method Summary
 void checkTarget(AuthorNode node, AuthorDocument targetDocument)
          Check if the referenced target can be inserted in the source document
 java.lang.String getDescription()
           
 java.lang.String getDisplayName(AuthorNode node)
          Returns the value of the conref attribute.
 java.lang.String getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess)
          Return the systemID of the referred content.
 java.lang.String getReferenceUniqueID(AuthorNode node)
          The value of conref 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 has conref attribute is an element with references.
 boolean isReferenceChanged(AuthorNode node, java.lang.String attributeName)
          Returns true 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 by conref attribute.
 void setResolveKeyrefsToMetaContentAsConrefs(boolean resolveKeyrefsAsConrefs)
          Set to true to resolve all keyrefs as conrefs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DITAConRefResolver

public DITAConRefResolver()
Method Detail

hasReferences

public boolean hasReferences(AuthorNode node)
An element that has conref attribute is an element with references.

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 the conref attribute.

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 by conref attribute.

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.
Returns:
The SAXSource including the parser and the parser's InputSource.
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)

getTopicPath

protected java.lang.String[] getTopicPath(java.lang.String value)
Gets the topic IDs as an array of strings.

Parameters:
value - The conref attribute value.
Returns:
The path of IDs as an array of strings.

getDescription

public java.lang.String getDescription()
Returns:
The description of the extension.
See Also:
Extension.getDescription()

getReferenceUniqueID

public java.lang.String getReferenceUniqueID(AuthorNode node)
The value of conref attribute is used as the unique identifier.

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)
Returns true when the attribute name is equal to 'conref'.

Parameters:
node - The AuthorNode 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.

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

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 to true to resolve all keyrefs as conrefs

Specified by:
setResolveKeyrefsToMetaContentAsConrefs in class DITAConrefsResolverBase
Parameters:
resolveKeyrefsAsConrefs - If true, will resolve keyword keyrefs as conrefs.
See Also:
DITAConrefsResolverBase.setResolveKeyrefsToMetaContentAsConrefs(boolean)

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.