Package ro.sync.ecss.dita
Class DITAAccess
java.lang.Object
ro.sync.ecss.dita.DITAAccess
Utility methods for DITA interaction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceShort cut for the insert link operation.static enumPaste type of clipboard fragments. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConkeyrefstatic final intConrefstatic final StringValue for conrefend attribute value when a conkeyref is used.static final StringThe attribute name for the keys manager.static final StringThe attribute name for the dita root map url.static final StringThe attribute name for the ditaval url.static final StringCan be sent as an URL parameter to give more information about the keyref fully qualified value.static final StringDeprecated.static final StringIdentifier used in references path, representing that the topic id is the first topic ID in the file.static final StringQuery parameter that imposes how a reference will be inserted in DITAstatic final intIf the source is a generalization of the targetstatic final intNo match between the two classes..static final intIf the source class is the same as the target class.static final intIf the source is a specialization of the targetstatic final intKeyrefstatic final StringThe 'href' attribute type DITA topic.static final StringThe 'href' attribute type non DITA resource.static final StringThe 'href' attribute type web page.static final String[]DITA reference attributes.static final StringCan be sent as an URL parameter to specify the class of the element that will be inserted as conref/conkeyref.static final StringCan be sent as an URL parameter to give more information about the element that will be inserted - path to the element ID (topicID/elementID).static final StringCan be sent as an URL parameter to specify the qname of the element that will be inserted as conref/conkeyref. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEditReference(AuthorAccess authorAccess) Add a new conref to the current element or edit the existing one.static List<CIAttribute>annotateAttributes(List<CIAttribute> attributes) Deprecated.This method does not do anything anynmore, the attribute annotations are gathered from the framework folder.static URLattachKeyScopeInformation(URL targetURL, String keyref, String contextMapURL) Deprecated.static URLattachKeyScopeInformation(URL targetURL, String keyref, String contextMapURL, String originalKeyName) Attach key scope information to the target URL.static URLAttach key scope information to the target URL.static StringbuildFigureHrefImageXMLToInsert(AuthorAccess authorAccess, String figTitle, String refAttrValue) Creates a figure with title and image with href XML element.static StringbuildFigureKeyrefImageXMLToInsert(AuthorAccess authorAccess, String figTitle, String keyName) Creates a figure with title and image with keyref XML element.protected static intcheckConsecutiveInsertionWarning(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 StringcheckValidKeyName(String keyName) Check if a keyref has a valid key name.static StringcheckValidKeyRef(String keyref) Check if a keyref has a valid key name.static ro.sync.ecss.dita.ImageInfochooseImageReference(AuthorAccess authorAccess) Allows the user to choose an image reference, which will be inserted inside the document.static ro.sync.ecss.dita.MediaInfochooseMediaReference(AuthorAccess authorAccess) Allows the user to choose an media file reference, which will be inserted inside the document.static StringCompute the element's clazzstatic StringcomputeFormatForURLPasteAndDnD(UtilAccess utilAccess, URL url, ReferenceType refType) Computes the format of the xref.static StringcomputeImageReferenceXMLToInsert(AuthorAccess authorAccess, String refAttrName, String refValue) Compute the image reference XML fragment to insert.computeKeyScopeStack(AuthorNode contextNode, LinkedHashMap<URL, List<Stack<Set<String>>>> urlKeyScopesMapping) Compute the entire key scope stack.computeKeyScopeStack(AuthorNode contextNode, LinkedHashMap<URL, List<Stack<Set<String>>>> urlKeyScopesMapping, Map<AuthorNode, Set<String>> stackCache) Compute the entire key scope stack.static StringcomputeLinkScope(URL editorLocation, URL hrefURL) Compute the scope attribute.static StringcomputeLinkText(String hrefValue, String baseSystemID) Deprecated.static StringcomputeLinkText(AuthorNode contextNode, String hrefValue, String baseSystemID) Deprecated.static StringcomputeLinkText(AuthorNode contextNode, String keyRefValue, String hrefValue, String baseSystemID) Deprecated.static StringcomputeLinkText(AuthorNode contextNode, String keyRefValue, String hrefValue, String baseSystemID, KeysManagerBase keysManager) Obtains information about the referred target.static StringcomputeMediaReferenceXMLToInsert(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo reference) Compute the media reference XML fragment to insert.computeQualifiedKeyNames(String keyToken, Stack<Set<String>> keyScopeStack) Compute key names qualified with key scope stack prefix.static StringcomputeVariableKeyrefElementName(AuthorAccess authorAccess) Compute the elements name.static StringcomputeVariableKeyrefElementName(AuthorAccess authorAccess, boolean preferImageElement) Compute the elements name.static StringconvertDitaCompatibleResource(Reader toConvert, String systemId, String format) Get the DITA-translated content for the given compatible resourcestatic voidcreateNewTopicReference(AuthorAccess authorAccess) Create a new DITA topic and link to it as a reference.static ObjectCreate a references graph, will make subsequent searches much faster and it can be reused among multiple searches with the method ro.sync.ecss.dita.DITAAccess.searchReferences(URL, Object).static voidcreateReusableComponent(AuthorAccess authorAccess, ro.sync.ecss.extensions.api.DITAUniqueIDAssigner idsAssigner) Reuse the selected content.static DITAImposedReferenceTypedetectInsertionType(URL url) Looks at the provided URL and detects if the referred resource should be inserted as a specific XML element.static StringdetectMediaObjectOutputclass(ro.sync.ecss.dita.reference.keyref.KeyInfo key) Detects the output class of a key.static voideditProperties(URL location, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, AuthorElement[] elementsToEdit, ro.sync.ecss.dita.topic.ref.TopicRefInserter topicRefInserter, Object parentFrame, boolean displayReferenceUrl) Edit properties for the given reference elements.static voideditProperties(AuthorAccess authorAccess) Edit properties for the given reference elements.static voideditTopicref(AuthorElement[] topicrefNodes, AuthorAccess authorAccess) Edits one or more topicref elements inside a specialized dialog.static List<DocumentPositionedInfo>expandAllKeyrefs(AuthorAccess authorAccess, LinkTextResolver linkTextResolver) Expand all keyrefs from the current document.static voidexportDITAMap(URL ditamapURL, File exportDirectory, boolean exportAsZip, String zipFileName, ExportProgressUpdater progressUpdater) Export DITA Map as zip.filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, String documentTypeName) Deprecated.Please use the equivalent method which also receives the URL of the requestor.filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, String documentTypeName, AuthorAccess authorAccess) Propose additional attribute values.filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, ContextKeyManager keyManager, String documentTypeName, AuthorAccess authorAccess) Propose additional attribute values.filterDITAVALAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context) Filter DITAVAL Attribute values.filterElements(List<CIElement> elements, WhatElementsCanGoHereContext context) Filter the given elements according to the given context.filterElements(List<CIElement> elements, WhatElementsCanGoHereContext context, String authorName) Filter the given elements according to the given context.static voidfindSimilarTopics(AuthorAccess authorAccess) Find similar topics based on words found in title, shortdesc, keyword, and indexterm elements.static Stringstatic StringgetAutoInsertImageRefElementName(AuthorAccess authorAccess, int caretPosition) Get the name of the image element to insert.static StringgetAutoInsertRefElementName(AuthorAccess authorAccess, int caretPosition) Get the name of the topic ref element to insertstatic StringgetAutoInsertTopicRefElementName(AuthorAccess authorAccess, int caretPosition) Get the name of the topic ref element to insertstatic StringgetAutoInsertTopicRefElementName(AuthorDocumentController authorDocumentController, int caretPosition) Get the name of the topic ref element to insertstatic StringgetConverterFormatForDITACompatibleResource(String resourceExtension) Get the converter format that corresponds with the given file extension of the DITA Compatible resourcestatic ro.sync.ecss.dita.DITAAccessCustomizerstatic List<DitaReferenceTargetDescriptor>getDitaReferenceTargets(URL baseUrl, URL topicUrl) Returns the DITA reference targets in the given topic.static List<DitaReferenceTargetDescriptor>getDitaReferenceTargets(AuthorAccess authorAccess, URL targetURL) Returns the DITA reference targets in the given topic.static CIElementgetEquivalentChildCIElement(AuthorAccess authorAccess, int caretOffset, String tagName) Get the equivalent child CIElementstatic StringDeprecated.static StringgetFormatForLinkCreatedFromGUI(String hrefValue, String formatValue, boolean fillFormatAttr) Get the format for the specified resource.static AuthorDocumentFragmentgetFragWithMostSuitableTopicrefs(AuthorDocumentController controller, AuthorDocumentFragment frag, int insertOffset) When moving/copying topic references, maybe they are not allowed at the new position.static AuthorDocumentFragmentgetFragWithMostSuitableTopicrefs(AuthorDocumentController controller, AuthorNode selectedElem, int insertOffset) When moving/copying topic references, maybe they are not allowed at the new position.static HrefInfogetHrefInformation(KeysManagerBase keyManager, AuthorNode node) Get the reference information (by analizing attributes like keyref, href, mapref, ...) of a node.static HrefInfogetHrefInformation(AuthorNode node) Get the reference information (by analizing attributes like keyref, href, mapref, ...) of a node.static intgetInheritanceType(String sourceClass, String targetClass) Check what inheritance is between the two classes.static voidgetInsertTopicref(URL editorLocation, Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, String initialTopicRefLocation, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, String preferredElementName, boolean displayReferenceUrl) Insert a topic reference.static StringgetKeyForUrl(URL url, URL editorLocation) Get the key corresponding to the given URL.static StringgetKeyForUrl(KeysManagerBase keyManager, URL url, URL editorLocation) Get the key corresponding to the given URL.static StringgetKeyForUrl(KeysManagerBase keyManager, URL url, URL editorLocation, AuthorNode contextNode) Get the key corresponding to the given URL.static StringgetKeyRefValueForUrl(KeysManagerBase keysManager, URL referenceUrl, URL editorLocation) Get the key reference corresponding to the given URL.static LinkedHashMap<String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys()Deprecated.Please use the equivalent method which also receives the URL of the requestor.static LinkedHashMap<String,ro.sync.ecss.dita.reference.keyref.KeyInfo> static LinkedHashMap<String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(URL originatorURL, ContextKeyManager keysManager) Returns the mapped DITA 1.2 keysstatic StringGet the value of the "keys" attribute based on the current filename.static List<ro.sync.ecss.dita.reference.keyref.KeyInfo>getKeysForInsertion(URL originatorURL) Get the list of keys which can be inserted in the topic identified by the "originatorURL" field.static StringgetPossibleElementQName(AuthorDocumentController ctrl, String clazzFrag, String mostUsed) Obtain the qualified name of the element with the given class, which will be inserted in the document.static CIElement[]getPossibleElements(AuthorDocumentController ctrl, int offset, String reqAttr, String... classFrag) Get the possible elements that can be inserted at a given offset and have the class 'classFrag' and a 'reqAttr' attribute.getRelatedLinksFromReltable(URL originatorURL) Get the list of related links from all the relationship tables defined in the DITA Maps.static URLGet DITA root map URL.static voidgetTopicRefInfo(URL location, 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) Deprecated.This method is not used anymore from oXygen to insert topic reference elements and it will be removed in a future release.getURLKeyScopeContexts(URL originatorURL) Get the URL to key scopes context for the default keys manager.getURLKeyScopeContexts(URL originatorURL, ContextKeyManager keysManager) Returns a mapping between topic URLs and DITA 1.3 key scopes where the URLs are referenced.static voidhandleTopicRefInsertUrl(AuthorAccess authorAccess, URL topicUrl) Insert a topic ref with the given URL.static booleanstatic voidinsertContentKeyReference(AuthorAccess authorAccess, String initialKeyName) Shows a dialog that allows inserting a content key reference and setting the original key to select in the Keys combo box.static voidinsertContentReference(AuthorAccess authorAccess, URL initialReferenceURL, boolean displayReferenceUrl) Shows a dialog that allows inserting a content reference (conref).static voidinsertHref(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic) Insert a Xref.static voidinsertHref(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic, URL initialReferenceURL, boolean displayReferenceUrl) Insert a Xref or link element.static voidinsertImage(AuthorAccess authorAccess, String ref) Insert a DITA Imagestatic voidinsertImage(AuthorAccess authorAccess, ro.sync.ecss.dita.ImageInfo ref) Insert a DITA Image.static SchemaAwareHandlerResultinsertImageSchemaAware(AuthorAccess authorAccess, String ref) Insert a DITA Imagestatic SchemaAwareHandlerResultinsertImageSchemaAware(AuthorAccess authorAccess, String refAttrName, String refValue) Insert a DITA Imagestatic SchemaAwareHandlerResultinsertImageSchemaAware(AuthorAccess authorAccess, ro.sync.ecss.dita.ImageInfo reference) Insert a DITA image.static voidinsertKeydefWithKeyword(Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, boolean append) Insert a key definition with keyword.static voidinsertKeydefWithKeyword(Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, DITATopicInsertionPosition insertPos) Insert a key definition with keyword.static voidinsertKeydefWithKeyword(AuthorAccess authorAccess) Insert a key definition with keyword.static voidinsertLinkReference(String referenceValue, String targetElementClass, String targetElementQName, AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, boolean useKeyRef, String hrefType) Insert a Xref or link element.static voidinsertLinkReference(String referenceValue, String targetElementClass, String targetElementQName, AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String hrefType) Insert a Xref or link element.static voidinsertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String preferredElName, String hrefType, URL initialReferenceURL, boolean displayReferenceUrl) Insert a Xref or link element.static voidinsertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String preferredElName, String hrefType, URL initialReferenceURL, boolean displayReferenceUrl, DITAAccess.InsertLinkReferenceShortcut insertLinkReferenceShortcut) Insert a Xref or link element.static voidinsertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String hrefType, URL initialReferenceURL, boolean displayReferenceUrl) Insert a Xref or link element.static voidinsertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String hrefType, URL initialReferenceURL, boolean displayReferenceUrl, DITAAccess.InsertLinkReferenceShortcut insertLinkReferenceShortcut) Insert a Xref or link element.static voidinsertMedia(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo ref) Insert a media object.static SchemaAwareHandlerResultinsertMediaSchemaAware(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo reference) Insert a DITA media object.static voidinsertReference(AuthorAccess authorAccess, int refType) Insert a keyref or a conkeyref.static intinsertReference(AuthorAccess authorAccess, int refType, ro.sync.ecss.component.HeadlessViewport viewport, ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.dita.reference.ReferenceInfo refInfo) Insert the given reference information with the given type.static voidinsertReference(AuthorAccess authorAccess, String referenceValue, int refType, String targetElementQName, String elementClass) Inserts a reference from the information passed in the ArgumentsMap.static voidinsertReference(AuthorAccess authorAccess, String referenceValue, String targetElementQName, String elementClass) Inserts a reference from the information passed in the ArgumentsMap.static voidinsertReusableComponent(AuthorAccess authorAccess) Insert a reusable componentstatic voidinsertTopicgroup(AuthorAccess authorAccess) Insert a topic group.static voidinsertTopichead(AuthorAccess authorAccess) Insert a topic head.static voidinsertTopicref(AuthorAccess authorAccess) Insert a topic ref.static voidinsertTopicref(AuthorAccess authorAccess, URL initialReferenceURL, boolean displayReferenceUrl) Insert a topic reference.static voidinsertTopicref(WSDITAMapEditorPage ditaPageAccess, URL initialReferenceURL, String preferredElementName, boolean asChild, boolean displayReferenceUrl) Insert a topic reference in the DITA Map tree.static voidinsertTopicref(WSDITAMapEditorPage ditaPageAccess, URL initialReferenceURL, String preferredElementName, DITATopicInsertionPosition insertPos, boolean displayReferenceUrl) Insert a topic reference in the DITA Map tree.static booleanisDITA(Attributes atts) Check if the resource is DITA.static booleanisDITA1_3OrNewer(String archVersion) Check if the topic or map with a certain architecture version is DITA 1.3 or newer,static booleanisDITA1_3OrNewer(Attributes atts) Check if the topic or map with a certain architecture version is DITA 1.3 or newer,static booleanisGeneralizationOf(String sourceClass, String targetClass) Deprecated.use getInheritanceType instead.static booleanisGenericMediaContent(ro.sync.ecss.dita.reference.keyref.KeyInfo selectedKey) Checks if the selected key refers resources that can be wrapped in a media object.sstatic booleanisKeyDefToDITAResource(ro.sync.ecss.dita.reference.keyref.KeyInfo keyInfo) Check if this key definition points to a DITA topic, map or variable text.static booleanisKeyReferenceToImage(ro.sync.ecss.dita.reference.keyref.KeyInfo key) Checks if the current key is a reference to an image.static booleanisReferenceToDITACompatibleResource(AuthorNode node, ro.sync.ecss.dita.reference.keyref.KeyInfo keyInfo) Check if this reference points to a DITA compatible resource (that can be converted to DITA using dynamic converter DITA-OT plugin).static booleanisReferenceToDITAResource(AuthorNode node, ro.sync.ecss.dita.reference.keyref.KeyInfo keyInfo) Check if this reference points to a DITA topic, map or variable text.static ReferenceparseDITAHref(String baseUrl, String hrefValue) Parse thehrefattribute and returns the absolute URL and the id.static ReferenceparseDITAHref(String baseUrl, String hrefValue, boolean isHrefToDITAResource) Parse thehrefattribute and returns the absolute URL and the id.static ReferenceparseDITAKeyRef(String keyref) Deprecated.Please use the equivalent method which also receives the URL of the requestor.static ReferenceparseDITAKeyRef(String keyref, ro.sync.ecss.dita.reference.keyref.KeyResolver kr) Parse the DITA conkeyref valuestatic ReferenceparseDITAKeyRef(URL originatorURL, String keyref) Parse the DITA conkeyref valuestatic ReferenceparseDITAKeyRef(URL originatorURL, ContextKeyManager keyManager, String keyref) Parse the DITA conkeyref valuestatic StringpasteAsReference(AuthorAccess authorAccess, boolean asConref) Paste as referencestatic StringpasteAsReference(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo) Paste as referencestatic booleanpasteClipboardFragmentsAsReference(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo, ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments) Paste the fragments from clipboard as reference.static booleanpasteClipboardFragmentsAsReference(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo, ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments, SelectionInterpretationMode selectionInterpretationMode) Paste the fragments from clipboard as reference.static booleanpreferAddingKeyrefToAlreadyReferencedResource(URL editorURL) Check if a keyref is preferred to be added when inserting a resource (that is already referred) in the editor .static URLPropose a folder URL where to save a new topicref that is added in a DITA Map as a child of the given node.static voidpushElement(AuthorAccess authorAccess) Shows a dialog that allows the user to push an element.static voidremoveReference(AuthorAccess authorAccess) Remove a content reference from a DITA document.static List<DocumentPositionedInfo>replaceAllConrefs(AuthorAccess authorAccess) Expand all conrefs and conkeyrefs from the current document.static voidreplaceConref(AuthorAccess authorAccess) Replace the conref at caret positionstatic voidresolveKeyNotFoundError(AuthorAccess authorAccess, String keyref) The give key was not found.static URLresolveKeyRef(String keyRef) Deprecated.Please use the equivalent method which also receives the URL of the requestor.static URLresolveKeyRef(String keyRef, boolean addANYIdentifierForKeys) Deprecated.Please use the equivalent method which also receives the URL of the requestor.static ro.sync.ecss.dita.KeyTargetURLWithTypeInforesolveKeyRef(String keyRef, ro.sync.ecss.dita.reference.keyref.KeyResolver kr) Resolve a keyref.static URLresolveKeyRef(URL originatorURL, String keyRef, boolean addANYIdentifierForKeys) Resolve a keyref.static URLresolveKeyRef(URL originatorURL, String keyRef, ContextKeyManager keysManager, boolean addANYIdentifierForKeys) Resolve a keyref.static StringresolveKeyRefToHref(URL originatorURL, String keyRef, ContextKeyManager keysManager, boolean addANYIdentifierForKeys) Resolve a keyref to a plain href which may or may not be an URL.static StringrewriteKeyref(LinkedHashMap<URL, List<Stack<Set<String>>>> urlKeyScopesMapping, LinkedHashMap<String, ro.sync.ecss.dita.reference.keyref.KeyInfo> keys, AuthorNode contextNode, String keyref) Rewrite a keyref looking also at key scopes..static List<DocumentPositionedInfo>searchReferences(URL targetTopicURL) Search the references to this topic.static List<DocumentPositionedInfo>searchReferences(URL targetTopicURL, Object referencesGraph) Search the references to this topic.static voidsearchReferences(AuthorAccess authorAccess) Search references to a certain element at the caret position.static voidsetDitaAccessCustomizer(ro.sync.ecss.dita.DITAAccessCustomizer ditaAccessCustomizer) Set the DITA access customizer from SA or EC.static voidsetKeyNameGenerator(DITAKeyNameGenerator ditaKeyNameGenerator) Set a key name generator for when the "keys" attribute is automatically generated and set to topicrefs based on the names of the referenced files.static voidshowInsertReferenceDialog(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.ue.AuthorDocumentControllerImpl controller, int caretOffset, Object parentFrame, int refType, boolean showOnlyKeysList, ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter) Shows the keyref/conkeyref insert dialog and returns the chosen reference information.static voidshowInsertReferenceDialog(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.ue.AuthorDocumentControllerImpl controller, int caretOffset, Object parentFrame, int refType, boolean showOnlyKeysList, ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter, ro.sync.ecss.dita.IKeyInfoFilter keysFilter, boolean useModalDialog) Shows the keyref/conkeyref insert dialog and returns the chosen reference information.static voidshowKeysAndReusableComponents(AuthorAccess authorAccess, boolean showKeys, boolean showComps) Show a content completion window with keys and components.static URLshowNewFileDialog(AuthorAccess authorAccess, String proposedTitle) Shows the New File wizard to allow creating new documents.
-
Field Details
-
IMPOSED_INSERTION_TYPE
Query parameter that imposes how a reference will be inserted in DITA- Since:
- 25
- See Also:
-
FULLY_QUALIFIED_KEYNAME_URL_PARAM
Can be sent as an URL parameter to give more information about the keyref fully qualified value.- See Also:
-
REUSABLE_COMPONENT_TARGET_PATH_PARAM
Can be sent as an URL parameter to give more information about the element that will be inserted - path to the element ID (topicID/elementID).- See Also:
-
REUSABLE_COMPONENT_TARGET_QNAME_PARAM
Can be sent as an URL parameter to specify the qname of the element that will be inserted as conref/conkeyref.- See Also:
-
REUSABLE_COMPONENT_ELEMENT_CLASS_PARAM
Can be sent as an URL parameter to specify the class of the element that will be inserted as conref/conkeyref.- See Also:
-
LINK_TYPE_WEB_PAGE
The 'href' attribute type web page.- See Also:
-
LINK_TYPE_NON_DITA_RESOURCE
The 'href' attribute type non DITA resource.- See Also:
-
LINK_TYPE_DITA_TOPIC
The 'href' attribute type DITA topic.- See Also:
-
DITA_ROOT_MAP_URL_ATTRIBUTE
The attribute name for the dita root map url. The attribute is given as string.- See Also:
-
DITA_VAL_URL_ATTRIBUTE
The attribute name for the ditaval url. The attribute is given as string.- See Also:
-
DITA_ROOT_MAP_KEYS_MANAGER_ATTRIBUTE
The attribute name for the keys manager. If set it has priority overDITA_ROOT_MAP_URL_ATTRIBUTE. The attribute class isContextKeyManager.- See Also:
-
REF_ATTRIBUTES
DITA reference attributes. -
DEFAULT_CONKEYREF_CONREFEND
Value for conrefend attribute value when a conkeyref is used.- See Also:
-
KEYREF_TYPE
public static final int KEYREF_TYPEKeyref- See Also:
-
CONREF_TYPE
public static final int CONREF_TYPEConref- See Also:
-
CONKEYREF_TYPE
public static final int CONKEYREF_TYPEConkeyref- See Also:
-
ID_FIRST_TOPIC_ID
Identifier used in references path, representing that the topic id is the first topic ID in the file.- See Also:
-
ID_ANY
Deprecated.UseID_FIRST_TOPIC_IDinstead which has a clearer meaning.
Identifier used in references path, representing that the topic id can be excluded from the reference.- See Also:
-
INHERITANCE_GENERALIZATION
public static final int INHERITANCE_GENERALIZATIONIf the source is a generalization of the target- See Also:
-
INHERITANCE_SPECIALIZATION
public static final int INHERITANCE_SPECIALIZATIONIf the source is a specialization of the target- See Also:
-
INHERITANCE_SAME
public static final int INHERITANCE_SAMEIf the source class is the same as the target class.- See Also:
-
INHERITANCE_NONE
public static final int INHERITANCE_NONENo match between the two classes..- See Also:
-
-
Method Details
-
setKeyNameGenerator
Set a key name generator for when the "keys" attribute is automatically generated and set to topicrefs based on the names of the referenced files.- Parameters:
ditaKeyNameGenerator- The dita key name generator to set.nullto remove the previous one.- Since:
- 23
-
getKeysAttributeValueBasedOnFilename
Get the value of the "keys" attribute based on the current filename.- Parameters:
url- The URL of the current file.- Returns:
- the value.
-
createReferencesGraph
Create a references graph, will make subsequent searches much faster and it can be reused among multiple searches with the method ro.sync.ecss.dita.DITAAccess.searchReferences(URL, Object).- Returns:
- the references graph. Can be
nullis something went wrong. - Since:
- 23
-
searchReferences
Search the references to this topic.- Parameters:
targetTopicURL- The URL of the target topic (i.e. the topic that is referenced).- Returns:
- the references or an empty list. Never
null;
-
searchReferences
public static List<DocumentPositionedInfo> searchReferences(URL targetTopicURL, Object referencesGraph) Search the references to this topic.- Parameters:
targetTopicURL- The URL of the target topic (i.e. the topic that is referenced).referencesGraph- The already created graph, if notnullthe search will be much faster.- Returns:
- the references or an empty list. Never
null; - Since:
- 23
-
insertTopicref
Insert a topic ref.- Parameters:
authorAccess- The author access.- Throws:
AuthorOperationException
-
handleTopicRefInsertUrl
public static void handleTopicRefInsertUrl(AuthorAccess authorAccess, URL topicUrl) throws AuthorOperationException Insert a topic ref with the given URL. No dialog is displayed.- Parameters:
authorAccess- The author access.topicUrl- The URL of the topic to be inserted.- Throws:
AuthorOperationException
-
insertTopicgroup
Insert a topic group.- Parameters:
authorAccess- The author access.- Throws:
AuthorOperationException
-
getTopicRefInfo
@Deprecated public static void getTopicRefInfo(URL location, 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) Deprecated.This method is not used anymore from oXygen to insert topic reference elements and it will be removed in a future release. All topic reference elements are inserted using the same method:editProperties(URL, AuthorCCManager, AuthorDocumentControllerImpl, AuthorElement[], TopicRefInserter, Object, boolean)Show the topic reference info dialog with some initial content- Parameters:
location- The DITA map locationparentFrame- 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.
-
getInsertTopicref
public static void getInsertTopicref(URL editorLocation, Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, String initialTopicRefLocation, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, String preferredElementName, boolean displayReferenceUrl) Insert a topic reference.- 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 inserterpreferredElementName- Preferred name or class of the element to insertdisplayReferenceUrl- Iftruethe 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 tofalsewhen 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.
-
insertKeydefWithKeyword
public static void insertKeydefWithKeyword(Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, boolean append) Insert a key definition with keyword.- Parameters:
parentFrame- The parent frame.ccM- The CC Manager.ctrl- The document controller.caretOffset- The caret offset.inserter- Topic reference inserter
Note: thepreferredElementNameparameter is not used on Eclipse plugin implementation.append-trueto append child,falseto insert after.
-
insertKeydefWithKeyword
public static void insertKeydefWithKeyword(Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, DITATopicInsertionPosition insertPos) Insert a key definition with keyword.- Parameters:
parentFrame- The parent frame.ccM- The CC Manager.ctrl- The document controller.caretOffset- The caret offset.inserter- Topic reference inserter
Note: thepreferredElementNameparameter is not used on Eclipse plugin implementation.insertPos- one of the values defined inDITATopicInsertionPosition.
-
insertKeydefWithKeyword
Insert a key definition with keyword.- Parameters:
authorAccess- Author access.
-
insertTopichead
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.
-
getDitaAccessCustomizer
public static ro.sync.ecss.dita.DITAAccessCustomizer getDitaAccessCustomizer()- Returns:
- Returns the ditaAccessCustomizer.
-
hasAPIKeysManager
public static boolean hasAPIKeysManager()- Returns:
trueif we have a keys manager provided through the API.
-
getAPIKeysManagerDescription
- Returns:
- A description for the API Keys manager.
-
editProperties
public static void editProperties(URL location, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, AuthorElement[] elementsToEdit, ro.sync.ecss.dita.topic.ref.TopicRefInserter topicRefInserter, Object parentFrame, boolean displayReferenceUrl) Edit properties for the given reference elements.- Parameters:
location- DITA Map editor location.ccM- The CC Managerctrl- The Author document controller.elementsToEdit- The elements that must be edited.topicRefInserter- Callback to insert/edit a topic refparentFrame- Parent frame.displayReferenceUrl- Iftruethe URL input will be displayed in the edit reference dialog (the user will have the possibility to change the reference URL).- Since:
- 17.1
-
editProperties
Edit properties for the given reference elements.- Parameters:
authorAccess- the author access.- Throws:
AuthorOperationException
-
insertHref
public static void insertHref(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic, 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-trueif we need to insert an <xref> element,falsefor the <link> element.isHrefTypeDitaTopic- Iftruethe user wants to insert a reference to a DITA resource (Insert Cross Reference action) Iffalsethe 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- Iftruethe 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 tofalsewhen 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, String typeValue, String formatValue, 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-trueif we need to insert a xref element,falsefor link element.isHrefTypeDitaTopic- iftruea dita topic chooser will be shown otherwise a input url dialog will be show for the href attribute value.- Throws:
AuthorOperationException
-
insertContentKeyReference
public static void insertContentKeyReference(AuthorAccess authorAccess, String initialKeyName) throws AuthorOperationException Shows a dialog that allows inserting a content key reference and setting the original key to select in the Keys combo box.- Parameters:
authorAccess- The Author access.initialKeyName- The key that will be displayed in the Key field of the insert reference dialog.- Throws:
AuthorOperationException- Since:
- 21
Note: this API method is implemented only for Eclipse plugin.
-
insertContentReference
public static void insertContentReference(AuthorAccess authorAccess, 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- Iftruethe 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 tofalsewhen 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, 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- Iftruethe 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 tofalsewhen 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, URL initialReferenceURL, 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-trueto insert as a child of the selected item,falseto insert as a next sibling.displayReferenceUrl- Iftruethe 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 tofalsewhen 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
-
insertTopicref
public static void insertTopicref(WSDITAMapEditorPage ditaPageAccess, URL initialReferenceURL, String preferredElementName, DITATopicInsertionPosition insertPos, 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.insertPos- one of the values defined inDITATopicInsertionPosition.displayReferenceUrl- Iftruethe 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 tofalsewhen 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, 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 chosen reference information.- Parameters:
ccManager- CC manager.controller- Author document controller.caretOffset- Caret offset.parentFrame- Parent frame.refType- One of:KEYREF_TYPE,CONREF_TYPE,CONKEYREF_TYPEshowOnlyKeysList-trueto show only keys list in the insert reference dialog.referenceInserter- The reference inserter.- Throws:
AuthorOperationException- When the insertion fails.
-
showInsertReferenceDialog
public static void showInsertReferenceDialog(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.ue.AuthorDocumentControllerImpl controller, int caretOffset, Object parentFrame, int refType, boolean showOnlyKeysList, ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter, ro.sync.ecss.dita.IKeyInfoFilter keysFilter, boolean useModalDialog) throws AuthorOperationException Shows the keyref/conkeyref insert dialog and returns the chosen reference information.- Parameters:
ccManager- CC manager.controller- Author document controller.caretOffset- Caret offset.parentFrame- Parent frame.refType- One of:KEYREF_TYPE,CONREF_TYPE,CONKEYREF_TYPEshowOnlyKeysList-trueto show only keys list in the insert reference dialog.referenceInserter- The reference inserter.keysFilter- Filters the keys.useModalDialog-trueif the dialog should be modal.- Throws:
AuthorOperationException- When the insertion fails.
-
insertReference
public static void insertReference(AuthorAccess authorAccess, String referenceValue, String targetElementQName, String elementClass) throws AuthorOperationException Inserts a reference from the information passed in the ArgumentsMap.- Parameters:
authorAccess- the AuthorAccessreferenceValue- the reference value.targetElementQName- the target element qualified name.elementClass- the element class.- Throws:
AuthorOperationException- if the operation fails.
-
insertReference
public static void insertReference(AuthorAccess authorAccess, String referenceValue, int refType, String targetElementQName, String elementClass) throws AuthorOperationException Inserts a reference from the information passed in the ArgumentsMap.- Parameters:
authorAccess- The AuthorAccessreferenceValue- The reference value.refType- The reference typetargetElementQName- The target element qualified name.elementClass- The element class.- Throws:
AuthorOperationException- if the operation fails.
-
insertReference
public static int insertReference(AuthorAccess authorAccess, int refType, ro.sync.ecss.component.HeadlessViewport viewport, ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.dita.reference.ReferenceInfo refInfo) throws AuthorOperationException Insert the given reference information with the given type.- Parameters:
authorAccess- The author accessrefType- The reference typeviewport- The viewportccManager- The CC ManagerrefInfo- The reference info.- Returns:
- The offset where the insertion took place.
- Throws:
AuthorOperationException- When a problem occurs.
-
getRootMapURL
Get DITA root map URL.- Returns:
- DITA root map URL.
-
resolveKeyRef
Deprecated.Please use the equivalent method which also receives the URL of the requestor.Deprecated method for resolving a keyref. Preserved for backward compatibility.- Parameters:
keyRef- The keyref value- Returns:
- The absolute value of the key ref target.
-
resolveKeyRef
Deprecated.Please use the equivalent method which also receives the URL of the requestor.Resolve a keyref.- Parameters:
keyRef- The keyref valueaddANYIdentifierForKeys- Iftruethen reference keys will be prefixed by 'ANY/'. in a element_keyref function.- Returns:
- The absolute value of the key ref target.
-
resolveKeyRef
Resolve a keyref.- Parameters:
originatorURL- The originator URL.keyRef- The keyref valueaddANYIdentifierForKeys- Iftruethen reference keys will be prefixed by 'ANY/'. in a element_keyref function.- Returns:
- The absolute value of the key ref target.
-
checkValidKeyRef
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
nullif the key name is valid.
-
resolveKeyRef
public static URL resolveKeyRef(URL originatorURL, String keyRef, ContextKeyManager keysManager, boolean addANYIdentifierForKeys) Resolve a keyref.- Parameters:
originatorURL- The url that contains the key.keyRef- The keyref valuekeysManager- The key manager.addANYIdentifierForKeys- Iftruethen reference keys will be prefixed by 'ANY/'. in a element_keyref function.- Returns:
- The absolute value of the key ref target.
-
resolveKeyRefToHref
public static String resolveKeyRefToHref(URL originatorURL, String keyRef, ContextKeyManager keysManager, boolean addANYIdentifierForKeys) Resolve a keyref to a plain href which may or may not be an URL.- Parameters:
originatorURL- The url that contains the key.keyRef- The keyref valuekeysManager- The key manager.addANYIdentifierForKeys- Iftruethen reference keys will be prefixed by 'ANY/'. in a element_keyref function.- Returns:
- The absolute value of the key ref target.
- Since:
- 27.1
-
resolveKeyRef
public static ro.sync.ecss.dita.KeyTargetURLWithTypeInfo resolveKeyRef(String keyRef, ro.sync.ecss.dita.reference.keyref.KeyResolver kr) Resolve a keyref.- Parameters:
keyRef- The keyref valuekr- 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 accessidsAssigner- 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
-
replaceAllConrefs
public static List<DocumentPositionedInfo> replaceAllConrefs(AuthorAccess authorAccess) throws AuthorOperationException Expand all conrefs and conkeyrefs from the current document.- Parameters:
authorAccess- The access in author page.- Returns:
- A list with problems from this process.
- Throws:
AuthorOperationException- If failed to find conrefs or conkeyrefs.
-
replaceConref
Replace the conref at caret position- Parameters:
authorAccess-- Throws:
AuthorOperationException
-
expandAllKeyrefs
public static List<DocumentPositionedInfo> expandAllKeyrefs(AuthorAccess authorAccess, LinkTextResolver linkTextResolver) throws AuthorOperationException Expand all keyrefs from the current document. The keyrefs from xrefs and links are changed with hrefs.- Parameters:
authorAccess- Access class to the author functions.linkTextResolver- Resolves a link and obtains a text representation.- Returns:
- A list with problems from this process.
- Throws:
AuthorOperationException- If failed to find keyrefs.
-
removeReference
Remove a content reference from a DITA document.- Parameters:
authorAccess- The author access.- Throws:
AuthorOperationException
-
addEditReference
Add a new conref to the current element or edit the existing one.- Parameters:
authorAccess- The author access- Throws:
AuthorOperationException
-
isGeneralizationOf
Deprecated.use getInheritanceType instead.True if the first class value is a generalization or the same as the second class value.- Parameters:
sourceClass- The source class valuetargetClass- The target class value- Returns:
- True if the first class value is a generalization of the second
-
getInheritanceType
Check what inheritance is between the two classes.- Parameters:
sourceClass- The source class valuetargetClass- The target class value- Returns:
- the inheritance type between the source and target class
-
parseDITAHref
public static Reference parseDITAHref(String baseUrl, String hrefValue) throws MalformedURLException Parse thehrefattribute and returns the absolute URL and the id.- Parameters:
baseUrl- The base document URL.hrefValue- Thehrefattribute 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:
MalformedURLException- Can't create the URL.
-
parseDITAHref
public static Reference parseDITAHref(String baseUrl, String hrefValue, boolean isHrefToDITAResource) throws MalformedURLException Parse thehrefattribute and returns the absolute URL and the id.- Parameters:
baseUrl- The base document URL.hrefValue- Thehrefattribute value. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utilityisHrefToDITAResource-trueif this is an href to a DITA resource- Returns:
- A container object with the content reference URI and topicID or
null. - Throws:
MalformedURLException- Can't create the URL.
-
parseDITAKeyRef
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:
MalformedURLException
-
parseDITAKeyRef
public static Reference parseDITAKeyRef(URL originatorURL, String keyref) throws MalformedURLException Parse the DITA conkeyref value- Parameters:
originatorURL- The originator URL.keyref- The attribute 'conkeyref' value- Returns:
- The DITA Conref object
- Throws:
MalformedURLException
-
parseDITAKeyRef
public static Reference parseDITAKeyRef(URL originatorURL, ContextKeyManager keyManager, String keyref) throws 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:
MalformedURLException
-
parseDITAKeyRef
public static Reference parseDITAKeyRef(String keyref, ro.sync.ecss.dita.reference.keyref.KeyResolver kr) throws MalformedURLException Parse the DITA conkeyref value- Parameters:
keyref- The attribute 'conkeyref' valuekr- The keys resolver- Returns:
- The DITA Conref object
- Throws:
MalformedURLException
-
getAutoInsertTopicRefElementName
Get the name of the topic ref element to insert- Parameters:
authorAccess- The author accesscaretPosition- Caret position- Returns:
- A name for the topic ref to insert
-
getAutoInsertTopicRefElementName
public static String getAutoInsertTopicRefElementName(AuthorDocumentController authorDocumentController, int caretPosition) Get the name of the topic ref element to insert- Parameters:
authorDocumentController- The author document controller.caretPosition- Caret position- Returns:
- A name for the topic ref to insert
- Since:
- 23.1
-
getAutoInsertRefElementName
Get the name of the topic ref element to insert- Parameters:
authorAccess- The author accesscaretPosition- Caret position- Returns:
- A name for the topic ref to insert
-
getAutoInsertImageRefElementName
Get the name of the image element to insert.- Parameters:
authorAccess- The author accesscaretPosition- Caret position- Returns:
- A name for the topic ref to insert
-
getPossibleElements
public static CIElement[] getPossibleElements(AuthorDocumentController ctrl, int offset, String reqAttr, String... classFrag) Get the possible elements that can be inserted at a given offset and have the class 'classFrag' and a 'reqAttr' attribute.- Parameters:
ctrl- the author document controller.offset- the offset.reqAttr- the required attribute that needs to be on the element.classFrag- the class fragments to search for in the element.- Returns:
- the possible elements that can be inserted at a given offset and have the class 'classFrag' and a 'reqAttr' attribute.
-
getEquivalentChildCIElement
public static CIElement getEquivalentChildCIElement(AuthorAccess authorAccess, int caretOffset, String tagName) Get the equivalent child CIElement- Parameters:
authorAccess- Author accesscaretOffset- The caret offsettagName- The tag name- Returns:
- the equivalent child CIElement
-
getKeys
@Deprecated public static LinkedHashMap<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 LinkedHashMap<String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(URL originatorURL) - Parameters:
originatorURL- The URL for which the keys are requested- Returns:
- The mapped DITA 1.2 keys
-
getKeysForInsertion
public static List<ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeysForInsertion(URL originatorURL) Get the list of keys which can be inserted in the topic identified by the "originatorURL" field. Depending on the places where the topic is referenced in the DITA Map, if there are key scopes defined the list of keys may contain the same key present multiple number of times but with different key scope prefixed names.- Parameters:
originatorURL- The URL for which the keys are requested- Returns:
- The list of keys depends on the current editing context.
-
getKeys
public static LinkedHashMap<String,ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys(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
-
getURLKeyScopeContexts
public static LinkedHashMap<URL,List<Stack<Set<String>>>> getURLKeyScopeContexts(URL originatorURL, ContextKeyManager keysManager) Returns a mapping between topic URLs and DITA 1.3 key scopes where the URLs are referenced.- 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
-
computeFormatForURLPasteAndDnD
public static String computeFormatForURLPasteAndDnD(UtilAccess utilAccess, URL url, ReferenceType refType) Computes the format of the xref.- Parameters:
utilAccess- The util access API. Nevernull.url- The URL to paste.refType- The reference type.- Returns:
- The format.
-
computeLinkScope
Compute the scope attribute.- Parameters:
editorLocation- Editor locationhrefURL- Href location.- Returns:
- the computed scope attribute construction. Never
null.
-
pasteAsReference
public static 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 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:
trueif the paste was valid.- Throws:
AuthorOperationException
-
pasteClipboardFragmentsAsReference
public static boolean pasteClipboardFragmentsAsReference(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo, ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments, SelectionInterpretationMode selectionInterpretationMode) 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.selectionInterpretationMode- Selection interpretation mode- Returns:
trueif the paste was valid.- Throws:
AuthorOperationException
-
filterAttributeValues
@Deprecated public static List<CIValue> filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, 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 List<CIValue> filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, 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.
-
filterAttributeValues
public static List<CIValue> filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, ContextKeyManager keyManager, String documentTypeName, AuthorAccess authorAccess) Propose additional attribute values.- Parameters:
attributeValues- The attribute values.context- The context.keyManager- The key manager to use to propose values for attributes like keyref.documentTypeName- The document type name.authorAccess- The Author Access. Can benull- Returns:
- The enriched list.
-
computeElementClazz
Compute the element's clazz- Parameters:
context- The attributes editing context.- Returns:
- The element clazz or null.
-
insertImage
public static void insertImage(AuthorAccess authorAccess, String ref) throws AuthorOperationException Insert a DITA Image- Parameters:
authorAccess- The author accessref- The reference.- Throws:
AuthorOperationException
-
insertMedia
public static void insertMedia(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo ref) throws AuthorOperationException Insert a media object.- Parameters:
authorAccess- The author access.ref- Media reference.- Throws:
AuthorOperationException- When fail.
-
chooseMediaReference
public static ro.sync.ecss.dita.MediaInfo chooseMediaReference(AuthorAccess authorAccess) throws AuthorOperationException Allows the user to choose an media file reference, which will be inserted inside the document.- Parameters:
authorAccess- The author access.- Returns:
- A
MediaInfoobject containing all the properties for the file which will be inserted. - Throws:
AuthorOperationException- On fail.
-
insertMediaSchemaAware
public static SchemaAwareHandlerResult insertMediaSchemaAware(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo reference) throws AuthorOperationException Insert a DITA media object.- Parameters:
authorAccess- The author accessreference- The reference value.- Returns:
- The insertion result
- Throws:
AuthorOperationException- On fail.
-
computeMediaReferenceXMLToInsert
public static String computeMediaReferenceXMLToInsert(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo reference) Compute the media reference XML fragment to insert.- Parameters:
authorAccess- The author access.reference- The reference information .- Returns:
- the image reference XML fragment to insert.
-
insertImage
public static void insertImage(AuthorAccess authorAccess, ro.sync.ecss.dita.ImageInfo ref) throws AuthorOperationException Insert a DITA Image.- Parameters:
authorAccess- The author accessref- The information reference.- Throws:
AuthorOperationException- If the image could not be inserted.
-
chooseImageReference
public static ro.sync.ecss.dita.ImageInfo chooseImageReference(AuthorAccess authorAccess) throws AuthorOperationException Allows the user to choose an image reference, which will be inserted inside the document.- Parameters:
authorAccess- The author access.- Returns:
- A
ImageInfoobject containing all the properties for the image, which will be inserted. - Throws:
AuthorOperationException
-
insertImageSchemaAware
public static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess, String ref) throws AuthorOperationException Insert a DITA Image- Parameters:
authorAccess- The author accessref- The reference.- Returns:
- The insertion result
- Throws:
AuthorOperationException
-
insertImageSchemaAware
public static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess, String refAttrName, String refValue) throws AuthorOperationException Insert a DITA Image- Parameters:
authorAccess- The author accessrefAttrName- The reference attribute name.refValue- The reference value.- Returns:
- The insertion result
- Throws:
AuthorOperationException
-
insertImageSchemaAware
public static SchemaAwareHandlerResult insertImageSchemaAware(AuthorAccess authorAccess, ro.sync.ecss.dita.ImageInfo reference) throws AuthorOperationException Insert a DITA image.- Parameters:
authorAccess- The author accessreference- The reference value.- Returns:
- The insertion result
- Throws:
AuthorOperationException
-
computeImageReferenceXMLToInsert
public static String computeImageReferenceXMLToInsert(AuthorAccess authorAccess, String refAttrName, String refValue) Compute the image reference XML fragment to insert.- Parameters:
authorAccess- The author access.refAttrName- The reference attribute namerefValue- The reference value name- Returns:
- the image reference XML fragment to insert.
-
buildFigureHrefImageXMLToInsert
public static String buildFigureHrefImageXMLToInsert(AuthorAccess authorAccess, String figTitle, String refAttrValue) Creates a figure with title and image with href XML element.- Parameters:
authorAccess- Offers access to Author page API.figTitle- The title of the figure.refAttrValue- The value of the href attribute.- Returns:
- a figure with title and image XML element.
- Since:
- 25.0
-
buildFigureKeyrefImageXMLToInsert
public static String buildFigureKeyrefImageXMLToInsert(AuthorAccess authorAccess, String figTitle, String keyName) Creates a figure with title and image with keyref XML element.- Parameters:
authorAccess- Offers access to Author page API.figTitle- The title of the figure.keyName- The name of the key.- Returns:
- a figure with title and image with keyref XML element.
- Since:
- 25.0
-
getPossibleElementQName
public static String getPossibleElementQName(AuthorDocumentController ctrl, String clazzFrag, String mostUsed) Obtain the qualified name of the element with the given class, which will be inserted in the document.- Parameters:
ctrl- The author document controller.clazzFrag- The class of the element, whose name is searched.mostUsed- The most used name of the element with the given class.- Returns:
- The qualified name of the element with the given class.
-
searchReferences
Search references to a certain element at the caret position.- Parameters:
authorAccess- The author access.
-
computeLinkText
@Deprecated public static String computeLinkText(String hrefValue, String baseSystemID) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, Exception Deprecated.Obtains information about the referred target.- Parameters:
hrefValue- The relative location of the target.baseSystemID- base system ID.- Returns:
- The computed title information.
- Throws:
MalformedURLExceptionIOExceptionParserConfigurationExceptionSAXExceptionException
-
computeLinkText
@Deprecated public static String computeLinkText(AuthorNode contextNode, String hrefValue, String baseSystemID) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, Exception Deprecated.Obtains information about the referred target.- Parameters:
contextNode- The context node.hrefValue- The relative location of the target.baseSystemID- base system ID.- Returns:
- The computed title information.
- Throws:
MalformedURLExceptionIOExceptionParserConfigurationExceptionSAXExceptionException
-
computeLinkText
@Deprecated public static String computeLinkText(AuthorNode contextNode, String keyRefValue, String hrefValue, String baseSystemID) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, Exception Deprecated.Obtains information about the referred target.- Parameters:
contextNode- The context node.keyRefValue- The fully prefixed key scope valuehrefValue- The relative location of the target.baseSystemID- base system ID.- Returns:
- The computed title information.
- Throws:
MalformedURLExceptionIOExceptionParserConfigurationExceptionSAXExceptionException
-
computeLinkText
public static String computeLinkText(AuthorNode contextNode, String keyRefValue, String hrefValue, String baseSystemID, KeysManagerBase keysManager) throws Exception Obtains information about the referred target.- Parameters:
contextNode- The context node.keyRefValue- The fully prefixed key scope valuehrefValue- The relative location of the target.baseSystemID- base system ID.keysManager- The key manager.- Returns:
- The computed title information.
- Throws:
Exception- Since:
- 21
-
filterElements
public static List<CIElement> filterElements(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.
-
filterElements
public static List<CIElement> filterElements(List<CIElement> elements, WhatElementsCanGoHereContext context, String authorName) Filter the given elements according to the given context.- Parameters:
elements- The list of CIElement elements.context- The context.authorName- the name of the author to be used for draft comment author attribute. Ifnull, the user from the current editor is used.- Returns:
- The filtered CIElements.
-
resolveKeyNotFoundError
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.
-
filterDITAVALAttributeValues
public static List<CIValue> filterDITAVALAttributeValues(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
Create a new DITA topic and link to it as a reference.- Parameters:
authorAccess- The Author Access- Throws:
Exception- if it fails.
-
pushElement
Shows a dialog that allows the user to push an element.- Parameters:
authorAccess- The Author access.- Throws:
AuthorOperationException- When the operation could not be completed.- Since:
- 17.1
-
isDITA
Check if the resource is DITA.- Parameters:
atts- The SAX attributes from the root element.- Returns:
trueif the topic or map with a certain architecture version is DITA,- Since:
- 20.1
-
isDITA1_3OrNewer
Check if the topic or map with a certain architecture version is DITA 1.3 or newer,- Parameters:
atts- The SAX attributes from the root element.- Returns:
trueif the topic or map with a certain architecture version is DITA 1.3 or newer,- Since:
- 20.1
-
isDITA1_3OrNewer
Check if the topic or map with a certain architecture version is DITA 1.3 or newer,- Parameters:
archVersion- The architecture version taken from the root element.- Returns:
trueif the topic or map with a certain architecture version is DITA 1.3 or newer,
-
insertLinkReference
public static void insertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String hrefType, 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-trueif we need to insert an <xref> element,falsefor the <link> element.hrefType- The type of the link. IfLINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). IfLINK_TYPE_NON_DITA_RESOURCE, 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- Iftruethe 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 tofalsewhen 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
-
insertLinkReference
public static void insertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String preferredElName, String hrefType, 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-trueif we need to insert an <xref> element,falsefor the <link> element.preferredElName- The preferred name of the reference element.hrefType- The type of the link. IfLINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). IfLINK_TYPE_NON_DITA_RESOURCE, 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- Iftruethe 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 tofalsewhen 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
-
insertLinkReference
public static void insertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String hrefType, URL initialReferenceURL, boolean displayReferenceUrl, DITAAccess.InsertLinkReferenceShortcut insertLinkReferenceShortcut) 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-trueif we need to insert an <xref> element,falsefor the <link> element.hrefType- The type of the link. IfLINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). IfLINK_TYPE_NON_DITA_RESOURCE, 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- Iftruethe 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 tofalsewhen 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.insertLinkReferenceShortcut- A shortcut class that allows us to collectthe references before inserting them into document.- Throws:
AuthorOperationException- Since:
- 18
-
insertLinkReference
public static void insertLinkReference(AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String preferredElName, String hrefType, URL initialReferenceURL, boolean displayReferenceUrl, DITAAccess.InsertLinkReferenceShortcut insertLinkReferenceShortcut) throws AuthorOperationException Insert a Xref or link element.- Parameters:
authorAccess- The author access.typeValue- The type attribute value. If notnull, the generated reference will have thetype="typeValue"attribute set to it.formatValue- The format attribute value. If notnulland the reference points to a non-DITA resource, the generated reference will have theformat="formatValue"attribute set to it.scopeValue- The scope attribute value. If notnull, the generated reference will have thescope="scopeValue"attribute set to it.isXref-trueif we need to insert an<xref>element,falsefor the<link>element.preferredElName- The preferred name of the reference element.hrefType- The type of the link. IfLINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). IfLINK_TYPE_NON_DITA_RESOURCE, 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- Iftruethe 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 tofalsewhen aninitialReferenceURLis 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.insertLinkReferenceShortcut- A shortcut class that allows us to collectthe references before inserting them into document.- Throws:
AuthorOperationException- Since:
- 18
-
insertLinkReference
public static void insertLinkReference(String referenceValue, String targetElementClass, String targetElementQName, AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, String hrefType) throws AuthorOperationException Insert a Xref or link element.- Parameters:
referenceValue- The class of the target element.targetElementClass- The class of the target element.targetElementQName- The qualified name of the target element.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-trueif we need to insert an <xref> element,falsefor the <link> element.hrefType- The type of the link. IfLINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). IfLINK_TYPE_NON_DITA_RESOURCE, wants to a reference to an external non-dita resource (Web Link action or File Reference action).- Throws:
AuthorOperationException- Since:
- 18
-
insertLinkReference
public static void insertLinkReference(String referenceValue, String targetElementClass, String targetElementQName, AuthorAccess authorAccess, String typeValue, String formatValue, String scopeValue, boolean isXref, boolean useKeyRef, String hrefType) throws AuthorOperationException Insert a Xref or link element.- Parameters:
referenceValue- The class of the target element.targetElementClass- The class of the target element.targetElementQName- The qualified name of the target element.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-trueif we need to insert an <xref> element,falsefor the <link> element.useKeyRef-trueif the reference is a keyref.hrefType- The type of the link. IfLINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). IfLINK_TYPE_NON_DITA_RESOURCE, wants to a reference to an external non-dita resource (Web Link action or File Reference action).- Throws:
AuthorOperationException- Since:
- 21
-
rewriteKeyref
public static String rewriteKeyref(LinkedHashMap<URL, List<Stack<Set<String>>>> urlKeyScopesMapping, LinkedHashMap<String, ro.sync.ecss.dita.reference.keyref.KeyInfo> keys, AuthorNode contextNode, String keyref) Rewrite a keyref looking also at key scopes..- Parameters:
urlKeyScopesMapping- Global URL to key scopes mapping.keys- Map of keys.contextNode- The context node.keyref- The original keyref.- Returns:
- The rewritten reference.
-
getURLKeyScopeContexts
Get the URL to key scopes context for the default keys manager.- Parameters:
originatorURL- The originator URL.- Returns:
- the URL to key scopes context mapping for the default keys manager.
-
editTopicref
Edits one or more topicref elements inside a specialized dialog.- Parameters:
topicrefNodes- The topicref elements.authorAccess- Author access.
-
getDitaReferenceTargets
public static List<DitaReferenceTargetDescriptor> getDitaReferenceTargets(AuthorAccess authorAccess, URL targetURL) throws IOException Returns the DITA reference targets in the given topic.- Parameters:
authorAccess- The author access of the currently opened document.targetURL- The URL of the topic.- Returns:
- the DITA reference targets in the given topic.
- Throws:
IOException- If an error occured while reading the URL.- Since:
- 18.0
-
getDitaReferenceTargets
public static List<DitaReferenceTargetDescriptor> getDitaReferenceTargets(URL baseUrl, URL topicUrl) throws IOException Returns the DITA reference targets in the given topic.- Parameters:
baseUrl- the target URL.topicUrl- the URL of the source topic.- Returns:
- the DITA reference targets in the given topic.
- Throws:
IOException- Since:
- 23.0
-
getFormat
@Deprecated public static String getFormat(String hrefValue, String formatValue, boolean fillFormatAttr) Deprecated.Get the format for the specified resource.- Parameters:
hrefValue- The HREF of the resource.formatValue- The default format value.fillFormatAttr-trueif the attribute should be filled when serializing.- Returns:
- The format for the resource.
-
getFormatForLinkCreatedFromGUI
public static String getFormatForLinkCreatedFromGUI(String hrefValue, String formatValue, boolean fillFormatAttr) Get the format for the specified resource.- Parameters:
hrefValue- The HREF of the resource.formatValue- The default format value.fillFormatAttr-trueif the attribute should be filled when serializing.- Returns:
- The format for the resource.
-
checkValidKeyName
Check if a keyref has a valid key name.- Parameters:
keyName- The key name.- Returns:
- an error message if the key name is not valid or
nullif the key name is valid.
-
getHrefInformation
Get the reference information (by analizing attributes like keyref, href, mapref, ...) of a node.- Parameters:
node- The author node to get the reference information for.- Returns:
- The information about what the given node references.
- Since:
- 18.1
-
getHrefInformation
Get the reference information (by analizing attributes like keyref, href, mapref, ...) of a node.- Parameters:
keyManager- The key manager to use to resolve keys.node- The author node to get the reference information for.- Returns:
- The information about what the given node references.
- Since:
- 22
-
exportDITAMap
public static void exportDITAMap(URL ditamapURL, File exportDirectory, boolean exportAsZip, String zipFileName, ExportProgressUpdater progressUpdater) Export DITA Map as zip.- Parameters:
ditamapURL- The DITA Map URL.exportDirectory- The export directory.exportAsZip-trueto export as ZIPzipFileName- Zip file name.progressUpdater- The progress updater.- Since:
- 18.1
-
attachKeyScopeInformation
@Deprecated public static URL attachKeyScopeInformation(URL targetURL, String keyref, String contextMapURL) Deprecated.Attach key scope information to the target URL.- Parameters:
targetURL- The URL which needs to be opened, referenced via a keyref.keyref- The fully qualified keyref.contextMapURL- The URL of the context map.- Since:
- 19
-
attachKeyScopeInformation
public static URL attachKeyScopeInformation(URL targetURL, String keyref, String contextMapURL, String originalKeyName) Attach key scope information to the target URL.- Parameters:
targetURL- The URL which needs to be opened, referenced via a keyref.keyref- The fully qualified keyref.contextMapURL- The URL of the context map.originalKeyName- The original key name without key scopes.- Returns:
- The URL with key scope information attached, so that we know from what key scope the URL was opened.
- Since:
- 25.1
-
attachKeyScopeInformation
public static URL attachKeyScopeInformation(URL targetURL, Stack<Set<String>> context, String contextMapURL) Attach key scope information to the target URL.- Parameters:
targetURL- The URL which needs to be opened, referenced via a keyref.context- The key scope context.
As an example, for a DITA map looking like this:<map><topicref keyscope="a b c"><topicref keyscope="d e f"/></topicref></map>
the stack consists of two sets, the first containing [a, b, c] and the second containing [d, e, f].contextMapURL- The URL of the context map.- Returns:
- The URL with key scope information attached, so that we know from what key scope the URL was opened.
- Since:
- 19
-
computeVariableKeyrefElementName
Compute the elements name.- Parameters:
authorAccess- The author access.- Returns:
- Returns the name of an element, that allows
-
computeVariableKeyrefElementName
public static String computeVariableKeyrefElementName(AuthorAccess authorAccess, boolean preferImageElement) Compute the elements name.- Parameters:
authorAccess- The author access.preferImageElement-trueif an image should be inserted.- Returns:
- Returns the name of an element, that allows
-
computeKeyScopeStack
public static Stack<Set<String>> computeKeyScopeStack(AuthorNode contextNode, LinkedHashMap<URL, List<Stack<Set<String>>>> urlKeyScopesMapping) Compute the entire key scope stack.- Parameters:
contextNode- The context node.urlKeyScopesMapping- The URL to key scopes mapping.- Returns:
- the entire key scope stack.
- Since:
- 19
-
computeKeyScopeStack
public static Stack<Set<String>> computeKeyScopeStack(AuthorNode contextNode, LinkedHashMap<URL, List<Stack<Set<String>>>> urlKeyScopesMapping, Map<AuthorNode, Set<String>> stackCache) Compute the entire key scope stack.- Parameters:
contextNode- The context node.urlKeyScopesMapping- The URL to key scopes mapping.stackCache- Key scopes stack cache. Can benull.- Returns:
- the entire key scope stack.
- Since:
- 23
-
getKeyForUrl
Get the key corresponding to the given URL.- Parameters:
keyManager- The key managerurl- The URL for which the search for a key is performed.editorLocation- The URL which is edited.- Returns:
- The name of the corresponding key, if existing, or
null. - Since:
- 21
-
getKeyForUrl
public static String getKeyForUrl(KeysManagerBase keyManager, URL url, URL editorLocation, AuthorNode contextNode) Get the key corresponding to the given URL.- Parameters:
keyManager- The key managerurl- The URL for which the search for a key is performed.editorLocation- The URL which is edited.contextNode- The context node. Can benull- Returns:
- The name of the corresponding key, if existing, or
null. - Since:
- 24
-
getKeyForUrl
Get the key corresponding to the given URL.- Parameters:
url- The URL for which the search for a key is performed.editorLocation- The URL which is edited.- Returns:
- The name of the corresponding key, if existing, or
null.
-
getKeyRefValueForUrl
public static String getKeyRefValueForUrl(KeysManagerBase keysManager, URL referenceUrl, URL editorLocation) Get the key reference corresponding to the given URL.- Parameters:
referenceUrl- The URL for which the search for a key is performed.editorLocation- The URL which is edited.keysManager- The context keys manager.- Returns:
- The name of the corresponding key, if existing, or
null. - Since:
- 21
-
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. !!! OBS: Do not delete. Internal API. !!!
-
isKeyReferenceToImage
public static boolean isKeyReferenceToImage(ro.sync.ecss.dita.reference.keyref.KeyInfo key) Checks if the current key is a reference to an image.- Parameters:
key- Current key to check.- Returns:
trueif we should treat the key as a reference to an image.
-
isGenericMediaContent
public static boolean isGenericMediaContent(ro.sync.ecss.dita.reference.keyref.KeyInfo selectedKey) Checks if the selected key refers resources that can be wrapped in a media object.s- Parameters:
selectedKey- Current key to check.- Returns:
trueif the current key has a reference to content that can be embedded in a media object.
-
detectMediaObjectOutputclass
Detects the output class of a key.- Parameters:
key- The key info.- Returns:
- the output class that should be used when the key is inserted as a media object.
-
isReferenceToDITAResource
public static boolean isReferenceToDITAResource(AuthorNode node, ro.sync.ecss.dita.reference.keyref.KeyInfo keyInfo) Check if this reference points to a DITA topic, map or variable text.- Parameters:
node- The node.keyInfo- The referenced key definition, can benull- Returns:
trueif this reference points to a DITA topic, map or variable text.- Since:
- 21
-
isReferenceToDITACompatibleResource
public static boolean isReferenceToDITACompatibleResource(AuthorNode node, ro.sync.ecss.dita.reference.keyref.KeyInfo keyInfo) Check if this reference points to a DITA compatible resource (that can be converted to DITA using dynamic converter DITA-OT plugin).- Parameters:
node- The node.keyInfo- The referenced key definition, can benull- Returns:
trueif this reference points to a DITA topic, map or variable text.- Since:
- 25
-
getConverterFormatForDITACompatibleResource
Get the converter format that corresponds with the given file extension of the DITA Compatible resource- Parameters:
resourceExtension- The file extension.- Returns:
- The converter format, or
nullwhen resource is not DITA-compatible or it's DITA. - Since:
- 25
-
convertDitaCompatibleResource
public static String convertDitaCompatibleResource(Reader toConvert, String systemId, String format) throws ro.sync.exml.editor.xmleditor.ErrorListException Get the DITA-translated content for the given compatible resource- Parameters:
toConvert- The content to convert.systemId- The system id of the content.format- The compatible resource conversion format.- Returns:
- The DITA content.
- Throws:
ro.sync.exml.editor.xmleditor.ErrorListException- if something goes wrong.- Since:
- 25
-
isKeyDefToDITAResource
public static boolean isKeyDefToDITAResource(ro.sync.ecss.dita.reference.keyref.KeyInfo keyInfo) Check if this key definition points to a DITA topic, map or variable text.- Parameters:
keyInfo- The key info.- Returns:
trueif this key definition points to a DITA topic, map or variable text.- Since:
- 21
-
annotateAttributes
Deprecated.This method does not do anything anynmore, the attribute annotations are gathered from the framework folder.Annotate a list of attributes.- Parameters:
attributes- The attributes list.- Returns:
- The list of attributes with annotations.
-
getFragWithMostSuitableTopicrefs
public static AuthorDocumentFragment getFragWithMostSuitableTopicrefs(AuthorDocumentController controller, AuthorDocumentFragment frag, int insertOffset) throws BadLocationException When moving/copying topic references, maybe they are not allowed at the new position. Try with other topic reference elements.- Parameters:
controller- Document controllerfrag- The fragment to moveinsertOffset- The offset position- Returns:
- the created fragment
- Throws:
BadLocationException
-
getFragWithMostSuitableTopicrefs
public static AuthorDocumentFragment getFragWithMostSuitableTopicrefs(AuthorDocumentController controller, AuthorNode selectedElem, int insertOffset) throws BadLocationException When moving/copying topic references, maybe they are not allowed at the new position. Try with other topic reference elements.- Parameters:
controller- document controllerselectedElem- the node to moveinsertOffset- the offset position- Returns:
- the created fragment
- Throws:
BadLocationException
-
findSimilarTopics
Find similar topics based on words found in title, shortdesc, keyword, and indexterm elements.- Parameters:
authorAccess- The author access.
-
getRelatedLinksFromReltable
Get the list of related links from all the relationship tables defined in the DITA Maps.- Parameters:
originatorURL- The topic for which we are searching for outgoing links.- Returns:
- The list of related links from all the relationship tables defined in the DITA Maps.
- Since:
- 22
-
proposeFolderUrlForChildTopicref
Propose a folder URL where to save a new topicref that is added in a DITA Map as a child of the given node.- Parameters:
parent- The parent node in the DITA Map of the new topicref element.- Returns:
- the folder URL where this topicref should be saved.
- Since:
- 25.0
-
detectInsertionType
Looks at the provided URL and detects if the referred resource should be inserted as a specific XML element.- Parameters:
url- The url.- Returns:
- the type the resource should be inserted.
- Since:
- 25.0
-
computeQualifiedKeyNames
public static List<String> computeQualifiedKeyNames(String keyToken, Stack<Set<String>> keyScopeStack) Compute key names qualified with key scope stack prefix.- Parameters:
keyToken- The key token.keyScopeStack- The current key scope stack.- Returns:
- key names qualified with key scope stack prefix.
- Since:
- 25.1
-
preferAddingKeyrefToAlreadyReferencedResource
Check if a keyref is preferred to be added when inserting a resource (that is already referred) in the editor .- Parameters:
editorURL- The URL location of the editor in which an already referenced resource needs to be inserted- Returns:
trueif a keyref should be added to the resource that needs to be inserted- Since:
- 25.1
-
showNewFileDialog
Shows the New File wizard to allow creating new documents.- Parameters:
authorAccess- The author access of the current opened document in Author page.proposedTitle- The title that will be presented in the New Document wizard. Ifnullno proposal will be presented.- Returns:
- the URL of the newly created document or
null. - Since:
- 26.0
-
showKeysAndReusableComponents
public static void showKeysAndReusableComponents(AuthorAccess authorAccess, boolean showKeys, boolean showComps) Show a content completion window with keys and components. Implemented only in the Oxygen desktop application.- Parameters:
authorAccess- The author accessshowKeys-trueto show keys.showComps-trueto show components- Since:
- 26.1
-
ID_FIRST_TOPIC_IDinstead which has a clearer meaning.