Merged HEAD (5.2) to 5.2.N (5.2.1)

126488 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      122630 gjames: RA-211: Moving the response callback down a level


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126832 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:42:52 +00:00
parent c0ca44c822
commit b5a0388b74
7 changed files with 12 additions and 10 deletions

View File

@@ -159,7 +159,7 @@ public abstract class AbstractResourceWebScript extends ApiWebScript implements
public Object execute() throws Throwable
{
Object result = executeAction(resource, params);
Object result = executeAction(resource, params, callBack);
if (result instanceof BinaryResource)
{
return result; //don't postprocess it.
@@ -171,8 +171,6 @@ public abstract class AbstractResourceWebScript extends ApiWebScript implements
return toReturn;
}
public abstract Object executeAction(ResourceWithMetadata resource, Params params) throws Throwable;
protected void streamResponse(final WebScriptRequest req, final WebScriptResponse res, BinaryResource resource) throws IOException
{
if (resource instanceof FileBinaryResource)

View File

@@ -113,7 +113,8 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
* @param params parameters to use
* @return anObject the result of the execute
*/
public Object executeAction(ResourceWithMetadata resource, Params params)
@Override
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse)
{
switch (resource.getMetaData().getType())
{
@@ -174,7 +175,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
@Override
public Void execute() throws Throwable
{
executeAction(resource, params); //ignore return result
executeAction(resource, params, callBack); //ignore return result
return null;
}
}, false, true);

View File

@@ -124,7 +124,7 @@ public class ResourceWebScriptGet extends AbstractResourceWebScript implements P
* @return anObject the result of the execute
*/
@Override
public Object executeAction(ResourceWithMetadata resource, Params params) throws Throwable
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable
{
switch (resource.getMetaData().getType())

View File

@@ -77,6 +77,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.map.JsonMappingException;
import org.springframework.beans.BeanUtils;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
import org.springframework.http.HttpMethod;
@@ -636,8 +637,9 @@ public class ResourceWebScriptHelper
paramFilter = filters.get(resourceKey);
}
final Params executionParams = Params.valueOf(paramFilter, uniqueEntityId, params.getRequest());
final ResponseCallBack callBack = new ResponseCallBack(Status.STATUS_OK,ApiWebScript.DEFAULT_JSON_CONTENT,ApiWebScript.CACHE_NEVER);
//Read only because this only occurs for GET requests
Object result = executor.executeAction(resource, executionParams);
Object result = executor.executeAction(resource, executionParams, callBack);
return processAdditionsToTheResponse(null, api, null, executionParams, result);
}
catch(NotFoundException e)

View File

@@ -217,7 +217,7 @@ public class ResourceWebScriptPost extends AbstractResourceWebScript implements
* @return anObject the result of the execute
*/
@Override
public Object executeAction(ResourceWithMetadata resource, Params params) throws Throwable
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable
{
final Object resObj = resource.getResource();

View File

@@ -186,7 +186,7 @@ public class ResourceWebScriptPut extends AbstractResourceWebScript implements P
* @return anObject the result of the execute
*/
@Override
public Object executeAction(ResourceWithMetadata resource, Params params) throws Throwable
public Object executeAction(ResourceWithMetadata resource, Params params, ResponseCallBack withResponse) throws Throwable
{
switch (resource.getMetaData().getType())
{