Class ApplicationScriptUtils

  • All Implemented Interfaces:
    org.alfresco.processor.ProcessorExtension, Scopeable

    public final class ApplicationScriptUtils
    extends BaseScopableProcessorExtension
    Utility functions specifically for external application use.
    Author:
    Mike Hatfield
    • Constructor Detail

      • ApplicationScriptUtils

        public ApplicationScriptUtils()
    • Method Detail

      • setJsonConversionComponent

        public void setJsonConversionComponent​(JSONConversionComponent jsonConversionComponent)
        Parameters:
        jsonConversionComponent - JSON conversion component
      • toJSON

        public java.lang.String toJSON​(ScriptNode node)
        Returns the JSON representation of a node. Long-form QNames are used in the result.
        Parameters:
        node - the node to convert to JSON representation.
        Returns:
        The JSON representation of this node
      • toJSON

        public java.lang.String toJSON​(ScriptNode node,
                                       boolean useShortQNames)
        Returns the JSON representation of this node.
        Parameters:
        node - the node to convert to JSON representation.
        useShortQNames - if true short-form qnames will be returned, else long-form.
        Returns:
        The JSON representation of this node
      • getDownloadAPIUrl

        public java.lang.String getDownloadAPIUrl​(ScriptNode node)
        Parameters:
        node - the node to construct the download URL for
        Returns:
        For a content document, this method returns the URL to the /api/node/content API for the default content property

        For a container node, this method returns an empty string