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

   <description>Alfresco Repository System Definitions</description>
   <author>Alfresco</author>
   <published>2005-09-29</published>
   <version>1.0</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
      <namespace uri="http://www.alfresco.org/system/registry/1.0" prefix="reg" />
      <namespace uri="http://www.alfresco.org/system/modules/1.0" prefix="module" />
   </namespaces>

   <types>

      <type name="sys:base">
         <title>Base</title>
         <mandatory-aspects>
            <aspect>sys:referenceable</aspect>
         </mandatory-aspects>
      </type>

      <type name="sys:descriptor">
         <title>Descriptor</title>
         <parent>sys:base</parent>
         <properties>
            <property name="sys:name">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:versionMajor">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:versionMinor">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:versionRevision">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:versionLabel">
               <type>d:text</type>
            </property>
            <property name="sys:versionBuild">
               <type>d:text</type>
            </property>
            <property name="sys:versionSchema">
               <type>d:int</type>
               <mandatory enforced="true">true</mandatory>
               <default>0</default>
            </property>
            <property name="sys:versionEdition">
               <type>d:content</type>
               <multiple>false</multiple>
            </property>               
            <property name="sys:versionProperties">
               <type>d:content</type>
               <multiple>false</multiple>
            </property>               
         </properties>
      </type>      

      <type name="sys:container">
         <title>Container</title>
         <parent>sys:base</parent>
         <associations>
            <child-association name="sys:children">
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>sys:base</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </child-association>
         </associations>
      </type>

      <type name="sys:store_root">
         <title>Store Root</title>
         <parent>sys:container</parent>
         <mandatory-aspects>
            <aspect>sys:aspect_root</aspect>
         </mandatory-aspects>
      </type>

      <type name="sys:reference">
         <title>Reference</title>
         <parent>sys:base</parent>
         <properties>
            <property name="sys:reference">
               <type>d:noderef</type>
               <mandatory enforced="true">true</mandatory>
            </property>
         </properties>
      </type>
      
   </types>


   <aspects>

      <aspect name="sys:aspect_root">
         <title>Root</title>
      </aspect>

      <!-- aspect to store the fundamental node identifiers -->
      <aspect name="sys:referenceable">
         <title>Referenceable</title>
         <properties>
            <property name="sys:store-protocol">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:store-identifier">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:node-uuid">
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="sys:node-dbid">
               <type>d:long</type>
               <mandatory enforced="true">true</mandatory>
            </property>
         </properties>
      </aspect>

      <!-- aspect to tag incomplete nodes -->
      <aspect name="sys:incomplete">
         <title>Incomplete</title>
      </aspect>
      
      <!-- aspect to tag temporary nodes -->
      <aspect name="sys:temporary">
         <title>Temporary</title>
         <!-- Explicitly turn off archiving for all nodes with this aspect -->
         <archive>false</archive>
      </aspect>
      
      <!-- aspect to tag nodes being formed and without any content yet -->
      <aspect name="sys:noContent">
         <title>NoContent</title>
         <archive>false</archive>
      </aspect>
      
      <!-- details stored on archived nodes -->
      <aspect name="sys:archived">
         <title>Archived</title>
         <properties>
            <property name="sys:archivedOriginalParentAssoc">
               <type>d:childassocref</type>
               <mandatory>true</mandatory>
            </property>
            <property name="sys:archivedBy">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="sys:archivedDate">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
			   <index enabled="true">
				  <atomic>true</atomic>
				  <stored>false</stored> 
                  <tokenised>both</tokenised>
               </index>
            </property>
            <property name="sys:archivedOriginalOwner">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </aspect>
      <aspect name="sys:archived-assocs">
         <properties>
            <property name="sys:archivedParentAssocs">
               <type>d:childassocref</type>
               <mandatory>false</mandatory>
               <multiple>true</multiple>
               <index enabled="false" />
            </property>
            <property name="sys:archivedChildAssocs">
               <type>d:childassocref</type>
               <mandatory>false</mandatory>
               <multiple>true</multiple>
               <index enabled="false" />
            </property>
            <property name="sys:archivedSourceAssocs">
               <type>d:assocref</type>
               <mandatory>false</mandatory>
               <multiple>true</multiple>
               <index enabled="false" />
            </property>
            <property name="sys:archivedTargetAssocs">
               <type>d:assocref</type>
               <mandatory>false</mandatory>
               <multiple>true</multiple>
               <index enabled="false" />
            </property>
         </properties>
      </aspect>

      <!--
         Localization:
         If you add this aspect to a node, then the server will assume that all non-multilingual
         properties apply to this locale.
      -->
      <aspect name="sys:localized">
         <title>Translation</title>
         <properties>
            <property name="sys:locale">
               <title>Locale</title>    
               <type>d:locale</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </aspect>

      <!--
         Aspect controlling some index behaviour.
         Sometimes it is necessary to reindex an entire hierarchy.  But instead of
         doing that inline, it can be done as a background process.
      -->
      <aspect name="sys:indexChildren">
         <title>Cascade Index Children</title>
      </aspect>

   </aspects>

</model>