How do I get the allowed values of a list constraint in the alfresco shared content model?
I have been trying to achieve this since a very long time and finally I am asking a question here.
I have created a custom content model around the world that I can successfully use using share. This content model is used in html form submission. User can enter data and save it successfully.
Now I have one more requirement. Several of the fields in this form are drop-down lists, which we refer to as the Limit List in the XML content model file. Anyway, I want to get a list of valid values and use that in the FTL file to populate the dropdown options. I tried a lot to find a solution, but my limited outdoor knowledge could not find it.
Any help is greatly appreciated ...
source to share
as @billerby said, you have to use the java based repository webpage to get the values.
You can use this code
serviceRegistry.getDictionaryService().getConstraint(constraintQName).getConstraint().getParameters().get(ListOfValuesConstraint.ALLOWED_VALUES_PARAM);
you will get List<String>
all valid values.
source to share