Oxygen XML Editor 11.2 Author API

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

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

public class DITAConRefResolver
extends Object
implements ValidatingAuthorReferenceResolver

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
 String getDescription()
           
 String getDisplayName(AuthorNode node)
          Returns the value of the conref attribute.
 String getReferenceSystemID(AuthorNode node, AuthorAccess authorAccess)
          Return the systemID of the referred content.
 String getReferenceUniqueID(AuthorNode node)
          The value of conref 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 has conref attribute is an element with references.
 boolean isReferenceChanged(AuthorNode node, String attributeName)
          Returns true when the attribute name is equal to 'conref'.
protected  DITAConRef parseDITAHref(String baseUrl, String hrefValue, AuthorAccess authorAccess, boolean forTopicRef)
          Parse the href attribute and returns the absolute URL and the id.
 SAXSource resolveReference(AuthorNode node, String systemID, AuthorAccess authorAccess, EntityResolver entityResolver)
          Resolve the content referred by conref attribute.
 
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.

Specified by:
hasReferences in interface AuthorReferenceResolver
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 String getDisplayName(AuthorNode node)
Returns the value of the conref attribute.

Specified by:
getDisplayName in interface AuthorReferenceResolver
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 SAXSource resolveReference(AuthorNode node,
                                  String systemID,
                                  AuthorAccess authorAccess,
                                  EntityResolver entityResolver)
Resolve the content referred by conref attribute.

Specified by:
resolveReference in interface AuthorReferenceResolver
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.
See Also:
AuthorReferenceResolver.resolveReference(ro.sync.ecss.extensions.api.node.AuthorNode, java.lang.String, AuthorAccess, EntityResolver)

getTopicPath

protected String[] getTopicPath(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.

parseDITAHref

protected final DITAConRef parseDITAHref(String baseUrl,
                                         String hrefValue,
                                         AuthorAccess authorAccess,
                                         boolean forTopicRef)
                                  throws MalformedURLException
Parse the href attribute and returns the absolute URL and the id.

Parameters:
baseUrl - The base document URL.
hrefValue - The href attribute value.
authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility
Returns:
A container object with the content reference URI and topicID or null.
Throws:
MalformedURLException - Can't create the URL.

getDescription

public String getDescription()
Specified by:
getDescription in interface Extension
Returns:
The description of the extension.
See Also:
Extension.getDescription()

getReferenceUniqueID

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

Specified by:
getReferenceUniqueID in interface AuthorReferenceResolver
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,
                                  String attributeName)
Returns true when the attribute name is equal to 'conref'.

Specified by:
isReferenceChanged in interface AuthorReferenceResolver
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 String getReferenceSystemID(AuthorNode node,
                                   AuthorAccess authorAccess)
Description copied from interface: AuthorReferenceResolver
Return the systemID of the referred content.

Specified by:
getReferenceSystemID in interface AuthorReferenceResolver
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 interface ValidatingAuthorReferenceResolver
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)

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.