cancel
Showing results for 
Search instead for 
Did you mean: 

reading metadata value from csv file

sachinr_bhat
Champ in-the-making
Champ in-the-making
Hi,

I have the below docuemntModel.xml file

<namespaces>
         <namespace uri="foo.document.model" prefix="foo"/>
      </namespaces>
     
      <constraints>
         <constraint name="foo:supCodeList" type="LIST">
           <parameter name="allowedValues">
                     <list>
                        <value>a101</value>
                        <value>a102</value>
                        <value>a103</value>
                     </list>
                </parameter>
         </constraint>
      </constraints>
    <types>
      <type name="foo:pinv">
            <title>Pinv</title>
       <parent>foo:baseDocument</parent>
       <properties>
       <property name="foo:pinvSupCode">
            <type>d:text</type>
            <multiple>true</multiple>
            <constraints>
               <constriant ref="foo:supCodeList" />
            </constraints>
       </property>
            </properties>
   </type>
    </types>
   <aspects>
       <aspect name="foo:pInvoice">
               <title>pinvoicable</title>
               <parent>foo:commonAspect1</parent>
               <properties>
             <property name="foo:pSupCode">
                <title>Supplier code</title>
                <type>d:text</type>
                <multiple>true</multiple>
               <constraints>
                  <constriant ref="foo:supCodeList" />
                     </constraints>
             </property>
                    </properties>
          </aspect>
     </aspects>

In the above model i have foo:supCodeList which is using "LIST" constriant. For this metadata i have hardcoded the values like a101, a102 etc. I don't want to hardcode those values and i want to read those values from the csv file. How to do this sir?

Thanks and Regards,
Sachin Bhat.
2 REPLIES 2

invictus9
Champ in-the-making
Champ in-the-making
The list of values can be maintained in a database or as a set of nodes in Alfresco. It does require adding a custom constraint type to your Alfresco installation. This is the reference:

http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/

sachinr_bhat
Champ in-the-making
Champ in-the-making
Thank you invictus for your quick reply. I am going through with your refence link and code.

Thanks and Regards,
Sachin Bhat.