Various translations for RM-183

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@55749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2013-09-20 14:12:37 +00:00
parent c6d7e34f0c
commit e56eb422a4
8 changed files with 26 additions and 13 deletions

View File

@@ -110,15 +110,6 @@
</bean>
<!-- Event types -->
<bean id="rmEventResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.org_alfresco_module_rm.messages.rm-events</value>
</list>
</property>
</bean>
<bean id="rmEventType" init-method="init" abstract="true">
<property name="recordsManagementEventService" ref="recordsManagementEventService"/>
</bean>

View File

@@ -4,7 +4,7 @@
<#escape x as jsonUtils.encodeJSONString(x)>
{
"eventName": "${event.name}",
"eventDisplayLabel": "${msg(event.displayLabel)}",
"eventDisplayLabel": "${event.displayLabel}",
"eventType":"${event.type}"
}
</#escape>

View File

@@ -3,7 +3,7 @@
<#escape x as jsonUtils.encodeJSONString(x)>
{
"name": "${role.name}",
"displayLabel": "${msg(role.displayLabel)}",
"displayLabel": "${role.displayLabel}",
"capabilities":
{
<#list role.capabilities as capability>

View File

@@ -36,6 +36,7 @@ import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.util.ParameterCheck;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Records management event service implementation
@@ -297,7 +298,11 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
// Get the details of the event
String eventType = eventJSON.getString("eventType");
String eventName = eventJSON.getString("eventName");
String eventDisplayLabel = eventJSON.getString("eventDisplayLabel");
String translated = I18NUtil.getMessage(eventDisplayLabel);
if (translated!=null ) eventDisplayLabel = translated;
// Check that the eventType is valid
if (eventTypes.containsKey(eventType) == false)

View File

@@ -518,6 +518,8 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
String groupShortName = authorityService.getShortName(roleAuthority);
String name = getShortRoleName(groupShortName, rmRootNode);
String displayLabel = authorityService.getAuthorityDisplayName(roleAuthority);
String translated = I18NUtil.getMessage(displayLabel);
if (translated!=null ) displayLabel = translated;
Set<Capability> capabilities = getCapabilitiesImpl(rmRootNode, roleAuthority);
Role role = new Role(name, displayLabel, capabilities, roleAuthority, groupShortName);
@@ -559,6 +561,8 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
String groupShortName = authorityService.getShortName(roleAuthority);
String name = getShortRoleName(groupShortName, rmRootNode);
String displayLabel = authorityService.getAuthorityDisplayName(roleAuthority);
String translated = I18NUtil.getMessage(displayLabel);
if (translated!=null ) displayLabel = translated;
Set<Capability> capabilities = getCapabilitiesImpl(rmRootNode, roleAuthority);
Role role = new Role(name, displayLabel, capabilities, roleAuthority, groupShortName);

View File

@@ -24,6 +24,7 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.util.ParameterCheck;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Saved search details.
@@ -139,6 +140,8 @@ public class SavedSearchDetails extends ReportDetails
if (search.has(DESCRIPTION) == true)
{
description = search.getString(DESCRIPTION);
String translated = I18NUtil.getMessage(description);
if (translated!=null ) description = translated;
}
// Get the query

View File

@@ -365,7 +365,7 @@ public class DispositionRestApiTest extends BaseRMWebScriptTestCase implements R
assertEquals(1, events.length());
JSONObject event1 = events.getJSONObject(0);
assertEquals("case_closed", event1.get("name"));
assertEquals("rmevent.case_closed", event1.get("label"));
assertEquals("Case Closed", event1.get("label"));
assertFalse(event1.getBoolean("complete"));
assertFalse(event1.getBoolean("automatic"));

View File

@@ -64,11 +64,15 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase
{
String role1 = GUID.generate();
String role2 = GUID.generate();
String role3 = GUID.generate();
// Create a couple or roles by hand
filePlanRoleService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
filePlanRoleService.createRole(filePlan, role2, "My Test Role Too", getListOfCapabilities(5));
//The user can either enter a plain text label or a key to look up in a property file.
filePlanRoleService.createRole(filePlan, role3, "bootstrap.rmadmin.lastName", getListOfCapabilities(5));
// create test group
String groupName = GUID.generate();
String group = authorityService.createAuthority(AuthorityType.GROUP, groupName, "monkey", null);
@@ -99,6 +103,12 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase
assertEquals("My Test Role Too", roleObj.get("displayLabel"));
checkCapabilities(roleObj, 5);
//Custom role with a user entered message key
roleObj = roles.getJSONObject(role3);
assertNotNull(roleObj);
assertEquals(role3, roleObj.get("name"));
assertEquals("System Administrator", roleObj.get("displayLabel"));
// Get the roles, specifying the file plan
rsp = sendRequest(new GetRequest(getRoleUrlByFilePlan()),200);
rspContent = rsp.getContentAsString();