|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.web.evaluator.BaseEvaluator
public abstract class BaseEvaluator
Base class for all UI evaluators.
Field Summary | |
---|---|
protected java.util.HashMap |
args
|
protected org.json.simple.JSONObject |
metadata
|
protected boolean |
negateOutput
|
Constructor Summary | |
---|---|
BaseEvaluator()
|
Method Summary | |
---|---|
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 |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap args
protected org.json.simple.JSONObject metadata
protected boolean negateOutput
Constructor Detail |
---|
public BaseEvaluator()
Method Detail |
---|
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 script
public 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 evaluation
public 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 webscript
public abstract boolean evaluate(org.json.simple.JSONObject jsonObject)
evaluate
in interface Evaluator
jsonObject
- The object the evaluation is for
public final java.util.HashMap getArgs()
public final java.lang.String getArg(java.lang.String name)
name
- Argument name
public final org.json.simple.JSONObject getMetadata()
public final java.lang.String getHeader(java.lang.String name)
name
- Header name to retrieve
public 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 retrieve
public 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 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 value
public 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 value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |