From 218412357da25c172b63667e739b19e50ee3d45f Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Thu, 1 Dec 2016 10:39:06 +0000 Subject: [PATCH] RM-4391: Support for non-electronic records. --- .../fileplancomponents/FilePlanComponent.java | 3 + .../FilePlanComponentContent.java | 98 +++++++++++++++++ .../FilePlanComponentFields.java | 15 ++- .../FilePlanComponentProperties.java | 100 ++++++++++++++++++ .../FilePlanComponentType.java | 3 +- 5 files changed, 215 insertions(+), 4 deletions(-) create mode 100644 rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentContent.java diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java index 8342ce9661..c74034ed5a 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java @@ -85,6 +85,9 @@ public class FilePlanComponent @JsonProperty (value = ALLOWABLE_OPERATIONS) private List allowableOperations; + @JsonProperty (required = false) + private FilePlanComponentContent content; + private FilePlanComponentPath path; @JsonProperty (required = true) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentContent.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentContent.java new file mode 100644 index 0000000000..9c90c35156 --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentContent.java @@ -0,0 +1,98 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + * #L% + */ +package org.alfresco.rest.rm.community.model.fileplancomponents; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * POJO for FilePlanComponent content field + * @author Kristijan Conkas + * @since 2.6 + */ +public class FilePlanComponentContent +{ + @JsonProperty (required = true) + private String encoding; + + @JsonProperty (required = true) + private String mimeType; + + @JsonProperty (required = true) + private String mimeTypeName; + + @JsonProperty (required = true) + private Integer sizeInBytes; + + /** + * @return the encoding + */ + public String getEncoding() + { + return this.encoding; + } + + /** + * @param encoding the encoding to set + */ + public void setEncoding(String encoding) + { + this.encoding = encoding; + } + + /** + * @return the mimeType + */ + public String getMimeType() + { + return this.mimeType; + } + + /** + * @param mimeType the mimeType to set + */ + public void setMimeType(String mimeType) + { + this.mimeType = mimeType; + } + + /** + * @return the mimeTypeName + */ + public String getMimeTypeName() + { + return this.mimeTypeName; + } + + /** + * @param mimeTypeName the mimeTypeName to set + */ + public void setMimeTypeName(String mimeTypeName) + { + this.mimeTypeName = mimeTypeName; + } + + /** + * @return the sizeInBytes + */ + public Integer getSizeInBytes() + { + return this.sizeInBytes; + } + + /** + * @param sizeInBytes the sizeInBytes to set + */ + public void setSizeInBytes(Integer sizeInBytes) + { + this.sizeInBytes = sizeInBytes; + } +} diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java index 98f38afd36..f839ffda9a 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java @@ -45,7 +45,16 @@ public class FilePlanComponentFields public static final String PROPERTIES_DESCRIPTION = "cm:description"; public static final String PROPERTIES_SUPPLEMENTAL_MARKING_LIST = "rmc:supplementalMarkingList"; public static final String ALLOWABLE_OPERATIONS = "allowableOperations"; - public static final String IS_CLOSED="isClosed"; - public static final String PROPERTIES_REVIEW_PERIOD="rma:reviewPeriod"; - public static final String PROPERTIES_LOCATION="rma:location"; + public static final String IS_CLOSED = "isClosed"; + public static final String PROPERTIES_REVIEW_PERIOD = "rma:reviewPeriod"; + public static final String PROPERTIES_LOCATION = "rma:location"; + + // for non-electronic records + public static final String PROPERTIES_BOX = "rma:box"; + public static final String PROPERTIES_FILE = "rma:file"; + public static final String PROPERTIES_NUMBER_OF_COPIES = "rma:numberOfCopies"; + public static final String PROPERTIES_PHYSICAL_SIZE = "rma:physicalSize"; + public static final String PROPERTIES_SHELF = "rma:shelf"; + public static final String PROPERTIES_STORAGE_LOCATION = "rma:storageLocation"; + } diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java index ab8fbcd253..261bf546e0 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java @@ -26,10 +26,15 @@ */ package org.alfresco.rest.rm.community.model.fileplancomponents; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_BOX; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_FILE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_HOLD_REASON; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_NUMBER_OF_COPIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PHYSICAL_SIZE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SHELF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SUPPLEMENTAL_MARKING_LIST; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR; @@ -74,6 +79,22 @@ public class FilePlanComponentProperties @JsonProperty(PROPERTIES_LOCATION) private String location; + + @JsonProperty(value = PROPERTIES_BOX, required = false) + private String box; + + @JsonProperty(value = PROPERTIES_FILE, required = false) + private String file; + + @JsonProperty(value = PROPERTIES_SHELF, required = false) + private String shelf; + + @JsonProperty(value = PROPERTIES_NUMBER_OF_COPIES, required = false) + private Integer numberOfCopies; + + @JsonProperty(value = PROPERTIES_PHYSICAL_SIZE, required = false) + private Integer physicalSize; + public FilePlanComponentProperties(String title, String description) { @@ -203,4 +224,83 @@ public class FilePlanComponentProperties this.location = location; } + /** + * @return the box + */ + public String getBox() + { + return this.box; + } + + /** + * @param box the box to set + */ + public void setBox(String box) + { + this.box = box; + } + + /** + * @return the file + */ + public String getFile() + { + return this.file; + } + + /** + * @param file the file to set + */ + public void setFile(String file) + { + this.file = file; + } + + /** + * @return the shelf + */ + public String getShelf() + { + return this.shelf; + } + + /** + * @param shelf the shelf to set + */ + public void setShelf(String shelf) + { + this.shelf = shelf; + } + + /** + * @return the numberOfCopies + */ + public Integer getNumberOfCopies() + { + return this.numberOfCopies; + } + + /** + * @param numberOfCopies the numberOfCopies to set + */ + public void setNumberOfCopies(Integer numberOfCopies) + { + this.numberOfCopies = numberOfCopies; + } + + /** + * @return the physicalSize + */ + public Integer getPhysicalSize() + { + return this.physicalSize; + } + + /** + * @param physicalSize the physicalSize to set + */ + public void setPhysicalSize(Integer physicalSize) + { + this.physicalSize = physicalSize; + } } diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java index 1308a68295..4398087e56 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java @@ -46,7 +46,8 @@ public enum FilePlanComponentType TRANSFER_CONTAINER_TYPE("rma:transferContainer"), UNFILED_CONTAINER_TYPE("rma:unfiledRecordContainer"), FOLDER_TYPE("cm:folder"), - CONTENT_TYPE("cm:content"); + CONTENT_TYPE("cm:content"), + NON_ELECTRONIC_RECORD_TYPE("rma:nonElectronicDocument"); private String type;