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

130165 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129774 gjames: SEARCH-113: Moving more api logic to helper classes, using a "trait" style


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130317 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:02:33 +00:00
parent a43d3a126f
commit c6dda1e7fa
26 changed files with 1521 additions and 1269 deletions

View File

@@ -39,6 +39,8 @@ import org.alfresco.rest.framework.jacksonextensions.JacksonHelper.Writer;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Paging;
import org.alfresco.rest.framework.resource.parameters.Params;
import org.alfresco.rest.framework.tools.RecognizedParamsExtractor;
import org.alfresco.rest.framework.tools.ResponseWriter;
import org.alfresco.rest.framework.webscripts.ApiWebScript;
import org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper;
import org.codehaus.jackson.JsonGenerationException;
@@ -56,7 +58,7 @@ import org.springframework.extensions.webscripts.WebScriptResponse;
* @author steveglover
*
*/
public class NetworksWebScriptGet extends ApiWebScript
public class NetworksWebScriptGet extends ApiWebScript implements RecognizedParamsExtractor, ResponseWriter
{
private Networks networks;
private ResourceWebScriptHelper helper;
@@ -82,7 +84,7 @@ public class NetworksWebScriptGet extends ApiWebScript
@Override
public Void execute() throws Throwable
{
final Paging paging = ResourceWebScriptHelper.findPaging(req);
final Paging paging = findPaging(req);
// apply content type
res.setContentType(Format.JSON.mimetype() + ";charset=UTF-8");
@@ -116,11 +118,11 @@ public class NetworksWebScriptGet extends ApiWebScript
}
catch (ApiException | WebScriptException apiException)
{
assistant.renderException(apiException, res);
renderException(apiException, res, assistant);
}
catch (RuntimeException runtimeException)
{
assistant.renderException(runtimeException, res);
renderException(runtimeException, res, assistant);
}
}
}