cancel
Showing results for 
Search instead for 
Did you mean: 

Localizing String for drop down search option not working

bisana
Champ on-the-rise
Champ on-the-rise
Hi
I have tried doing Document Type, added few properties, able to apply the document type to documents and save the selected document type properties and I am able to search for the selected document type and display the documents in advanced search.
"https://forums.alfresco.com/en/viewtopic.php?f=48&t=44362&p=130386#p130386".

I have uploaded my screen shot of the advanced search option after selecting the document type at
http://oss101.com/dm/advancedSearch.png
My issue is that for the drop down option name I am not able to localize strings, I had observed that only for the drop down fields it is not taking value from xxModel.properties
Advice requested
Thanks
Joseph John
8 REPLIES 8

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
The ability to localize constraint values is new to version 4 (see JIRA: https://issues.alfresco.com/jira/browse/ALF-9514).

You need to add labels for the constraint values in the model for your property. E.g. like this in bpmModel.properties:

listconstraint.bpm_allowedPriority.1=High

bisana
Champ on-the-rise
Champ on-the-rise
Hi Arnold
Thanks for the reply, I am trying to localize the strings as shown in the link http://oss101.com/dm/advancedSearch.png 
When I checked bpmModel.xml , I found out that it is for business process model . I got confused over here.
Guidance requested
Thanks
Joseph John

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
If you add labels for those values in the message bundle associated to the model that defines your Ig namespace, then it should work, if those list properties get their values from a regular LIST constraint in that model.

If you use some other mechanism to get them, i.e. by calling some custom business logic, then you'll probably need a custom labeling mechanism as well, e.g. one that matches labels based on a naming convention (e.g. Ig_nameofparty.Party_A, etc.).

(Note: You can find info on registering the resource bundle here: http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Registering_a_Model_Resource_Bundle)

bisana
Champ on-the-rise
Champ on-the-rise
Hi Arnold
I guess I have not  explained correctly, my problem is not the value in the drop down, my problem is that the label-id which I have defined in "share-config-custom.xml"  and in  "myModel.properties" is not getting resolved at the advance search option screen as shown with marked/shaded area in the my http://www.oss101.com/dm/advancedSearch.png
the fields which has to be resolved are "lg:nameofparty, lgSmiley Tongueurpose, lg:governinglaw,lgSmiley Surprisedrgin,lg:category" as shown in the above url
In my "share-config-custom.xml" , I have

<field id="lg:nameofparty(ex.custom:prop)" label-id="assoc.lg_nameofparty" >
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="lg:purpose(ex.custom:prop)" label-id="assoc.lg_purpose"  >
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="lg:governinglaw(ex.custom:prop)"  label-id="assoc.lg_governinglaw">
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="lg:orgin(ex.custom:prop)" label-id="assoc.lg_orgin" >
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="lg:category(ex.custom:prop)" label-id="assoc.lg_category" >
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>


Hope I am able to explain it more clearly
Thanks
Joseph John

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
Ok, sorry, that wasn't clear to me. Looking at the code snippet I think the '(ex.customSmiley Tonguerop)' suffix won't work.. (at least not on the 4.0.b that I am using…don't know about 4.0.d) Should be just id="lg:nameofparty", etc.

bisana
Champ on-the-rise
Champ on-the-rise
Thanks for the mail
If is only ""lg:nameofparty", I wont be able to display the search option in drop down menu.
please check my former post https://forums.alfresco.com/en/viewtopic.php?f=48&t=44362 about the drop down option
Thanks
Joseph John

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
Hmm, I don't know this notation of id's and can't find info on it on the wiki. I think mitpatoliya in the other thread might have included it as sample text (i.e. property id = customSmiley Tonguerop = lg:nameofparty).
If you make the id="lg:nameofparty" then the label-id should work. You can localize the list values in the message bundle, but you can also specify value/label pairs in the form definition on the selectone form control, by setting the 'options' controlparameter. See: http://wiki.alfresco.com/wiki/Forms#selectone.ftl.
In the model you can specify the default value for the list property as well.

ctan
Champ in-the-making
Champ in-the-making
Just my two cents, may not apply here. Generally speaking, depending on situation, option values inside the dropdown list
<control .. selectone.ftl" />
may be fetched from a resource bundle in a different context to its field label
<field .. label-id= ..>
.  Eg. the select option values could come from a resource bundle in Alfresco's Spring context if EnumParameterConstraint is used while the actual label could come from a resource bundle sitting in Share's Spring context.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.