Oxygen XML Editor 16.1 Author API

ro.sync.ecss.dita
Class DITAAccess

java.lang.Object
  extended by ro.sync.ecss.dita.DITAAccess

@API(type=NOT_EXTENDABLE,
     src=PRIVATE)
public class DITAAccess
extends java.lang.Object

Utility methods for DITA interaction.


Nested Class Summary
static class DITAAccess.PasteInfo
          Paste type of clipboard fragments.
 
Field Summary
static int CONKEYREF_TYPE
          Conkeyref
static int CONREF_TYPE
          Conref
static java.lang.String DEFAULT_CONKEYREF_CONREFEND
          Value for conrefend attribute value when a conkeyref is used.
static java.lang.String ID_ANY
          Identifier used in references path, representing that the topic id can be excluded from the reference.
static int INHERITANCE_GENERALIZATION
          If the source is a generalization of the target
static int INHERITANCE_NONE
          No match between the two classes..
static int INHERITANCE_SAME
          If the source class is the same as the target class.
static int INHERITANCE_SPECIALIZATION
          If the source is a specialization of the target
static java.lang.String INVALID_PASTE_RESULT_MESSAGE
          Invalid paste message
static int KEYREF_TYPE
          Keyref
protected static ro.sync.exml.MessageBundle messages
          The messages resource bundle.
static java.lang.String[] REF_ATTRIBUTES
          DITA reference attributes.
 
Constructor Summary
DITAAccess()
           
 
Method Summary
static void addEditReference(AuthorAccess authorAccess)
          Add a new conref to the current element or edit the existing one.
static java.util.List<CIAttribute> annotateAttributes(java.util.List<CIAttribute> attributes)
          Annotate a list of attributes.
protected static int checkConsecutiveInsertionWarning(int previousOperationOffset, int selectionStart, int selectionEnd, ro.sync.ecss.dita.reference.ReferenceInfo previousReferenceInfo, ro.sync.ecss.dita.reference.ReferenceInfo currentReferenceInfo)
          Show a warning message when consecutive insertion of the same references are performed.
static java.lang.String checkValidKeyRef(java.lang.String keyref)
          Check if a keyref has a valid key name.
static java.lang.String computeElementClazz(WhatPossibleValuesHasAttributeContext context)
          Compute the element's clazz
static java.lang.String computeLinkText(java.lang.String hrefValue, java.lang.String baseSystemID)
          Obtains the title of the referred topic (a specialization of topic).
static void createNewTopicReference(AuthorAccess authorAccess)
          Create a new DITA topic and link to it as a reference.
static void createReusableComponent(AuthorAccess authorAccess, ro.sync.ecss.extensions.api.DITAUniqueIDAssigner idsAssigner)
          Reuse the selected content.
static java.util.List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, java.lang.String documentTypeName)
          Deprecated. Please use the equivalent method which also receives the URL of the requestor.
static java.util.List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, java.lang.String documentTypeName, AuthorAccess authorAccess)
          Propose additional attribute values.
static java.util.List<CIValue> filterDITAVALAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context)
          Filter DITAVAL Attribute values.
static java.util.List<CIElement> filterElements(java.util.List<CIElement> elements, WhatElementsCanGoHereContext context)
          Filter the given elements according to the given context.
static java.lang.String getAPIKeysManagerDescription()
           
static java.lang.String getAutoInsertImageRefElementName(AuthorAccess authorAccess, int caretPosition)
          Get the name of the topic ref element to insert
static java.lang.String getAutoInsertRefElementName(AuthorAccess authorAccess, int caretPosition)
          Get the name of the topic ref element to insert
static java.lang.String getAutoInsertTopicRefElementName(AuthorAccess authorAccess, int caretPosition)
          Get the name of the topic ref element to insert
static CIElement getEquivalentChildCIElement(AuthorAccess authorAccess, int caretOffset, java.lang.String tagName)
          Get the equivalent child CIElement
static int getInheritanceType(java.lang.String sourceClass, java.lang.String targetClass)
          Check what inheritance is between the two classes.
static ro.sync.ecss.dita.topic.group.TopicgroupInfo getInsertTopicgroup(java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, int caretOffset)
          Insert a topic group.
static ro.sync.ecss.dita.topic.TopicInfo getInsertTopichead(java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, int caretOffset)
          Insert a topic head.
static void getInsertTopicref(java.net.URL editorLocation, java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, java.lang.String initialTopicRefLocation, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, java.lang.String preferredElementName, boolean displayReferenceUrl)
          Insert a topic ref.
