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

agericke
Champ in-the-making
Champ in-the-making
Hi Gavin,
thank you for the quick answer.  Are you planning to add this feature to the dictionary service?

Cheers,
Alex

davidc
Star Contributor
Star Contributor
There's some time allocated to web services in v1.4, so we'll see if this can be added.

sbanner
Champ in-the-making
Champ in-the-making
Is it possible to expose the "list of values" constraint in the web client configuration for Advanced Search?  I've implemented the example above but I do not see the same constraint when the properties are included in Advanced Search.

csiege
Champ in-the-making
Champ in-the-making
This was our idea also…
we haven't gotten around to trying it yet…
have you?

thanks.

Chris

gavinc
Champ in-the-making
Champ in-the-making
The advanced search is still generating it's components by hand, it is not using the component generator framework yet. Some component generator framework enhancements will also be required to handle this scenario.

There is a task to do this on JIRA: http://www.alfresco.org/jira/browse/AWC-674

In the meantime you could customise org.alfresco.web.ui.repo.component.UISearchCustomProperties to generate the list of properties by examining the constraint on the property in the data dictionary.

sbanner
Champ in-the-making
Champ in-the-making
Gavin, thanks for the quick response.  I've only been working with Alfresco for a couple of weeks but am very pleased with the progress I've been able to make.

I have implemented constrained properties for an extended space (cm:folder) and I can see the drop-down lists when I view the "Modify Space Properties" page.  Could you point me to the class which implements the drop-down lists (using the data dictionary constraints) on this page?  The url I'm looking at is as follows:  http://localhost:8080/alfresco/faces/jsp/dialog/space-details.jsp.  I've looked at the org.alfresco.web.ui.repo.component.UISearchCustomProperties class and feel that I can proceed if I can compare to the "Modify Space Properties" page implementation.  I understand that they're implemented differently (in terms of framework) but still want to look.

Thanks for your help.

gavinc
Champ in-the-making
Champ in-the-making
Sure.

You'll find it in org.alfresco.web.bean.generator.TextFieldGenerator.

steel
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…

I am receiving this error as well.  I am using the latest code that I got off SVN today.

Here is my model:


<types>

        <type name="ra:digitalAsset">
            <title>Digital Asset</title>
            <parent>cm:content</parent>
            <properties>
                <property name="ra:assetTitle">
                    <type>d:text</type>
                </property>

                <property name="ra:featureSeriesTitle">
                    <type>d:text</type>
                </property>

                <property name="ra:episodeReelNum">
                    <type>d:text</type>
                </property>

                <property name="ra:releaseAirDate">
                    <type>d:datetime</type>
                </property>

                <property name="ra:director">
                    <type>d:text</type>
                </property>

                <property name="ra:studioNetworkLabel">
                    <type>d:text</type>
                </property>

                <property name="ra:category">
                    <type>d:text</type>
                    <constraints>
                        <constraint ref="ra:categories"/>
                    </constraints>
                </property>

                <property name="ra:genre">
                    <type>d:text</type>
                    <multiple>true</multiple>
                    <constraints>
                        <constraint ref="ra:genres"/>
                    </constraints>
                </property>

                <property name="ra:upc">
                    <type>d:int</type>
                </property>

                <property name="ra:inventoryId">
                    <type>d:int</type>
                </property>

                <property name="ra:storageLocation">
                    <type>d:text</type>
                </property>

                <property name="ra:restricted">
                    <type>d:boolean</type>
                </property>

                <property name="ra:restrictedTo">
                    <type>d:text</type>
                </property>

                <property name="ra:qtyOnHandDVD">
                    <type>d:int</type>
                </property>

                <property name="ra:qtyOnHandVHS">
                    <type>d:int</type>
                </property>

                <property name="ra:dvdInStock">
                    <type>d:boolean</type>
                </property>

                <property name="ra:vhsInStock">
                    <type>d:boolean</type>
                </property>

                <property name="ra:reason">
                    <type>d:text</type>
                </property>

                <property name="ra:blurb">
                    <type>d:text</type>
                </property>

            </properties>
        </type>

        <type name="ra:print">
            <title>Print</title>
            <parent>cm:content</parent>
        </type>

        <type name="ra:resume">
            <title>Resume</title>
            <parent>cm:content</parent>
        </type>

    </types>

    <constraints>

        <constraint name="ra:categories" type="list">
            <parameter name="allowedValues">
                <list>
                    <value>Below The Line</value>
                    <value>Demo Reel</value>
                    <value>Feature Film/Short</value>
                    <value>Pilot</value>
                    <value>TV</value>
                </list>
            </parameter>
        </constraint>

        <constraint name="ra:genres" type="list">
            <parameter name="allowedValues">
                <list>
                    <value>Action &amp; Adventure</value>
                    <value>Children &amp; Family</value>
                    <value>Classics</value>
                    <value>Comedy</value>
                    <value>Documentary</value>
                    <value>Drama</value>
                    <value>Foreign</value>
                    <value>Horror</value>
                    <value>Independent</value>
                    <value>Music &amp; Concert</value>
                    <value>Romance</value>
                    <value>Sci-Fi &amp; Fantasy</value>
                    <value>Special Interest</value>
                    <value>Sports</value>
                    <value>Television</value>
                    <value>Thrillers</value>
                </list>
            </parameter>
        </constraint>

    </constraints>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

gavinc
Champ in-the-making
Champ in-the-making
Try putting the <constraints> element before the <types> element.

steel
Champ in-the-making
Champ in-the-making
Try putting the <constraints> element before the <types> element.

thanks! that worked.

Is there a documentation on how to properly use the contraints tag and its options?

thanks.