Merge 'feature/RM-4921_ExceptionsDoneOnTransactionCommit' into feature/RM-5012_recordIdentifier

This commit is contained in:
Ana Bozianu
2017-05-03 22:16:53 +03:00
24 changed files with 2124 additions and 1508 deletions

View File

@@ -28,8 +28,10 @@ package org.alfresco.rest.rm.community.model.fileplan;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_COMPONENT_ID;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_COUNT;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IDENTIFIER;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -71,4 +73,10 @@ public class FilePlanProperties extends TestModel
/************************/
@JsonProperty (PROPERTIES_COUNT)
private Integer count;
@JsonProperty (PROPERTIES_TITLE)
private String title;
@JsonProperty (PROPERTIES_DESCRIPTION)
private String description;
}

View File

@@ -96,9 +96,6 @@ public class UnfiledContainerChild extends TestModel
@JsonProperty
private List<String> aspectNames;
@JsonProperty
private Boolean hasRetentionSchedule;
@JsonProperty
private Boolean isClosed;

View File

@@ -45,8 +45,8 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PHYSICAL_SIZE;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PIXEL_X_DIMENSION;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PIXEL_Y_DIMENSION;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RESOLUTION_UNIT;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SHELF;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SOFTWARE;
@@ -54,7 +54,6 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_LABEL;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_TYPE;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_X_RESOLUTION;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_Y_RESOLUTION;
@@ -64,7 +63,6 @@ import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -92,22 +90,18 @@ public class UnfiledContainerChildProperties extends TestModel
@JsonProperty (required = true, value = PROPERTIES_TITLE)
private String title;
@JsonProperty (required = true, value = PROPERTIES_VITAL_RECORD_INDICATOR)
private Boolean vitalRecordIndicator;
@JsonProperty (required = true, value = PROPERTIES_ROOT_NODE_REF)
private String rootNodeRef;
@JsonProperty (required = true, value = PROPERTIES_IDENTIFIER)
private String identifier;
@JsonProperty (required = true, value = PROPERTIES_REVIEW_PERIOD)
@JsonSerialize (using = ReviewPeriodSerializer.class)
private ReviewPeriod reviewPeriod;
@JsonProperty (required = true, value = PROPERTIES_DESCRIPTION)
private String description;
@JsonProperty (value = PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE)
private Boolean recordSearchHasDispositionSchedule;
/*********************************/
/** Electronic record parameters */
/*********************************/

View File

@@ -34,6 +34,7 @@ import static org.alfresco.rest.rm.community.util.PojoUtility.toJson;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.springframework.http.HttpMethod.GET;
import static org.springframework.http.HttpMethod.POST;
import static org.springframework.http.HttpMethod.PUT;
import org.alfresco.rest.core.RMRestWrapper;
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
@@ -172,4 +173,44 @@ public class FilePlanAPI extends RMModelRequest
parameters
));
}
/**
* see {@link #updateFilePlan(FilePlan, String, String)
*/
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId) throws Exception
{
mandatoryObject("filePlanModel", filePlanModel);
mandatoryString("filePlanId", filePlanId);
return updateFilePlan(filePlanModel, filePlanId, EMPTY);
}
/**
* Updates a file plan.
*
* @param filePlanModel The file plan model which holds the information
* @param filePlanId The identifier of the file plan
* @param parameters The URL parameters to add
* @throws Exception for the following cases:
* <ul>
* <li>the update request is invalid or {@code filePlanId} is not a valid format or {@code filePlanModel} is invalid</li>
* <li>authentication fails</li>
* <li>current user does not have permission to update {@code filePlanId}</li>
* <li>{@code filePlanId} does not exist</li>
* <li>model integrity exception, including file name with invalid characters</li>
* </ul>
*/
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId, String parameters) throws Exception
{
mandatoryObject("filePlanModel", filePlanModel);
mandatoryString("filePlanId", filePlanId);
return getRmRestWrapper().processModel(FilePlan.class, requestWithBody(
PUT,
toJson(filePlanModel),
"file-plans/{filePlanId}?{parameters}",
filePlanId,
parameters));
}
}

View File

@@ -263,7 +263,7 @@ public class RecordFolderAPI extends RMModelRequest
* Creates a record in a record folder child, i.e. a record.
*
* @param recordModel The record model which holds the information
* @param recordfolderId The identifier of a record folder
* @param recordFolderId The identifier of a record folder
* @param parameters The URL parameters to add
* @return The created {@link Record}
* @throws Exception for the following cases:

View File

@@ -108,7 +108,7 @@ public class UnfiledContainerAPI extends RMModelRequest
}
/**
* see {@link #getRootRecordCategories(String, String)}
* see {@link #getUnfiledContainerChildren(String)} (String, String)}
*/
public UnfiledContainerChildCollection getUnfiledContainerChildren(String unfiledContainerId)
{