public abstract class BaseEvaluator extends Object implements Evaluator
| Modifier and Type | Field and Description |
|---|---|
protected HashMap<String,String> |
args |
protected org.json.simple.JSONObject |
metadata |
protected boolean |
negateOutput |
| Constructor and Description |
|---|
BaseEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
evaluate(org.json.simple.JSONObject jsonObject)
Evaluator implementations abstract method.
|
boolean |
evaluate(Object record)
Optional entry point from Rhino script.
|
boolean |
evaluate(Object record,
Object metadata)
Optional entry point from Rhino script.
|
boolean |
evaluate(Object record,
Object metadata,
HashMap<String,String> args)
Main entry point from Rhino script.
|
String |
getArg(String name)
Get webscript argument by name
|
HashMap<String,String> |
getArgs()
Simple getter for optional webscript args
|
String |
getContainerType(org.json.simple.JSONObject jsonObject)
Get the container node type (e.g.
|
String |
getHeader(String name)
Get request header value
|
boolean |
getIsLocked(org.json.simple.JSONObject jsonObject)
Get a boolean value indicating whether the node is locked or not
|
boolean |
getIsPortlet()
Get flag indicating portlet or standalone mode
|
boolean |
getIsWorkingCopy(org.json.simple.JSONObject jsonObject)
Get a boolean value indicating whether the node is a working copy or not
|
Object |
getJSONValue(org.json.simple.JSONObject jsonObject,
String accessor)
Retrieve a JSON value given an accessor string containing dot notation (e.g.
|
boolean |
getMatchesCurrentUser(org.json.simple.JSONObject jsonObject,
String propertyName)
Checks whether the current user matches that of a given user property
|
org.json.simple.JSONObject |
getMetadata()
Get metadata
|
org.json.simple.JSONArray |
getNodeAspects(org.json.simple.JSONObject jsonObject)
Retrieve a JSONArray of aspects for a node
|
String |
getNodeType(org.json.simple.JSONObject jsonObject)
Retrieves the type for a node
|
Object |
getProperty(org.json.simple.JSONObject jsonObject,
String propertyName)
Retrieve a JSONArray of aspects for a node
|
String |
getSiteId(org.json.simple.JSONObject jsonObject)
Get the site shortName applicable to this node (if requested via a site-based page context)
|
String |
getSitePreset(org.json.simple.JSONObject jsonObject)
Get the site preset (e.g.
|
String |
getUserId()
Get the current user associated with this request
|
void |
setNegateOutput(boolean negateOutput)
Sets optional negateOutput flag which applies when one of the main entry points is used
|
protected org.json.simple.JSONObject metadata
protected boolean negateOutput
public void setNegateOutput(boolean negateOutput)
public final boolean evaluate(Object record)
record - JSON String representing the record wrapping the node as received from a Rhino scriptpublic final boolean evaluate(Object record, Object metadata)
record - JSON String representing the record wrapping the node as received from a Rhino scriptmetadata - JSON String containing metadata which may be relevant to the evaluationpublic final boolean evaluate(Object record, Object metadata, HashMap<String,String> args)
record - JSON String or JSONObject as received from a Rhino scriptmetadata - JSON String or JSONObject as received from a Rhino scriptargs - URL arguments passed to calling webscriptpublic abstract boolean evaluate(org.json.simple.JSONObject jsonObject)
public final HashMap<String,String> getArgs()
public final String getArg(String name)
name - Argument namepublic final org.json.simple.JSONObject getMetadata()
public final String getHeader(String name)
name - Header name to retrievepublic final boolean getIsPortlet()
public final String getNodeType(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final org.json.simple.JSONArray getNodeAspects(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final Object getProperty(org.json.simple.JSONObject jsonObject, String propertyName)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.propertyName - Name of the property to retrievepublic final String getUserId()
public final String getSiteId(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final String getSitePreset(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final String getContainerType(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final boolean getIsLocked(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final boolean getIsWorkingCopy(org.json.simple.JSONObject jsonObject)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final boolean getMatchesCurrentUser(org.json.simple.JSONObject jsonObject,
String propertyName)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.propertyName - String containing dotted notation path to valuepublic final Object getJSONValue(org.json.simple.JSONObject jsonObject, String accessor)
jsonObject - JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.accessor - String containing dotted notation path to valueCopyright © 2005–2014 Alfresco Software. All rights reserved.