Class RecordsAPI
- java.lang.Object
-
- org.alfresco.rest.requests.ModelRequest<Request>
-
- org.alfresco.rest.rm.community.requests.RMModelRequest
-
- org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI
-
public class RecordsAPI extends RMModelRequest
Records REST API Wrapper- Since:
- 2.6
- Author:
- Rodica Sutu
-
-
Constructor Summary
Constructors Constructor Description RecordsAPI(RMRestWrapper rmRestWrapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordcompleteRecord(String recordId)RecordcompleteRecord(String recordId, String parameters)Complete the record recordIdvoiddeleteRecord(String recordId)Deletes a record.RecordfileRecord(RecordBodyFile recordBodyFile, String recordId)File the record recordId into file plan structure based on the location sent via the request bodyRecordfileRecord(RecordBodyFile recordBodyFile, String recordId, String parameters)File the record recordId into file plan structure based on the location sent via the request bodyRecordgetRecord(String recordId)RecordgetRecord(String recordId, String parameters)Gets a record.io.restassured.response.ResponseBody<?>getRecordContent(String recordId)Get the content for the electronic recordRecordupdateRecord(Record recordModel, String recordId)RecordupdateRecord(Record recordModel, String recordId, String parameters)Updates a record.
-
-
-
Constructor Detail
-
RecordsAPI
public RecordsAPI(RMRestWrapper rmRestWrapper)
- Parameters:
rmRestWrapper- RM REST Wrapper
-
-
Method Detail
-
getRecordContent
public io.restassured.response.ResponseBody<?> getRecordContent(String recordId)
Get the content for the electronic record- Parameters:
recordId- The id of the electronic record- Returns:
ResponseBodyrepresenting content for the given record id- Throws:
RuntimeException- for the following cases:recordIdhas no content-
recordIdis not a valid format, or is not a record - authentication fails
recordIddoes not exist
-
fileRecord
public Record fileRecord(RecordBodyFile recordBodyFile, String recordId)
File the record recordId into file plan structure based on the location sent via the request body- Parameters:
recordBodyFile- The properties where to file the recordrecordId- The id of the record to file- Returns:
- The
Recordwith the given properties - Throws:
RuntimeException- for the following cases:- Invalid parameter:
recordBodyFileis not a valid format,recordIdis not a record - authentication fails
- current user does not have permission to file to
fileplanComponentId recordIddoes not exist- targetParentId from recordBodyFile does not exist
- model integrity exception: the action breaks system's integrity restrictions
- Invalid parameter:
-
fileRecord
public Record fileRecord(RecordBodyFile recordBodyFile, String recordId, String parameters)
File the record recordId into file plan structure based on the location sent via the request body- Parameters:
recordBodyFile- The properties where to file the recordrecordId- The id of the record to file- Returns:
- The
Recordwith the given properties - Throws:
RuntimeException- for the following cases:- Invalid parameter:
recordBodyFileis not a valid format,recordIdis not a record - authentication fails
- current user does not have permission to file to
fileplanComponentId recordIddoes not exist- targetParentId from recordBodyFile does not exist
- model integrity exception: the action breaks system's integrity restrictions
- Invalid parameter:
-
completeRecord
public Record completeRecord(String recordId, String parameters)
Complete the record recordId- Parameters:
recordId- The id of the record to complete- Returns:
- The completed
Recordwith the given properties - Throws:
RuntimeException- for the following cases:- Invalid parameter:
recordIdis not a record - authentication fails
- current user does not have permission to complete
recordId recordIddoes not exist or is frozen- model integrity exception: the record is already completed
- model integrity exception: the record has missing meta-data
- Invalid parameter:
-
deleteRecord
public void deleteRecord(String recordId)
Deletes a record.- Parameters:
recordId- The identifier of a record- Throws:
RuntimeException- for the following cases:recordIdis not a valid format- authentication fails
- current user does not have permission to delete
recordId recordIddoes not existrecordIdis locked and cannot be deleted
-
getRecord
public Record getRecord(String recordId, String parameters)
Gets a record.- Parameters:
recordId- The identifier of a recordparameters- The URL parameters to add- Returns:
- The
Recordfor the givenrecordId - Throws:
RuntimeException- for the following cases:recordIdis not a valid format- authentication fails
- current user does not have permission to read
recordId recordIddoes not exist
-
updateRecord
public Record updateRecord(Record recordModel, String recordId, String parameters)
Updates a record.- Parameters:
recordModel- The record model which holds the informationrecordId- The identifier of a recordparameters- The URL parameters to add- Returns:
- The updated
Record - Throws:
RuntimeException- for the following cases:- the update request is invalid or
recordIdis not a valid format orrecordModelis invalid - authentication fails
- current user does not have permission to update
recordId recordIddoes not exist- the updated name clashes with an existing record in the current parent folder
- model integrity exception, including file name with invalid characters
- the update request is invalid or
-
-