mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Dynamic Models - minor, validate message resource bundle exists in repo
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8055 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -323,29 +323,14 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
|
||||
|
||||
for (NodeRef messageResource : nodeRefs)
|
||||
{
|
||||
String name = (String) nodeService.getProperty(
|
||||
String resourceName = (String) nodeService.getProperty(
|
||||
messageResource, ContentModel.PROP_NAME);
|
||||
|
||||
// convert resource file name to a resource bundle basename
|
||||
// e.g. either 'workflow_fr_FR.properties' or 'workflow.properties' should be converted to 'workflow'
|
||||
// note: this assumes that the baseName itself does not contain underscore !
|
||||
int idx = name.indexOf("_");
|
||||
if (idx > 0)
|
||||
|
||||
String bundleBaseName = messageService.getBaseBundleName(resourceName);
|
||||
|
||||
if (!resourceBundleBaseNames.contains(bundleBaseName))
|
||||
{
|
||||
name = name.substring(0, idx - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int idx1 = name.indexOf(".");
|
||||
if (idx1 > 0)
|
||||
{
|
||||
name = name.substring(0, idx1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!resourceBundleBaseNames.contains(name))
|
||||
{
|
||||
resourceBundleBaseNames.add(name);
|
||||
resourceBundleBaseNames.add(bundleBaseName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user