Merged modules/recordsmanagement/BRANCHES/V2.0-BUG-FIX to modules/recordsmanagement/BRANCHES/V2.0

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

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@42564 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2012-10-12 09:51:24 +00:00
parent 296172eb7d
commit 5cb2fb1f51

View File

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