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 Details

  • Constructor Details

    • ContentAccess

      public ContentAccess(javax.servlet.http.HttpSession session_)
      Constructs a ContentAccess object.
      Parameters:
      session_ - an HttpSession object
  • Method Details

    • testFreeformRule

      public com.appiancorp.process.common.presentation.Response testFreeformRule(FreeformRule rule_)
      This method tests a freeform rule by evaluating its definition.
      Parameters:
      rule_ - the rule to test
      Returns:
      a Response object
    • validateFreeformRule

      public HashMap validateFreeformRule(FreeformRule rule_)
      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

      public HashMap saveFreeformRule(FreeformRule rule_, Long oldParentId)
      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
      We must pass the actual successMessage as well as the success key, because the message is shown directly from javascript when this is called by the expression editor, but is passed through the ActionError framework otherwise
      Parameters:
      rule_ - the freeform rule to save
      oldParentId - 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 validate
      session_ - the session
      checkNameCollision - if set to false, names will not be compared against existing expression functions.
      Returns:
      map of error messages
    • hasRuleEditingPrivileges

      public Boolean hasRuleEditingPrivileges()
      Returns true if the user has edit privileges for Rules.
      Returns:
      true if the user can edit rules