public class ScriptUtils extends BaseScopableProcessorExtension
| Constructor and Description |
|---|
ScriptUtils() |
| Modifier and Type | Method and Description |
|---|---|
ScriptPagingDetails |
createPaging(int maxItems,
int skipCount)
Builds a paging object, from the supplied
Max Items and Skip Count
|
ScriptPagingDetails |
createPaging(int maxItems,
int skipCount,
String queryExecutionId)
Builds a paging object, from the supplied
Max Items, Skip Count and Query Execution ID
|
ScriptPagingDetails |
createPaging(Map<String,String> args)
Builds a paging object, from the supplied Args object.
|
void |
disableRules()
Disable rule execution for this thread
|
String |
displayPath(ScriptNode node)
Function to return the cm:name display path for a node with minimum performance overhead.
|
void |
enableRules()
Enable rule execution for this thread
|
Date |
fromISO8601(String isoDateString)
Parse date from ISO formatted string
|
String |
getLocale()
Returns current thread's locale
|
ScriptNode |
getNodeFromString(String nodeRefString)
Gets a JS node object from a string noderef
|
String |
longQName(String s)
Given a short-form QName string, this method returns the fully qualified QName string.
|
boolean |
moduleInstalled(String moduleName)
Function to check if a module is installed
|
String |
pad(String s,
int len)
Function to pad a string with zero '0' characters to the required length
|
void |
setLocale(String localeStr)
Sets current Locale from string
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setServiceRegistry(ServiceRegistry services)
Sets the service registry
|
String |
shortQName(String s)
Given a long-form QName string, this method uses the namespace service to create a
short-form QName string.
|
boolean |
toBoolean(String booleanString)
Gets a boolean value from a string
|
String |
toISO8601(Date date)
Format date to ISO 8601 formatted string
|
String |
toISO8601(long timeInMillis)
Format timeInMillis to ISO 8601 formatted string
|
getScope, setScopegetExtensionName, register, setExtensionName, setProcessorpublic void setServiceRegistry(ServiceRegistry services)
services - the service registrypublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService - the NodeService to setpublic String displayPath(ScriptNode node)
node - ScriptNodepublic String pad(String s, int len)
s - String to pad with leading zero '0' characterslen - Length to pad topublic ScriptNode getNodeFromString(String nodeRefString)
nodeRefString - string reference to a nodepublic boolean toBoolean(String booleanString)
booleanString - boolean stringBoolean.parseBoolean(String)public boolean moduleInstalled(String moduleName)
moduleName - module name (e.g. "org.alfresco.module.foo")public String toISO8601(long timeInMillis)
timeInMillis - public String toISO8601(Date date)
date - public Date fromISO8601(String isoDateString)
isoDateString - public String shortQName(String s)
s - Fully qualified QName stringpublic String longQName(String s)
s - Short form QName string, e.g. "cm:content"public ScriptPagingDetails createPaging(int maxItems, int skipCount)
public ScriptPagingDetails createPaging(int maxItems, int skipCount, String queryExecutionId)
public ScriptPagingDetails createPaging(Map<String,String> args)
public void disableRules()
public void enableRules()
public void setLocale(String localeStr)
public String getLocale()
Copyright © 2005–2014 Alfresco Software. All rights reserved.