AnsweredAssumed Answered

Validating values of custom aspects with a dynamic constrain

Question asked by theorbix on Jun 20, 2008
Latest reply on May 7, 2012 by venzia
I need to define a custom Aspect that can have a list of allowed values.

If the list of allowed values is fixed, this can be done easily by modifying the customModel.xml file and adding a <constraint> tag, as show below:


  <constraints>
      <constraint name="custom:VerticalMarketAllowedValuesList" type="LIST">
       <parameter name="allowedValues">
          <list>
             <value>Telco</value>
             <value>Finance</value>
             <value>Insurance</value>
             <value>Government</value>
          </list>
       </parameter>
      </constraint>
     </constraints>
   <types>

              <property name="custom:VerticalMarket">
                  <title>Settore</title>
                  <type>d:text</type>
                  <mandatory>true</mandatory>
                  <constraints>
                    <constraint ref="custom:VerticalMarketAllowedValuesList"/>
                  </constraints>
               </property>


So far, so good… but is there an easy way to dynamically retrieve the list of valid contstrain values from an external source (for instance a database table, via JDBC)?

Has anyone done something similar, and can post a description of how this can be done?

Does this require the development of a custom Java component?

Outcomes