static java.util.LinkedHashMap<java.lang.String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys()
          Deprecated. Please use the equivalent method which also receives the URL of the requestor.
static java.util.LinkedHashMap<java.lang.String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(java.net.URL originatorURL)
           
static java.util.LinkedHashMap<java.lang.String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(java.net.URL originatorURL, ContextKeyManager keysManager)
          Returns the mapped DITA 1.2 keys
static ro.sync.ecss.dita.reference.keyref.KeysManager getKeysManager()
          Get the keys manager,
static ro.sync.ecss.dita.map.TitleInfo getNewMapTitle(java.lang.Object parentFrame, java.lang.String oldTitle, boolean preferTitleAttribute)
          Edit the map title
static java.net.URL getRootMapURL()
          Get DITA root map URL.
static ro.sync.ecss.dita.topic.group.TopicgroupInfo getTopicGroupInfo(java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, int caretOffset, ro.sync.ecss.dita.topic.group.TopicgroupInfo initialTopicrefInfo)
          Show the topic group info dialog with some initial content
static ro.sync.ecss.dita.topic.head.TopicheadInfo getTopicHeadInfo(java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, int caretOffset, ro.sync.ecss.dita.topic.head.TopicheadInfo initialHeadInfo)
          Show the topic head info dialog with some initial content
static void getTopicRefInfo(java.net.URL location, java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, int caretOffset, ro.sync.ecss.dita.topic.ref.TopicrefInfo initialTopicrefInfo, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter)
          Show the topic head info dialog with some initial content
static boolean hasAPIKeysManager()
           
static void insertContentReference(AuthorAccess authorAccess, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
          Shows a dialog that allows inserting a content reference (conref).
static void insertHref(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic)
          Insert a Xref.
static void insertHref(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
          Insert a Xref or link element.
static void insertImage(AuthorAccess authorAccess, java.lang.String ref)
          Insert a DITA Image
static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess, java.lang.String ref)
          Insert a DITA Image
static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess, java.lang.String refAttrName, java.lang.String refValue)
          Insert a DITA Image
static void insertReference(AuthorAccess authorAccess, int refType)
          Insert a keyref or a conkeyref.
static void insertReusableComponent(AuthorAccess authorAccess)
          Insert a reusable component
static void insertTopicgroup(AuthorAccess authorAccess)
          Insert a topic group.
static void insertTopichead(AuthorAccess authorAccess)
          Insert a topic head.
static void insertTopicref(AuthorAccess authorAccess)
          Insert a topic ref.
