Package org.alfresco.repo.jscript
Class ApplicationScriptUtils
- java.lang.Object
-
- org.alfresco.repo.processor.BaseProcessorExtension
-
- org.alfresco.repo.jscript.BaseScopableProcessorExtension
-
- org.alfresco.repo.jscript.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 Summary
Constructors Constructor Description ApplicationScriptUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDownloadAPIUrl(ScriptNode node)voidsetJsonConversionComponent(JSONConversionComponent jsonConversionComponent)java.lang.StringtoJSON(ScriptNode node)Returns the JSON representation of a node.java.lang.StringtoJSON(ScriptNode node, boolean useShortQNames)Returns the JSON representation of this node.-
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
-
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
-
-
-
-
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
-
-