org.alfresco.repo.jscript
Class ScriptUtils

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessorExtension
      extended by org.alfresco.repo.jscript.BaseScopableProcessorExtension
          extended by org.alfresco.repo.jscript.ScriptUtils
All Implemented Interfaces:
Scopeable, ProcessorExtension

public final class ScriptUtils
extends BaseScopableProcessorExtension

Place for general and miscellenous utility functions not already found in generic JavaScript.


Constructor Summary
ScriptUtils()
           
 
Method Summary
 ScriptNode getNodeFromString(java.lang.String nodeRefString)
          Gets a JS node object from a string noderef
 java.lang.String pad(java.lang.String s, int len)
          Function to pad a string with zero '0' characters to the required length
 void setServiceRegistry(ServiceRegistry services)
          Sets the service registry
 boolean toBoolean(java.lang.String booleanString)
          Gets a boolean value from a string
 
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptUtils

public ScriptUtils()
Method Detail

setServiceRegistry

public void setServiceRegistry(ServiceRegistry services)
Sets the service registry

Parameters:
services - the service registry

pad

public java.lang.String pad(java.lang.String s,
                            int len)
Function to pad a string with zero '0' characters to the required length

Parameters:
s - String to pad with leading zero '0' characters
len - Length to pad to
Returns:
padded string or the original if already at >=len characters

getNodeFromString

public ScriptNode getNodeFromString(java.lang.String nodeRefString)
Gets a JS node object from a string noderef

Parameters:
nodeRefString - string reference to a node
Returns:
a JS node object

toBoolean

public boolean toBoolean(java.lang.String booleanString)
Gets a boolean value from a string

Parameters:
booleanString - boolean string
Returns:
boolean the boolean value
See Also:
Boolean.parseBoolean(String)


Copyright © 2005 - 2008 Alfresco Software, Inc. All Rights Reserved.