public abstract class BaseEvaluator extends java.lang.Object implements Evaluator
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap |
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(java.lang.Object record)
Optional entry point from Rhino script.
|
boolean |
evaluate(java.lang.Object record,
java.lang.Object metadata)
Optional entry point from Rhino script.
|
boolean |
evaluate(java.lang.Object record,
java.lang.Object metadata,
java.util.HashMap args)
Main entry point from Rhino script.
|
java.lang.String |
getArg(java.lang.String name)
Get webscript argument by name
|
java.util.HashMap |
getArgs()
Simple getter for optional webscript args
|
java.lang.String |
getContainerType(org.json.simple.JSONObject jsonObject)
Get the container node type (e.g.
|
java.lang.String |
getHeader(java.lang.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
|
java.lang.Object |
getJSONValue(org.json.simple.JSONObject jsonObject,
java.lang.String accessor)
Retrieve a JSON value given an accessor string containing dot notation (e.g.
|
boolean |
getMatchesCurrentUser(org.json.simple.JSONObject jsonObject,
java.lang.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
|
java.lang.String |
getNodeType(org.json.simple.JSONObject jsonObject)
Retrieves the type for a node
|
java.lang.Object |
getProperty(org.json.simple.JSONObject jsonObject,
java.lang.String propertyName)
Retrieve a JSONArray of aspects for a node
|
java.lang.String |
getSiteId(org.json.simple.JSONObject jsonObject)
Get the site shortName applicable to this node (if requested via a site-based page context)
|
java.lang.String |
getSitePreset(org.json.simple.JSONObject jsonObject)
Get the site preset (e.g.
|
java.lang.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 java.util.HashMap args
protected org.json.simple.JSONObject metadata
protected boolean negateOutput
public void setNegateOutput(boolean negateOutput)
public final boolean evaluate(java.lang.Object record)
record
- JSON String representing the record wrapping the node as received from a Rhino scriptpublic final boolean evaluate(java.lang.Object record, java.lang.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(java.lang.Object record, java.lang.Object metadata, java.util.HashMap 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 java.util.HashMap getArgs()
public final java.lang.String getArg(java.lang.String name)
name
- Argument namepublic final org.json.simple.JSONObject getMetadata()
public final java.lang.String getHeader(java.lang.String name)
name
- Header name to retrievepublic final boolean getIsPortlet()
public final java.lang.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 java.lang.Object getProperty(org.json.simple.JSONObject jsonObject, java.lang.String propertyName)
jsonObject
- JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.propertyName
- Name of the property to retrievepublic final java.lang.String getUserId()
public final java.lang.String getSiteId(org.json.simple.JSONObject jsonObject)
jsonObject
- JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final java.lang.String getSitePreset(org.json.simple.JSONObject jsonObject)
jsonObject
- JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.public final java.lang.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, java.lang.String propertyName)
jsonObject
- JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.propertyName
- String containing dotted notation path to valuepublic final java.lang.Object getJSONValue(org.json.simple.JSONObject jsonObject, java.lang.String accessor)
jsonObject
- JSONObject containing a "node" object as returned from the ApplicationScriptUtils class.accessor
- String containing dotted notation path to valueCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.