Merged remote tracking branch RM REST API Automation

This commit is contained in:
Tuna Aksoy
2016-11-14 19:31:27 +00:00
14 changed files with 861 additions and 21 deletions

View File

@@ -12,11 +12,11 @@
package org.alfresco.rest.rm.model.fileplancomponents;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.ALLOWABLE_OPERATIONS;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@@ -25,24 +25,61 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author Tuna Aksoy
* @since 1.0
*/
//FIXME: Once the fields have been added the JsonIgnoreProperties annotation should be removed
@JsonIgnoreProperties(ignoreUnknown = true)
public class FilePlanComponent
{
@JsonProperty (required = true)
private String id;
@JsonProperty (required = true)
private String parentId;
@JsonProperty (required = true)
private String name;
@JsonProperty (required = true)
private String nodeType;
@JsonProperty (required = true)
private boolean isCategory;
@JsonProperty (required = true)
private boolean isRecordFolder;
@JsonProperty (required = true)
private boolean isFile;
@JsonProperty
private boolean hasRetentionSchedule;
@JsonProperty(value = IS_CLOSED)
private boolean isClosed;
@JsonProperty
private boolean isCompleted;
@JsonProperty (required = true)
private List<String> aspectNames;
private FilePlanComponentCreatedByUser createdByUser;
@JsonProperty(PROPERTIES)
@JsonProperty (required = true)
private FilePlanComponentUserInfo createdByUser;
@JsonProperty(value = PROPERTIES, required = true)
private FilePlanComponentProperties properties;
@JsonProperty (ALLOWABLE_OPERATIONS)
@JsonProperty (value = ALLOWABLE_OPERATIONS)
private List<String> allowableOperations;
private FilePlanComponentPath path;
@JsonProperty (required = true)
private String modifiedAt;
@JsonProperty (required = true)
private String createdAt;
@JsonProperty (required = true)
private FilePlanComponentUserInfo modifiedByUser;
/**
* @return the id
@@ -207,7 +244,7 @@ public class FilePlanComponent
/**
* @return the createdByUser
*/
public FilePlanComponentCreatedByUser getCreatedByUser()
public FilePlanComponentUserInfo getCreatedByUser()
{
return this.createdByUser;
}
@@ -215,7 +252,7 @@ public class FilePlanComponent
/**
* @param createdByUser the createdByUser to set
*/
public void setCreatedByUser(FilePlanComponentCreatedByUser createdByUser)
public void setCreatedByUser(FilePlanComponentUserInfo createdByUser)
{
this.createdByUser = createdByUser;
}
@@ -227,4 +264,100 @@ public class FilePlanComponent
{
return this.allowableOperations;
}
/**
* @return the path
*/
public FilePlanComponentPath getPath()
{
return this.path;
}
/**
* @param path the path to set
*/
public void setPath(FilePlanComponentPath path)
{
this.path = path;
}
/**
* @param modifiedAt the modifiedAt to set
*/
public void setModifiedAt(String modifiedAt)
{
this.modifiedAt = modifiedAt;
}
/**
* @param createdAt the createdAt to set
*/
public void setCreatedAt(String createdAt)
{
this.createdAt = createdAt;
}
/**
* @param modifiedByUser the modifiedByUser to set
*/
public void setModifiedByUser(FilePlanComponentUserInfo modifiedByUser)
{
this.modifiedByUser = modifiedByUser;
}
/**
* @return the modifiedAt
*/
public String getModifiedAt()
{
return this.modifiedAt;
}
/**
* @return the createdAt
*/
public String getCreatedAt()
{
return this.createdAt;
}
/**
* @return the modifiedByUser
*/
public FilePlanComponentUserInfo getModifiedByUser()
{
return this.modifiedByUser;
}
/**
* @return the isClosed
*/
public boolean isClosed()
{
return this.isClosed;
}
/**
* @param closed the isClosed to set
*/
public void setClosed(boolean closed)
{
this.isClosed = closed;
}
/**
* @return the isCompleted
*/
public boolean isCompleted()
{
return this.isCompleted;
}
/**
* @param completed the isCompleted to set
*/
public void setCompleted(boolean completed)
{
this.isCompleted = completed;
}
}

View File

@@ -28,5 +28,9 @@ public class FilePlanComponentFields
public static final String PROPERTIES_VITAL_RECORD_INDICATOR = "rma:vitalRecordIndicator";
public static final String PROPERTIES_HOLD_REASON = "rma:holdReason";
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";
}

View File

@@ -0,0 +1,56 @@
/*
* #%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.model.fileplancomponents;
/**
* POJO for id/name pair
*
* @author Kristijan Conkas
* @since 1.0
*/
public class FilePlanComponentIdNamePair
{
public String id;
public String name;
/**
* @return the id
*/
public String getId()
{
return this.id;
}
/**
* @param id the id to set
*/
public void setId(String id)
{
this.id = id;
}
/**
* @return the name
*/
public String getName()
{
return this.name;
}
/**
* @param name the name to set
*/
public void setName(String name)
{
this.name = name;
}
}

