Merge branch 'master' of git.alfresco.com:records-management/records-management into feature/RM-4921_TestUpdates

This commit is contained in:
Rodica Sutu
2017-05-17 09:36:03 +03:00
3 changed files with 17 additions and 16 deletions

View File

@@ -39,22 +39,23 @@ import java.util.Map;
import java.util.Set;
import org.alfresco.query.PagingResults;
import org.alfresco.repo.activities.ActivityType;
import org.alfresco.repo.node.getchildren.FilterProp;
import org.alfresco.repo.node.integrity.IntegrityException;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.rest.api.impl.Util;
import org.alfresco.rest.api.model.UserInfo;
import org.alfresco.rest.framework.WebApiDescription;
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
import org.alfresco.rest.framework.resource.RelationshipResource;
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.rest.framework.webscripts.WithResponse;
import org.alfresco.rm.rest.api.impl.ApiNodesModelFactory;
import org.alfresco.rm.rest.api.impl.FilePlanComponentsApiUtils;
import org.alfresco.rm.rest.api.impl.SearchTypesFactory;
import org.alfresco.rm.rest.api.model.FilePlan;
import org.alfresco.rm.rest.api.model.Record;
import org.alfresco.rm.rest.api.model.RecordCategory;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
@@ -63,6 +64,7 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ParameterCheck;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.extensions.webscripts.servlet.FormData;
/**
* File plan children relation
@@ -72,7 +74,9 @@ import org.springframework.beans.factory.InitializingBean;
*/
@RelationshipResource(name="categories", entityResource = FilePlanEntityResource.class, title = "Category children of file plan")
public class FilePlanChildrenRelation implements RelationshipResourceAction.Read<RecordCategory>,
RelationshipResourceAction.Create<RecordCategory>, InitializingBean
RelationshipResourceAction.Create<RecordCategory>,
MultiPartRelationshipResourceAction.Create<RecordCategory>,
InitializingBean
{
/** Record category type */
public static final String RECORD_CATEGORY_TYPE = "rma:recordCategory";
@@ -218,4 +222,13 @@ public class FilePlanChildrenRelation implements RelationshipResourceAction.Read
return result;
}
/**
* @see org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction.Create#create(java.lang.String, org.springframework.extensions.webscripts.servlet.FormData, org.alfresco.rest.framework.resource.parameters.Parameters, org.alfresco.rest.framework.webscripts.WithResponse)
*/
@Override
public RecordCategory create(String entityResourceId, FormData formData, Parameters parameters, WithResponse withResponse)
{
throw new IntegrityException("Uploading records into file plan root is not allowed.", null);
}
}

View File

@@ -30,16 +30,13 @@ package org.alfresco.rm.rest.api.fileplans;
import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.checkNotBlank;
import static org.alfresco.util.ParameterCheck.mandatory;
import org.alfresco.repo.node.integrity.IntegrityException;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.rest.framework.WebApiDescription;
import org.alfresco.rest.framework.WebApiParam;
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
import org.alfresco.rest.framework.resource.EntityResource;
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.rest.framework.webscripts.WithResponse;
import org.alfresco.rm.rest.api.impl.ApiNodesModelFactory;
import org.alfresco.rm.rest.api.impl.FilePlanComponentsApiUtils;
import org.alfresco.rm.rest.api.model.FilePlan;
@@ -50,7 +47,6 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ParameterCheck;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.extensions.webscripts.servlet.FormData;
/**
* File plan entity resource
@@ -61,7 +57,6 @@ import org.springframework.extensions.webscripts.servlet.FormData;
@EntityResource(name = "file-plans", title = "File plans")
public class FilePlanEntityResource implements EntityResourceAction.ReadById<FilePlan>,
EntityResourceAction.Update<FilePlan>,
MultiPartRelationshipResourceAction.Create<FilePlan>,
InitializingBean
{
@@ -153,10 +148,4 @@ public class FilePlanEntityResource implements EntityResourceAction.ReadById<Fil
return nodesModelFactory.createFilePlan(info, parameters, null, false);
}
@Override
public FilePlan create(String entityResourceId, FormData formData, Parameters parameters, WithResponse withResponse)
{
throw new IntegrityException("Uploading records into file plan root is not allowed.", null);
}
}

View File

@@ -215,8 +215,7 @@ public class RecordCategoryChildrenRelation implements RelationshipResourceActio
}
@Override
public RecordCategoryChild create(String entityResourceId, FormData formData, Parameters parameters,
WithResponse withResponse)
public RecordCategoryChild create(String entityResourceId, FormData formData, Parameters parameters, WithResponse withResponse)
{
throw new IntegrityException("Uploading records into record categories is not allowed.", null);
}