Package org.alfresco.rest.v0
Class RulesAPI
- java.lang.Object
-
- org.alfresco.rest.core.v0.BaseAPI
-
- org.alfresco.rest.v0.RulesAPI
-
@Component public class RulesAPI extends BaseAPI
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
Fields Modifier and Type Field Description static StringINHERIT_RULES_APIstatic StringINHERIT_RULES_STATE_APIstatic org.slf4j.LoggerLOGGERstatic StringRULE_APIstatic StringRULES_API-
Fields 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 Constructor Description RulesAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainerInheritsRulesFromParent(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 containerStringgetRuleIdWithTitle(String username, String password, String containerNodeRef, String title)Returns the rule id for the give rule title set on a containerList<String>getRulesIdsSetOnContainer(String username, String password, String containerNodeRef)Retrieves all the ids of the rules set on the containerList<RuleDefinition>getRulesSetOnContainer(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 properties-
Methods 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 Detail
-
RULES_API
public static final String RULES_API
- See Also:
- Constant Field Values
-
RULE_API
public static final String RULE_API
- See Also:
- Constant Field Values
-
INHERIT_RULES_API
public static final String INHERIT_RULES_API
- See Also:
- Constant Field Values
-
INHERIT_RULES_STATE_API
public static final String INHERIT_RULES_STATE_API
- See Also:
- Constant Field Values
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
-
Method Detail
-
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
public void deleteRule(String username, String password, String containerNodeRef, String ruleId)
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
public void deleteAllRulesOnContainer(String username, String password, String containerNodeRef)
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
-
-