Package com.appiancorp.suiteapi.content
Class ContentAccess
java.lang.Object
com.appiancorp.process.common.presentation.JSONCallableObject
com.appiancorp.suiteapi.content.ContentAccess
- All Implemented Interfaces:
Serializable
public class ContentAccess
extends com.appiancorp.process.common.presentation.JSONCallableObject
This class provides methods accessible through JSON, which are
relevant to Content objects.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionContentAccess
(javax.servlet.http.HttpSession session_) Constructs a ContentAccess object. -
Method Summary
Modifier and TypeMethodDescriptionReturns true if the user has edit privileges for Rules.saveFreeformRule
(FreeformRule rule_, Long oldParentId) This method saves a freeform rule and returns a map of validation messages.com.appiancorp.process.common.presentation.Response
testFreeformRule
(FreeformRule rule_) This method tests a freeform rule by evaluating its definition.static HashMap
validate
(FreeformRule rule_, javax.servlet.http.HttpSession session_, boolean checkNameCollision) This method validates a freeform rule and returns a map of validation messages.validateFreeformRule
(FreeformRule rule_) This method validates a freeform rule for testing.Methods inherited from class com.appiancorp.process.common.presentation.JSONCallableObject
getServiceContext, getSession
-
Field Details
-
SUCCESS
- See Also:
-
NAME
- See Also:
-
FAIL
- See Also:
-
-
Constructor Details
-
ContentAccess
public ContentAccess(javax.servlet.http.HttpSession session_) Constructs a ContentAccess object.- Parameters:
session_
- an HttpSession object
-
-
Method Details
-
testFreeformRule
This method tests a freeform rule by evaluating its definition.- Parameters:
rule_
- the rule to test- Returns:
- a Response object
-
validateFreeformRule
This method validates a freeform rule for testing. It calls the process design service to ensure that the expression is well formed, and that all inputs have been declared.- Parameters:
rule_
- the freeform rule to validate- Returns:
- a map of validation messages
-
saveFreeformRule
This method saves a freeform rule and returns a map of validation messages. If given rule has an id, it attempts to create a new version. Otherwise, it creates a new rule The HashMap we return is converted to a JSON object and used by the edit rule page to display inline messages for any validation errors for each rule field. Thus the map mimics the structure of a rule bean, e.g. an error on rule.parent gets stored in map.parent. On a successful save, we populate the return HashMap with:- success: internationalized key for success message
- successMessage: actual success message
- successParam: success message param
- Parameters:
rule_
- the freeform rule to saveoldParentId
- the old parent id- Returns:
- map of validation messages
-
validate
public static HashMap validate(FreeformRule rule_, javax.servlet.http.HttpSession session_, boolean checkNameCollision) This method validates a freeform rule and returns a map of validation messages. It validates for: input parameter names rule name The HashMap we return is converted to a JSON object and used by the edit rule page to display inline messages for any validation errors for each rule field. Thus the map mimics the structure of a rule bean, e.g. an error on rule.name gets stored in map.name.- Parameters:
rule_
- the freeform rule to validatesession_
- the sessioncheckNameCollision
- if set to false, names will not be compared against existing expression functions.- Returns:
- map of error messages
-
hasRuleEditingPrivileges
Returns true if the user has edit privileges for Rules.- Returns:
- true if the user can edit rules
-