Package org.alfresco.rest.v0
Class RulesAPI
java.lang.Object
org.alfresco.rest.core.v0.BaseAPI
org.alfresco.rest.v0.RulesAPI
Covers CRUD API operations on rules
-
Nested Class Summary
Nested classes/interfaces inherited from class org.alfresco.rest.core.v0.BaseAPI
BaseAPI.PermissionType, BaseAPI.RETENTION_SCHEDULE, BaseAPI.RM_ACTIONS, BaseAPI.RMProperty -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final org.slf4j.Loggerstatic final Stringstatic final StringFields inherited from class org.alfresco.rest.core.v0.BaseAPI
ACTIONS_API, contentService, NODE_PREFIX, NODE_REF_WORKSPACE_SPACES_STORE, RM_ACTIONS_API, RM_SITE_ID, SHARE_ACTION_API, UPDATE_METADATA_API -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainerInheritsRulesFromParent(String username, String password, String containerNodeRef) Returns the rules inheritance state of the containerorg.apache.http.HttpResponsecreateRule(String username, String password, String containerNodeRef, RuleDefinition ruleProperties) Creates a rule for the specified container with given rule propertiesvoiddeleteAllRulesOnContainer(String username, String password, String containerNodeRef) Deletes all the rules on a container and checks they don't exist anymorevoiddeleteRule(String username, String password, String containerNodeRef, String ruleId) Deletes a rule on a container and checks it doesn't exist anymoreorg.apache.http.HttpResponsedisableRulesInheritance(String username, String password, String containerNodeRef) Disable inheritance on specific containerorg.apache.http.HttpResponseenableRulesInheritance(String username, String password, String containerNodeRef) Enable inheritance on specific containergetRuleIdWithTitle(String username, String password, String containerNodeRef, String title) Returns the rule id for the give rule title set on a containergetRulesIdsSetOnContainer(String username, String password, String containerNodeRef) Retrieves all the ids of the rules set on the containergetRulesSetOnContainer(String username, String password, String containerNodeRef) Gets all the rules for the specified container with given rule propertiesorg.json.JSONObjectupdateRule(String username, String password, String containerNodeRef, RuleDefinition ruleProperties) Updates a rule for the specified container with given rule propertiesMethods inherited from class org.alfresco.rest.core.v0.BaseAPI
addPropertyToRequest, deleteItem, doDeleteRequest, doGetRequest, doPostJsonRequest, doPostRequest, doPutJsonRequest, doPutRequest, doSlingshotPostJsonRequest, facetedRequest, getFilePlanPath, getItemNodeRef, getNodeRefSpacesStore, getObjectByPath, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesByUniquePropertyValue
-
Field Details
-
RULES_API
- See Also:
-
RULE_API
- See Also:
-
INHERIT_RULES_API
- See Also:
-
INHERIT_RULES_STATE_API
- See Also:
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
RulesAPI
public RulesAPI()
-
-
Method Details
-
createRule
public org.apache.http.HttpResponse createRule(String username, String password, String containerNodeRef, RuleDefinition ruleProperties) Creates a rule for the specified container with given rule properties- Parameters:
containerNodeRef- the container to have the rule created onruleProperties- the rule properties- Returns:
- The HTTP Response (or null if the response could not be understood).
-
updateRule
public org.json.JSONObject updateRule(String username, String password, String containerNodeRef, RuleDefinition ruleProperties) Updates a rule for the specified container with given rule properties- Parameters:
containerNodeRef- the container to have the rule created onruleProperties- the rule properties- Returns:
- true if the rule has been updated successfully, false otherwise
-
deleteRule
Deletes a rule on a container and checks it doesn't exist anymore- Parameters:
username- the user performing the requestpassword- the passwordcontainerNodeRef- the container on which the rule has been createdruleId- the rule id- Throws:
AssertionError- if the rule could not be deleted.
-
deleteAllRulesOnContainer
Deletes all the rules on a container and checks they don't exist anymore- Parameters:
username- the user performing the requestpassword- the passwordcontainerNodeRef- the container on which the rules have been created- Throws:
AssertionError- if at least one of the rules could not be deleted.
-
getRulesSetOnContainer
public List<RuleDefinition> getRulesSetOnContainer(String username, String password, String containerNodeRef) Gets all the rules for the specified container with given rule properties- Parameters:
username- the user performing the requestpassword- the passwordcontainerNodeRef- the container to get the rules from- Returns:
- list of rules on container
-
getRulesIdsSetOnContainer
public List<String> getRulesIdsSetOnContainer(String username, String password, String containerNodeRef) Retrieves all the ids of the rules set on the container- Parameters:
username- the user performing the requestpassword- the passwordcontainerNodeRef- the container's noderef to get set rules for- Returns:
- the list of rules ids that the container has
-
getRuleIdWithTitle
public String getRuleIdWithTitle(String username, String password, String containerNodeRef, String title) Returns the rule id for the give rule title set on a container- Parameters:
username- the user performing the requestpassword- the passwordcontainerNodeRef- container nodeRef- Returns:
- the rule id
-
disableRulesInheritance
public org.apache.http.HttpResponse disableRulesInheritance(String username, String password, String containerNodeRef) Disable inheritance on specific container- Parameters:
username- the usernamepassword- the passwordcontainerNodeRef- the container nodeRef- Returns:
- The HTTP Response (or null if the current state is disabled).
-
enableRulesInheritance
public org.apache.http.HttpResponse enableRulesInheritance(String username, String password, String containerNodeRef) Enable inheritance on specific container- Parameters:
username- the usernamepassword- the passwordcontainerNodeRef- the container nodeRef- Returns:
- The HTTP Response (or null if the current state is disabled).
-
containerInheritsRulesFromParent
public boolean containerInheritsRulesFromParent(String username, String password, String containerNodeRef) throws org.json.JSONException Returns the rules inheritance state of the container- Parameters:
username- the usernamepassword- the passwordcontainerNodeRef- the container nodeRef- Returns:
- a boolean specifying if the container inherits rules from parent
- Throws:
org.json.JSONException
-