View File

@@ -0,0 +1,78 @@
/*
* #%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.model.fileplancomponents;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* POJO for FilePlanComponent path parameter
* <br>
* @author Kristijan Conkas
* @since 1.0
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class FilePlanComponentPath
{
private String name;
private boolean isComplete;
private List<FilePlanComponentIdNamePair> elements;
/**
* @return the name
*/
public String getName()
{
return this.name;
}
/**
* @param name the name to set
*/
public void setName(String name)
{
this.name = name;
}
/**
* @return the isComplete
*/
public boolean isComplete()
{
return this.isComplete;
}
/**
* @param isComplete the isComplete to set
*/
public void setComplete(boolean isComplete)
{
this.isComplete = isComplete;
}
/**
* @return the elements
*/
public List<FilePlanComponentIdNamePair> getElements()
{
return this.elements;
}
/**
* @param elements the elements to set
*/
public void setElements(List<FilePlanComponentIdNamePair> elements)
{
this.elements = elements;
}
}

View File

@@ -13,9 +13,14 @@ package org.alfresco.rest.rm.model.fileplancomponents;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_HOLD_REASON;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SUPPLEMENTAL_MARKING_LIST;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE;
import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -26,9 +31,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @since 1.0
*/
//FIXME: Once the fields have been added the JsonIgnoreProperties annotation should be removed
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonIgnoreProperties (ignoreUnknown = true)
public class FilePlanComponentProperties
{
@JsonProperty(PROPERTIES_VITAL_RECORD_INDICATOR)
private boolean vitalRecord;
@@ -41,6 +47,16 @@ public class FilePlanComponentProperties
@JsonProperty(PROPERTIES_DESCRIPTION)
private String description;
@JsonProperty(PROPERTIES_SUPPLEMENTAL_MARKING_LIST)
private List<String> supplementalMarkingList;
@JsonProperty(PROPERTIES_REVIEW_PERIOD)
private ReviewPeriod reviewPeriod;
@JsonProperty(PROPERTIES_LOCATION)
private String location;
/**
* @return the vitalRecord
*/
@@ -104,4 +120,52 @@ public class FilePlanComponentProperties
{
return this.description;
}
/**
* @return the supplementalMarkingList
*/
public List<String> getSupplementalMarkingList()
{
return this.supplementalMarkingList;
}
/**
* @param supplementalMarkingList the supplementalMarkingList to set
*/
public void setSupplementalMarkingList(List<String> supplementalMarkingList)
{
this.supplementalMarkingList = supplementalMarkingList;
}
/**
* @return the reviewPeriod
*/
public ReviewPeriod getReviewPeriod()
{
return reviewPeriod;
}
/**
* @param reviewPeriod the reviewPeriod to set
*/
public void setReviewPeriod(ReviewPeriod reviewPeriod)
{
this.reviewPeriod = reviewPeriod;
}
/**
* @return the location
*/
public String getLocation()
{
return location;
}
/**
* @param location the location to set
*/
public void setLocation(String location)
{
this.location = location;
}
}

View File

@@ -17,7 +17,7 @@ package org.alfresco.rest.rm.model.fileplancomponents;
* @author Kristijan Conkas
* @since 1.0
*/
public class FilePlanComponentCreatedByUser
public class FilePlanComponentUserInfo
{
private String id;
private String displayName;

View File

@@ -0,0 +1,45 @@
package org.alfresco.rest.rm.model.fileplancomponents;
/**
* POJO for the review period
*
* @author Rodica Sutu
* @since 1.0
*/
public class ReviewPeriod
{
private String periodType;
private String expression;
/**
* @return the periodType
*/
public String getPeriodType()
{
return this.periodType;
}
/**
* @param periodType the periodType to set
*/
public void setPeriodType(String periodType)
{
this.periodType = periodType;
}
/**
* @return the expression
*/
public String getExpression()
{
return this.expression;
}
/**
* @param expression the expression to set
*/
public void setExpression(String expression)
{
this.expression = expression;
}
}

View File

@@ -53,7 +53,7 @@ public class RMSiteAPI extends RestAPI<RMSiteAPI>
{
return usingRestWrapper().processModel(RMSite.class, simpleRequest(
GET,
"sites/rm"
"ig-sites/rm"
));
}
@@ -77,7 +77,7 @@ public class RMSiteAPI extends RestAPI<RMSiteAPI>
return usingRestWrapper().processModel(RMSite.class, requestWithBody(
POST,
rmSiteProperties.toString(),
"sites"
"ig-sites"
));
}
@@ -96,7 +96,7 @@ public class RMSiteAPI extends RestAPI<RMSiteAPI>
{
usingRestWrapper().processEmptyModel(simpleRequest(
DELETE,
"sites/rm"
"ig-sites/rm"
));
}
@@ -121,7 +121,7 @@ public class RMSiteAPI extends RestAPI<RMSiteAPI>
return usingRestWrapper().processModel(RMSite.class, requestWithBody(
PUT,
rmSiteProperties.toString(),
"sites/rm"
"ig-sites/rm"
));
}
}