Class DITAExternalObjectInsertionHandlerUtil

java.lang.Object
ro.sync.ecss.extensions.dita.DITAExternalObjectInsertionHandlerUtil

@API(type=INTERNAL, src=PUBLIC) public final class DITAExternalObjectInsertionHandlerUtil extends Object
Utility class for the DITA and DITA Map external object insertion handlers.
  • Method Details

    • getReferenceAttributeNameAndValue

      public static String[] getReferenceAttributeNameAndValue(ContextKeyManagerProvider keysManagerProvider, AuthorAccess authorAccess, URL base, URL url, AuthorNode contextNode)
      Get the reference attribute name (href or keyref) and value.
      Parameters:
      keysManagerProvider - The keys manager provider.
      authorAccess - The Author access.
      base - The base URL.
      url - The current URL.
      contextNode - Context node
      Returns:
      An array of strings, containing the attribute name and the value.
    • getMediaReferenceAttributeNameAndValue

      public static String[] getMediaReferenceAttributeNameAndValue(ContextKeyManagerProvider keysManagerProvider, URL editorLocation, URL base, URL url, AuthorNode contextNode)
      Get the reference attribute name (href / keyref or data / datakeyref) and value.
      Parameters:
      keysManagerProvider - The keys manager provider.
      editorLocation - The URL location of the current editor.
      base - The base URL.
      url - The current URL.
      contextNode - Context node, can be null
      Returns:
      An array of strings, containing the attribute name and the value.
    • getReferenceAttributeNameAndValueInternal

      public static String[] getReferenceAttributeNameAndValueInternal(ContextKeyManagerProvider keysManagerProvider, URL editorLocation, URL base, URL url, AuthorNode contextNode, boolean isMediaElement)
      Get the reference attribute name (href / keyref or data / datakeyref) and value.
      Parameters:
      keysManagerProvider - The keys manager provider.
      editorLocation - The URL location of the current editor.
      base - The base URL.
      url - The current URL.
      contextNode - The context node, can be null
      isMediaElement - true to insert media objects.
      Returns:
      An array of strings, containing the attribute name and the value.
    • insertContentReference

      public static void insertContentReference(ContextKeyManagerProvider keysManagerProvider, AuthorAccess authorAccess, URL url) throws AuthorOperationException
      Inserts a content reference to the given URL.
      Parameters:
      keysManagerProvider - The keys manager provider.
      authorAccess - Access to the current document.
      url - Target for the conref.
      Throws:
      AuthorOperationException - If it fails.
    • clearInternalQueryParamsFromExtractedRefAttrVal

      public static String clearInternalQueryParamsFromExtractedRefAttrVal(URL base, String refAttrValue)
      Removes internal query from a relative URL.
      Parameters:
      base - The original base URL of the relative value.
      refAttrValue - The relative value.
      Returns:
      The relative value without internal query params or original value if no cleanup should be done.
    • detectKeyInfo

      public static ro.sync.ecss.dita.reference.keyref.KeyInfo detectKeyInfo(URL urlToDrop, URL originatorURL)
      Extracts the KeyInfo (can be a fully qualified KeyInfo) from current URL and returns the appropriate key (can be the relative key).
      Parameters:
      urlToDrop - The dropped URL
      originatorURL - The URL for which the keys are requested.
      Returns:
      The key extracted from URL (fully qualified or relative, context aware key) or null.