cancel
Showing results for 
Search instead for 
Did you mean: 

specialising a document depending on a value

sharifu
Confirmed Champ
Confirmed Champ
I have 3 models

finance
bonds
annualretruns

bonds and annual retruns is a submodel of finance. submodels have different definitions.

i would like a user to select what type of document it shall be using a combo box on finance properties and then a different set of properties would be displayed on the "edit properties"

is this possible to do and how?


my  model

<?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:domainmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>domain 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>

   <constraints>
      <constraint name="sp:location" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value></value>
               <value>UK</value>
               <value>USA</value>
            </list>
         </parameter>
      </constraint>
   </constraints>

   <!– Type and Aspect definitions go here –>
   <types>
      <type name="sp:contract">
         <title>domain Contract Document</title>
         <parent>cm:content</parent>
         <!– <properties> <property name="sp:thirdParties"> <title>Third Parties</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:finance">
         <title>domain Finance Document</title>
         <parent>sp:contract</parent>
      </type>
      <type name="sp:annualreturn">
         <title>domain Annual Return Document</title>
         <parent>sp:finance</parent>
      </type>
      <type name="sp:bonds">
         <title>domain Bonds and Garantees Document</title>
         <parent>sp:finance</parent>
      </type>
      <type name="sp:invoice">
         <title>domain Invoice</title>
         <parent>sp:finance</parent>
      </type>
   </types>

   <aspects>
      <aspect name="sp:contractFields">
         <title>Contract Meta Data</title>
         <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>
               <constraints>
                  <constraint ref="sp:location" />
               </constraints>
            </property>
            <property name="sp:responsibleEmp">
               <title>Responsible domain 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>


      <aspect name="sp:financeFields">
         <title>Finance Meta Data</title>
         <properties>
            <property name="sp:value">
               <title>Value</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
      </aspect>

      <aspect name="sp:annualreturnFields">
         <title>Annual Return Meta Data</title>
         <properties>
         </properties>
      </aspect>

      <aspect name="sp:bondsFields">
         <title>Bonds Meta Data</title>
         <properties>
            <property name="sp:refNo">
               <title>Reference Number (optional)</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
      </aspect>

      <aspect name="sp:invoiceFields">
         <title>Invoice Meta Data</title>
         <properties>
            <property name="sp:invoiceNo">
               <title>Invoice Number</title>
               <type>d:text</type>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
      </aspect>

   </aspects>

</model>

2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Either specialise the type.

Or add an aspect.    Adding an aspect is probably the way to go if they are all "finance" documents.

sharifu
Confirmed Champ
Confirmed Champ
my directory structure is as follows

finance
     bonds
     annuals



now when all documents are inputted  they go to finance and are automatically specialised and aspect added. what i would like to do as mentioned create a combo box for finace so it is diplayed on edit properties, which depending on the what is selected bonds or annual to specialise it to that type and display the appropiate properties to edit.