cancel
Showing results for 
Search instead for 
Did you mean: 

Ensure values of a certain category only

agericke
Champ in-the-making
Champ in-the-making
Hi there,
I'm defining my own custom model (Alfresco 1.3.0). I have a property 'lang' which can take one of the following enumeration values: 'eng', 'ger', 'fre'. I set the property type to 'd:category'. The root category for the enumeration values would be something like 'language'. Since I'm also having other classifications (e.g. 'documentType') I would like to ensure that my 'lang' property only gets values of category 'language' assigned.

I customized the 'add content wizard' in the Alfresco Web Client in order to display a field 'Lang' on the 'Modify content Properties' page but then the user can assign any existing category value. Is there a way to ensure that my 'lang' property gets only values of category 'language' assigned? Or is there a workaround using a datatype other than 'd:category' for enumerations?

Thanx a lot,

Alex
3 REPLIES 3

agericke
Champ in-the-making
Champ in-the-making
Hi there,
I see that there are constraints on property values (e.g. numerical ranges or reg exps). Are there also constraints to limit the values of 'd:category' properties?

The list constraint would solve my problem but as I read in the Alfresco Roadmap, Version 1.4 will provide browsing by categories so text properties with list constrains won't work then, I guess.

I haven't gotten any answers to my original question. Is my question too basic or too exotic? Please give me a hint.

Cheers,
Alex

dbevacqua
Champ in-the-making
Champ in-the-making
Custom constraints are your friend:

http://wiki.alfresco.com/wiki/Constraints

Hope this helps.

Dominic.

agericke
Champ in-the-making
Champ in-the-making
Hi Dominic,
thank you for your reply.

Alex