mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126493 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 122640 gjames: RA-211: Renamed ResponseCallBack to WithResponse (because its not a callback) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126837 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,7 +30,7 @@ import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelation
|
|||||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.alfresco.util.ParameterCheck;
|
import org.alfresco.util.ParameterCheck;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.extensions.webscripts.servlet.FormData;
|
import org.springframework.extensions.webscripts.servlet.FormData;
|
||||||
@@ -113,7 +113,7 @@ public class NodeChildrenRelation implements RelationshipResourceAction.Read<Nod
|
|||||||
@Override
|
@Override
|
||||||
@WebApiDescription(title = "Upload file content and meta-data into the repository.")
|
@WebApiDescription(title = "Upload file content and meta-data into the repository.")
|
||||||
@WebApiParam(name = "formData", title = "A single form data", description = "A single form data which holds FormFields.")
|
@WebApiParam(name = "formData", title = "A single form data", description = "A single form data which holds FormFields.")
|
||||||
public Node create(String parentFolderNodeId, FormData formData, Parameters parameters, ResponseCallBack withResponse)
|
public Node create(String parentFolderNodeId, FormData formData, Parameters parameters, WithResponse withResponse)
|
||||||
{
|
{
|
||||||
return nodes.upload(parentFolderNodeId, formData, parameters);
|
return nodes.upload(parentFolderNodeId, formData, parameters);
|
||||||
}
|
}
|
||||||
|
@@ -27,11 +27,8 @@ package org.alfresco.rest.framework.resource.actions;
|
|||||||
|
|
||||||
import org.alfresco.rest.framework.core.HttpMethodSupport;
|
import org.alfresco.rest.framework.core.HttpMethodSupport;
|
||||||
import org.alfresco.rest.framework.core.ResourceWithMetadata;
|
import org.alfresco.rest.framework.core.ResourceWithMetadata;
|
||||||
import org.alfresco.rest.framework.resource.content.ContentInfo;
|
|
||||||
import org.alfresco.rest.framework.resource.parameters.Params;
|
import org.alfresco.rest.framework.resource.parameters.Params;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
|
||||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes an action in the system
|
* Executes an action in the system
|
||||||
@@ -47,6 +44,6 @@ public interface ActionExecutor extends HttpMethodSupport
|
|||||||
* @param params Params
|
* @param params Params
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable;
|
public Object executeAction(ResourceWithMetadata resource, Params params, WithResponse withResponse) throws Throwable;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
package org.alfresco.rest.framework.resource.actions.interfaces;
|
package org.alfresco.rest.framework.resource.actions.interfaces;
|
||||||
|
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.springframework.extensions.webscripts.servlet.FormData;
|
import org.springframework.extensions.webscripts.servlet.FormData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,6 +41,6 @@ public interface MultiPartRelationshipResourceAction
|
|||||||
*/
|
*/
|
||||||
public static interface Create<E> extends ResourceAction
|
public static interface Create<E> extends ResourceAction
|
||||||
{
|
{
|
||||||
public E create(String entityResourceId, FormData formData, Parameters parameters, ResponseCallBack withResponse);
|
public E create(String entityResourceId, FormData formData, Parameters parameters, WithResponse withResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
package org.alfresco.rest.framework.resource.actions.interfaces;
|
package org.alfresco.rest.framework.resource.actions.interfaces;
|
||||||
|
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.springframework.extensions.webscripts.servlet.FormData;
|
import org.springframework.extensions.webscripts.servlet.FormData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,6 +41,6 @@ public interface MultiPartResourceAction
|
|||||||
*/
|
*/
|
||||||
public static interface Create<E> extends ResourceAction
|
public static interface Create<E> extends ResourceAction
|
||||||
{
|
{
|
||||||
public E create(FormData formData, Parameters parameters, ResponseCallBack withResponse);
|
public E create(FormData formData, Parameters parameters, WithResponse withResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -152,7 +152,7 @@ public abstract class AbstractResourceWebScript extends ApiWebScript implements
|
|||||||
{
|
{
|
||||||
final String entityCollectionName = ResourceInspector.findEntityCollectionNameName(resource.getMetaData());
|
final String entityCollectionName = ResourceInspector.findEntityCollectionNameName(resource.getMetaData());
|
||||||
final ResourceOperation operation = resource.getMetaData().getOperation(getHttpMethod());
|
final ResourceOperation operation = resource.getMetaData().getOperation(getHttpMethod());
|
||||||
final ResponseCallBack callBack = new ResponseCallBack(operation.getSuccessStatus(),DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
final WithResponse callBack = new WithResponse(operation.getSuccessStatus(),DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
||||||
Object toReturn = transactionService.getRetryingTransactionHelper().doInTransaction(
|
Object toReturn = transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||||
new RetryingTransactionHelper.RetryingTransactionCallback<Object>()
|
new RetryingTransactionHelper.RetryingTransactionCallback<Object>()
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@ public abstract class AbstractResourceWebScript extends ApiWebScript implements
|
|||||||
setContentInfoOnResponse(res,contentInfo);
|
setContentInfoOnResponse(res,contentInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setResponse(final WebScriptResponse res, ResponseCallBack withResponse)
|
protected void setResponse(final WebScriptResponse res, WithResponse withResponse)
|
||||||
{
|
{
|
||||||
setResponse(res, withResponse.getStatus(), withResponse.getCache(), withResponse.getContentInfo(), withResponse.getHeaders());
|
setResponse(res, withResponse.getStatus(), withResponse.getCache(), withResponse.getContentInfo(), withResponse.getHeaders());
|
||||||
}
|
}
|
||||||
|
@@ -114,7 +114,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
|||||||
* @return anObject the result of the execute
|
* @return anObject the result of the execute
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse)
|
public Object executeAction(ResourceWithMetadata resource, Params params, WithResponse withResponse)
|
||||||
{
|
{
|
||||||
switch (resource.getMetaData().getType())
|
switch (resource.getMetaData().getType())
|
||||||
{
|
{
|
||||||
@@ -168,7 +168,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
|||||||
public Void execute(final ResourceWithMetadata resource, final Params params, final WebScriptResponse res, boolean isReadOnly)
|
public Void execute(final ResourceWithMetadata resource, final Params params, final WebScriptResponse res, boolean isReadOnly)
|
||||||
{
|
{
|
||||||
final ResourceOperation operation = resource.getMetaData().getOperation(HttpMethod.DELETE);
|
final ResourceOperation operation = resource.getMetaData().getOperation(HttpMethod.DELETE);
|
||||||
final ResponseCallBack callBack = new ResponseCallBack(operation.getSuccessStatus(),DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
final WithResponse callBack = new WithResponse(operation.getSuccessStatus(),DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
||||||
transactionService.getRetryingTransactionHelper().doInTransaction(
|
transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||||
new RetryingTransactionCallback<Void>()
|
new RetryingTransactionCallback<Void>()
|
||||||
{
|
{
|
||||||
|
@@ -25,11 +25,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.framework.webscripts;
|
package org.alfresco.rest.framework.webscripts;
|
||||||
|
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
|
||||||
import org.alfresco.rest.framework.core.ResourceInspector;
|
|
||||||
import org.alfresco.rest.framework.core.ResourceLocator;
|
import org.alfresco.rest.framework.core.ResourceLocator;
|
||||||
import org.alfresco.rest.framework.core.ResourceMetadata;
|
import org.alfresco.rest.framework.core.ResourceMetadata;
|
||||||
import org.alfresco.rest.framework.core.ResourceOperation;
|
|
||||||
import org.alfresco.rest.framework.core.ResourceWithMetadata;
|
import org.alfresco.rest.framework.core.ResourceWithMetadata;
|
||||||
import org.alfresco.rest.framework.core.exceptions.DeletedResourceException;
|
import org.alfresco.rest.framework.core.exceptions.DeletedResourceException;
|
||||||
import org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationException;
|
import org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationException;
|
||||||
@@ -40,17 +37,13 @@ import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAct
|
|||||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
|
||||||
import org.alfresco.rest.framework.resource.content.BinaryResource;
|
import org.alfresco.rest.framework.resource.content.BinaryResource;
|
||||||
import org.alfresco.rest.framework.resource.content.ContentInfo;
|
|
||||||
import org.alfresco.rest.framework.resource.content.NodeBinaryResource;
|
|
||||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Params;
|
import org.alfresco.rest.framework.resource.parameters.Params;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Params.RecognizedParams;
|
import org.alfresco.rest.framework.resource.parameters.Params.RecognizedParams;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
|
||||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,7 +117,7 @@ public class ResourceWebScriptGet extends AbstractResourceWebScript implements P
|
|||||||
* @return anObject the result of the execute
|
* @return anObject the result of the execute
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable
|
public Object executeAction(ResourceWithMetadata resource, Params params, WithResponse withResponse) throws Throwable
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (resource.getMetaData().getType())
|
switch (resource.getMetaData().getType())
|
||||||
|
@@ -637,7 +637,7 @@ public class ResourceWebScriptHelper
|
|||||||
paramFilter = filters.get(resourceKey);
|
paramFilter = filters.get(resourceKey);
|
||||||
}
|
}
|
||||||
final Params executionParams = Params.valueOf(paramFilter, uniqueEntityId, params.getRequest());
|
final Params executionParams = Params.valueOf(paramFilter, uniqueEntityId, params.getRequest());
|
||||||
final ResponseCallBack callBack = new ResponseCallBack(Status.STATUS_OK,ApiWebScript.DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
final WithResponse callBack = new WithResponse(Status.STATUS_OK,ApiWebScript.DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
||||||
//Read only because this only occurs for GET requests
|
//Read only because this only occurs for GET requests
|
||||||
Object result = executor.executeAction(resource, executionParams, callBack);
|
Object result = executor.executeAction(resource, executionParams, callBack);
|
||||||
return processAdditionsToTheResponse(null, api, null, executionParams, result);
|
return processAdditionsToTheResponse(null, api, null, executionParams, result);
|
||||||
|
@@ -28,9 +28,7 @@ package org.alfresco.rest.framework.webscripts;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
|
||||||
import org.alfresco.rest.framework.core.OperationResourceMetaData;
|
import org.alfresco.rest.framework.core.OperationResourceMetaData;
|
||||||
import org.alfresco.rest.framework.core.ResourceInspector;
|
|
||||||
import org.alfresco.rest.framework.core.ResourceInspectorUtil;
|
import org.alfresco.rest.framework.core.ResourceInspectorUtil;
|
||||||
import org.alfresco.rest.framework.core.ResourceLocator;
|
import org.alfresco.rest.framework.core.ResourceLocator;
|
||||||
import org.alfresco.rest.framework.core.ResourceMetadata;
|
import org.alfresco.rest.framework.core.ResourceMetadata;
|
||||||
@@ -48,10 +46,8 @@ import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
|||||||
import org.alfresco.rest.framework.resource.parameters.Params;
|
import org.alfresco.rest.framework.resource.parameters.Params;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Params.RecognizedParams;
|
import org.alfresco.rest.framework.resource.parameters.Params.RecognizedParams;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
|
||||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||||
import org.springframework.extensions.webscripts.WebScriptRequestImpl;
|
import org.springframework.extensions.webscripts.WebScriptRequestImpl;
|
||||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
|
||||||
import org.springframework.extensions.webscripts.servlet.FormData;
|
import org.springframework.extensions.webscripts.servlet.FormData;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
@@ -217,7 +213,7 @@ public class ResourceWebScriptPost extends AbstractResourceWebScript implements
|
|||||||
* @return anObject the result of the execute
|
* @return anObject the result of the execute
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable
|
public Object executeAction(ResourceWithMetadata resource, Params params, WithResponse withResponse) throws Throwable
|
||||||
{
|
{
|
||||||
final Object resObj = resource.getResource();
|
final Object resObj = resource.getResource();
|
||||||
|
|
||||||
|
@@ -30,8 +30,6 @@ import java.io.InputStream;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
|
||||||
import org.alfresco.rest.framework.core.ResourceInspector;
|
|
||||||
import org.alfresco.rest.framework.core.ResourceLocator;
|
import org.alfresco.rest.framework.core.ResourceLocator;
|
||||||
import org.alfresco.rest.framework.core.ResourceMetadata;
|
import org.alfresco.rest.framework.core.ResourceMetadata;
|
||||||
import org.alfresco.rest.framework.core.ResourceOperation;
|
import org.alfresco.rest.framework.core.ResourceOperation;
|
||||||
@@ -43,16 +41,13 @@ import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAct
|
|||||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
|
||||||
import org.alfresco.rest.framework.resource.content.BasicContentInfo;
|
import org.alfresco.rest.framework.resource.content.BasicContentInfo;
|
||||||
import org.alfresco.rest.framework.resource.content.BinaryResource;
|
|
||||||
import org.alfresco.rest.framework.resource.content.ContentInfoImpl;
|
import org.alfresco.rest.framework.resource.content.ContentInfoImpl;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Params;
|
import org.alfresco.rest.framework.resource.parameters.Params;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Params.RecognizedParams;
|
import org.alfresco.rest.framework.resource.parameters.Params.RecognizedParams;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
|
||||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
|
||||||
import org.springframework.extensions.webscripts.WrappingWebScriptRequest;
|
import org.springframework.extensions.webscripts.WrappingWebScriptRequest;
|
||||||
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest;
|
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
@@ -186,7 +181,7 @@ public class ResourceWebScriptPut extends AbstractResourceWebScript implements P
|
|||||||
* @return anObject the result of the execute
|
* @return anObject the result of the execute
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable
|
public Object executeAction(ResourceWithMetadata resource, Params params, WithResponse withResponse) throws Throwable
|
||||||
{
|
{
|
||||||
switch (resource.getMetaData().getType())
|
switch (resource.getMetaData().getType())
|
||||||
{
|
{
|
||||||
|
@@ -13,14 +13,14 @@ import java.util.Map;
|
|||||||
*
|
*
|
||||||
* @author Gethin James
|
* @author Gethin James
|
||||||
*/
|
*/
|
||||||
public class ResponseCallBack
|
public class WithResponse
|
||||||
{
|
{
|
||||||
private ContentInfo contentInfo;
|
private ContentInfo contentInfo;
|
||||||
private int status;
|
private int status;
|
||||||
private Map<String, String> headers;
|
private Map<String, String> headers;
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
public ResponseCallBack(int status, ContentInfo contentInfo, Cache cache)
|
public WithResponse(int status, ContentInfo contentInfo, Cache cache)
|
||||||
{
|
{
|
||||||
this.contentInfo = contentInfo;
|
this.contentInfo = contentInfo;
|
||||||
this.status = status;
|
this.status = status;
|
@@ -30,7 +30,7 @@ import org.alfresco.rest.framework.WebApiDescription;
|
|||||||
import org.alfresco.rest.framework.resource.EntityResource;
|
import org.alfresco.rest.framework.resource.EntityResource;
|
||||||
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
import org.springframework.extensions.webscripts.Status;
|
||||||
import org.springframework.extensions.webscripts.servlet.FormData;
|
import org.springframework.extensions.webscripts.servlet.FormData;
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ public class MultiPartTestEntityResource
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@WebApiDescription(title = "Creates a multipart", successStatus = Status.STATUS_ACCEPTED)
|
@WebApiDescription(title = "Creates a multipart", successStatus = Status.STATUS_ACCEPTED)
|
||||||
public MultiPartTestResponse create(FormData formData, Parameters parameters, ResponseCallBack withResponse)
|
public MultiPartTestResponse create(FormData formData, Parameters parameters, WithResponse withResponse)
|
||||||
{
|
{
|
||||||
return new MultiPartTestResponse(formData.getParameters().get("filename")[0]);
|
return new MultiPartTestResponse(formData.getParameters().get("filename")[0]);
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ package org.alfresco.rest.framework.tests.api.mocks;
|
|||||||
import org.alfresco.rest.framework.resource.RelationshipResource;
|
import org.alfresco.rest.framework.resource.RelationshipResource;
|
||||||
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.springframework.extensions.webscripts.servlet.FormData;
|
import org.springframework.extensions.webscripts.servlet.FormData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +42,7 @@ public class MultiPartTestRelationshipResource
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MultiPartTestResponse create(String entityResourceId, FormData formData,
|
public MultiPartTestResponse create(String entityResourceId, FormData formData,
|
||||||
Parameters parameters, ResponseCallBack withResponse)
|
Parameters parameters, WithResponse withResponse)
|
||||||
{
|
{
|
||||||
return new MultiPartTestResponse(formData.getParameters().get("filename")[0]);
|
return new MultiPartTestResponse(formData.getParameters().get("filename")[0]);
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@ import org.alfresco.rest.framework.resource.parameters.Params;
|
|||||||
import org.alfresco.rest.framework.webscripts.AbstractResourceWebScript;
|
import org.alfresco.rest.framework.webscripts.AbstractResourceWebScript;
|
||||||
import org.alfresco.rest.framework.webscripts.ApiWebScript;
|
import org.alfresco.rest.framework.webscripts.ApiWebScript;
|
||||||
import org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper;
|
import org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper;
|
||||||
import org.alfresco.rest.framework.webscripts.ResponseCallBack;
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -52,7 +52,7 @@ public abstract class AbstractContextTest
|
|||||||
|
|
||||||
static Params NOT_USED = Params.valueOf("notUsed", null, mock(WebScriptRequest.class));
|
static Params NOT_USED = Params.valueOf("notUsed", null, mock(WebScriptRequest.class));
|
||||||
static final Params.RecognizedParams NULL_PARAMS = new Params.RecognizedParams(null, null, null, null, null, null, null, false);
|
static final Params.RecognizedParams NULL_PARAMS = new Params.RecognizedParams(null, null, null, null, null, null, null, false);
|
||||||
static final ResponseCallBack callBack = new ResponseCallBack(Status.STATUS_OK, ApiWebScript.DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
static final WithResponse callBack = new WithResponse(Status.STATUS_OK, ApiWebScript.DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
|
||||||
static Api api = Api.valueOf("alfrescomock", "private", "1");
|
static Api api = Api.valueOf("alfrescomock", "private", "1");
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
Reference in New Issue
Block a user