From 77b51ec5dc7e641c1e776b05a68049790c0d71d2 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Tue, 18 Jul 2006 15:04:50 +0000 Subject: [PATCH] Merged V1.3 to HEAD (3017:3020) svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3017 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3020 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3337 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/messages/patch-service.properties | 6 +++--- ...velGroupParentChildAssociationTypePatch.java | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/config/alfresco/messages/patch-service.properties b/config/alfresco/messages/patch-service.properties index 64d5461e5c..17eac74a1a 100644 --- a/config/alfresco/messages/patch-service.properties +++ b/config/alfresco/messages/patch-service.properties @@ -69,6 +69,6 @@ patch.scriptsFolder.result.exists=The scripts folder already exists: {0} patch.scriptsFolder.result.created=The scripts folder was successfully created: {0} patch.topLevelGroupParentChildAssociationTypePatch.description=Ensure top level groups have the correct child association type. -patch.topLevelGroupParentChildAssociationTypePatch.=Fixed top level groups child association type. - - +patch.topLevelGroupParentChildAssociationTypePatch.result=Fixed {0} top level groups child association types. +patch.topLevelGroupParentChildAssociationTypePatch.err.sys_path_not_found=Required authority system path not found: {0} +patch.topLevelGroupParentChildAssociationTypePatch.err.auth_path_not_found=Required authority path not found: {0} diff --git a/source/java/org/alfresco/repo/admin/patch/impl/TopLevelGroupParentChildAssociationTypePatch.java b/source/java/org/alfresco/repo/admin/patch/impl/TopLevelGroupParentChildAssociationTypePatch.java index 786c713334..6a552121ca 100644 --- a/source/java/org/alfresco/repo/admin/patch/impl/TopLevelGroupParentChildAssociationTypePatch.java +++ b/source/java/org/alfresco/repo/admin/patch/impl/TopLevelGroupParentChildAssociationTypePatch.java @@ -25,14 +25,14 @@ import org.alfresco.repo.admin.patch.AbstractPatch; import org.alfresco.repo.security.authority.AuthorityDAOImpl; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.cmr.repository.NodeService; -import org.alfresco.service.namespace.NamespacePrefixResolver; import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.RegexQNamePattern; public class TopLevelGroupParentChildAssociationTypePatch extends AbstractPatch { private static final String MSG_RESULT = "patch.topLevelGroupParentChildAssociationTypePatch.result"; + private static final String ERR_SYS_PATH_NOT_FOUND = "patch.topLevelGroupParentChildAssociationTypePatch.err.sys_path_not_found"; + private static final String ERR_AUTH_PATH_NOT_FOUND = "patch.topLevelGroupParentChildAssociationTypePatch.err.auth_path_not_found"; public TopLevelGroupParentChildAssociationTypePatch() { @@ -48,12 +48,15 @@ public class TopLevelGroupParentChildAssociationTypePatch extends AbstractPatch { if (!car.getTypeQName().equals(ContentModel.ASSOC_CHILDREN)) { - nodeService - .moveNode(car.getChildRef(), car.getParentRef(), ContentModel.ASSOC_CHILDREN, car.getQName()); + nodeService.moveNode( + car.getChildRef(), + car.getParentRef(), + ContentModel.ASSOC_CHILDREN, + car.getQName()); } } - return I18NUtil.getMessage(MSG_RESULT); + return I18NUtil.getMessage(MSG_RESULT, results.size()); } private NodeRef getAuthorityContainer() @@ -68,7 +71,7 @@ public class TopLevelGroupParentChildAssociationTypePatch extends AbstractPatch NodeRef sysNodeRef = null; if (results.size() == 0) { - throw new AlfrescoRuntimeException("Required authority system path not found: " + qnameAssocSystem); + throw new AlfrescoRuntimeException(ERR_SYS_PATH_NOT_FOUND, new Object[] {qnameAssocSystem}); } else { @@ -78,7 +81,7 @@ public class TopLevelGroupParentChildAssociationTypePatch extends AbstractPatch NodeRef authNodeRef = null; if (results.size() == 0) { - throw new AlfrescoRuntimeException("Required authority path not found: " + qnameAssocAuthorities); + throw new AlfrescoRuntimeException(ERR_AUTH_PATH_NOT_FOUND, new Object[] {qnameAssocAuthorities}); } else {