static void insertTopicref(AuthorAccess authorAccess, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
          Insert a topic reference.
static void insertTopicref(WSDITAMapEditorPage ditaPageAccess, java.net.URL initialReferenceURL, java.lang.String preferredElementName, boolean asChild, boolean displayReferenceUrl)
          Insert a topic reference in the DITA Map tree.
static boolean isGeneralizationOf(java.lang.String sourceClass, java.lang.String targetClass)
          True if the first class value is a generalization or the same as the second class value.
static Reference parseDITAHref(java.lang.String baseUrl, java.lang.String hrefValue)
          Parse the href attribute and returns the absolute URL and the id.
static Reference parseDITAKeyRef(java.lang.String keyref)
          Deprecated. Please use the equivalent method which also receives the URL of the requestor.
static Reference parseDITAKeyRef(java.lang.String keyref, ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
          Parse the DITA conkeyref value
static Reference parseDITAKeyRef(java.net.URL originatorURL, ContextKeyManager keyManager, java.lang.String keyref)
          Parse the DITA conkeyref value
static Reference parseDITAKeyRef(java.net.URL originatorURL, java.lang.String keyref)
          Parse the DITA conkeyref value
static java.lang.String pasteAsReference(AuthorAccess authorAccess, boolean asConref)
          Paste as reference
static java.lang.String pasteAsReference(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo)
          Paste as reference
static boolean pasteClipboardFragmentsAsReference(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo, ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments)
          Paste the fragments from clipboard as reference.
static void removeReference(AuthorAccess authorAccess)
          Remove a content reference from a DITA document.
static void replaceConref(AuthorAccess authorAccess)
          Replace the conref at caret position
static void resolveKeyNotFoundError(AuthorAccess authorAccess, java.lang.String keyref)
          The give key was not found.
static java.net.URL resolveKeyRef(java.lang.String keyRef, boolean addANYIdentifierForKeys)
          Deprecated. Please use the equivalent method which also receives the URL of the requestor.
static java.net.URL resolveKeyRef(java.lang.String keyRef, ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
          Resolve a keyref.
static java.net.URL resolveKeyRef(java.net.URL originatorURL, java.lang.String keyRef, boolean addANYIdentifierForKeys)
          Resolve a keyref.
static java.net.URL resolveKeyRef(java.net.URL originatorURL, java.lang.String keyRef, ContextKeyManager keysManager, boolean addANYIdentifierForKeys)
          Resolve a keyref.
static void searchReferences(AuthorAccess authorAccess)
          Search references to a certain element at the caret position.
static void setDitaAccessCustomizer(ro.sync.ecss.dita.DITAAccessCustomizer ditaAccessCustomizer)
          Set the DITA access customizer from SA or EC.
static void showInsertReferenceDialog(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.ue.AuthorDocumentControllerImpl controller, int caretOffset, java.lang.Object parentFrame, int refType, boolean showOnlyKeysList, ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter)
          Shows the keyref/conkeyref insert dialog and returns the choosen refrence information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

protected static final ro.sync.exml.MessageBundle messages
The messages resource bundle.


REF_ATTRIBUTES

public static final java.lang.String[] REF_ATTRIBUTES
DITA reference attributes.


DEFAULT_CONKEYREF_CONREFEND

public static final java.lang.String DEFAULT_CONKEYREF_CONREFEND
Value for conrefend attribute value when a conkeyref is used.

See Also:
Constant Field Values

KEYREF_TYPE

public static final int KEYREF_TYPE
Keyref

See Also:
Constant Field Values

CONREF_TYPE

public static final int CONREF_TYPE
Conref

See Also:
Constant Field Values

CONKEYREF_TYPE

public static final int CONKEYREF_TYPE
Conkeyref

See Also:
Constant Field Values

INVALID_PASTE_RESULT_MESSAGE

public static final java.lang.String INVALID_PASTE_RESULT_MESSAGE
Invalid paste message

See Also:
Constant Field Values

ID_ANY

public static final java.lang.String ID_ANY
Identifier used in references path, representing that the topic id can be excluded from the reference.

See Also:
Constant Field Values

INHERITANCE_GENERALIZATION

public static final int INHERITANCE_GENERALIZATION
If the source is a generalization of the target

See Also:
Constant Field Values

INHERITANCE_SPECIALIZATION

public static final int INHERITANCE_SPECIALIZATION
If the source is a specialization of the target

See Also:
Constant Field Values

INHERITANCE_SAME

public static final int INHERITANCE_SAME
If the source class is the same as the target class.

See Also:
Constant Field Values

INHERITANCE_NONE

public static final int INHERITANCE_NONE
No match between the two classes..

See Also:
Constant Field Values
Constructor Detail

DITAAccess

public DITAAccess()
Method Detail

getInsertTopicref

public static void getInsertTopicref(java.net.URL editorLocation,
                                     java.lang.Object parentFrame,
                                     ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                     AuthorDocumentController ctrl,
                                     int caretOffset,
                                     java.lang.String initialTopicRefLocation,
                                     ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter,
                                     java.lang.String preferredElementName,
                                     boolean displayReferenceUrl)
Insert a topic ref.

Parameters:
editorLocation - The editor location.
parentFrame - The parent frame.
ccM - The CC Manager.
ctrl - The document controller.
caretOffset - The caret offset.
initialTopicRefLocation - The initial location (relative or absolute) to set to the topic ref insert dialog.
inserter - Topic ref inserter
preferredElementName - Preferred name of the element to insert
displayReferenceUrl - If true the URL input will be displayed in the insert topic reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
Note: this parameter is not used on Eclipse plugin implementation.

insertTopicref

public static void insertTopicref(AuthorAccess authorAccess)
                           throws AuthorOperationException
Insert a topic ref.

Parameters:
authorAccess - The author access.
Throws:
AuthorOperationException

insertTopicgroup

public static void insertTopicgroup(AuthorAccess authorAccess)
                             throws AuthorOperationException
Insert a topic group.

Parameters:
authorAccess - The author access.
Throws:
AuthorOperationException

getInsertTopichead

public static ro.sync.ecss.dita.topic.TopicInfo getInsertTopichead(java.lang.Object parentFrame,
                                                                   ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                                                   ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                                                   int caretOffset)
Insert a topic head.

Parameters:
parentFrame - The parent frame.
ccM - The CC Manager.
ctrl - The document controller.
caretOffset - The caret offset.
Returns:
The XML fragment to insert or null if operation canceled.

insertTopichead

public static void insertTopichead(AuthorAccess authorAccess)
                            throws AuthorOperationException
Insert a topic head.

Parameters:
authorAccess - The author access.
Throws:
AuthorOperationException

setDitaAccessCustomizer

public static void setDitaAccessCustomizer(ro.sync.ecss.dita.DITAAccessCustomizer ditaAccessCustomizer)
Set the DITA access customizer from SA or EC.

Parameters:
ditaAccessCustomizer - The DITA access customizer.

hasAPIKeysManager

public static boolean hasAPIKeysManager()
Returns:
true if we have a keys manager provided through the API.

getAPIKeysManagerDescription

public static java.lang.String getAPIKeysManagerDescription()
Returns:
A description for the API Keys manager.

getNewMapTitle

public static ro.sync.ecss.dita.map.TitleInfo getNewMapTitle(java.lang.Object parentFrame,
                                                             java.lang.String oldTitle,
                                                             boolean preferTitleAttribute)
Edit the map title

Parameters:
parentFrame - The parent frame
oldTitle - The old title
preferTitleAttribute -
Returns:
The new title proposed by the user

getTopicHeadInfo

public static ro.sync.ecss.dita.topic.head.TopicheadInfo getTopicHeadInfo(java.lang.Object parentFrame,
                                                                          ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                                                          ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                                                          int caretOffset,
                                                                          ro.sync.ecss.dita.topic.head.TopicheadInfo initialHeadInfo)
Show the topic head info dialog with some initial content

Parameters:
parentFrame - The parent frame.
ccM - The CC Manager.
ctrl - The document controller.
caretOffset - The caret offset.
initialHeadInfo - Initial topic head info.
Returns:
The new modified content.

getTopicRefInfo

public static void getTopicRefInfo(java.net.URL location,
                                   java.lang.Object parentFrame,
                                   ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                   ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                   int caretOffset,
                                   ro.sync.ecss.dita.topic.ref.TopicrefInfo initialTopicrefInfo,
                                   ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter)
Show the topic head info dialog with some initial content

Parameters:
location - The dita map location
parentFrame - The parent frame.
ccM - The CC Manager.
ctrl - The document controller.
caretOffset - The caret offset.
initialTopicrefInfo - Initial topic ref info.
inserter - Callback when the dialog is used.

getTopicGroupInfo

public static ro.sync.ecss.dita.topic.group.TopicgroupInfo getTopicGroupInfo(java.lang.Object parentFrame,
                                                                             ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                                                             ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                                                             int caretOffset,
                                                                             ro.sync.ecss.dita.topic.group.TopicgroupInfo initialTopicrefInfo)
Show the topic group info dialog with some initial content

Parameters:
parentFrame - The parent frame.
ccM - The CC Manager.
ctrl - The document controller.
caretOffset - The caret offset.
initialTopicrefInfo - Initial topic group info.
Returns:
The new modified content.

getInsertTopicgroup

public static ro.sync.ecss.dita.topic.group.TopicgroupInfo getInsertTopicgroup(java.lang.Object parentFrame,
                                                                               ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                                                               ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                                                               int caretOffset)
Insert a topic group.

Parameters:
parentFrame - The parent frame.
ccM - The CC Manager.
ctrl - The document controller.
caretOffset - The caret offset.
Returns:
The XML fragment to insert or null if operation canceled.

insertHref

public static void insertHref(AuthorAccess authorAccess,
                              java.lang.String typeValue,
                              java.lang.String formatValue,
                              java.lang.String scopeValue,
                              boolean isXref,
                              boolean isHrefTypeDitaTopic,
                              java.net.URL initialReferenceURL,
                              boolean displayReferenceUrl)
                       throws AuthorOperationException
Insert a Xref or link element.

Parameters:
authorAccess - The author access.
typeValue - The type attribute value. If not null, the generated reference will have the 'type="typeValue"' attribute set to it.
formatValue - The format attribute value. If not null and the reference points to a non-DITA resource, the generated reference will have the 'format="formatValue"' attribute set to it.
scopeValue - The scope attribute value. If not null, the generated reference will have the 'scope="scopeValue"' attribute set to it.
isXref - true if we need to insert an <xref> element, false for the <link> element.
isHrefTypeDitaTopic - If true the user wants to insert a reference to a DITA resource (Insert Cross Reference action) If false the user wants to a reference to an external non-dita resource (Web Link action or File Reference action).
initialReferenceURL - The default URL that will be displayed in the URL field of the insert reference dialog.
Note: this parameter is not used on Eclipse plugin implementation.
displayReferenceUrl - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
Note: this parameter is not used on Eclipse plugin implementation.
Throws:
AuthorOperationException
Since:
14.2

insertHref

public static void insertHref(AuthorAccess authorAccess,
                              java.lang.String typeValue,
                              java.lang.String formatValue,
                              java.lang.String scopeValue,
                              boolean isXref,
                              boolean isHrefTypeDitaTopic)
                       throws AuthorOperationException
Insert a Xref.

Parameters:
authorAccess - The author access.
typeValue - The the attribute value.
formatValue - The format attribute value.
scopeValue - The scope attribute value.
isXref - true if we need to insert a xref element, false for link element.
isHrefTypeDitaTopic - if true a dita topic chooser will be shown otherwise a input url dialog will be show for the href attribute value.
Throws:
AuthorOperationException

insertContentReference

public static void insertContentReference(AuthorAccess authorAccess,
                                          java.net.URL initialReferenceURL,
                                          boolean displayReferenceUrl)
                                   throws AuthorOperationException
Shows a dialog that allows inserting a content reference (conref).

Parameters:
authorAccess - The Author access.
initialReferenceURL - The default URL that will be displayed in the URL field of the insert reference dialog.
Note: this parameter is not used on Eclipse plugin implementation.
displayReferenceUrl - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
Note: this parameter is not used on Eclipse plugin implementation.
Throws:
AuthorOperationException
Since:
14.2

insertTopicref

public static void insertTopicref(AuthorAccess authorAccess,
                                  java.net.URL initialReferenceURL,
                                  boolean displayReferenceUrl)
                           throws AuthorOperationException
Insert a topic reference.

Parameters:
authorAccess - The Author access.
initialReferenceURL - The default URL that will be displayed in the URL field of the insert reference dialog.
Note: this parameter is not used on Eclipse plugin implementation.
displayReferenceUrl - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
Note: this parameter is not used on Eclipse plugin implementation.
Throws:
AuthorOperationException
Since:
14.2

insertTopicref

public static void insertTopicref(WSDITAMapEditorPage ditaPageAccess,
                                  java.net.URL initialReferenceURL,
                                  java.lang.String preferredElementName,
                                  boolean asChild,
                                  boolean displayReferenceUrl)
                           throws AuthorOperationException
Insert a topic reference in the DITA Map tree.

Parameters:
ditaPageAccess - The DITA Page access.
initialReferenceURL - The default URL that will be displayed in the URL field of the insert reference dialog.
Note: this parameter is not used on Eclipse plugin implementation.
preferredElementName - The preferred name of the element to insert.
asChild - true to insert as a child of the selected item, false to insert as a next sibling.
displayReferenceUrl - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
Note: this parameter is not used on Eclipse plugin implementation.
Throws:
AuthorOperationException
Since:
15

insertReference

public static void insertReference(AuthorAccess authorAccess,
                                   int refType)
                            throws AuthorOperationException
Insert a keyref or a conkeyref.

Parameters:
authorAccess - The author access.
refType - Reference type. Can be one of the following constants:
Throws:
AuthorOperationException

showInsertReferenceDialog

public static void showInsertReferenceDialog(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager,
                                             ro.sync.ecss.ue.AuthorDocumentControllerImpl controller,
                                             int caretOffset,
                                             java.lang.Object parentFrame,
                                             int refType,
                                             boolean showOnlyKeysList,
                                             ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter)
                                      throws AuthorOperationException
Shows the keyref/conkeyref insert dialog and returns the choosen refrence information.

Parameters:
ccManager - CC manager.
controller - Author document controller.
caretOffset - Caret offset.
parentFrame - Parent frame.
refType - One of: KEYREF_TYPE, CONREF_TYPE, CONKEYREF_TYPE
showOnlyKeysList - true to show only keys list in the insert reference dialog.
referenceInserter - The reference inserter.
Throws:
AuthorOperationException - When the insertion fails.

getKeysManager

public static ro.sync.ecss.dita.reference.keyref.KeysManager getKeysManager()
Get the keys manager,

Returns:
The keys manager

getRootMapURL

public static java.net.URL getRootMapURL()
Get DITA root map URL.

Returns:
DITA root map URL.

resolveKeyRef

@Deprecated
public static java.net.URL resolveKeyRef(java.lang.String keyRef,
                                                    boolean addANYIdentifierForKeys)
Deprecated. Please use the equivalent method which also receives the URL of the requestor.

Resolve a keyref.

Parameters:
keyRef - The keyref value
addANYIdentifierForKeys - If true then reference keys will be prefixed by 'ANY/'. in a element_keyref function.
Returns:
The absolute value of the key ref target.

resolveKeyRef

public static java.net.URL resolveKeyRef(java.net.URL originatorURL,
                                         java.lang.String keyRef,
                                         boolean addANYIdentifierForKeys)
Resolve a keyref.

Parameters:
originatorURL - The originator URL.
keyRef - The keyref value
addANYIdentifierForKeys - If true then reference keys will be prefixed by 'ANY/'. in a element_keyref function.
Returns:
The absolute value of the key ref target.

checkValidKeyRef

public static java.lang.String checkValidKeyRef(java.lang.String keyref)
Check if a keyref has a valid key name.

Parameters:
keyref - The keyref (may also contain the "/").
Returns:
an error message if the key name is not valid or null if the key name is valid.

resolveKeyRef

public static java.net.URL resolveKeyRef(java.net.URL originatorURL,
                                         java.lang.String keyRef,
                                         ContextKeyManager keysManager,
                                         boolean addANYIdentifierForKeys)
Resolve a keyref.

Parameters:
originatorURL - The url that contains the key.
keyRef - The keyref value
keysManager - The key manager.
addANYIdentifierForKeys - If true then reference keys will be prefixed by 'ANY/'. in a element_keyref function.
Returns:
The absolute value of the key ref target.

resolveKeyRef

public static java.net.URL resolveKeyRef(java.lang.String keyRef,
                                         ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
Resolve a keyref.

Parameters:
keyRef - The keyref value
kr - The key resolver.
Returns:
The absolute value of the key ref target.

createReusableComponent

public static void createReusableComponent(AuthorAccess authorAccess,
                                           ro.sync.ecss.extensions.api.DITAUniqueIDAssigner idsAssigner)
                                    throws AuthorOperationException
Reuse the selected content.

Parameters:
authorAccess - The author access
idsAssigner - The IDs assigner
Throws:
AuthorOperationException - If fails

insertReusableComponent

public static void insertReusableComponent(AuthorAccess authorAccess)
                                    throws AuthorOperationException
Insert a reusable component

Parameters:
authorAccess - The author access
Throws:
AuthorOperationException

replaceConref

public static void replaceConref(AuthorAccess authorAccess)
                          throws AuthorOperationException
Replace the conref at caret position

Parameters:
authorAccess -
Throws:
AuthorOperationException

removeReference

public static void removeReference(AuthorAccess authorAccess)
                            throws AuthorOperationException
Remove a content reference from a DITA document.

Parameters:
authorAccess - The author access.
Throws:
AuthorOperationException

addEditReference

public static void addEditReference(AuthorAccess authorAccess)
                             throws AuthorOperationException
Add a new conref to the current element or edit the existing one.

Parameters:
authorAccess - The author access
Throws:
AuthorOperationException

isGeneralizationOf

public static boolean isGeneralizationOf(java.lang.String sourceClass,
                                         java.lang.String targetClass)
True if the first class value is a generalization or the same as the second class value.

Parameters:
sourceClass - The source class value
targetClass - The target class value
Returns:
True if the first class value is a generalization of the second

getInheritanceType

public static int getInheritanceType(java.lang.String sourceClass,
                                     java.lang.String targetClass)
Check what inheritance is between the two classes.

Parameters:
sourceClass - The source class value
targetClass - The target class value
Returns:
True if the first class value is a generalization of the second

parseDITAHref

public static final Reference parseDITAHref(java.lang.String baseUrl,
                                            java.lang.String hrefValue)
                                     throws java.net.MalformedURLException
Parse the href attribute and returns the absolute URL and the id.

Parameters:
baseUrl - The base document URL.
hrefValue - The href attribute value. 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:
java.net.MalformedURLException - Can't create the URL.

parseDITAKeyRef

@Deprecated
public static Reference parseDITAKeyRef(java.lang.String keyref)
                                 throws java.net.MalformedURLException
Deprecated. Please use the equivalent method which also receives the URL of the requestor.

Parse the DITA conkeyref value

Parameters:
keyref - The attribute 'conkeyref' value
Returns:
The DITA Conref object
Throws:
java.net.MalformedURLException

parseDITAKeyRef

public static Reference parseDITAKeyRef(java.net.URL originatorURL,
                                        java.lang.String keyref)
                                 throws java.net.MalformedURLException
Parse the DITA conkeyref value

Parameters:
originatorURL - The originator URL.
keyref - The attribute 'conkeyref' value
Returns:
The DITA Conref object
Throws:
java.net.MalformedURLException

parseDITAKeyRef

public static Reference parseDITAKeyRef(java.net.URL originatorURL,
                                        ContextKeyManager keyManager,
                                        java.lang.String keyref)
                                 throws java.net.MalformedURLException
Parse the DITA conkeyref value

Parameters:
originatorURL - The originator URL.
keyManager - The key manager used to resolve the keyref.
keyref - The attribute 'conkeyref' value
Returns:
The DITA Conref object
Throws:
java.net.MalformedURLException

parseDITAKeyRef

public static Reference parseDITAKeyRef(java.lang.String keyref,
                                        ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
                                 throws java.net.MalformedURLException
Parse the DITA conkeyref value

Parameters:
keyref - The attribute 'conkeyref' value
kr - The keys resolver
Returns:
The DITA Conref object
Throws:
java.net.MalformedURLException

getAutoInsertTopicRefElementName

public static java.lang.String getAutoInsertTopicRefElementName(AuthorAccess authorAccess,
                                                                int caretPosition)
Get the name of the topic ref element to insert

Parameters:
authorAccess - The author access
caretPosition - Caret position
Returns:
A name for the topic ref to insert

getAutoInsertRefElementName

public static java.lang.String getAutoInsertRefElementName(AuthorAccess authorAccess,
                                                           int caretPosition)
Get the name of the topic ref element to insert

Parameters:
authorAccess - The author access
caretPosition - Caret position
Returns:
A name for the topic ref to insert

getAutoInsertImageRefElementName

public static java.lang.String getAutoInsertImageRefElementName(AuthorAccess authorAccess,
                                                                int caretPosition)
Get the name of the topic ref element to insert

Parameters:
authorAccess - The author access
caretPosition - Caret position
Returns:
A name for the topic ref to insert

getEquivalentChildCIElement

public static CIElement getEquivalentChildCIElement(AuthorAccess authorAccess,
                                                    int caretOffset,
                                                    java.lang.String tagName)
Get the equivalent child CIElement

Parameters:
authorAccess - Author access
caretOffset - The caret offset
tagName - The tag name
Returns:
the equivalent child CIElement

getKeys

@Deprecated
public static java.util.LinkedHashMap<java.lang.String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys()
Deprecated. Please use the equivalent method which also receives the URL of the requestor.

Returns:
The mapped DITA 1.2 keys

getKeys

public static java.util.LinkedHashMap<java.lang.String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(java.net.URL originatorURL)
Parameters:
originatorURL - The URL for which the keys are requested
Returns:
The mapped DITA 1.2 keys

getKeys

public static java.util.LinkedHashMap<java.lang.String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(java.net.URL originatorURL,
                                                                                                           ContextKeyManager keysManager)
Returns the mapped DITA 1.2 keys

Parameters:
originatorURL - The URL of the document which contains the keys.
keysManager - The key manager that is aware of the context of the document.
Returns:
The mapped DITA 1.2 keys

pasteAsReference

public static java.lang.String pasteAsReference(AuthorAccess authorAccess,
                                                boolean asConref)
                                         throws AuthorOperationException
Paste as reference

Parameters:
authorAccess - The author access.
asConref - True if paste as conref, false as link
Returns:
information about how this action should be used.
Throws:
AuthorOperationException

pasteAsReference

public static java.lang.String pasteAsReference(AuthorAccess authorAccess,
                                                DITAAccess.PasteInfo pasteInfo)
                                         throws AuthorOperationException
Paste as reference

Parameters:
authorAccess - The author access.
pasteInfo - Paste type of clipboard fragments.
Returns:
information about how this action should be used.
Throws:
AuthorOperationException

pasteClipboardFragmentsAsReference

public static boolean pasteClipboardFragmentsAsReference(AuthorAccess authorAccess,
                                                         DITAAccess.PasteInfo pasteInfo,
                                                         ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments)
                                                  throws AuthorOperationException
Paste the fragments from clipboard as reference.

Parameters:
authorAccess - The author access.
pasteInfo - Paste type of clipboard fragments.
fragments - The fragments to paste with.
Returns:
true if the paste was valid.
Throws:
AuthorOperationException

filterAttributeValues

@Deprecated
public static java.util.List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues,
                                                                       WhatPossibleValuesHasAttributeContext context,
                                                                       java.lang.String documentTypeName)
Deprecated. Please use the equivalent method which also receives the URL of the requestor.

Propose additional attribute values.

Parameters:
attributeValues - The attribute values.
context - The context.
documentTypeName - The document type name.
Returns:
The enriched list.

filterAttributeValues

public static java.util.List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues,
                                                            WhatPossibleValuesHasAttributeContext context,
                                                            java.lang.String documentTypeName,
                                                            AuthorAccess authorAccess)
Propose additional attribute values.

Parameters:
attributeValues - The attribute values.
context - The context.
documentTypeName - The document type name.
authorAccess - The Author Access.
Returns:
The enriched list.

computeElementClazz

public static java.lang.String computeElementClazz(WhatPossibleValuesHasAttributeContext context)
Compute the element's clazz

Parameters:
context - The attributes editing context.
Returns:
The element clazz or null.

annotateAttributes

public static java.util.List<CIAttribute> annotateAttributes(java.util.List<CIAttribute> attributes)
Annotate a list of attributes.

Parameters:
attributes - The attributes list.
Returns:
The list of attributes with annotations.

insertImage

public static void insertImage(AuthorAccess authorAccess,
                               java.lang.String ref)
                        throws AuthorOperationException
Insert a DITA Image

Parameters:
authorAccess - The author access
ref - The reference.
Throws:
AuthorOperationException

insertImageSchemaAware

public static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess,
                                                              java.lang.String ref)
                                                       throws AuthorOperationException
Insert a DITA Image

Parameters:
authorAccess - The author access
ref - The reference.
Returns:
The insertion result
Throws:
AuthorOperationException

insertImageSchemaAware

public static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess,
                                                              java.lang.String refAttrName,
                                                              java.lang.String refValue)
                                                       throws AuthorOperationException
Insert a DITA Image

Parameters:
authorAccess - The author access
refAttrName - The reference attribute name.
refValue - The reference value.
Returns:
The insertion result
Throws:
AuthorOperationException

searchReferences

public static void searchReferences(AuthorAccess authorAccess)
Search references to a certain element at the caret position.

Parameters:
authorAccess - The author access.

computeLinkText

public static java.lang.String computeLinkText(java.lang.String hrefValue,
                                               java.lang.String baseSystemID)
                                        throws java.net.MalformedURLException,
                                               java.io.IOException,
                                               javax.xml.parsers.ParserConfigurationException,
                                               org.xml.sax.SAXException,
                                               java.lang.Exception
Obtains the title of the referred topic (a specialization of topic).

Parameters:
hrefValue - The relative location of the topic.
baseSystemID - base system ID.
Returns:
The computed title information.
Throws:
java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception

filterElements

public static java.util.List<CIElement> filterElements(java.util.List<CIElement> elements,
                                                       WhatElementsCanGoHereContext context)
Filter the given elements according to the given context.

Parameters:
elements - The list of CIElement elements.
context - The context.
Returns:
The filtered CIElements.

resolveKeyNotFoundError

public static void resolveKeyNotFoundError(AuthorAccess authorAccess,
                                           java.lang.String keyref)
The give key was not found. We will present a warning dialog to the user and we will offer the user as a possible solution to change the root map.

Parameters:
authorAccess - Interface to the author context.
keyref - The key that wasn't found in the current root map context.

checkConsecutiveInsertionWarning

protected static int checkConsecutiveInsertionWarning(int previousOperationOffset,
                                                      int selectionStart,
                                                      int selectionEnd,
                                                      ro.sync.ecss.dita.reference.ReferenceInfo previousReferenceInfo,
                                                      ro.sync.ecss.dita.reference.ReferenceInfo currentReferenceInfo)
Show a warning message when consecutive insertion of the same references are performed.

Parameters:
previousOperationOffset - The previous operation offset, usually where the caret is positioned.
selectionStart - The current selection start.
selectionEnd - The current selection end.
previousReferenceInfo - The previous inserted reference.
currentReferenceInfo - The current inserted reference.

filterDITAVALAttributeValues

public static java.util.List<CIValue> filterDITAVALAttributeValues(java.util.List<CIValue> attributeValues,
                                                                   WhatPossibleValuesHasAttributeContext context)
Filter DITAVAL Attribute values.

Parameters:
attributeValues - The current list of attribute values.
context - The what attribute values context.
Returns:
The modified list of values.

createNewTopicReference

public static void createNewTopicReference(AuthorAccess authorAccess)
                                    throws java.lang.Exception
Create a new DITA topic and link to it as a reference.

Parameters:
authorAccess - The Author Access
Throws:
java.lang.Exception - if it fails.

Oxygen XML Editor 16.1 Author API

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