AnsweredAssumed Answered

Combo box in metadata

Question asked by sharifu on Apr 27, 2012
Latest reply on Aug 20, 2013 by srowsell
I am trying to add combo box to my location field in the metadata. it does not work.

SpectrumModel.xml

<?xml version="1.0" encoding="UTF-8"?>

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.
   So, all custom –>
<!– types and aspects added here will automatically be registered –>

<model name="sp:spectrummodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Spectrum Custom Model</description>
   <author></author>
   <version>1.0</version>

   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0"
         prefix="d" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <namespaces>
      <!– Define a Namespace for my new definitions –>
      <namespace uri="sp.new.model" prefix="sp" />
   </namespaces>
<!–
   <constraint name="sp:allowedLocation" type="LIST">
      <parameter name="allowedValues">
         <list>
            <value>ABC</value>
            <value>DEF</value>
         </list>
      </parameter>
      <parameter name="caseSensitive">
         <value>true</value>
      </parameter>
   </constraint>
–>
   <!– Type and Aspect definitions go here –>
   <types>
      <type name="sp:contract">
         <title>Spectrum Contract Document</title>
         <parent>cm:content</parent>
         <!– <properties> <property name="sp:thirdParties"> <title>Third Parties</title>
            <type>d:text</type> </property> <property name="sp:location"> <title>Location</title>
            <type>d:text</type> </property> <property name="sp:responsibleEmp"> <title>Resposible
            Employee</title> <type>d:text</type> </property> <property name="sp:effectiveDate">
            <title>Effective Date</title> <type>d:date</type> </property> <property name="sp:expiryDate">
            <title>Expiry Date</title> <type>d:date</type> </property> </properties> –>
      </type>
   <!–
      <type name="sp:contractFields">
         <title>Contract Meta Data</title>
         <parent>cm:content</parent>
         <property name="sp:location">
            <title>Location</title>
            <type>d:text</type>
            <constraints>
               <constraint ref="sp:allowedLocation" />
            </constraints>
         </property>
      </type>
       –>
   </types>

   <aspects>
      <aspect name="sp:contractFields">
         <title>Contract Meta Data</title>
         <parent>cm:content</parent>
         <properties>
            <property name="sp:thirdParties">
               <title>Third Parties</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
            <property name="sp:location">
               <title>Location</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
            <property name="sp:responsibleEmp">
               <title>Responsible Spectrum Employee</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
            <property name="sp:contractRef">
               <title>Internal Reference</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
            <property name="sp:logNumber">
               <title>Log Number</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
            <property name="sp:effectiveDate">
               <title>Effective Date</title>
               <type>d:date</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
            <property name="sp:expiryDate">
               <title>Expiry Date</title>
               <type>d:date</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
      </aspect>
   </aspects>

</model>


web-client-config-custom.xml

<alfresco-config>

   <!– Example of overriding the from email address –>
   <!–
   <config>
      <client>
         <from-email-address>someone@your-domain.com</from-email-address>
         <search-max-results>100</search-max-results>
      </client>
   </config>
   –>

   <!– Example of adding languages to the list in the login page –>
   <!–
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES">Catalan</language>
         <language locale="hr_HR">Croatian</language>
         <language locale="cs_CZ">Czech</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pl_PL">Polish</language>
         <language locale="pt_PT">Portuguese</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="sv_SV">Swedish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </config>
   –>
  
   <!– Example of configuring advanced search –>
   <!–
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

   <!– Example of changing the sort direction for a view in the client –>
   <!–
   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>
   –>

   <!– Example of adding a custom icon to the Create Space dialog –>
   <!–
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>
   –>

   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>
   <!–
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:publishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="my:processSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="cm:storeSelector">
      <property-sheet>
         <show-property name="cm:storeName" />
      </property-sheet>
   </config>
   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="cm:storeSelector"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
   –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="sp:contract" />
      </content-types>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <!– The list of types shown in the is-subtype condition
      –>
      <subtypes>
         <type name="sp:contract"/>
      </subtypes>

      <!– The list of content and/or folder types shown in the specialise-type action –>
      <specialise-types>
         <type name="sp:contract" display-label="Spectrum Contract"/>
      </specialise-types>

      <!– The list of aspects to show in the add/remove features action –>
      <!– and the has-aspect condition –>
      <aspects>
         <aspect name="sp:contractFields"/>
         <aspect name="generalclassifiable"/>
         <aspect name="complianceable"/>
         <aspect name="dublincore"/>
         <aspect name="effectivity"/>
         <aspect name="summarizable"/>
         <aspect name="versionable"/>
         <aspect name="templatable"/>
         <aspect name="emailed"/>
         <aspect name="emailserver:aliasable"/>
         <aspect name="taggable"/>
      </aspects>
   </config>

   <config evaluator="aspect-name" condition="sp:contractFields">
      <property-sheet>
         <show-property name="sp:thirdParties" display-label="Third Parties"/>
         <show-property name="sp:location" display-label="Location"/>
         <show-property name="sp:responsibleEmp" display-label="Responsible Spectrum Employee"/>
         <show-property name="sp:contractRef" display-label="Internal Reference"/>
         <show-property name="sp:logNumber" display-label="Log Number"/>
         <show-property name="sp:effectiveDate" display-label="Effective Date"/>
         <show-property name="sp:expiryDate" display-label="Expiry Date"/>
      </property-sheet>
   </config>



</alfresco-config>



custom-model-context.xml


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
    <!– Registration of new models –>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/SpectrumModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>




I am using v 3.4d, can anyone help?

I have tried following the following articles but it has not help. what am I doing wrong?

http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Step_by_Step_Model_Definition
http://wiki.alfresco.com/wiki/Constraints

Outcomes