From 77e9c0fa4d38d3e0860e759e020dfeb44923cb2b Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Tue, 24 Sep 2013 05:03:57 +0000 Subject: [PATCH] RM-183: All Language Packs: translation errors - Records Management site * role groups wheren't being created with the resolved display label * I18N'ed the name of the 'all roles' group git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@55870 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../messages/rm-system.properties | 3 ++- .../role/FilePlanRoleServiceImpl.java | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/rm-system.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/rm-system.properties index 77e14423bb..f50c8d5eab 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/rm-system.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/rm-system.properties @@ -10,4 +10,5 @@ rm.role.user=Records Management User rm.role.powerUser=Records Management Power User rm.role.securityOfficer=Records Management Security Officer rm.role.recordsManager=Records Management Records Manager -rm.role.administrator=Records Management Administrator \ No newline at end of file +rm.role.administrator=Records Management Administrator +rm.role.all=All Records Management Roles \ No newline at end of file diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java index a2f83f8bfe..50e545acfe 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/role/FilePlanRoleServiceImpl.java @@ -79,6 +79,10 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, /** I18N */ private static final String MSG_FIRST_NAME = "bootstrap.rmadmin.firstName"; private static final String MSG_LAST_NAME = "bootstrap.rmadmin.lastName"; + private static final String MSG_ALL_ROLES = "rm.role.all"; + + /** Location of bootstrap role JSON */ + private static final String BOOTSTRAP_ROLE_JSON_LOCATION = "alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json"; /** Capability service */ private CapabilityService capabilityService; @@ -249,7 +253,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, String allRoles = authorityService.createAuthority( AuthorityType.GROUP, getAllRolesGroupShortName(rmRootNode), - "All Roles", + I18NUtil.getMessage(MSG_ALL_ROLES), new HashSet(Arrays.asList(RMAuthority.ZONE_APP_RM))); // Set the permissions @@ -332,7 +336,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, try { // Load up the default roles from JSON - InputStream is = getClass().getClassLoader().getResourceAsStream("alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json"); + InputStream is = getClass().getClassLoader().getResourceAsStream(BOOTSTRAP_ROLE_JSON_LOCATION); if (is == null) { throw new AlfrescoRuntimeException("Could not load default bootstrap roles configuration"); @@ -725,7 +729,15 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService, Set zones = new HashSet(2); zones.add(getZoneName(rmRootNode)); zones.add(RMAuthority.ZONE_APP_RM); - String roleGroup = authorityService.createAuthority(AuthorityType.GROUP, fullRoleName, roleDisplayLabel, zones); + + // Look up string, default to passed value if none found + String groupDisplayLabel = I18NUtil.getMessage(roleDisplayLabel); + if (groupDisplayLabel == null) + { + groupDisplayLabel = roleDisplayLabel; + } + + String roleGroup = authorityService.createAuthority(AuthorityType.GROUP, fullRoleName, groupDisplayLabel, zones); // Add the roleGroup to the "all" role group String allRoleGroup = authorityService.getName(AuthorityType.GROUP, getAllRolesGroupShortName(rmRootNode));