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,11 +94,14 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
return null; return null;
} }
StringBuilder sb = new StringBuilder(100);
// Get the rm root // Get the rm root
NodeRef rmRootNodeRef = filePlanService.getFilePlan(nodeRef); NodeRef rmRootNodeRef = filePlanService.getFilePlan(nodeRef);
if (rmRootNodeRef != null)
{
Set<Role> roles = filePlanRoleService.getRolesByUser(rmRootNodeRef, user); Set<Role> roles = filePlanRoleService.getRolesByUser(rmRootNodeRef, user);
StringBuilder sb = new StringBuilder(100);
for (Role role : roles) for (Role role : roles)
{ {
if (sb.length() > 0) if (sb.length() > 0)
@@ -107,6 +110,7 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
} }
sb.append(role.getDisplayLabel()); sb.append(role.getDisplayLabel());
} }
}
// Done // Done
return sb.toString(); return sb.toString();

View File

@@ -93,16 +93,19 @@ public final class FilePlanNamePathDataExtractor extends AbstractDataExtractor
try try
{ {
NodeRef nodeRef = (NodeRef) value; NodeRef nodeRef = (NodeRef) value;
StringBuilder sb = new StringBuilder(128);
if (nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT))
{
// Get path from the RM root // Get path from the RM root
List<NodeRef> nodeRefPath = filePlanService.getNodeRefPath(nodeRef); List<NodeRef> nodeRefPath = filePlanService.getNodeRefPath(nodeRef);
StringBuilder sb = new StringBuilder(128);
for (NodeRef pathNodeRef : nodeRefPath) for (NodeRef pathNodeRef : nodeRefPath)
{ {
String name = (String)nodeService.getProperty(pathNodeRef, ContentModel.PROP_NAME); String name = (String)nodeService.getProperty(pathNodeRef, ContentModel.PROP_NAME);
sb.append("/").append(name); sb.append("/").append(name);
} }
}
// Done // Done
extractedData = sb.toString(); extractedData = sb.toString();

View File

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