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
Thank you Gavin. You have been very helpful! I know that labels but i didn't realize… Smiley Surprisedops: Thanks again.

gavinc
Champ in-the-making
Champ in-the-making
No problem.

gadani
Champ in-the-making
Champ in-the-making
I added "contraints" definition as shown above for my custom drop-down meta-data list. Also added reference in property definition, but I am getting this error on startup..

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

I was wondering, whether this feature is available in 1.4 preview version ?

Pls advise.

Thanks.

gadani
Champ in-the-making
Champ in-the-making
Here I am pasting what I have in my model.

  <aspects>
     <aspect name="al:resumeMetadata">
         <title>Resume Metadata</title>
         <properties>
            <property name="al:referredBy">
            <title>Referred By</title>
               <type>d:text</type>
            </property>
         <property name="al:appliedFor">
            <title>Position Applied For</title>
               <type>d:text</type>
            </property>
         <property name="al:resumeStatus">
            <title>Status</title>
            <type>d:text</type>
            <constraints>
              <constraint ref="al:resumeStatus" />
            </constraints>
         </property>
         </properties>
      </aspect>
   </aspects>

   <!– Constraint definitions go here –>

   <constraints>
      <constraint name="al:resumeStatus" type="LIST">
        <parameter name="allowedValues">
          <list>
            <value>Inbox</value>
            <value>HR Verification</value>
            <value>Initial Screening</value>
            <value>Categorized</value>
            <value>Technical Evaluation</value>
            <value>Team Evaluation</value>
            <value>Company Evaluation</value>
            <value>Offered</value>
            <value>On Hold</value>
            <value>Rejected</value>
          </list>
        </parameter>
      </constraint>
   </constraints>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
This is throwing expection mentioned above..

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

gavinc
Champ in-the-making
Champ in-the-making
The constraints element is in the wrong place, it should go above the <types> element i.e.


<model>
   <imports … />
   <namespaces … />
   <constraints>
      …
   </constraints>
   <types … />
   <aspects … />
</model>
‍‍‍‍‍‍‍‍‍‍‍

gadani
Champ in-the-making
Champ in-the-making
Thanks Gavin. Your posts on this forum have always been very helpful.

I have one more question. How can I have this meta-data (drop-down list) allowing multiple values ? In other words, I want to have SelectManyListBox.

I guess I would have to write a custom component-generator for that, but I was wondering if there is any quick workaround/solution to this problem ?

Let me know.

gavinc
Champ in-the-making
Champ in-the-making
Your welcome.

You should just be able to add <multiple>true</multiple> to your type property definition and the property sheet should wrap the drop down list in a multi value editor component that will allow you to add items to a list.

For example:

   
<property name="al:resumeStatus">
   <title>Status</title>
   <type>d:text</type>
   <multiple>false</multiple>
   <constraints>
      <constraint ref="al:resumeStatus" />
   </constraints>
</property>
‍‍‍‍‍‍‍‍‍‍

gadani
Champ in-the-making
Champ in-the-making
Thanks Gavin for prompt reply.

I knew this and has been using it, but I wanted SelectManyListBox so that users can select multiple values in one shot.

I am having such drop-down list in several custom metadata properties in my application.

On other note, how can I add warning rule (on Update or Edit) ? I am having a checkbox as one property, if user has selected that checkbox and tries to update/edit that content - I want to show a warning similar to the warning we see on delete. Can I do this with some simple configuration changes or more code changes (in Rule services/componets and a new JSP) are needed ?

Thanks in advance.

gavinc
Champ in-the-making
Champ in-the-making
Ahh, sorry, in that case you were right, you will have to write a custom component generator.

As for the other question, there aren't any configuration options for what you are looking for, you will indeed need more custom code.

It sounds like you'll have to override the edit and update actions to go through an action listener which can determine whether you need to display the warning or not. The action listener code can then either display the warning dialog or just allow the edit/update through.

tiofelix
Champ in-the-making
Champ in-the-making
Yes, for the category property you have found a bug. I have raised this in JIRA: http://issues.alfresco.com/browse/AWC-900

For the second issue (the constraints list) you raise, this is by design. By the fact that it is rendered as a list a mandatory validation rule is not required as the UI will always submit a value.

The example you highlight is not supported, if you have an empty string as one of the allowable values that is treated as an "allowable value" and will therefore have no effect on the OK button state.

Hope this helps.

I've just realized the bag was yet fixed but for the alfresco 1.4 E, how can i update my alfresco 1.3 to support the new functionality??can i do it myself by retrofitting some component??

Thanks a lot Gavin.