AnsweredAssumed Answered

How to make custom properties mandatory in the AddContent?

Question asked by grp1260 on Nov 12, 2008
Dear All

       How to make the all custom content properties to be mandatory while uploading a file.Until unless user has selected the all cutom properties.I should not allow the user to complete the wizard. Please help me how to make those properties mandatory.  Below i have mentioned the my custom model file below.




<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="rt:regtosmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

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

<!– Imports are required to allow references to definitions in other models –>
<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>

<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="http://www.some.company.it/model/content/1.0" prefix="rt" />
</namespaces>

<constraints>

   <!–Actual Content Type Constraint–>
   
   <constraint name="rt:actype" type="LIST">
      <parameter name="allowedValues">
      <list>
         <value></value>
         <value>Whitepaper</value>
         <value>Trend</value>
         <value>Update</value>
         <value>Article</value>
      </list>
      </parameter>
   </constraint>
   
   <!–Source Constraint–>
   
   <constraint name="rt:source" type="LIST">
      <parameter name="allowedValues">
      <list>
         <value></value>
         <value>Gartner</value>
         <value>Aberdeen</value>
         <value>WEB</value>
         <value>TCS</value>
      </list>
      </parameter>
   </constraint>
   
   <!–Domain Constraint–>
   
   <constraint name="rt:domain" type="LIST">
      <parameter name="allowedValues">
      <list>
         <value></value>
         <value>Hitech</value>
         <value>LifeSciences</value>
         <value>Manufacturing</value>
         <value>Auto</value>
         <value>Process</value>
         <value>General</value>
      </list>
      </parameter>
   </constraint>
   
   <!–Year Constraint–>
   
   <constraint name="rt:year" type="LIST">
      <parameter name="allowedValues">
      <list>
         <value></value>
         <value>2008</value>
         <value>2007</value>
         <value>2006</value>
         <value>2005</value>
         <value>2004</value>
         <value>2003</value>
         <value>2002</value>
         <value>2001</value>
         <value>2000</value>         
      </list>
      </parameter>
   </constraint>
   
   <!–Month Constraint–>
   
   <constraint name="rt:month" type="LIST">
      <parameter name="allowedValues">
      <list>
         <value></value>
         <value>01</value>
         <value>02</value>
         <value>03</value>
         <value>04</value>
         <value>05</value>
         <value>06</value>
         <value>07</value>
         <value>08</value>
         <value>09</value>
         <value>10</value>
         <value>11</value>
         <value>12</value>         
      </list>
      </parameter>
   </constraint>
</constraints>

<types>

   <type name="rt:actualtype">
      <title>Actual Content</title>
      <parent>cm:content</parent>
      <mandatory-aspects>
         <aspect>cm:auditable</aspect>
         <aspect>rt:acttype</aspect>
         <aspect>rt:sourced</aspect>
         <aspect>rt:domained</aspect>
         <aspect>rt:yr</aspect>
         <aspect>rt:mnth</aspect>
      </mandatory-aspects>
   </type>
   
            
</types>

<aspects>
   <aspect name="rt:acttype">
      <title>Content</title>
      <properties>
         <property name="rt:actype">
            <type>d:text</type>
            <mandatory>true</mandatory>
            <constraints>
            <constraint ref="rt:actype" />
         </constraints>
         </property>
      </properties>
   </aspect>   
   
   <aspect name="rt:sourced">
      <title>Source</title>
      <properties>
         <property name="rt:source">
            <type>d:text</type>
            <mandatory>true</mandatory>
            <constraints>
            <constraint ref="rt:source" />
         </constraints>
         </property>
      </properties>
   </aspect>   
   
   <aspect name="rt:domained">
      <title>Domain</title>
      <properties>
         <property name="rt:domain">
            <type>d:text</type>
            <mandatory>true</mandatory>
           <constraints>
            <constraint ref="rt:domain" />
         </constraints>
         </property>
      </properties>
   </aspect>
   
   <aspect name="rt:yr">
      <title>Year</title>
      <properties>
         <property name="rt:year">
            <type>d:text</type>
            <mandatory>true</mandatory>
            <constraints>
            <constraint ref="rt:year" />
         </constraints>
         </property>
      </properties>
   </aspect>
   
   <aspect name="rt:mnth">
      <title>Month</title>
      <properties>
         <property name="rt:month">
            <type>d:text</type>
            <mandatory>true</mandatory>
           <constraints>
            <constraint ref="rt:month" />
         </constraints>
         </property>
      </properties>
   </aspect>
</aspects>

</model>


Thanks
Prasad

Outcomes