AnsweredAssumed Answered

Using Java to manage LIST constraints...

Question asked by wagon13 on Oct 23, 2007
Latest reply on Oct 24, 2007 by wagon13
How do i retrieve the values of the LIST in Java… I have the following:

        <constraint name="dwr:sectorList" type="LIST">
            <parameter name="allowedValues">
                    <value>Consumer Discretionary</value>
                    <value>Consumer Staples</value>
            <parameter name="caseSensitive">

        <aspect name="dwr:reportsMetaData">
            <title>Position Report</title>
                <property name="dwr:date">
                <property name="dwr:sector">
                        <constraint ref="dwr:sectorList" />

This is mapped in the web-client-config-custom

         <!– Definition of the create space dialog –>
         <dialog name="createPositionReportSpace"
               error-message-id="error_create_space_dialog" />

         <!– Definition of the edit space dialog –>
         <dialog name="editPositionReportsSpace"
               description-id="editspace_description" />

   <config evaluator="aspect-name" condition="dwr:reportsMetaData">
         <show-property name="dwr:date"/>
         <show-property name="dwr:sector" component-generator="TextFieldGenerator"/>

So, I have this working using the "base" metadata. I want to do 1 of 2 things… either use a propertySheetGrid when creating the space to display all the metadata to be populated by the user - OR - write a custom JSP.

If I do the proprtySheetGrid, how do I give it the correct node reference to use the metadata.

If I do the custom JSP I am writing the code to create the lists to be used in the <h:selectOneMenu>. I am able to access the aspect and get the PropertyDefinitions but unable to get the constraints…

I do something like this…

    AspectDefinition aspectDef = this.dictionaryService.getAspect(idQName);
    Iterator<PropertyDefinition> iterPropDefCol = aspectDef.getProperties().values().iterator();

     while (iterPropDefCol.hasNext()) {
          PropertyDefinition propDef =;
          if (propDef.getName().getLocalName().equals("sector")) {
              List<ConstraintDefinition> propConstraints = propDef.getConstraints();

I am trying to use ListOfValuesConstraint for displaying the list.

Am I completely confused here or doing something right?