Multilingual Content Fixes

- Fixed parsing of locale string to use I18NUtil.parseLocale and not Locale constructor
 - Fixed type conversion of properties returned from MLPropertyInterceptor's directNodeService
 - Fixed handling of ALL_LANGUAGES filter selection
 - Fixed MultilingualContentService NPE when checking for duplicate locales


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5007 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-02-02 00:09:20 +00:00
parent faee564ea2
commit 2a2ed653f1
2 changed files with 107 additions and 94 deletions

View File

@@ -217,12 +217,6 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// The aspect is present, so just ensure that the locale is correct
nodeService.setProperty(contentNodeRef, ContentModel.PROP_LOCALE, locale);
}
//get all the languages already there
Map<Locale, NodeRef> existingLanguages = this.getTranslations(mlContainerNodeRef);
if (existingLanguages.containsKey(locale))
{
throw new AlfrescoRuntimeException("Duplicate locale in document pool:" + locale.toString());
}
// Do we make use of an existing container?
if (mlContainerNodeRef == null)
@@ -232,6 +226,13 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
}
else
{
// Check that the language is not duplicated
Map<Locale, NodeRef> existingLanguages = this.getTranslations(mlContainerNodeRef);
if (existingLanguages.containsKey(locale))
{
throw new AlfrescoRuntimeException("Duplicate locale in document pool: " + locale);
}
// Use the existing container
nodeService.addChild(
mlContainerNodeRef,