mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'feature/RM-5457_AutomateAC' into feature/RM-5458_Tests_Prevent_FolderClassification
# Conflicts: # rm-enterprise/rm-enterprise-repo/src/main/amp/config/alfresco/module/alfresco-rm-enterprise-repo/messages/classified-content/classified-content.properties
This commit is contained in:
@@ -26,11 +26,12 @@
|
||||
*/
|
||||
package org.alfresco.rest.rm.community.model.common;
|
||||
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
/**
|
||||
* POJO for owner parameter
|
||||
@@ -43,6 +44,7 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
@JsonIgnoreProperties (ignoreUnknown = true)
|
||||
public class Owner extends TestModel
|
||||
{
|
||||
|
||||
|
@@ -30,7 +30,10 @@ import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.alfresco.rest.core.IRestModel;
|
||||
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||
import org.alfresco.rest.model.RestByUserModel;
|
||||
import org.alfresco.rest.model.RestNodeModel;
|
||||
import org.alfresco.rest.rm.community.model.common.Path;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
@@ -51,7 +54,7 @@ import lombok.NoArgsConstructor;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Record extends TestModel
|
||||
public class Record extends TestModel implements IRestModel<RestNodeModel>
|
||||
{
|
||||
public final static String CONTENT_NODE_TYPE = "cm:content";
|
||||
|
||||
@@ -102,4 +105,25 @@ public class Record extends TestModel
|
||||
|
||||
@JsonProperty
|
||||
private Path path;
|
||||
|
||||
@Override
|
||||
public ModelAssertion<RestNodeModel> assertThat()
|
||||
{
|
||||
return new ModelAssertion<RestNodeModel>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAssertion<RestNodeModel> and()
|
||||
{
|
||||
return assertThat();
|
||||
}
|
||||
|
||||
@JsonProperty (value = "entry")
|
||||
RestNodeModel model;
|
||||
|
||||
@Override
|
||||
public RestNodeModel onModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
@@ -114,6 +114,35 @@ public class RecordsAPI extends BaseAPI
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reject the record given as parameter
|
||||
*
|
||||
* @param user the user declaring the document as record
|
||||
* @param password the user's password
|
||||
* @param recordName the record name
|
||||
* @param reason reject reason
|
||||
* @return true if the action completed successfully
|
||||
*/
|
||||
public boolean rejectRecord(String user, String password, String recordName, String reason)
|
||||
{
|
||||
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, recordName);
|
||||
|
||||
try
|
||||
{
|
||||
JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("name", "reject");
|
||||
requestParams.put("nodeRef", recNodeRef);
|
||||
requestParams.put("params",new JSONObject()
|
||||
.put("reason",reason));
|
||||
|
||||
return doPostJsonRequest(user, password, requestParams, RM_ACTIONS_API);
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
LOGGER.error("Unable to extract response parameter", error);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Declare document version as record
|
||||
*
|
||||
|
Reference in New Issue
Block a user