mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
"eventName": "${event.name}",
|
||||
"eventDisplayLabel": "${msg(event.displayLabel)}",
|
||||
"eventDisplayLabel": "${event.displayLabel}",
|
||||
"eventType":"${event.type}"
|
||||
}
|
||||
</#escape>
|
||||
|
@@ -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>
|
||||
|
@@ -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,8 +298,12 @@ 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 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)
|
||||
{
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -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"));
|
||||
|
||||
|
@@ -64,10 +64,14 @@ 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();
|
||||
@@ -98,6 +102,12 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase
|
||||
assertEquals(role2, roleObj.get("name"));
|
||||
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);
|
||||
|
Reference in New Issue
Block a user