As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
{ * name: "cx:language" * title: "Language" * defaultValues: "" * dataType: "d:text" * multiValued: true * mandatory: false * enforced: false * protected: false * indexed: true * indexedAtomically: true * constraints: [ ] * url: "/api/property/cx_language" }
….. ….. ….. <constraint name="cx:languageList" type="LIST"> <parameter name="allowedValues"> <list> <value>German</value> <value>English</value> <value>Russian</value> <value>Italian</value> <value>Turkish</value> <value>Czech</value> <value>Slovak</value> <value>Hungarian</value> <value>Serb</value> <value>Uzbek</value> <value>Spanish</value> </list> </parameter> </constraint> …. …. …. <property name="cx:language"> <title>Language</title> <type>d:text</type> <multiple>true</multiple> <constraints> <constraint ref="cx:languageList" /> </constraints> </property>
I use the Alfresco 3.3 Community Version on Debian Lenny
<#macro propertyDefJSON propertydefs> <#escape x as jsonUtils.encodeJSONString(x)> { <#if propertydefs.name?exists> "name" : "${propertydefs.name.toPrefixString()}", </#if> <#if propertydefs.title?exists> "title" : "${propertydefs.title}", </#if> <#if propertydefs.description?exists> "description" : "${propertydefs.description}", </#if> <#if propertydefs.defaultValues?exists> "defaultValues" : "${propertydefs.defaultValues}", <#else> "defaultValues" : "", </#if> <#if propertydefs.dataType?exists> "dataType" : "${propertydefs.dataType.name.toPrefixString()}", </#if> "multiValued" : ${propertydefs.multiValued?string}, "mandatory" : ${propertydefs.mandatory?string}, "enforced" : ${propertydefs.mandatoryEnforced?string}, "protected" : ${propertydefs.protected?string}, "indexed" : ${propertydefs.indexed?string}, "indexedAtomically" : ${propertydefs.indexedAtomically?string}, "constraints" : [<#– <#if propertydefs.constraints?exists> <#list propertydefs.constraints as constraintdefs> { <#assign keys = constraintdefs.getConstraint()?keys> <#list keys as key> <#if key == "expression"> "${key}" : <#if constraintdefs.getConstraint()[key]?exists>"${constraintdefs.getConstraint()[key]}" <#else>"has no value"</#if> </#if> <#if key_has_next>,</#if> </#list> }<#if constraintdefs_has_next>,</#if> </#list> </#if>–> ], "url" : "${"/api/property/" + propertydefs.name.toPrefixString()?replace(":","_")}" } </#escape> </#macro>
"restricValues" : [ <#if propertydefs.constraints?exists> <#list propertydefs.constraints as constraintdefs> <#list constraintdefs.getConstraint()?keys as key> <#if key == "getAllowedValues"> <#assign vals = constraintdefs.getConstraint().getAllowedValues()> <#list vals as val> "${val}" <#if val_has_next>,</#if> </#list> </#if> </#list> </#list> </#if> ]