Package org.alfresco.rest.v0
Class RMRolesAndActionsAPI
java.lang.Object
org.alfresco.rest.core.v0.BaseAPI
org.alfresco.rest.v0.RMRolesAndActionsAPI
Methods to make API requests using v0 API on RM items (move, update and other actions) including adding users to RM roles
- Since:
- 2.5
- Author:
- Oana Nechiforescu
-
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 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 TypeMethodDescriptionvoidassignRoleToUser(String adminUser, String adminPassword, String userName, String role) Assign a records management role to a user.org.apache.http.HttpResponseComplete an event on the record/record foldervoidcreateRole(String adminUser, String adminPassword, String roleName, String roleDisplayLabel, Set<String> capabilities) Create a new RM role.voidcreateUserAndAssignToRole(String adminUser, String adminPassword, String userName, String password, String role) create user and assign to records management rolevoiddeleteAllItemsInContainer(String username, String password, String siteId, String containerName) Deletes every item in the given containervoiddeleteRole(String adminUser, String adminPassword, String roleName) Delete a created RM role.org.apache.http.HttpResponseexecuteAction(String user, String password, String contentName, BaseAPI.RM_ACTIONS action) Perform an action on the given contentorg.apache.http.HttpResponseexecuteAction(String user, String password, String contentName, BaseAPI.RM_ACTIONS action, ZonedDateTime date) Perform an action on the given contentorg.apache.http.HttpResponseexecuteAction(String user, String password, String contentName, BaseAPI.RM_ACTIONS action, ZonedDateTime date, int status) Perform an action on the record folderorg.apache.http.HttpResponseexecuteActionAndExpectResponseCode(String user, String password, String contentName, BaseAPI.RM_ACTIONS action, int status) Perform an action on the given contentgetCapabilitiesForRole(String adminUser, String adminPassword, String role) Get the capabilities for a given role.getConfiguredRoles(String adminUser, String adminPassword) Get all the configured RM roles.voidMove actionvoidmoveToAndExpectFailure(String user, String password, String contentPath, String destinationPath) Move actionorg.apache.http.HttpResponseUndo an event on the record/record folderorg.apache.http.HttpResponseupdateMetadata(String username, String password, String itemNodeRef, Map<BaseAPI.RMProperty, String> properties) Updates metadata, can be used on records, folders and categoriesvoidupdateRole(String adminUser, String adminPassword, String roleName, String roleDisplayLabel, Set<String> capabilities) Update an existing RM role.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
-
Constructor Details
-
RMRolesAndActionsAPI
public RMRolesAndActionsAPI()
-
-
Method Details
-
getConfiguredRoles
Get all the configured RM roles.- Parameters:
adminUser- The RM admin user.adminPassword- The password of the user.- Returns:
- The RM roles in the system (Note that this will be the internal names, not the display labels).
-
getCapabilitiesForRole
Get the capabilities for a given role.- Parameters:
adminUser- The RM admin user.adminPassword- The password of the user.role- The role to get capabilities for.- Returns:
- The set of system names for the capabilities.
-
createRole
public void createRole(String adminUser, String adminPassword, String roleName, String roleDisplayLabel, Set<String> capabilities) Create a new RM role.- Parameters:
adminUser- The username of the admin user.adminPassword- The password for the admin user.roleName- The name of the new role.roleDisplayLabel- A human-readable label for the role.capabilities- A list of capabilities for the role.
-
updateRole
public void updateRole(String adminUser, String adminPassword, String roleName, String roleDisplayLabel, Set<String> capabilities) Update an existing RM role.- Parameters:
adminUser- The username of the admin user.adminPassword- The password for the admin user.roleName- The name of the new role.roleDisplayLabel- A human-readable label for the role.capabilities- A list of capabilities for the role.
-
deleteRole
Delete a created RM role.- Parameters:
adminUser- The username of the admin user.adminPassword- The password for the admin user.roleName- The name of the role to be deleted.
-
createUserAndAssignToRole
public void createUserAndAssignToRole(String adminUser, String adminPassword, String userName, String password, String role) create user and assign to records management role -
assignRoleToUser
Assign a records management role to a user.- Throws:
AssertionError- if the assignation is unsuccessful.
-
moveTo
Move action- Parameters:
user- the user to move the contentPathpassword- the user's passwordcontentPath- path to the content to be moveddestinationPath- destination path- Throws:
AssertionError- if the move was unsuccessful.
-
moveToAndExpectFailure
public void moveToAndExpectFailure(String user, String password, String contentPath, String destinationPath) Move action- Parameters:
user- the user to move the contentPathpassword- the user's passwordcontentPath- path to the content to be moveddestinationPath- destination path- Throws:
AssertionError- if the move was unexpectedly successful.
-
executeAction
public org.apache.http.HttpResponse executeAction(String user, String password, String contentName, BaseAPI.RM_ACTIONS action) Perform an action on the given content- Parameters:
user- the user executing the actionpassword- the user's passwordcontentName- the content name- Returns:
- The HTTP response.
-
executeActionAndExpectResponseCode
public org.apache.http.HttpResponse executeActionAndExpectResponseCode(String user, String password, String contentName, BaseAPI.RM_ACTIONS action, int status) Perform an action on the given content- Parameters:
user- the user executing the actionpassword- the user's passwordcontentName- the content name- Returns:
- The HTTP response.
-
executeAction
public org.apache.http.HttpResponse executeAction(String user, String password, String contentName, BaseAPI.RM_ACTIONS action, ZonedDateTime date) Perform an action on the given content- Parameters:
user- the user executing the actionpassword- the user's passwordcontentName- the content name- Returns:
- The HTTP response.
-
executeAction
public org.apache.http.HttpResponse executeAction(String user, String password, String contentName, BaseAPI.RM_ACTIONS action, ZonedDateTime date, int status) Perform an action on the record folder- Parameters:
user- the user executing the actionpassword- the user's passwordcontentName- the content namedate- the date to be updated- Returns:
- The HTTP response.
-
completeEvent
public org.apache.http.HttpResponse completeEvent(String user, String password, String nodeName, RMEvents event, Instant date) Complete an event on the record/record folder- Parameters:
user- the user executing the actionpassword- the user's passwordnodeName- the node nameevent- the event to be completeddate- the date to be updated- Returns:
- The HTTP response.
-
undoEvent
public org.apache.http.HttpResponse undoEvent(String user, String password, String contentName, RMEvents event) Undo an event on the record/record folder- Parameters:
user- the user executing the actionpassword- the user's passwordcontentName- the content nameevent- the event to be undone- Returns:
- The HTTP response.
-
deleteAllItemsInContainer
public void deleteAllItemsInContainer(String username, String password, String siteId, String containerName) Deletes every item in the given container- Parameters:
username- the user's usernamepassword- its passwordsiteId- the site id in which the container is locatedcontainerName- the container to look for items into- Throws:
AssertionError- if not all items could be deleted.
-
updateMetadata
public org.apache.http.HttpResponse updateMetadata(String username, String password, String itemNodeRef, Map<BaseAPI.RMProperty, String> properties) Updates metadata, can be used on records, folders and categories- Parameters:
username- the user updating the itempassword- the user's passworditemNodeRef- the item noderef- Returns:
- The HTTP response.
-