RM-510 (CLONE - RM Email Mapping tool behaves strangely)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0-BUG-FIX@42532 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2012-10-11 14:54:03 +00:00
parent 05d46df501
commit dd1bf82571

View File

@@ -53,17 +53,6 @@ public class EmailMapPost extends DeclarativeWebScript
JSONObject json = null;
json = new JSONObject(new JSONTokener(req.getContent().getContent()));
if(json.has("add"))
{
JSONArray toAdd = json.getJSONArray("add");
for(int i = 0 ; i < toAdd.length(); i++)
{
JSONObject val = toAdd.getJSONObject(i);
customEmailMappingService.addCustomMapping(val.getString("from"), val.getString("to"));
}
}
if(json.has("delete"))
{
JSONArray toDelete = json.getJSONArray("delete");
@@ -74,6 +63,16 @@ public class EmailMapPost extends DeclarativeWebScript
}
}
if(json.has("add"))
{
JSONArray toAdd = json.getJSONArray("add");
for(int i = 0 ; i < toAdd.length(); i++)
{
JSONObject val = toAdd.getJSONObject(i);
customEmailMappingService.addCustomMapping(val.getString("from"), val.getString("to"));
}
}
// Set the return value.
Set<CustomMapping> emailMap = customEmailMappingService.getCustomMappings();