cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup drop down list to choose for metadata field???

csiege
Champ in-the-making
Champ in-the-making
I know this has been discussed somewhat on other posts, but could not see a recent post or a real resolution.

I want to provide a down down list for the user to select from when
editing document details (metadata).   This would allow me to enforce the vocabulary.

thanks!

Chris
76 REPLIES 76

gavinc
Champ in-the-making
Champ in-the-making
There is now a "list of values" constraint in the data dictionary. In your model you can now have the following:


<constraints>
   <constraint name="my:status" type="LIST">
      <parameter name="allowedValues">
         <list>
            <value>Ready</value>
            <value>Steady</value>
            <value>Go</value>
         </list>
      </parameter>
   </constraint>
</constraints>

and then reference the constraint from your property as follows:


<property name="my:status">
   <type>d:text</type>
   <constraints>
      <constraint ref="my:status" />
   </constraints>
</property>

csiege
Champ in-the-making
Champ in-the-making
Exactly what I needed. 🙂

In the future it would be nice to have the constraint values dynamically selected from a database table.  Is that possible now?  In the future…?

thanks again!

Chris

gavinc
Champ in-the-making
Champ in-the-making
Not possible yet.

I've raised this as a new feature request in JIRA: http://www.alfresco.org/jira/browse/AR-677

loggheci
Champ in-the-making
Champ in-the-making
I suppose the use of constraints to implement value lists is only available in version 1.3?

When I add constraints in my model I get an error in my stdout log file:

Caused by: org.jibx.runtime.JiBXException: Expected end tag, found start tag "{http://www.alfresco.org/model/dictionary/1.0}constraint" (line 29, col 55)

I also do not find any constraints in the models of version 1.2…

gavinc
Champ in-the-making
Champ in-the-making
Correct, this is a new 1.3 feature.

felipe
Champ in-the-making
Champ in-the-making
Thanks for this topic!
Another question,
is it possible to use the constraint values defined in the search UI, with a drop down list too?

Regards

gavinc
Champ in-the-making
Champ in-the-making
Yes, if a property has the constraint set on it the values you define will appear in a drop down list when the property is shown in a property sheet.

agericke
Champ in-the-making
Champ in-the-making
Hello Gavin,
may I add an additional question about this topic?

How can I get the list values ('Ready', 'Steady', etc) via the Alfresco Web Services? I'm using Alfresco V 1.3.

Thanks,
Alex

gavinc
Champ in-the-making
Champ in-the-making
Unfortunately, property constraints are not currently exposed via the Dictionary Web Service.