cancel
Showing results for 
Search instead for 
Did you mean: 

Constraints

dbevacqua
Champ in-the-making
Champ in-the-making
Hi

Is it possible to find out programmatically what constraints are defined for a given property? Also what the parameter values are for constraints.

The reason is that I would like to be able to offer users different categories depending on what property they are setting e.g. when they set the value of the 'region' property they would be presented with lists of countries, continents etc but not irrelevant categories (there are more complex examples).

Thanks,

Dominic
1 REPLY 1

derek
Star Contributor
Star Contributor
For an example of getting the constraints defined for a property, see:

org.alfresco.repo.node.integrity.PropertiesIntegrityEvent
To get the parameter values, cast the constraint and use getters.  See:

org.alfresco.web.bean.generator.BaseComponentGenerator#setupStringLengthConstraint

Regards