external values for list constraint

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 04:33 PM
Hi all,
I'm pretty sure i have seen this somewhere, but i can't find it anymore. I am looking for the following:
I have the following constraint in my custom content model:
What i want is that these kind of value lists are read from another XML-file. And i think i saw it somewhere, but, as said, i cant find it anymore and i cant find it on the wiki. How to include the list values from another XML file? Can anyone help?
Kind regards,
Koen Bonnet
I'm pretty sure i have seen this somewhere, but i can't find it anymore. I am looking for the following:
I have the following constraint in my custom content model:
<constraint name="gov:cdocumenttype" type="LIST"> <parameter name="allowedValues"> <list> <value>Aangifte</value> <value>Aanvraag</value> <value>Advies</value> <value>Agenda</value> </list> </parameter> </constraint>
What i want is that these kind of value lists are read from another XML-file. And i think i saw it somewhere, but, as said, i cant find it anymore and i cant find it on the wiki. How to include the list values from another XML file? Can anyone help?
Kind regards,
Koen Bonnet
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2008 04:24 AM
I think that you should write your own component-generator. Copy /Web-Client/source/java/org/alfresco/web/bean/generator/TextFieldGenerator.java to your own class and modify getListOfValuesConstraint function.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2008 09:49 AM
There is no out-of-the-box solution for getting the list of allowable values from anywhere else, you have to define it inline within the model definition. There is a new feature request for this, but there are no scheduled plans for it at this time: http://issues.alfresco.com/browse/AR-677
The suggestion given is OK, as long as don't have any other clients as those clients would not be restricted to the values you define in the web client code. Defining them in the model ensures all clients have to enter valid data.
The suggestion given is OK, as long as don't have any other clients as those clients would not be restricted to the values you define in the web client code. Defining them in the model ensures all clients have to enter valid data.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2008 09:04 AM
Hi Koen,
I don't know if this is still an issue for you but you can configure it.
At least in release 2.2 it is possible to have the constraints used in your custom model(s) defined in a
separate .xml file. This is done through a custom-model-context.xml file (e.g. extension/custom-model-context.xml.sample).
Specific entry should look something like this (for example if you have a Contezza model):
——————————–
<!– Registration of new models –>
<bean id="extension.dictionaryBootstrap"
parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/contezza-constraints.xml</value>
<value>alfresco/extension/contezza-custom-model.xml</value>
</list>
</property>
</bean>
——————————–
Regards,
Alex
Your ex-colleague from Amstelveen
I don't know if this is still an issue for you but you can configure it.
At least in release 2.2 it is possible to have the constraints used in your custom model(s) defined in a
separate .xml file. This is done through a custom-model-context.xml file (e.g. extension/custom-model-context.xml.sample).
Specific entry should look something like this (for example if you have a Contezza model):
——————————–
<!– Registration of new models –>
<bean id="extension.dictionaryBootstrap"
parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/contezza-constraints.xml</value>
<value>alfresco/extension/contezza-custom-model.xml</value>
</list>
</property>
</bean>
——————————–
Regards,
Alex
Your ex-colleague from Amstelveen

Hi all,
I'm pretty sure i have seen this somewhere, but i can't find it anymore. I am looking for the following:
I have the following constraint in my custom content model:<constraint name="gov:cdocumenttype" type="LIST"> <parameter name="allowedValues"> <list> <value>Aangifte</value> <value>Aanvraag</value> <value>Advies</value> <value>Agenda</value> </list> </parameter> </constraint>
What i want is that these kind of value lists are read from another XML-file. And i think i saw it somewhere, but, as said, i cant find it anymore and i cant find it on the wiki. How to include the list values from another XML file? Can anyone help?
Kind regards,
Koen Bonnet
