cancel
Showing results for 
Search instead for 
Did you mean: 

Custom aspetcs

fstnboy
Champ on-the-rise
Champ on-the-rise
Hi guys!

i have come up against a new problem…. I´ve got a .xml file for custom aspects/model, everything is ok. But there is a thing that i need and i don´t know how to do it.

I have a property representing a "combo box" and then some other properties as long as telephone, fax, email, …. What i need is that certain properties to be mandatory only if the selected value in combo is 'Procurador' or 'Abogado'

What I have in libertyAJDmodel.xml



<constraint name="ajd:profesionales" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Abogado</value>
               <value>Procurador</value>
               <value>Perito</value>
               <value>Otros</value>
            </list>
         </parameter>
</constraint>
      
<constraint name="ajd:especialds" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>-</value>
            </list>
         </parameter>
</constraint>

<type name="ajd:espaciocontactos">
         <title>Espacio para expedientes de contactos</title>
         <parent>ajd:eticos</parent>
         <properties>
            <property name="ajd:tipoprof_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <multiple>false</multiple>
                    <default>Abogado</default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                    <constraints>
                       <constraint ref="ajd:profesionales"/>
               </constraints>
                  </property>
                  <property name="ajd:espe_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory><!– only mandatory when ajd:tipoprof_6 is 'abogado' or 'procurador' –>
               <multiple>false</multiple>
                    <default>-</default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                    <constraints>
                       <constraint ref="ajd:especialds"/>
               </constraints>
                  </property>
                  <property name="ajd:reparto_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:partjud_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory><!– only mandatory when ajd:tipoprof_6 is 'abogado' or 'procurador' –>
                    <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  
                  <property name="ajd:direcc_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:telf_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:movil_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:fax_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:mail_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:nifcif_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
                  <property name="ajd:observs_6">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
               <default></default>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                  </property>
               </properties>

         <mandatory-aspects>
           <aspect>ajd:contenedorajd</aspect>
         </mandatory-aspects>            
</type>
15 REPLIES 15

archana_bonkanp
Champ in-the-making
Champ in-the-making
Hi

Please help in implementing the combo box
for the requirement given us,there is no need of mandatory items.
so please implementing the static values to be populated in a combo box,so the user can select them

Thanks & Regards,
Archana

fstnboy
Champ on-the-rise
Champ on-the-rise
Hi!

Those would be the possible values to be selected in the combo, you have to put then within the <constraint> tag: (this would be a YES/NO/INDETERMINATED combo)


<constraint name="pre:yesno" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Yes</value>
               <value>No</value>
               <value>Indeterminated</value>
            </list>
         </parameter>
      </constraint>

To associate the constraint with the property of a type just write this code:


<type name="pre:oneType">
         <title>One kind of type</title>
         <parent>cm:content</parent>
         <properties>
            <property name="pre:whatever">
               <type>d:text</type>
               <multiple>false</multiple>
                    <index enabled="true">
                  <tokenised>true</tokenised>
               </index>
                    <constraints>
                       <constraint ref="pre:yesno"/>
               </constraints>
                  </property>
               </properties>
            </type>

Instead of 'pre' write the prefix you want to use…

I hope it will help you!

archana_bonkanp
Champ in-the-making
Champ in-the-making
Thanks for the reply,but im confused like which code to write in which XML file.Please help me in that regard,it woukld be so great of you.

archana_bonkanp
Champ in-the-making
Champ in-the-making
HI,

Please let us know the stpes in detail like,which code to add in whiich xml file step wise to get drop down box.
As we are getting an excpetion

fstnboy
Champ on-the-rise
Champ on-the-rise
I suppose you have created a new xml, let say "customModel.xml". All this code would be written in the customModel.xml file.

Hope I´m helpfull…

archana_bonkanp
Champ in-the-making
Champ in-the-making
can u give me the detail description
since the file already exists
even though i create how could i relate that file

fstnboy
Champ on-the-rise
Champ on-the-rise
let have a look to http://ecmarchitect.com/images/articles/alfresco-content/content-article.pdf

Sorry but i´m a bit bussy, i will explain it to you later.

archana_bonkanp
Champ in-the-making
Champ in-the-making
i have the information,but we need the help like in which place to put what code

fstnboy
Champ on-the-rise
Champ on-the-rise
Well… you have to put the file (with ALL the code) in alfresco/extension directory.