Class DITAAccess


  • @API(type=NOT_EXTENDABLE,
         src=PRIVATE)
    public final class DITAAccess
    extends java.lang.Object
    Utility methods for DITA interaction.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void addEditReference​(AuthorAccess authorAccess)
      Add a new conref to the current element or edit the existing one.
      static java.util.List<CIAttribute> annotateAttributes​(java.util.List<CIAttribute> attributes)
      Deprecated.
      This method does not do anything anynmore, the attribute annotations are gathered from the framework folder.
      static java.net.URL attachKeyScopeInformation​(java.net.URL targetURL, java.lang.String keyref, java.lang.String contextMapURL)
      Deprecated.
      static java.net.URL attachKeyScopeInformation​(java.net.URL targetURL, java.lang.String keyref, java.lang.String contextMapURL, java.lang.String originalKeyName)
      Attach key scope information to the target URL.
      static java.net.URL attachKeyScopeInformation​(java.net.URL targetURL, java.util.Stack<java.util.Set<java.lang.String>> context, java.lang.String contextMapURL)
      Attach key scope information to the target URL.
      static java.lang.String buildFigureHrefImageXMLToInsert​(AuthorAccess authorAccess, java.lang.String figTitle, java.lang.String refAttrValue)
      Creates a figure with title and image with href XML element.
      static java.lang.String buildFigureKeyrefImageXMLToInsert​(AuthorAccess authorAccess, java.lang.String figTitle, java.lang.String keyName)
      Creates a figure with title and image with keyref XML element.
      protected static int checkConsecutiveInsertionWarning​(int previousOperationOffset, int selectionStart, int selectionEnd, ro.sync.ecss.dita.reference.ReferenceInfo previousReferenceInfo, ro.sync.ecss.dita.reference.ReferenceInfo currentReferenceInfo)
      Show a warning message when consecutive insertion of the same references are performed.
      static java.lang.String checkValidKeyName​(java.lang.String keyName)
      Check if a keyref has a valid key name.
      static java.lang.String checkValidKeyRef​(java.lang.String keyref)
      Check if a keyref has a valid key name.
      static ro.sync.ecss.dita.ImageInfo chooseImageReference​(AuthorAccess authorAccess)
      Allows the user to choose an image reference, which will be inserted inside the document.
      static ro.sync.ecss.dita.MediaInfo chooseMediaReference​(AuthorAccess authorAccess)
      Allows the user to choose an media file reference, which will be inserted inside the document.
      static java.lang.String computeElementClazz​(WhatPossibleValuesHasAttributeContext context)
      Compute the element's clazz
      static java.lang.String computeFormatForURLPasteAndDnD​(UtilAccess utilAccess, java.net.URL url, ReferenceType refType)
      Computes the format of the xref.
      static java.lang.String computeImageReferenceXMLToInsert​(AuthorAccess authorAccess, java.lang.String refAttrName, java.lang.String refValue)
      Compute the image reference XML fragment to insert.
      static java.util.Stack<java.util.Set<java.lang.String>> computeKeyScopeStack​(AuthorNode contextNode, java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> urlKeyScopesMapping)
      Compute the entire key scope stack.
      static java.util.Stack<java.util.Set<java.lang.String>> computeKeyScopeStack​(AuthorNode contextNode, java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> urlKeyScopesMapping, java.util.Map<AuthorNode,​java.util.Set<java.lang.String>> stackCache)
      Compute the entire key scope stack.
      static java.lang.String computeLinkScope​(java.net.URL editorLocation, java.net.URL hrefURL)
      Compute the scope attribute.
      static java.lang.String computeLinkText​(java.lang.String hrefValue, java.lang.String baseSystemID)
      static java.lang.String computeLinkText​(AuthorNode contextNode, java.lang.String hrefValue, java.lang.String baseSystemID)
      static java.lang.String computeLinkText​(AuthorNode contextNode, java.lang.String keyRefValue, java.lang.String hrefValue, java.lang.String baseSystemID)
      static java.lang.String computeLinkText​(AuthorNode contextNode, java.lang.String keyRefValue, java.lang.String hrefValue, java.lang.String baseSystemID, KeysManagerBase keysManager)
      Obtains information about the referred target.
      static java.lang.String computeMediaReferenceXMLToInsert​(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo reference)
      Compute the media reference XML fragment to insert.
      static java.util.List<java.lang.String> computeQualifiedKeyNames​(java.lang.String keyToken, java.util.Stack<java.util.Set<java.lang.String>> keyScopeStack)
      Compute key names qualified with key scope stack prefix.
      static java.lang.String computeVariableKeyrefElementName​(AuthorAccess authorAccess)
      Compute the elements name.
      static java.lang.String computeVariableKeyrefElementName​(AuthorAccess authorAccess, boolean preferImageElement)
      Compute the elements name.
      static java.lang.String convertDitaCompatibleResource​(java.io.Reader toConvert, java.lang.String systemId, java.lang.String format)
      Get the DITA-translated content for the given compatible resource
      static void createNewTopicReference​(AuthorAccess authorAccess)
      Create a new DITA topic and link to it as a reference.
      static java.lang.Object 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).
      static void createReusableComponent​(AuthorAccess authorAccess, ro.sync.ecss.extensions.api.DITAUniqueIDAssigner idsAssigner)
      Reuse the selected content.
      static DITAImposedReferenceType detectInsertionType​(java.net.URL url)
      Looks at the provided URL and detects if the referred resource should be inserted as a specific XML element.
      static java.lang.String detectMediaObjectOutputclass​(ro.sync.ecss.dita.reference.keyref.KeyInfo key)
      Detects the output class of a key.
      static void editProperties​(java.net.URL location, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, AuthorElement[] elementsToEdit, ro.sync.ecss.dita.topic.ref.TopicRefInserter topicRefInserter, java.lang.Object parentFrame, boolean displayReferenceUrl)
      Edit properties for the given reference elements.
      static void editProperties​(AuthorAccess authorAccess)
      Edit properties for the given reference elements.
      static void editTopicref​(AuthorElement[] topicrefNodes, AuthorAccess authorAccess)
      Edits one or more topicref elements inside a specialized dialog.
      static java.util.List<DocumentPositionedInfo> expandAllKeyrefs​(AuthorAccess authorAccess, LinkTextResolver linkTextResolver)
      Expand all keyrefs from the current document.
      static void exportDITAMap​(java.net.URL ditamapURL, java.io.File exportDirectory, boolean exportAsZip, java.lang.String zipFileName, ExportProgressUpdater progressUpdater)
      Export DITA Map as zip.
      static java.util.List<CIValue> filterAttributeValues​(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, java.lang.String documentTypeName)
      Deprecated.
      Please use the equivalent method which also receives the URL of the requestor.
      static java.util.List<CIValue> filterAttributeValues​(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, java.lang.String documentTypeName, AuthorAccess authorAccess)
      Propose additional attribute values.
      static java.util.List<CIValue> filterAttributeValues​(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, ContextKeyManager keyManager, java.lang.String documentTypeName, AuthorAccess authorAccess)
      Propose additional attribute values.
      static java.util.List<CIValue> filterDITAVALAttributeValues​(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context)
      Filter DITAVAL Attribute values.
      static java.util.List<CIElement> filterElements​(java.util.List<CIElement> elements, WhatElementsCanGoHereContext context)
      Filter the given elements according to the given context.
      static java.util.List<CIElement> filterElements​(java.util.List<CIElement> elements, WhatElementsCanGoHereContext context, java.lang.String authorName)
      Filter the given elements according to the given context.
      static void findSimilarTopics​(AuthorAccess authorAccess)
      Find similar topics based on words found in title, shortdesc, keyword, and indexterm elements.
      static java.lang.String getAPIKeysManagerDescription()  
      static java.lang.String getAutoInsertImageRefElementName​(AuthorAccess authorAccess, int caretPosition)
      Get the name of the image element to insert.
      static java.lang.String getAutoInsertRefElementName​(AuthorAccess authorAccess, int caretPosition)
      Get the name of the topic ref element to insert
      static java.lang.String getAutoInsertTopicRefElementName​(AuthorAccess authorAccess, int caretPosition)
      Get the name of the topic ref element to insert
      static java.lang.String getAutoInsertTopicRefElementName​(AuthorDocumentController authorDocumentController, int caretPosition)
      Get the name of the topic ref element to insert
      static java.lang.String getConverterFormatForDITACompatibleResource​(java.lang.String resourceExtension)
      Get the converter format that corresponds with the given file extension of the DITA Compatible resource
      static ro.sync.ecss.dita.DITAAccessCustomizer getDitaAccessCustomizer()  
      static java.util.List<DitaReferenceTargetDescriptor> getDitaReferenceTargets​(java.net.URL baseUrl, java.net.URL topicUrl)
      Returns the DITA reference targets in the given topic.
      static java.util.List<DitaReferenceTargetDescriptor> getDitaReferenceTargets​(AuthorAccess authorAccess, java.net.URL targetURL)
      Returns the DITA reference targets in the given topic.
      static CIElement getEquivalentChildCIElement​(AuthorAccess authorAccess, int caretOffset, java.lang.String tagName)
      Get the equivalent child CIElement
      static java.lang.String getFormat​(java.lang.String hrefValue, java.lang.String formatValue, boolean fillFormatAttr)
      static java.lang.String getFormatForLinkCreatedFromGUI​(java.lang.String hrefValue, java.lang.String formatValue, boolean fillFormatAttr)
      Get the format for the specified resource.
      static AuthorDocumentFragment getFragWithMostSuitableTopicrefs​(AuthorDocumentController controller, AuthorDocumentFragment frag, int insertOffset)
      When moving/copying topic references, maybe they are not allowed at the new position.
      static AuthorDocumentFragment getFragWithMostSuitableTopicrefs​(AuthorDocumentController controller, AuthorNode selectedElem, int insertOffset)
      When moving/copying topic references, maybe they are not allowed at the new position.
      static HrefInfo getHrefInformation​(KeysManagerBase keyManager, AuthorNode node)
      Get the reference information (by analizing attributes like keyref, href, mapref, ...) of a node.
      static HrefInfo getHrefInformation​(AuthorNode node)
      Get the reference information (by analizing attributes like keyref, href, mapref, ...) of a node.
      static int getInheritanceType​(java.lang.String sourceClass, java.lang.String targetClass)
      Check what inheritance is between the two classes.
      static void getInsertTopicref​(java.net.URL editorLocation, java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, AuthorDocumentController ctrl, int caretOffset, java.lang.String initialTopicRefLocation, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter, java.lang.String preferredElementName, boolean displayReferenceUrl)
      Insert a topic reference.
      static java.lang.String getKeyForUrl​(java.net.URL url, java.net.URL editorLocation)
      Get the key corresponding to the given URL.
      static java.lang.String getKeyForUrl​(KeysManagerBase keyManager, java.net.URL url, java.net.URL editorLocation)
      Get the key corresponding to the given URL.
      static java.lang.String getKeyForUrl​(KeysManagerBase keyManager, java.net.URL url, java.net.URL editorLocation, AuthorNode contextNode)
      Get the key corresponding to the given URL.
      static java.lang.String getKeyRefValueForUrl​(KeysManagerBase keysManager, java.net.URL referenceUrl, java.net.URL editorLocation)
      Get the key reference corresponding to the given URL.
      static java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys()
      Deprecated.
      Please use the equivalent method which also receives the URL of the requestor.
      static java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys​(java.net.URL originatorURL)  
      static java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys​(java.net.URL originatorURL, ContextKeyManager keysManager)
      Returns the mapped DITA 1.2 keys
      static java.lang.String getKeysAttributeValueBasedOnFilename​(java.net.URL url)
      Get the value of the "keys" attribute based on the current filename.
      static java.util.List<ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeysForInsertion​(java.net.URL originatorURL)
      Get the list of keys which can be inserted in the topic identified by the "originatorURL" field.
      static java.lang.String getPossibleElementQName​(AuthorDocumentController ctrl, java.lang.String clazzFrag, java.lang.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, java.lang.String reqAttr, java.lang.String... classFrag)
      Get the possible elements that can be inserted at a given offset and have the class 'classFrag' and a 'reqAttr' attribute.
      static java.util.List<RelLink> getRelatedLinksFromReltable​(java.net.URL originatorURL)
      Get the list of related links from all the relationship tables defined in the DITA Maps.
      static java.net.URL getRootMapURL()
      Get DITA root map URL.
      static void getTopicRefInfo​(java.net.URL location, java.lang.Object parentFrame, ro.sync.ecss.contentcompletion.AuthorCCManager ccM, ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl, int caretOffset, ro.sync.ecss.dita.topic.ref.TopicrefInfo initialTopicrefInfo, ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter)
      Deprecated.
      This method is not used anymore from oXygen to insert topic reference elements and it will be removed in a future release.
      static java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> getURLKeyScopeContexts​(java.net.URL originatorURL)
      Get the URL to key scopes context for the default keys manager.
      static java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> getURLKeyScopeContexts​(java.net.URL originatorURL, ContextKeyManager keysManager)
      Returns a mapping between topic URLs and DITA 1.3 key scopes where the URLs are referenced.
      static void handleTopicRefInsertUrl​(AuthorAccess authorAccess, java.net.URL topicUrl)
      Insert a topic ref with the given URL.
      static boolean hasAPIKeysManager()  
      static void insertContentKeyReference​(AuthorAccess authorAccess, java.lang.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 void insertContentReference​(AuthorAccess authorAccess, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
      Shows a dialog that allows inserting a content reference (conref).
      static void insertHref​(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic)
      Insert a Xref.
      static void insertHref​(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, boolean isHrefTypeDitaTopic, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
      Insert a Xref or link element.
      static void insertImage​(AuthorAccess authorAccess, java.lang.String ref)
      Insert a DITA Image
      static void insertImage​(AuthorAccess authorAccess, ro.sync.ecss.dita.ImageInfo ref)
      Insert a DITA Image.
      static SchemaAwareHandlerResult insertImageSchemaAware​(AuthorAccess authorAccess, java.lang.String ref)
      Insert a DITA Image
      static SchemaAwareHandlerResult insertImageSchemaAware​(AuthorAccess authorAccess, java.lang.String refAttrName, java.lang.String refValue)
      Insert a DITA Image
      static SchemaAwareHandlerResult insertImageSchemaAware​(AuthorAccess authorAccess, ro.sync.ecss.dita.ImageInfo reference)
      Insert a DITA image.
      static void insertKeydefWithKeyword​(java.lang.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 void insertKeydefWithKeyword​(java.lang.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 void insertKeydefWithKeyword​(AuthorAccess authorAccess)
      Insert a key definition with keyword.
      static void insertLinkReference​(java.lang.String referenceValue, java.lang.String targetElementClass, java.lang.String targetElementQName, AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, boolean useKeyRef, java.lang.String hrefType)
      Insert a Xref or link element.
      static void insertLinkReference​(java.lang.String referenceValue, java.lang.String targetElementClass, java.lang.String targetElementQName, AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, java.lang.String hrefType)
      Insert a Xref or link element.
      static void insertLinkReference​(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, java.lang.String preferredElName, java.lang.String hrefType, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
      Insert a Xref or link element.
      static void insertLinkReference​(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, java.lang.String preferredElName, java.lang.String hrefType, java.net.URL initialReferenceURL, boolean displayReferenceUrl, DITAAccess.InsertLinkReferenceShortcut insertLinkReferenceShortcut)
      Insert a Xref or link element.
      static void insertLinkReference​(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, java.lang.String hrefType, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
      Insert a Xref or link element.
      static void insertLinkReference​(AuthorAccess authorAccess, java.lang.String typeValue, java.lang.String formatValue, java.lang.String scopeValue, boolean isXref, java.lang.String hrefType, java.net.URL initialReferenceURL, boolean displayReferenceUrl, DITAAccess.InsertLinkReferenceShortcut insertLinkReferenceShortcut)
      Insert a Xref or link element.
      static void insertMedia​(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo ref)
      Insert a media object.
      static SchemaAwareHandlerResult insertMediaSchemaAware​(AuthorAccess authorAccess, ro.sync.ecss.dita.MediaInfo reference)
      Insert a DITA media object.
      static void insertReference​(AuthorAccess authorAccess, int refType)
      Insert a keyref or a conkeyref.
      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)
      Insert the given reference information with the given type.
      static void insertReference​(AuthorAccess authorAccess, java.lang.String referenceValue, int refType, java.lang.String targetElementQName, java.lang.String elementClass)
      Inserts a reference from the information passed in the ArgumentsMap.
      static void insertReference​(AuthorAccess authorAccess, java.lang.String referenceValue, java.lang.String targetElementQName, java.lang.String elementClass)
      Inserts a reference from the information passed in the ArgumentsMap.
      static void insertReusableComponent​(AuthorAccess authorAccess)
      Insert a reusable component
      static void insertTopicgroup​(AuthorAccess authorAccess)
      Insert a topic group.
      static void insertTopichead​(AuthorAccess authorAccess)
      Insert a topic head.
      static void insertTopicref​(AuthorAccess authorAccess)
      Insert a topic ref.
      static void insertTopicref​(AuthorAccess authorAccess, java.net.URL initialReferenceURL, boolean displayReferenceUrl)
      Insert a topic reference.
      static void insertTopicref​(WSDITAMapEditorPage ditaPageAccess, java.net.URL initialReferenceURL, java.lang.String preferredElementName, boolean asChild, boolean displayReferenceUrl)
      Insert a topic reference in the DITA Map tree.
      static void insertTopicref​(WSDITAMapEditorPage ditaPageAccess, java.net.URL initialReferenceURL, java.lang.String preferredElementName, DITATopicInsertionPosition insertPos, boolean displayReferenceUrl)
      Insert a topic reference in the DITA Map tree.
      static boolean isDITA​(org.xml.sax.Attributes atts)
      Check if the resource is DITA.
      static boolean isDITA1_3OrNewer​(java.lang.String archVersion)
      Check if the topic or map with a certain architecture version is DITA 1.3 or newer,
      static boolean isDITA1_3OrNewer​(org.xml.sax.Attributes atts)
      Check if the topic or map with a certain architecture version is DITA 1.3 or newer,
      static boolean isGeneralizationOf​(java.lang.String sourceClass, java.lang.String targetClass)
      Deprecated.
      use getInheritanceType instead.
      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
      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.
      static boolean isKeyReferenceToImage​(ro.sync.ecss.dita.reference.keyref.KeyInfo key)
      Checks if the current key is a reference to an image.
      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).
      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.
      static Reference parseDITAHref​(java.lang.String baseUrl, java.lang.String hrefValue)
      Parse the href attribute and returns the absolute URL and the id.
      static Reference parseDITAHref​(java.lang.String baseUrl, java.lang.String hrefValue, boolean isHrefToDITAResource)
      Parse the href attribute and returns the absolute URL and the id.
      static Reference parseDITAKeyRef​(java.lang.String keyref)
      Deprecated.
      Please use the equivalent method which also receives the URL of the requestor.
      static Reference parseDITAKeyRef​(java.lang.String keyref, ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
      Parse the DITA conkeyref value
      static Reference parseDITAKeyRef​(java.net.URL originatorURL, java.lang.String keyref)
      Parse the DITA conkeyref value
      static Reference parseDITAKeyRef​(java.net.URL originatorURL, ContextKeyManager keyManager, java.lang.String keyref)
      Parse the DITA conkeyref value
      static java.lang.String pasteAsReference​(AuthorAccess authorAccess, boolean asConref)
      Paste as reference
      static java.lang.String pasteAsReference​(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo)
      Paste as reference
      static boolean pasteClipboardFragmentsAsReference​(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo, ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments)
      Paste the fragments from clipboard as reference.
      static boolean pasteClipboardFragmentsAsReference​(AuthorAccess authorAccess, DITAAccess.PasteInfo pasteInfo, ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments, SelectionInterpretationMode selectionInterpretationMode)
      Paste the fragments from clipboard as reference.
      static boolean preferAddingKeyrefToAlreadyReferencedResource​(java.net.URL editorURL)
      Check if a keyref is preferred to be added when inserting a resource (that is already referred) in the editor .
      static java.net.URL proposeFolderUrlForChildTopicref​(AuthorElement parent)
      Propose a folder URL where to save a new topicref that is added in a DITA Map as a child of the given node.
      static void pushElement​(AuthorAccess authorAccess)
      Shows a dialog that allows the user to push an element.
      static void removeReference​(AuthorAccess authorAccess)
      Remove a content reference from a DITA document.
      static java.util.List<DocumentPositionedInfo> replaceAllConrefs​(AuthorAccess authorAccess)
      Expand all conrefs and conkeyrefs from the current document.
      static void replaceConref​(AuthorAccess authorAccess)
      Replace the conref at caret position
      static void resolveKeyNotFoundError​(AuthorAccess authorAccess, java.lang.String keyref)
      The give key was not found.
      static java.net.URL resolveKeyRef​(java.lang.String keyRef)
      Deprecated.
      Please use the equivalent method which also receives the URL of the requestor.
      static java.net.URL resolveKeyRef​(java.lang.String keyRef, boolean addANYIdentifierForKeys)
      Deprecated.
      Please use the equivalent method which also receives the URL of the requestor.
      static ro.sync.ecss.dita.KeyTargetURLWithTypeInfo resolveKeyRef​(java.lang.String keyRef, ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
      Resolve a keyref.
      static java.net.URL resolveKeyRef​(java.net.URL originatorURL, java.lang.String keyRef, boolean addANYIdentifierForKeys)
      Resolve a keyref.
      static java.net.URL resolveKeyRef​(java.net.URL originatorURL, java.lang.String keyRef, ContextKeyManager keysManager, boolean addANYIdentifierForKeys)
      Resolve a keyref.
      static java.lang.String rewriteKeyref​(java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> urlKeyScopesMapping, java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> keys, AuthorNode contextNode, java.lang.String keyref)
      Rewrite a keyref looking also at key scopes..
      static java.util.List<DocumentPositionedInfo> searchReferences​(java.net.URL targetTopicURL)
      Search the references to this topic.
      static java.util.List<DocumentPositionedInfo> searchReferences​(java.net.URL targetTopicURL, java.lang.Object referencesGraph)
      Search the references to this topic.
      static void searchReferences​(AuthorAccess authorAccess)
      Search references to a certain element at the caret position.
      static void setDitaAccessCustomizer​(ro.sync.ecss.dita.DITAAccessCustomizer ditaAccessCustomizer)
      Set the DITA access customizer from SA or EC.
      static void setKeyNameGenerator​(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 void showInsertReferenceDialog​(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.ue.AuthorDocumentControllerImpl controller, int caretOffset, java.lang.Object parentFrame, int refType, boolean showOnlyKeysList, ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter)
      Shows the keyref/conkeyref insert dialog and returns the chosen reference information.
      static void showInsertReferenceDialog​(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager, ro.sync.ecss.ue.AuthorDocumentControllerImpl controller, int caretOffset, java.lang.Object parentFrame, int refType, boolean showOnlyKeysList, ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter, ro.sync.ecss.dita.IKeyInfoFilter keysFilter, boolean useModalDialog)
      Shows the keyref/conkeyref insert dialog and returns the chosen reference information.
      static void showKeysAndReusableComponents​(AuthorAccess authorAccess, boolean showKeys, boolean showComps)
      Show a content completion window with keys and components.
      static java.net.URL showNewFileDialog​(AuthorAccess authorAccess, java.lang.String proposedTitle)
      Shows the New File wizard to allow creating new documents.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • IMPOSED_INSERTION_TYPE

        public static final java.lang.String IMPOSED_INSERTION_TYPE
        Query parameter that imposes how a reference will be inserted in DITA
        Since:
        25
        See Also:
        Constant Field Values
      • FULLY_QUALIFIED_KEYNAME_URL_PARAM

        public static final java.lang.String FULLY_QUALIFIED_KEYNAME_URL_PARAM
        Can be sent as an URL parameter to give more information about the keyref fully qualified value.
        See Also:
        Constant Field Values
      • REUSABLE_COMPONENT_TARGET_PATH_PARAM

        public static final java.lang.String 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:
        Constant Field Values
      • REUSABLE_COMPONENT_TARGET_QNAME_PARAM

        public static final java.lang.String 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:
        Constant Field Values
      • REUSABLE_COMPONENT_ELEMENT_CLASS_PARAM

        public static final java.lang.String 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:
        Constant Field Values
      • LINK_TYPE_WEB_PAGE

        public static final java.lang.String LINK_TYPE_WEB_PAGE
        The 'href' attribute type web page.
        See Also:
        Constant Field Values
      • LINK_TYPE_NON_DITA_RESOURCE

        public static final java.lang.String LINK_TYPE_NON_DITA_RESOURCE
        The 'href' attribute type non DITA resource.
        See Also:
        Constant Field Values
      • LINK_TYPE_DITA_TOPIC

        public static final java.lang.String LINK_TYPE_DITA_TOPIC
        The 'href' attribute type DITA topic.
        See Also:
        Constant Field Values
      • DITA_ROOT_MAP_URL_ATTRIBUTE

        public static final java.lang.String DITA_ROOT_MAP_URL_ATTRIBUTE
        The attribute name for the dita root map url. The attribute is given as string.
        See Also:
        Constant Field Values
      • DITA_VAL_URL_ATTRIBUTE

        public static final java.lang.String DITA_VAL_URL_ATTRIBUTE
        The attribute name for the ditaval url. The attribute is given as string.
        See Also:
        Constant Field Values
      • REF_ATTRIBUTES

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

        public static final java.lang.String DEFAULT_CONKEYREF_CONREFEND
        Value for conrefend attribute value when a conkeyref is used.
        See Also:
        Constant Field Values
      • ID_FIRST_TOPIC_ID

        public static final java.lang.String ID_FIRST_TOPIC_ID
        Identifier used in references path, representing that the topic id is the first topic ID in the file.
        See Also:
        Constant Field Values
      • ID_ANY

        @Deprecated
        public static final java.lang.String ID_ANY
        Deprecated.
        Use ID_FIRST_TOPIC_ID instead which has a clearer meaning.

        Identifier used in references path, representing that the topic id can be excluded from the reference.
        See Also:
        Constant Field Values
      • INHERITANCE_GENERALIZATION

        public static final int INHERITANCE_GENERALIZATION
        If the source is a generalization of the target
        See Also:
        Constant Field Values
      • INHERITANCE_SPECIALIZATION

        public static final int INHERITANCE_SPECIALIZATION
        If the source is a specialization of the target
        See Also:
        Constant Field Values
      • INHERITANCE_SAME

        public static final int INHERITANCE_SAME
        If the source class is the same as the target class.
        See Also:
        Constant Field Values
      • INHERITANCE_NONE

        public static final int INHERITANCE_NONE
        No match between the two classes..
        See Also:
        Constant Field Values
    • Method Detail

      • setKeyNameGenerator

        public static void setKeyNameGenerator​(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.
        Parameters:
        ditaKeyNameGenerator - The dita key name generator to set. null to remove the previous one.
        Since:
        23
      • getKeysAttributeValueBasedOnFilename

        public static java.lang.String getKeysAttributeValueBasedOnFilename​(java.net.URL url)
        Get the value of the "keys" attribute based on the current filename.
        Parameters:
        url - The URL of the current file.
        Returns:
        the value.
      • createReferencesGraph

        public static java.lang.Object 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 null is something went wrong.
        Since:
        23
      • searchReferences

        public static java.util.List<DocumentPositionedInfo> searchReferences​(java.net.URL targetTopicURL)
        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 java.util.List<DocumentPositionedInfo> searchReferences​(java.net.URL targetTopicURL,
                                                                              java.lang.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 not null the search will be much faster.
        Returns:
        the references or an empty list. Never null;
        Since:
        23
      • handleTopicRefInsertUrl

        public static void handleTopicRefInsertUrl​(AuthorAccess authorAccess,
                                                   java.net.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
      • getTopicRefInfo

        @Deprecated
        public static void getTopicRefInfo​(java.net.URL location,
                                           java.lang.Object parentFrame,
                                           ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                           ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                           int caretOffset,
                                           ro.sync.ecss.dita.topic.ref.TopicrefInfo initialTopicrefInfo,
                                           ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter)
        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 location
        parentFrame - The parent frame.
        ccM - The CC Manager.
        ctrl - The document controller.
        caretOffset - The caret offset.
        initialTopicrefInfo - Initial topic ref info.
        inserter - Callback when the dialog is used.
      • getInsertTopicref

        public static void getInsertTopicref​(java.net.URL editorLocation,
                                             java.lang.Object parentFrame,
                                             ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                             AuthorDocumentController ctrl,
                                             int caretOffset,
                                             java.lang.String initialTopicRefLocation,
                                             ro.sync.ecss.dita.topic.ref.TopicRefInserter inserter,
                                             java.lang.String preferredElementName,
                                             boolean displayReferenceUrl)
        Insert a topic 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 inserter
        preferredElementName - Preferred name or class of the element to insert
        displayReferenceUrl - If true the URL input will be displayed in the insert topic reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
      • insertKeydefWithKeyword

        public static void insertKeydefWithKeyword​(java.lang.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: the preferredElementName parameter is not used on Eclipse plugin implementation.
        append - true to append child, false to insert after.
      • insertKeydefWithKeyword

        public static void insertKeydefWithKeyword​(java.lang.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: the preferredElementName parameter is not used on Eclipse plugin implementation.
        insertPos - one of the values defined in DITATopicInsertionPosition.
      • insertKeydefWithKeyword

        public static void insertKeydefWithKeyword​(AuthorAccess authorAccess)
        Insert a key definition with keyword.
        Parameters:
        authorAccess - Author access.
      • 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:
        true if we have a keys manager provided through the API.
      • getAPIKeysManagerDescription

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

        public static void editProperties​(java.net.URL location,
                                          ro.sync.ecss.contentcompletion.AuthorCCManager ccM,
                                          ro.sync.ecss.ue.AuthorDocumentControllerImpl ctrl,
                                          AuthorElement[] elementsToEdit,
                                          ro.sync.ecss.dita.topic.ref.TopicRefInserter topicRefInserter,
                                          java.lang.Object parentFrame,
                                          boolean displayReferenceUrl)
        Edit properties for the given reference elements.
        Parameters:
        location - DITA Map editor location.
        ccM - The CC Manager
        ctrl - The Author document controller.
        elementsToEdit - The elements that must be edited.
        topicRefInserter - Callback to insert/edit a topic ref
        parentFrame - Parent frame.
        displayReferenceUrl - If true the URL input will be displayed in the edit reference dialog (the user will have the possibility to change the reference URL).
        Since:
        17.1
      • insertHref

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

        public static void insertHref​(AuthorAccess authorAccess,
                                      java.lang.String typeValue,
                                      java.lang.String formatValue,
                                      java.lang.String scopeValue,
                                      boolean isXref,
                                      boolean isHrefTypeDitaTopic)
                               throws AuthorOperationException
        Insert a Xref.
        Parameters:
        authorAccess - The author access.
        typeValue - The the attribute value.
        formatValue - The format attribute value.
        scopeValue - The scope attribute value.
        isXref - true if we need to insert a xref element, false for link element.
        isHrefTypeDitaTopic - if true a dita topic chooser will be shown otherwise a input url dialog will be show for the href attribute value.
        Throws:
        AuthorOperationException
      • insertContentKeyReference

        public static void insertContentKeyReference​(AuthorAccess authorAccess,
                                                     java.lang.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,
                                                  java.net.URL initialReferenceURL,
                                                  boolean displayReferenceUrl)
                                           throws AuthorOperationException
        Shows a dialog that allows inserting a content reference (conref).
        Parameters:
        authorAccess - The Author access.
        initialReferenceURL - The default URL that will be displayed in the URL field of the insert reference dialog.
        Note: this parameter is not used on Eclipse plugin implementation.
        displayReferenceUrl - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
        Throws:
        AuthorOperationException
        Since:
        14.2
      • insertTopicref

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

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

        public static void insertTopicref​(WSDITAMapEditorPage ditaPageAccess,
                                          java.net.URL initialReferenceURL,
                                          java.lang.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 in DITATopicInsertionPosition.
        displayReferenceUrl - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
        Throws:
        AuthorOperationException
        Since:
        15
      • showInsertReferenceDialog

        public static void showInsertReferenceDialog​(ro.sync.ecss.contentcompletion.AuthorCCManager ccManager,
                                                     ro.sync.ecss.ue.AuthorDocumentControllerImpl controller,
                                                     int caretOffset,
                                                     java.lang.Object parentFrame,
                                                     int refType,
                                                     boolean showOnlyKeysList,
                                                     ro.sync.ecss.dita.topic.ref.ReferenceInserter referenceInserter)
                                              throws AuthorOperationException
        Shows the keyref/conkeyref insert dialog and returns the 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_TYPE
        showOnlyKeysList - true to 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,
                                                     java.lang.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_TYPE
        showOnlyKeysList - true to show only keys list in the insert reference dialog.
        referenceInserter - The reference inserter.
        keysFilter - Filters the keys.
        useModalDialog - true if the dialog should be modal.
        Throws:
        AuthorOperationException - When the insertion fails.
      • insertReference

        public static void insertReference​(AuthorAccess authorAccess,
                                           java.lang.String referenceValue,
                                           java.lang.String targetElementQName,
                                           java.lang.String elementClass)
                                    throws AuthorOperationException
        Inserts a reference from the information passed in the ArgumentsMap.
        Parameters:
        authorAccess - the AuthorAccess
        referenceValue - 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,
                                           java.lang.String referenceValue,
                                           int refType,
                                           java.lang.String targetElementQName,
                                           java.lang.String elementClass)
                                    throws AuthorOperationException
        Inserts a reference from the information passed in the ArgumentsMap.
        Parameters:
        authorAccess - The AuthorAccess
        referenceValue - The reference value.
        refType - The reference type
        targetElementQName - 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 access
        refType - The reference type
        viewport - The viewport
        ccManager - The CC Manager
        refInfo - The reference info.
        Returns:
        The offset where the insertion took place.
        Throws:
        AuthorOperationException - When a problem occurs.
      • getRootMapURL

        public static java.net.URL getRootMapURL()
        Get DITA root map URL.
        Returns:
        DITA root map URL.
      • resolveKeyRef

        @Deprecated
        public static java.net.URL resolveKeyRef​(java.lang.String keyRef)
        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
        public static java.net.URL resolveKeyRef​(java.lang.String keyRef,
                                                 boolean addANYIdentifierForKeys)
        Deprecated.
        Please use the equivalent method which also receives the URL of the requestor.
        Resolve a keyref.
        Parameters:
        keyRef - The keyref value
        addANYIdentifierForKeys - If true then reference keys will be prefixed by 'ANY/'. in a element_keyref function.
        Returns:
        The absolute value of the key ref target.
      • resolveKeyRef

        public static java.net.URL resolveKeyRef​(java.net.URL originatorURL,
                                                 java.lang.String keyRef,
                                                 boolean addANYIdentifierForKeys)
        Resolve a keyref.
        Parameters:
        originatorURL - The originator URL.
        keyRef - The keyref value
        addANYIdentifierForKeys - If true then reference keys will be prefixed by 'ANY/'. in a element_keyref function.
        Returns:
        The absolute value of the key ref target.
      • checkValidKeyRef

        public static java.lang.String checkValidKeyRef​(java.lang.String keyref)
        Check if a keyref has a valid key name.
        Parameters:
        keyref - The keyref (may also contain the "/").
        Returns:
        an error message if the key name is not valid or null if the key name is valid.
      • resolveKeyRef

        public static java.net.URL resolveKeyRef​(java.net.URL originatorURL,
                                                 java.lang.String keyRef,
                                                 ContextKeyManager keysManager,
                                                 boolean addANYIdentifierForKeys)
        Resolve a keyref.
        Parameters:
        originatorURL - The url that contains the key.
        keyRef - The keyref value
        keysManager - The key manager.
        addANYIdentifierForKeys - If true then reference keys will be prefixed by 'ANY/'. in a element_keyref function.
        Returns:
        The absolute value of the key ref target.
      • resolveKeyRef

        public static ro.sync.ecss.dita.KeyTargetURLWithTypeInfo resolveKeyRef​(java.lang.String keyRef,
                                                                               ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
        Resolve a keyref.
        Parameters:
        keyRef - The keyref value
        kr - The key resolver.
        Returns:
        The absolute value of the key ref target.
      • createReusableComponent

        public static void createReusableComponent​(AuthorAccess authorAccess,
                                                   ro.sync.ecss.extensions.api.DITAUniqueIDAssigner idsAssigner)
                                            throws AuthorOperationException
        Reuse the selected content.
        Parameters:
        authorAccess - The author access
        idsAssigner - The IDs assigner
        Throws:
        AuthorOperationException - If fails
      • expandAllKeyrefs

        public static java.util.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.
      • isGeneralizationOf

        @Deprecated
        public static boolean isGeneralizationOf​(java.lang.String sourceClass,
                                                 java.lang.String targetClass)
        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 value
        targetClass - The target class value
        Returns:
        True if the first class value is a generalization of the second
      • getInheritanceType

        public static int getInheritanceType​(java.lang.String sourceClass,
                                             java.lang.String targetClass)
        Check what inheritance is between the two classes.
        Parameters:
        sourceClass - The source class value
        targetClass - The target class value
        Returns:
        the inheritance type between the source and target class
      • parseDITAHref

        public static Reference parseDITAHref​(java.lang.String baseUrl,
                                              java.lang.String hrefValue)
                                       throws java.net.MalformedURLException
        Parse the href attribute and returns the absolute URL and the id.
        Parameters:
        baseUrl - The base document URL.
        hrefValue - The href attribute value. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility
        Returns:
        A container object with the content reference URI and topicID or null.
        Throws:
        java.net.MalformedURLException - Can't create the URL.
      • parseDITAHref

        public static Reference parseDITAHref​(java.lang.String baseUrl,
                                              java.lang.String hrefValue,
                                              boolean isHrefToDITAResource)
                                       throws java.net.MalformedURLException
        Parse the href attribute and returns the absolute URL and the id.
        Parameters:
        baseUrl - The base document URL.
        hrefValue - The href attribute value. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility
        isHrefToDITAResource - true if this is an href to a DITA resource
        Returns:
        A container object with the content reference URI and topicID or null.
        Throws:
        java.net.MalformedURLException - Can't create the URL.
      • parseDITAKeyRef

        @Deprecated
        public static Reference parseDITAKeyRef​(java.lang.String keyref)
                                         throws java.net.MalformedURLException
        Deprecated.
        Please use the equivalent method which also receives the URL of the requestor.
        Parse the DITA conkeyref value
        Parameters:
        keyref - The attribute 'conkeyref' value
        Returns:
        The DITA Conref object
        Throws:
        java.net.MalformedURLException
      • parseDITAKeyRef

        public static Reference parseDITAKeyRef​(java.net.URL originatorURL,
                                                java.lang.String keyref)
                                         throws java.net.MalformedURLException
        Parse the DITA conkeyref value
        Parameters:
        originatorURL - The originator URL.
        keyref - The attribute 'conkeyref' value
        Returns:
        The DITA Conref object
        Throws:
        java.net.MalformedURLException
      • parseDITAKeyRef

        public static Reference parseDITAKeyRef​(java.net.URL originatorURL,
                                                ContextKeyManager keyManager,
                                                java.lang.String keyref)
                                         throws java.net.MalformedURLException
        Parse the DITA conkeyref value
        Parameters:
        originatorURL - The originator URL.
        keyManager - The key manager used to resolve the keyref.
        keyref - The attribute 'conkeyref' value
        Returns:
        The DITA Conref object
        Throws:
        java.net.MalformedURLException
      • parseDITAKeyRef

        public static Reference parseDITAKeyRef​(java.lang.String keyref,
                                                ro.sync.ecss.dita.reference.keyref.KeyResolver kr)
                                         throws java.net.MalformedURLException
        Parse the DITA conkeyref value
        Parameters:
        keyref - The attribute 'conkeyref' value
        kr - The keys resolver
        Returns:
        The DITA Conref object
        Throws:
        java.net.MalformedURLException
      • getAutoInsertTopicRefElementName

        public static java.lang.String getAutoInsertTopicRefElementName​(AuthorAccess authorAccess,
                                                                        int caretPosition)
        Get the name of the topic ref element to insert
        Parameters:
        authorAccess - The author access
        caretPosition - Caret position
        Returns:
        A name for the topic ref to insert
      • getAutoInsertTopicRefElementName

        public static java.lang.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

        public static java.lang.String getAutoInsertRefElementName​(AuthorAccess authorAccess,
                                                                   int caretPosition)
        Get the name of the topic ref element to insert
        Parameters:
        authorAccess - The author access
        caretPosition - Caret position
        Returns:
        A name for the topic ref to insert
      • getAutoInsertImageRefElementName

        public static java.lang.String getAutoInsertImageRefElementName​(AuthorAccess authorAccess,
                                                                        int caretPosition)
        Get the name of the image element to insert.
        Parameters:
        authorAccess - The author access
        caretPosition - Caret position
        Returns:
        A name for the topic ref to insert
      • getPossibleElements

        public static CIElement[] getPossibleElements​(AuthorDocumentController ctrl,
                                                      int offset,
                                                      java.lang.String reqAttr,
                                                      java.lang.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,
                                                            java.lang.String tagName)
        Get the equivalent child CIElement
        Parameters:
        authorAccess - Author access
        caretOffset - The caret offset
        tagName - The tag name
        Returns:
        the equivalent child CIElement
      • getKeys

        @Deprecated
        public static java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys()
        Deprecated.
        Please use the equivalent method which also receives the URL of the requestor.
        Returns:
        The mapped DITA 1.2 keys
      • getKeys

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

        public static java.util.List<ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeysForInsertion​(java.net.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 java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> getKeys​(java.net.URL originatorURL,
                                                                                                                         ContextKeyManager keysManager)
        Returns the mapped DITA 1.2 keys
        Parameters:
        originatorURL - The URL of the document which contains the keys.
        keysManager - The key manager that is aware of the context of the document.
        Returns:
        The mapped DITA 1.2 keys
      • getURLKeyScopeContexts

        public static java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> getURLKeyScopeContexts​(java.net.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 java.lang.String computeFormatForURLPasteAndDnD​(UtilAccess utilAccess,
                                                                      java.net.URL url,
                                                                      ReferenceType refType)
        Computes the format of the xref.
        Parameters:
        utilAccess - The util access API. Never null.
        url - The URL to paste.
        refType - The reference type.
        Returns:
        The format.
      • computeLinkScope

        public static java.lang.String computeLinkScope​(java.net.URL editorLocation,
                                                        java.net.URL hrefURL)
        Compute the scope attribute.
        Parameters:
        editorLocation - Editor location
        hrefURL - Href location.
        Returns:
        the computed scope attribute construction. Never null.
      • pasteAsReference

        public static java.lang.String pasteAsReference​(AuthorAccess authorAccess,
                                                        boolean asConref)
                                                 throws AuthorOperationException
        Paste as reference
        Parameters:
        authorAccess - The author access.
        asConref - True if paste as conref, false as link
        Returns:
        information about how this action should be used.
        Throws:
        AuthorOperationException
      • pasteClipboardFragmentsAsReference

        public static boolean pasteClipboardFragmentsAsReference​(AuthorAccess authorAccess,
                                                                 DITAAccess.PasteInfo pasteInfo,
                                                                 ro.sync.ecss.component.AuthorDocumentFragmentClipboardObject[] fragments)
                                                          throws AuthorOperationException
        Paste the fragments from clipboard as reference.
        Parameters:
        authorAccess - The author access.
        pasteInfo - Paste type of clipboard fragments.
        fragments - The fragments to paste with.
        Returns:
        true if the paste was valid.
        Throws:
        AuthorOperationException
      • 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:
        true if the paste was valid.
        Throws:
        AuthorOperationException
      • filterAttributeValues

        @Deprecated
        public static java.util.List<CIValue> filterAttributeValues​(java.util.List<CIValue> attributeValues,
                                                                    WhatPossibleValuesHasAttributeContext context,
                                                                    java.lang.String documentTypeName)
        Deprecated.
        Please use the equivalent method which also receives the URL of the requestor.
        Propose additional attribute values.
        Parameters:
        attributeValues - The attribute values.
        context - The context.
        documentTypeName - The document type name.
        Returns:
        The enriched list.
      • filterAttributeValues

        public static java.util.List<CIValue> filterAttributeValues​(java.util.List<CIValue> attributeValues,
                                                                    WhatPossibleValuesHasAttributeContext context,
                                                                    java.lang.String documentTypeName,
                                                                    AuthorAccess authorAccess)
        Propose additional attribute values.
        Parameters:
        attributeValues - The attribute values.
        context - The context.
        documentTypeName - The document type name.
        authorAccess - The Author Access.
        Returns:
        The enriched list.
      • filterAttributeValues

        public static java.util.List<CIValue> filterAttributeValues​(java.util.List<CIValue> attributeValues,
                                                                    WhatPossibleValuesHasAttributeContext context,
                                                                    ContextKeyManager keyManager,
                                                                    java.lang.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 be null
        Returns:
        The enriched list.
      • computeElementClazz

        public static java.lang.String computeElementClazz​(WhatPossibleValuesHasAttributeContext context)
        Compute the element's clazz
        Parameters:
        context - The attributes editing context.
        Returns:
        The element clazz or null.
      • 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 MediaInfo object containing all the properties for the file which will be inserted.
        Throws:
        AuthorOperationException - On fail.
      • computeMediaReferenceXMLToInsert

        public static java.lang.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 access
        ref - 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 ImageInfo object containing all the properties for the image, which will be inserted.
        Throws:
        AuthorOperationException
      • computeImageReferenceXMLToInsert

        public static java.lang.String computeImageReferenceXMLToInsert​(AuthorAccess authorAccess,
                                                                        java.lang.String refAttrName,
                                                                        java.lang.String refValue)
        Compute the image reference XML fragment to insert.
        Parameters:
        authorAccess - The author access.
        refAttrName - The reference attribute name
        refValue - The reference value name
        Returns:
        the image reference XML fragment to insert.
      • buildFigureHrefImageXMLToInsert

        public static java.lang.String buildFigureHrefImageXMLToInsert​(AuthorAccess authorAccess,
                                                                       java.lang.String figTitle,
                                                                       java.lang.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 java.lang.String buildFigureKeyrefImageXMLToInsert​(AuthorAccess authorAccess,
                                                                         java.lang.String figTitle,
                                                                         java.lang.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 java.lang.String getPossibleElementQName​(AuthorDocumentController ctrl,
                                                               java.lang.String clazzFrag,
                                                               java.lang.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

        public static void searchReferences​(AuthorAccess authorAccess)
        Search references to a certain element at the caret position.
        Parameters:
        authorAccess - The author access.
      • computeLinkText

        @Deprecated
        public static java.lang.String computeLinkText​(java.lang.String hrefValue,
                                                       java.lang.String baseSystemID)
                                                throws java.net.MalformedURLException,
                                                       java.io.IOException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.lang.Exception
        Obtains information about the referred target.
        Parameters:
        hrefValue - The relative location of the target.
        baseSystemID - base system ID.
        Returns:
        The computed title information.
        Throws:
        java.net.MalformedURLException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.lang.Exception
      • computeLinkText

        @Deprecated
        public static java.lang.String computeLinkText​(AuthorNode contextNode,
                                                       java.lang.String hrefValue,
                                                       java.lang.String baseSystemID)
                                                throws java.net.MalformedURLException,
                                                       java.io.IOException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.lang.Exception
        Obtains 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:
        java.net.MalformedURLException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.lang.Exception
      • computeLinkText

        @Deprecated
        public static java.lang.String computeLinkText​(AuthorNode contextNode,
                                                       java.lang.String keyRefValue,
                                                       java.lang.String hrefValue,
                                                       java.lang.String baseSystemID)
                                                throws java.net.MalformedURLException,
                                                       java.io.IOException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.lang.Exception
        Obtains information about the referred target.
        Parameters:
        contextNode - The context node.
        keyRefValue - The fully prefixed key scope value
        hrefValue - The relative location of the target.
        baseSystemID - base system ID.
        Returns:
        The computed title information.
        Throws:
        java.net.MalformedURLException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.lang.Exception
      • computeLinkText

        public static java.lang.String computeLinkText​(AuthorNode contextNode,
                                                       java.lang.String keyRefValue,
                                                       java.lang.String hrefValue,
                                                       java.lang.String baseSystemID,
                                                       KeysManagerBase keysManager)
                                                throws java.lang.Exception
        Obtains information about the referred target.
        Parameters:
        contextNode - The context node.
        keyRefValue - The fully prefixed key scope value
        hrefValue - The relative location of the target.
        baseSystemID - base system ID.
        keysManager - The key manager.
        Returns:
        The computed title information.
        Throws:
        java.lang.Exception
        Since:
        21
      • filterElements

        public static java.util.List<CIElement> filterElements​(java.util.List<CIElement> elements,
                                                               WhatElementsCanGoHereContext context)
        Filter the given elements according to the given context.
        Parameters:
        elements - The list of CIElement elements.
        context - The context.
        Returns:
        The filtered CIElements.
      • filterElements

        public static java.util.List<CIElement> filterElements​(java.util.List<CIElement> elements,
                                                               WhatElementsCanGoHereContext context,
                                                               java.lang.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. If null, the user from the current editor is used.
        Returns:
        The filtered CIElements.
      • resolveKeyNotFoundError

        public static void resolveKeyNotFoundError​(AuthorAccess authorAccess,
                                                   java.lang.String keyref)
        The give key was not found. We will present a warning dialog to the user and we will offer the user as a possible solution to change the root map.
        Parameters:
        authorAccess - Interface to the author context.
        keyref - The key that wasn't found in the current root map context.
      • filterDITAVALAttributeValues

        public static java.util.List<CIValue> filterDITAVALAttributeValues​(java.util.List<CIValue> attributeValues,
                                                                           WhatPossibleValuesHasAttributeContext context)
        Filter DITAVAL Attribute values.
        Parameters:
        attributeValues - The current list of attribute values.
        context - The what attribute values context.
        Returns:
        The modified list of values.
      • createNewTopicReference

        public static void createNewTopicReference​(AuthorAccess authorAccess)
                                            throws java.lang.Exception
        Create a new DITA topic and link to it as a reference.
        Parameters:
        authorAccess - The Author Access
        Throws:
        java.lang.Exception - if it fails.
      • pushElement

        public static void pushElement​(AuthorAccess authorAccess)
                                throws AuthorOperationException
        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

        public static boolean isDITA​(org.xml.sax.Attributes atts)
        Check if the resource is DITA.
        Parameters:
        atts - The SAX attributes from the root element.
        Returns:
        true if the topic or map with a certain architecture version is DITA,
        Since:
        20.1
      • isDITA1_3OrNewer

        public static boolean isDITA1_3OrNewer​(org.xml.sax.Attributes atts)
        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:
        true if the topic or map with a certain architecture version is DITA 1.3 or newer,
        Since:
        20.1
      • isDITA1_3OrNewer

        public static boolean isDITA1_3OrNewer​(java.lang.String archVersion)
        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:
        true if the topic or map with a certain architecture version is DITA 1.3 or newer,
      • insertLinkReference

        public static void insertLinkReference​(AuthorAccess authorAccess,
                                               java.lang.String typeValue,
                                               java.lang.String formatValue,
                                               java.lang.String scopeValue,
                                               boolean isXref,
                                               java.lang.String hrefType,
                                               java.net.URL initialReferenceURL,
                                               boolean displayReferenceUrl)
                                        throws AuthorOperationException
        Insert a Xref or link element.
        Parameters:
        authorAccess - The author access.
        typeValue - The type attribute value. If not null, the generated reference will have the 'type="typeValue"' attribute set to it.
        formatValue - The format attribute value. If not null and the reference points to a non-DITA resource, the generated reference will have the 'format="formatValue"' attribute set to it.
        scopeValue - The scope attribute value. If not null, the generated reference will have the 'scope="scopeValue"' attribute set to it.
        isXref - true if we need to insert an <xref> element, false for the <link> element.
        hrefType - The type of the link. If LINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). If LINK_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 - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
        Throws:
        AuthorOperationException
      • insertLinkReference

        public static void insertLinkReference​(AuthorAccess authorAccess,
                                               java.lang.String typeValue,
                                               java.lang.String formatValue,
                                               java.lang.String scopeValue,
                                               boolean isXref,
                                               java.lang.String preferredElName,
                                               java.lang.String hrefType,
                                               java.net.URL initialReferenceURL,
                                               boolean displayReferenceUrl)
                                        throws AuthorOperationException
        Insert a Xref or link element.
        Parameters:
        authorAccess - The author access.
        typeValue - The type attribute value. If not null, the generated reference will have the 'type="typeValue"' attribute set to it.
        formatValue - The format attribute value. If not null and the reference points to a non-DITA resource, the generated reference will have the 'format="formatValue"' attribute set to it.
        scopeValue - The scope attribute value. If not null, the generated reference will have the 'scope="scopeValue"' attribute set to it.
        isXref - true if we need to insert an <xref> element, false for the <link> element.
        preferredElName - The preferred name of the reference element.
        hrefType - The type of the link. If LINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). If LINK_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 - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
        Throws:
        AuthorOperationException
      • insertLinkReference

        public static void insertLinkReference​(AuthorAccess authorAccess,
                                               java.lang.String typeValue,
                                               java.lang.String formatValue,
                                               java.lang.String scopeValue,
                                               boolean isXref,
                                               java.lang.String hrefType,
                                               java.net.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 - true if we need to insert an <xref> element, false for the <link> element.
        hrefType - The type of the link. If LINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). If LINK_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 - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
        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,
                                               java.lang.String typeValue,
                                               java.lang.String formatValue,
                                               java.lang.String scopeValue,
                                               boolean isXref,
                                               java.lang.String preferredElName,
                                               java.lang.String hrefType,
                                               java.net.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 - true if we need to insert an <xref> element, false for the <link> element.
        preferredElName - The preferred name of the reference element.
        hrefType - The type of the link. If LINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). If LINK_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 - If true the URL input will be displayed in the insert reference dialog (the user will have the possibility to change the reference URL). This parameter can be set to false when an initialReferenceURL is provided, and the user must not have the possibility to change it (the reference URL must be fixed).
        Note: this parameter is not used on Eclipse plugin implementation.
        insertLinkReferenceShortcut - A shortcut class that allows us to collectthe references before inserting them into document.
        Throws:
        AuthorOperationException
        Since:
        18
      • insertLinkReference

        public static void insertLinkReference​(java.lang.String referenceValue,
                                               java.lang.String targetElementClass,
                                               java.lang.String targetElementQName,
                                               AuthorAccess authorAccess,
                                               java.lang.String typeValue,
                                               java.lang.String formatValue,
                                               java.lang.String scopeValue,
                                               boolean isXref,
                                               java.lang.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 - true if we need to insert an <xref> element, false for the <link> element.
        hrefType - The type of the link. If LINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). If LINK_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​(java.lang.String referenceValue,
                                               java.lang.String targetElementClass,
                                               java.lang.String targetElementQName,
                                               AuthorAccess authorAccess,
                                               java.lang.String typeValue,
                                               java.lang.String formatValue,
                                               java.lang.String scopeValue,
                                               boolean isXref,
                                               boolean useKeyRef,
                                               java.lang.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 - true if we need to insert an <xref> element, false for the <link> element.
        useKeyRef - true if the reference is a keyref.
        hrefType - The type of the link. If LINK_TYPE_DITA_TOPIC, the user wants to insert a reference to a DITA resource (Insert Cross Reference action). If LINK_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 java.lang.String rewriteKeyref​(java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> urlKeyScopesMapping,
                                                     java.util.LinkedHashMap<java.lang.String,​ro.sync.ecss.dita.reference.keyref.KeyInfo> keys,
                                                     AuthorNode contextNode,
                                                     java.lang.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

        public static java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> getURLKeyScopeContexts​(java.net.URL originatorURL)
        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

        public static void editTopicref​(AuthorElement[] topicrefNodes,
                                        AuthorAccess authorAccess)
        Edits one or more topicref elements inside a specialized dialog.
        Parameters:
        topicrefNodes - The topicref elements.
        authorAccess - Author access.
      • getDitaReferenceTargets

        public static java.util.List<DitaReferenceTargetDescriptor> getDitaReferenceTargets​(AuthorAccess authorAccess,
                                                                                            java.net.URL targetURL)
                                                                                     throws java.io.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:
        java.io.IOException - If an error occured while reading the URL.
        Since:
        18.0
      • getDitaReferenceTargets

        public static java.util.List<DitaReferenceTargetDescriptor> getDitaReferenceTargets​(java.net.URL baseUrl,
                                                                                            java.net.URL topicUrl)
                                                                                     throws java.io.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:
        java.io.IOException
        Since:
        23.0
      • getFormat

        @Deprecated
        public static java.lang.String getFormat​(java.lang.String hrefValue,
                                                 java.lang.String formatValue,
                                                 boolean fillFormatAttr)
        Get the format for the specified resource.
        Parameters:
        hrefValue - The HREF of the resource.
        formatValue - The default format value.
        fillFormatAttr - true if the attribute should be filled when serializing.
        Returns:
        The format for the resource.
      • getFormatForLinkCreatedFromGUI

        public static java.lang.String getFormatForLinkCreatedFromGUI​(java.lang.String hrefValue,
                                                                      java.lang.String formatValue,
                                                                      boolean fillFormatAttr)
        Get the format for the specified resource.
        Parameters:
        hrefValue - The HREF of the resource.
        formatValue - The default format value.
        fillFormatAttr - true if the attribute should be filled when serializing.
        Returns:
        The format for the resource.
      • checkValidKeyName

        public static java.lang.String checkValidKeyName​(java.lang.String keyName)
        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 null if the key name is valid.
      • getHrefInformation

        public static HrefInfo getHrefInformation​(AuthorNode node)
        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

        public static HrefInfo getHrefInformation​(KeysManagerBase keyManager,
                                                  AuthorNode node)
        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​(java.net.URL ditamapURL,
                                         java.io.File exportDirectory,
                                         boolean exportAsZip,
                                         java.lang.String zipFileName,
                                         ExportProgressUpdater progressUpdater)
        Export DITA Map as zip.
        Parameters:
        ditamapURL - The DITA Map URL.
        exportDirectory - The export directory.
        exportAsZip - true to export as ZIP
        zipFileName - Zip file name.
        progressUpdater - The progress updater.
        Since:
        18.1
      • attachKeyScopeInformation

        @Deprecated
        public static java.net.URL attachKeyScopeInformation​(java.net.URL targetURL,
                                                             java.lang.String keyref,
                                                             java.lang.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 java.net.URL attachKeyScopeInformation​(java.net.URL targetURL,
                                                             java.lang.String keyref,
                                                             java.lang.String contextMapURL,
                                                             java.lang.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 java.net.URL attachKeyScopeInformation​(java.net.URL targetURL,
                                                             java.util.Stack<java.util.Set<java.lang.String>> context,
                                                             java.lang.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

        public static java.lang.String computeVariableKeyrefElementName​(AuthorAccess authorAccess)
        Compute the elements name.
        Parameters:
        authorAccess - The author access.
        Returns:
        Returns the name of an element, that allows
      • computeVariableKeyrefElementName

        public static java.lang.String computeVariableKeyrefElementName​(AuthorAccess authorAccess,
                                                                        boolean preferImageElement)
        Compute the elements name.
        Parameters:
        authorAccess - The author access.
        preferImageElement - true if an image should be inserted.
        Returns:
        Returns the name of an element, that allows
      • computeKeyScopeStack

        public static java.util.Stack<java.util.Set<java.lang.String>> computeKeyScopeStack​(AuthorNode contextNode,
                                                                                            java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.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 java.util.Stack<java.util.Set<java.lang.String>> computeKeyScopeStack​(AuthorNode contextNode,
                                                                                            java.util.LinkedHashMap<java.net.URL,​java.util.List<java.util.Stack<java.util.Set<java.lang.String>>>> urlKeyScopesMapping,
                                                                                            java.util.Map<AuthorNode,​java.util.Set<java.lang.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 be null.
        Returns:
        the entire key scope stack.
        Since:
        23
      • getKeyForUrl

        public static java.lang.String getKeyForUrl​(KeysManagerBase keyManager,
                                                    java.net.URL url,
                                                    java.net.URL editorLocation)
        Get the key corresponding to the given URL.
        Parameters:
        keyManager - The key manager
        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.
        Since:
        21
      • getKeyForUrl

        public static java.lang.String getKeyForUrl​(KeysManagerBase keyManager,
                                                    java.net.URL url,
                                                    java.net.URL editorLocation,
                                                    AuthorNode contextNode)
        Get the key corresponding to the given URL.
        Parameters:
        keyManager - The key manager
        url - The URL for which the search for a key is performed.
        editorLocation - The URL which is edited.
        contextNode - The context node. Can be null
        Returns:
        The name of the corresponding key, if existing, or null.
        Since:
        24
      • getKeyForUrl

        public static java.lang.String getKeyForUrl​(java.net.URL url,
                                                    java.net.URL editorLocation)
        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 java.lang.String getKeyRefValueForUrl​(KeysManagerBase keysManager,
                                                            java.net.URL referenceUrl,
                                                            java.net.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:
        true if 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:
        true if the current key has a reference to content that can be embedded in a media object.
      • detectMediaObjectOutputclass

        public static java.lang.String detectMediaObjectOutputclass​(ro.sync.ecss.dita.reference.keyref.KeyInfo key)
        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 be null
        Returns:
        true if 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 be null
        Returns:
        true if this reference points to a DITA topic, map or variable text.
        Since:
        25
      • getConverterFormatForDITACompatibleResource

        public static java.lang.String getConverterFormatForDITACompatibleResource​(java.lang.String resourceExtension)
        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 null when resource is not DITA-compatible or it's DITA.
        Since:
        25
      • convertDitaCompatibleResource

        public static java.lang.String convertDitaCompatibleResource​(java.io.Reader toConvert,
                                                                     java.lang.String systemId,
                                                                     java.lang.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:
        true if this key definition points to a DITA topic, map or variable text.
        Since:
        21
      • annotateAttributes

        @Deprecated
        public static java.util.List<CIAttribute> annotateAttributes​(java.util.List<CIAttribute> attributes)
        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 javax.swing.text.BadLocationException
        When moving/copying topic references, maybe they are not allowed at the new position. Try with other topic reference elements.
        Parameters:
        controller - Document controller
        frag - The fragment to move
        insertOffset - The offset position
        Returns:
        the created fragment
        Throws:
        javax.swing.text.BadLocationException
      • getFragWithMostSuitableTopicrefs

        public static AuthorDocumentFragment getFragWithMostSuitableTopicrefs​(AuthorDocumentController controller,
                                                                              AuthorNode selectedElem,
                                                                              int insertOffset)
                                                                       throws javax.swing.text.BadLocationException
        When moving/copying topic references, maybe they are not allowed at the new position. Try with other topic reference elements.
        Parameters:
        controller - document controller
        selectedElem - the node to move
        insertOffset - the offset position
        Returns:
        the created fragment
        Throws:
        javax.swing.text.BadLocationException
      • findSimilarTopics

        public static void findSimilarTopics​(AuthorAccess authorAccess)
        Find similar topics based on words found in title, shortdesc, keyword, and indexterm elements.
        Parameters:
        authorAccess - The author access.
      • getRelatedLinksFromReltable

        public static java.util.List<RelLink> getRelatedLinksFromReltable​(java.net.URL originatorURL)
        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

        public static java.net.URL proposeFolderUrlForChildTopicref​(AuthorElement parent)
        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

        public static DITAImposedReferenceType detectInsertionType​(java.net.URL url)
        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 java.util.List<java.lang.String> computeQualifiedKeyNames​(java.lang.String keyToken,
                                                                                java.util.Stack<java.util.Set<java.lang.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

        public static boolean preferAddingKeyrefToAlreadyReferencedResource​(java.net.URL editorURL)
        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:
        true if a keyref should be added to the resource that needs to be inserted
        Since:
        25.1
      • showNewFileDialog

        public static java.net.URL showNewFileDialog​(AuthorAccess authorAccess,
                                                     java.lang.String proposedTitle)
        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. If null no proposal will be presented.
        Returns:
        the URL of the newly created document or null.
        Since:
        26.0

        *********************************
        EXPERIMENTAL - Subject to change
        ********************************

        Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

      • 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 access
        showKeys - true to show keys.
        showComps - true to show components
        Since:
        26.1

        **************************************
        EXPERIMENTAL - Subject to change
        **************************************

        Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.