[MNT-14087] Properties with localized constraints are not correctly rendered when using metadata-templates in documentlibrary Created: 30-Jan-14  Updated: 12-Jul-16  Resolved: 12-Jul-16

Status: Closed
Project: Service Packs and Hot Fixes
Component/s: Share Application
Affects Version/s: 4.2.4
Fix Version/s: None

Type: Service Pack Request
Reporter: Douglas Cassiano Rodrigues Paes Assignee: Closed Issues
Resolution: Not a bug Votes: 2
Labels: CommunityPainPoints
Remaining Estimate: 0 minutes
Time Spent: 4 hours
Original Estimate: Not Specified
Environment:

Alfresco Community 4.2.f
Tomcat 7
Ubuntu 14.04


Attachments: XML File example-model-context.xml     File exampleModel.properties     XML File exampleModel.xml    
Bug Priority:
Category 3
ACT Numbers:

00396976


 Description   

I'm trying to use a localized list contraint to use in my customization.

I've defined a constraint like this:

<constraint name="my:gender" type="LIST">
<parameter name="allowedValues">
<list>
<value>male</value>
<value>female</value>
</list>
</parameter>
</constraint>

And the localization is like this
listconstraint.my_gender.male=Male
listconstraint.my_gender.female=Female

If I add the custom field using that list constraint in a metadata-template, like bellow, the documentLibrary component always shows the internal value (male/female) and not the localized ones (Male/Female).

<line index="10" id="customField">

{test:myCustomField prop.myCustomField}

</line>

In all the others forms (view properties, edit properties, create new document), the property is correctly shown.

The problem only happens in documentLibrary list.



 Comments   
Comment by Douglas Cassiano Rodrigues Paes [ 05-Jul-15 ]

I've just faced a new problem with constrainst, and the solution shown here http://www.seedim.com.au/content/alfresco-list-constraints-and-repeating-metadata-fields-commas wont work because of this one.

Comment by Jennie Soria [X] (Inactive) [ 05-Nov-15 ]

Current workaround with constraint properties defined in localized i18n properties for list constraints, then used in the metadata template syntax:

msg.get(properties["my_gender:male"])

Generated at Sun Mar 07 18:38:20 GMT 2021 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.