mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged BRANCHES/V2.3 to HEAD:
95742: RM-1835 (Error is generated when giving access on a list to a user) 95746: RM-1867 (Reject rule works incorrect if set up in File Plan) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@95747 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -77,19 +77,25 @@ public final class FilePlanNamePathDataExtractor extends AbstractDataExtractor
|
||||
*/
|
||||
public Serializable extractData(Serializable value)
|
||||
{
|
||||
String extractedData = null;
|
||||
|
||||
NodeRef nodeRef = (NodeRef) value;
|
||||
|
||||
// Get path from the RM root
|
||||
List<NodeRef> nodeRefPath = filePlanService.getNodeRefPath(nodeRef);
|
||||
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
for (NodeRef pathNodeRef : nodeRefPath)
|
||||
if (nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT))
|
||||
{
|
||||
String name = (String)nodeService.getProperty(pathNodeRef, ContentModel.PROP_NAME);
|
||||
sb.append("/").append(name);
|
||||
// Get path from the RM root
|
||||
List<NodeRef> nodeRefPath = filePlanService.getNodeRefPath(nodeRef);
|
||||
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
for (NodeRef pathNodeRef : nodeRefPath)
|
||||
{
|
||||
String name = (String)nodeService.getProperty(pathNodeRef, ContentModel.PROP_NAME);
|
||||
sb.append("/").append(name);
|
||||
}
|
||||
|
||||
// Done
|
||||
extractedData = sb.toString();
|
||||
}
|
||||
|
||||
// Done
|
||||
return sb.toString();
|
||||
return extractedData;
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.caveat;
|
||||
|
||||
import static org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
@@ -992,31 +994,58 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
*/
|
||||
private String convertToJSONString(SimpleCache<String, Map<String, List<String>>> config)
|
||||
{
|
||||
JSONObject obj = new JSONObject();
|
||||
JSONObject configJSONObject = new JSONObject();
|
||||
|
||||
try
|
||||
Collection<String> listNames = config.getKeys();
|
||||
for (String listName : listNames)
|
||||
{
|
||||
Collection<String> listNames = config.getKeys();
|
||||
for(String listName : listNames)
|
||||
Map<String, List<String>> members = config.get(listName);
|
||||
|
||||
Set<String> authorityNames = members.keySet();
|
||||
JSONObject listMembers = new JSONObject();
|
||||
|
||||
for (String authorityName : authorityNames)
|
||||
{
|
||||
Map<String, List<String>> members = config.get(listName);
|
||||
|
||||
Set<String> authorityNames = members.keySet();
|
||||
JSONObject listMembers = new JSONObject();
|
||||
|
||||
for(String authorityName : authorityNames)
|
||||
List<String> authorities = members.get(authorityName);
|
||||
try
|
||||
{
|
||||
listMembers.put(authorityName, members.get(authorityName));
|
||||
listMembers.put(authorityName, authorities);
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Cannot add the key '");
|
||||
sb.append(authorityName);
|
||||
sb.append("' with the value '");
|
||||
sb.append(authorities);
|
||||
sb.append("' to the JSONObject 'listMembers' '");
|
||||
sb.append(listMembers);
|
||||
sb.append("': ");
|
||||
sb.append(getFullStackTrace(error));
|
||||
throw new AlfrescoRuntimeException(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
obj.put(listName, listMembers);
|
||||
try
|
||||
{
|
||||
configJSONObject.put(listName, listMembers);
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Cannot add the key '");
|
||||
sb.append(listName);
|
||||
sb.append("' with the value '");
|
||||
sb.append(listMembers);
|
||||
sb.append("' to the JSONObject 'configJSONObject' '");
|
||||
sb.append(configJSONObject);
|
||||
sb.append("': ");
|
||||
sb.append(getFullStackTrace(error));
|
||||
throw new AlfrescoRuntimeException(sb.toString());
|
||||
}
|
||||
}
|
||||
catch (JSONException je)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid caveat config syntax: "+ je);
|
||||
}
|
||||
return obj.toString();
|
||||
|
||||
return configJSONObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user