Package org.alfresco.rest.v0
Class HoldsAPI
java.lang.Object
org.alfresco.rest.core.v0.BaseAPI
org.alfresco.rest.v0.HoldsAPI
Methods to make API requests using v0 API for generalized holds
- Since:
- 3.2
- Author:
- Rodica Sutu
-
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
FieldsFields inherited from class org.alfresco.rest.core.v0.BaseAPI
ACTIONS_API, contentService, LOGGER, 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 TypeMethodDescriptionorg.apache.http.HttpResponseaddItemsToHolds(String user, String password, int expectedStatus, List<String> itemNodeRefs, List<String> holdNodeRefs) Adds a list of items (content/record/record folder) to a list of holdsorg.apache.http.HttpResponseAdds a list of items (content/record/record folder) to a list of holdsorg.apache.http.HttpResponseaddItemToHold(String user, String password, String itemNodeRef, String holdName) Adds item(content/record/record folder) to the holdaddToHoldAndGetMessage(String user, String password, int expectedStatus, String itemNodeRef, String holdNodeRef) Util method to add item(content/record/record folder) to the hold and get the error messageorg.apache.http.HttpResponseUtil method to create a holdorg.apache.http.HttpResponsecreateHold(String user, String password, String holdName, String reason, String description, int expectedStatusCode) Util method to create a holdcreateHoldAndGetNodeRef(String user, String password, String holdName, String reason, String description) Create a hold and get the node ref of the hold from the response bodyvoiddeleteHold(String username, String password, String holdName) Deletes hold using cmisorg.apache.http.HttpResponsedeleteHold(String username, String password, String holdNodeRef, int expectedStatusCode) Deletes hold using RM Actions API and expect a specific status codeorg.apache.http.HttpResponsedeleteHold(org.alfresco.utility.model.UserModel user, String holdNodeRef) Deletes hold using RM Actions API and expect action to be successfulgetHolds(String user, String password, String itemNodeRef, Boolean includedInHold, Boolean fileOnly) Get the list of the available holds which have the item node reference if includedInHold parameter is true, otherwise a list of hold node references will be retrieved which do not include the given node reference.removeFromHoldAndGetMessage(String user, String password, int expectedStatus, String itemNodeRef, String holdNodeRef) Util method to remove item(content/record/record folder) from hold and get the error messageorg.apache.http.HttpResponseremoveItemFromHold(String user, String password, String itemNodeRef, String holdName) Remove item(content/record/record folder) from holdorg.apache.http.HttpResponseremoveItemsFromHolds(String user, String password, int expectedStatus, List<String> itemNodeRefs, List<String> holdNodeRefs) Remove a list of items (content/record/record folder) from a list of holdsorg.apache.http.HttpResponseremoveItemsFromHolds(String user, String password, List<String> itemNodeRefs, List<String> holdNames) Remove a list of items (content/record/record folder) from a list of holdsMethods 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
-
HOLDS_CONTAINER
- See Also:
-
-
Constructor Details
-
HoldsAPI
public HoldsAPI()
-
-
Method Details
-
createHold
public org.apache.http.HttpResponse createHold(String user, String password, String holdName, String reason, String description) Util method to create a hold- Parameters:
user- the user creating the holdpassword- the user's passwordholdName- the hold namereason- hold reasondescription- hold description- Returns:
- The HTTP response.
-
createHold
public org.apache.http.HttpResponse createHold(String user, String password, String holdName, String reason, String description, int expectedStatusCode) Util method to create a hold- Parameters:
user- the user creating the holdpassword- the user's passwordholdName- the hold namereason- hold reasondescription- hold descriptionexpectedStatusCode- The expected return status code.- Returns:
- The HTTP response or throws AssertionError if the returned status code is not as expected.
-
createHoldAndGetNodeRef
public String createHoldAndGetNodeRef(String user, String password, String holdName, String reason, String description) Create a hold and get the node ref of the hold from the response body- Parameters:
user- the user creating the holdpassword- the user's passwordholdName- the hold name to be createdreason- reason of the hold to be createddescription- hold description- Returns:
- node ref of the hold created
-
deleteHold
public org.apache.http.HttpResponse deleteHold(org.alfresco.utility.model.UserModel user, String holdNodeRef) Deletes hold using RM Actions API and expect action to be successful- Parameters:
user- the user who does the requestholdNodeRef- the hold node ref- Returns:
- The HTTP Response or throws AssertionError if the request is not successful.
-
deleteHold
public org.apache.http.HttpResponse deleteHold(String username, String password, String holdNodeRef, int expectedStatusCode) Deletes hold using RM Actions API and expect a specific status code- Parameters:
username- user's usernamepassword- its passwordholdNodeRef- the hold node ref- Returns:
- The HTTP Response or throws AssertionError if the returned status code is not as expected.
-
deleteHold
Deletes hold using cmis- Parameters:
username- user's usernamepassword- its passwordholdName- the hold name- Throws:
AssertionError- if the deletion was unsuccessful.
-
addItemToHold
public org.apache.http.HttpResponse addItemToHold(String user, String password, String itemNodeRef, String holdName) Adds item(content/record/record folder) to the hold- Parameters:
user- the user who adds the item to the holdpassword- the user's passworditemNodeRef- the nodeRef of the item to be added to holdholdName- the hold name- Returns:
- The HTTP response
-
addItemsToHolds
public org.apache.http.HttpResponse addItemsToHolds(String user, String password, List<String> itemNodeRefs, List<String> holdNames) Adds a list of items (content/record/record folder) to a list of holds- Parameters:
user- the user who adds the items to the holdspassword- the user's passworditemNodeRefs- the list of items nodeRefs to be added to holdsholdNames- the list of holds- Returns:
- The HTTP response
-
addItemsToHolds
public org.apache.http.HttpResponse addItemsToHolds(String user, String password, int expectedStatus, List<String> itemNodeRefs, List<String> holdNodeRefs) Adds a list of items (content/record/record folder) to a list of holds- Parameters:
user- the user who adds the items to the holdspassword- the user's passworditemNodeRefs- the list of items nodeRefs to be added to holdsholdNodeRefs- the list of holds- Returns:
- The HTTP response
-
addToHoldAndGetMessage
public String addToHoldAndGetMessage(String user, String password, int expectedStatus, String itemNodeRef, String holdNodeRef) Util method to add item(content/record/record folder) to the hold and get the error message- Parameters:
user- the user who adds the item to the holdpassword- the user's passworditemNodeRef- the nodeRef of the item to be added to holdholdNodeRef- the hold node ref- Returns:
- The error message
-
removeItemFromHold
public org.apache.http.HttpResponse removeItemFromHold(String user, String password, String itemNodeRef, String holdName) Remove item(content/record/record folder) from hold- Parameters:
user- the user who removes the item from the holdpassword- the user's passworditemNodeRef- the nodeRef of the item to be removed from holdholdName- the hold name- Returns:
- The HTTP response
-
removeItemsFromHolds
public org.apache.http.HttpResponse removeItemsFromHolds(String user, String password, List<String> itemNodeRefs, List<String> holdNames) Remove a list of items (content/record/record folder) from a list of holds- Parameters:
user- the user who removes the item from the holdpassword- the user's passworditemNodeRefs- the list of items nodeRefs to be removed from holdholdNames- the list of hold names- Returns:
- The HTTP response
-
removeItemsFromHolds
public org.apache.http.HttpResponse removeItemsFromHolds(String user, String password, int expectedStatus, List<String> itemNodeRefs, List<String> holdNodeRefs) Remove a list of items (content/record/record folder) from a list of holds- Parameters:
user- the user who removes the item from the holdpassword- the user's passwordexpectedStatus- https status code expecteditemNodeRefs- the list of items nodeRefs to be removed from holdholdNodeRefs- the list of hold node refs- Returns:
- The HTTP response
-
removeFromHoldAndGetMessage
public String removeFromHoldAndGetMessage(String user, String password, int expectedStatus, String itemNodeRef, String holdNodeRef) Util method to remove item(content/record/record folder) from hold and get the error message- Parameters:
user- the user who removes the item from holdpassword- the user's passworditemNodeRef- the nodeRef of the item to be removed from holdholdNodeRef- the hold node ref- Returns:
- The error message
-
getHolds
public List<HoldEntry> getHolds(String user, String password, String itemNodeRef, Boolean includedInHold, Boolean fileOnly) Get the list of the available holds which have the item node reference if includedInHold parameter is true, otherwise a list of hold node references will be retrieved which do not include the given node reference.- Parameters:
user- The username of the user to use.password- The password of the user.itemNodeRef- The item node referenceincludedInHold- True to retrieve the holds which have the item node referencefileOnly- True if only files should be return- Returns:
- return a list of hold entries
-