mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
updates on Read Records API tests
This commit is contained in:
@@ -28,6 +28,7 @@ package org.alfresco.rest.rm.community.model.fileplancomponents;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.ALLOWABLE_OPERATIONS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.IS_COMPLETED;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PATH;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.RELATIVE_PATH;
|
||||
@@ -81,7 +82,7 @@ public class FilePlanComponent
|
||||
@JsonProperty(value = IS_CLOSED)
|
||||
private Boolean isClosed;
|
||||
|
||||
@JsonProperty
|
||||
@JsonProperty(value = IS_COMPLETED)
|
||||
private Boolean isCompleted;
|
||||
|
||||
@JsonProperty (required = true)
|
||||
|
@@ -49,6 +49,7 @@ public class FilePlanComponentFields
|
||||
public static final String PROPERTIES_REVIEW_PERIOD = "rma:reviewPeriod";
|
||||
public static final String PROPERTIES_LOCATION = "rma:location";
|
||||
public static final String PROPERTIES_IS_CLOSED = "rma:isClosed"; // not to be confused with IS_CLOSED!
|
||||
public static final String IS_COMPLETED = "isCompleted";
|
||||
|
||||
// for non-electronic records
|
||||
public static final String PROPERTIES_BOX = "rma:box";
|
||||
@@ -58,7 +59,7 @@ public class FilePlanComponentFields
|
||||
public static final String PROPERTIES_SHELF = "rma:shelf";
|
||||
public static final String PROPERTIES_STORAGE_LOCATION = "rma:storageLocation";
|
||||
|
||||
//RelativePath specifies the container structure to create relative to the node nodeId.
|
||||
//RelativePath specifies the container structure to create relative to the nodeId.
|
||||
public static final String RELATIVE_PATH = "relativePath";
|
||||
public static final String PATH = "path";
|
||||
}
|
||||
|
@@ -49,18 +49,45 @@ import org.springframework.stereotype.Component;
|
||||
@Scope (value = "prototype")
|
||||
public class RecordsAPI extends RestAPI<FilePlanComponentAPI>
|
||||
{
|
||||
/**
|
||||
* Get the content for the electronic record
|
||||
*
|
||||
* @param recordId The id of the electronic record
|
||||
* @return The content for the given record id
|
||||
* @throws Exception for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordId} has no content</li>
|
||||
* <li> {@code recordId} is not a valid format, or is not a record</li>
|
||||
* <li>authentication fails</li>
|
||||
* <li>{@code recordId} does not exist</li>
|
||||
* </ul>
|
||||
*/
|
||||
public <T> T getRecordContentText(String recordId) throws Exception
|
||||
{
|
||||
mandatoryString("recordId", recordId);
|
||||
//RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "records/{recordId}/content?{parameters}", recordId, getParameters());
|
||||
Response response = given().auth().basic(usingRestWrapper().getTestUser().getUsername(), usingRestWrapper().getTestUser().getPassword())
|
||||
.get("records/{recordId}/content?{parameters}", recordId, getParameters())
|
||||
.andReturn();
|
||||
.get("records/{recordId}/content?{parameters}", recordId, getParameters())
|
||||
.andReturn();
|
||||
|
||||
usingRestWrapper().setStatusCode(Integer.toString(response.getStatusCode()));
|
||||
|
||||
LOG.info("The record content is " + response.getBody().prettyPrint());
|
||||
return (T) response.getBody().prettyPrint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the html content for the electronic record
|
||||
*
|
||||
* @param recordId The id of the electronic record
|
||||
* @return The content for the given record id
|
||||
* @throws Exception for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordId} has no content</li>
|
||||
* <li> {@code recordId} is not a valid format, or is not a record</li>
|
||||
* <li>authentication fails</li>
|
||||
* <li>{@code recordId} does not exist</li>
|
||||
* </ul>
|
||||
*/
|
||||
public RestHtmlResponse getRecordContent(String recordId) throws Exception
|
||||
{
|
||||
mandatoryString("recordId", recordId);
|
||||
|
Reference in New Issue
Block a user