mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
More d:locale property support
- Specific tests - Locale is persisted as a string of a more consistent nature git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -43,6 +43,10 @@ public interface ContentModel
|
||||
// tag for temporary nodes
|
||||
static final QName ASPECT_TEMPORARY = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "temporary");
|
||||
|
||||
// tag for temporary nodes
|
||||
static final QName ASPECT_LOCALIZED = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "localized");
|
||||
static final QName PROP_LOCALE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "locale");
|
||||
|
||||
// archived nodes aspect constants
|
||||
static final QName ASPECT_ARCHIVED = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archived");
|
||||
static final QName PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedOriginalParentAssoc");
|
||||
|
@@ -134,7 +134,12 @@ public class PropertyValue implements Cloneable, Serializable
|
||||
@Override
|
||||
Serializable convert(Serializable value)
|
||||
{
|
||||
return DefaultTypeConverter.INSTANCE.convert(String.class, value);
|
||||
String str = DefaultTypeConverter.INSTANCE.convert(String.class, value);
|
||||
if (value instanceof Locale && str.length() < 6)
|
||||
{
|
||||
str += "_";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
DATE
|
||||
|
@@ -1649,4 +1649,15 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
NodeRef checkHijRef = nodeService.getChildByName(checkAbcRef, ASSOC_TYPE_QNAME_TEST_CONTAINS, "hij");
|
||||
assertNull("Third level, named node 'HIJ' should not have been found", checkHijRef);
|
||||
}
|
||||
|
||||
public void testLocalizedAspect() throws Exception
|
||||
{
|
||||
nodeService.addAspect(
|
||||
rootNodeRef,
|
||||
ContentModel.ASPECT_LOCALIZED,
|
||||
Collections.<QName, Serializable>singletonMap(ContentModel.PROP_LOCALE, Locale.CANADA_FRENCH));
|
||||
// commit to check
|
||||
setComplete();
|
||||
endTransaction();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user