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 ...

+3


source to share


2 answers


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.

0


source


Write a Java based repository website that asks for the alfresco DictionaryService to get a list of restrictions and expose this as json or xml for your form to use.



+1


source







All Articles