public class ScriptWidgetUtils extends ScriptBase
context, properties| Constructor and Description |
|---|
ScriptWidgetUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.extensions.webscripts.ScriptableMap<String,Serializable> |
buildProperties() |
static boolean |
deleteObjectFromArray(Object o,
String targetAttributeKey,
String targetAttributeValue)
Finds and deletes
ScriptableObject that is located in a NativeArray within the supplied object
attribute where the object has the supplied target attribute that matches the supplied target value. |
static org.mozilla.javascript.ScriptableObject |
findObject(Object o,
String targetAttributeKey,
String targetAttributeValue)
Finds a
ScriptableObject that is located somewhere in the supplied object that has an attribute
matching the supplied attribute key and a value matching the supplied attribute value. |
static org.mozilla.javascript.ScriptableObject |
findObject(Object o,
String targetAttributeKey,
String targetAttributeValue,
boolean delete,
RecursionResults results)
This method performs recursive searching through the supplied object.
|
getConfig, getObject, getObjectService, getProperties, getRequestContext, toStringprotected org.springframework.extensions.webscripts.ScriptableMap<String,Serializable> buildProperties()
buildProperties in class ScriptBasepublic static org.mozilla.javascript.ScriptableObject findObject(Object o, String targetAttributeKey, String targetAttributeValue, boolean delete, RecursionResults results)
o - ObjecttargetAttributeKey - StringtargetAttributeValue - Stringdelete - booleanresults - RecursionResultspublic static org.mozilla.javascript.ScriptableObject findObject(Object o, String targetAttributeKey, String targetAttributeValue)
Finds a ScriptableObject that is located somewhere in the supplied object that has an attribute
matching the supplied attribute key and a value matching the supplied attribute value. This method will search
through all NativeArray and NativeObject instances until it finds a match.
o - The object to search in (this should be a ScriptableObject that is either a NativeArray or a NativeObjecttargetAttributeKey - The value of the attribute key to find (e.g. "id")targetAttributeValue - The value of the attribute value to findnull if no match can be found.public static boolean deleteObjectFromArray(Object o, String targetAttributeKey, String targetAttributeValue)
Finds and deletes ScriptableObject that is located in a NativeArray within the supplied object
attribute where the object has the supplied target attribute that matches the supplied target value. The first
object matching this criteria will be deleted - any other occurrences will remain. This method is intended for use
in deleting widget definitions from the JSON model that will be processed by the ProcessJsonModelDirective.
o - ObjecttargetAttributeKey - StringtargetAttributeValue - StringCopyright © 2005–2016 Alfresco Software. All rights reserved.