Audit related errors seen on console that had no side effect cleaned up

* discovered whilst testing RM-1835



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97109 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2015-02-16 03:10:25 +00:00
parent 552359138e
commit 6817585c22
3 changed files with 21 additions and 14 deletions

View File

@@ -94,18 +94,22 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
return null;
}
StringBuilder sb = new StringBuilder(100);
// Get the rm root
NodeRef rmRootNodeRef = filePlanService.getFilePlan(nodeRef);
Set<Role> roles = filePlanRoleService.getRolesByUser(rmRootNodeRef, user);
StringBuilder sb = new StringBuilder(100);
for (Role role : roles)
if (rmRootNodeRef != null)
{
if (sb.length() > 0)
Set<Role> roles = filePlanRoleService.getRolesByUser(rmRootNodeRef, user);
for (Role role : roles)
{
sb.append(", ");
if (sb.length() > 0)
{
sb.append(", ");
}
sb.append(role.getDisplayLabel());
}
sb.append(role.getDisplayLabel());
}
// Done

View File

@@ -93,15 +93,18 @@ public final class FilePlanNamePathDataExtractor extends AbstractDataExtractor
try
{
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);
for (NodeRef pathNodeRef : nodeRefPath)
{
String name = (String)nodeService.getProperty(pathNodeRef, ContentModel.PROP_NAME);
sb.append("/").append(name);
}
}
// Done

View File

@@ -467,7 +467,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
// Prepend it to the path
nodeRefPath.addFirst(nodeRef);
// Are we not at the root
if (!isFilePlan(nodeRef))
if (!isFilePlan(nodeRef) && isFilePlanComponent(nodeRef))
{
ChildAssociationRef assocRef = nodeService.getPrimaryParent(nodeRef);
if (assocRef == null)