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

tiofelix
Champ in-the-making
Champ in-the-making
I?ve just found the solution of my problem, don`t disturbe answer me:

 

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

‍‍‍‍‍‍‍‍‍‍‍

tiofelix
Champ in-the-making
Champ in-the-making
I?ve just found the solution of my problem, don`t disturbe answer me:

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

steel
Champ in-the-making
Champ in-the-making
I?ve just found the solution of my problem, don`t disturbe answer me:

 

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

‍‍‍‍‍‍‍‍‍‍‍

You may want to include "enforced="true"" in the mandatory tag.

Eg: <mandatory enforced="true">true</mandatory>

tiofelix
Champ in-the-making
Champ in-the-making
If i include that in my code this warning appears:


WARN  [org.alfresco.repo.node.integrity.IntegrityChecker] Found 1 integrity violations:
Mandatory property not set:
   Node: workspace://SpacesStore/96eb978f-2848-11db-a6c1-e9c1ce4141a5
   Type: {my.new.model}documenax
   Property: {my.new.model}listatipodoc
‍‍‍‍‍‍‍

      what is the diference between including enforced="true" or not??

Thanks.

gavinc
Champ in-the-making
Champ in-the-making
You have to be careful where you apply the use of enforced="true". What it means is that the node, when it is created, MUST have all the enforced properties provided, otherwise you will see the warning you are seeing. Note, in the future this warning will become an error and so therefore you won't be able to create the node.

enforced is used more for system types/properties where you know the value of the property at creation time.

In the web client nodes are created in the wizard with the bare minimum properties populated, the edit properties dialog is immediately shown after the node is created to give the user a chance to populate the properties. This is the reason for you getting the warning.

In conclusion, for types you are allowing your users to create through the UI you should not use enforced="true" on your property definition.

Hope that helps.

agericke
Champ in-the-making
Champ in-the-making
Hi Gavin,
sorry to bother you again. I have a question which is related to the topic of providing the user with a list of values:

Is there a similary way to restrict the selection of properties of type 'd:category' (eg. I have a property 'lang' which can take one of the following enumeration values: 'eng', 'ger', 'fre'. I set the property type to 'd:category'. The root category for the enumeration values would be something like 'language'. Since I'm also having other classifications (e.g. 'documentType') I would like to ensure that my 'lang' property only gets values of category 'language' assigned).

The list constraint would solve my problem but as I read in the Alfresco Roadmap, Version 1.4 will provide browsing by categories so text properties with list constrains could not be used for this kind of browsing, I guess.

Thank you,

Alex

gavinc
Champ in-the-making
Champ in-the-making
If you have a property that has a type of d:category then by default you should get a control that allows you to select from the category tree. However, you can not limit this to a particular category at the moment. This ability is something that has been on the list of things to do for a while!

The category browsing is a different feature, it will allow you to browse the repository by category instead of by space. This will not help with the scenario you are talking about.

I think you're best bet at the moment is to use the list of values constraint.

agericke
Champ in-the-making
Champ in-the-making
Gavin,
thank you for your quick answer.

Cheers,
Alex

tiofelix
Champ in-the-making
Champ in-the-making
I have the same problem as Chris, i'd like to have the constraint values dynamically selected from an external table so i tried to have a look on jira but the link doesn?t work…i don't know if the problem is already solved?

   Thanks.

tiofelix
Champ in-the-making
Champ in-the-making
I have the same problem as Chris, i'd like to have the constraint values dynamically selected from an external table so i tried to have a look on http://www.alfresco.org/jira/browse/AR-677 but the link doesn?t work…i don't know if the problem is already solved?

   Thanks.