RM-825 (Records Search by XSS query works wrong)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@54092 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2013-08-14 19:36:33 +00:00
parent b446ae8e07
commit 0ced9a82ba
2 changed files with 106 additions and 95 deletions

View File

@@ -1,5 +1,6 @@
<#escape x as jsonUtils.encodeJSONString(x)> <#escape x as jsonUtils.encodeJSONString(x)>
{ {
<#if !errorMessage??>
"items": "items":
[ [
<#list items as item> <#list items as item>
@@ -40,5 +41,8 @@
}<#if item_has_next>,</#if> }<#if item_has_next>,</#if>
</#list> </#list>
] ]
<#else>
"errorMessage": "${errorMessage}"
</#if>
} }
</#escape> </#escape>

View File

@@ -161,6 +161,9 @@ public class RMSearchGet extends DeclarativeWebScript
*/ */
@Override @Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, Object> model = new HashMap<String, Object>(1);
try
{ {
// Get the site id and confirm it is valid // Get the site id and confirm it is valid
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars(); Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
@@ -216,8 +219,12 @@ public class RMSearchGet extends DeclarativeWebScript
} }
// Return model // Return model
Map<String, Object> model = new HashMap<String, Object>(1);
model.put("items", items); model.put("items", items);
}
catch (Exception ex)
{
model.put("errorMessage", ex.toString());
}
return model; return model;
} }