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

  <description>CMIS Model Definitions</description>
  <version>1.0</version>

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

  <namespaces>
    <namespace uri="http://www.alfresco.org/model/cmis/1.0/cs01" prefix="cmis" />
  </namespaces>

  <data-types>

    <data-type name="cmis:id">
      <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
      <java-class>java.lang.String</java-class>
    </data-type>

    <data-type name="cmis:uri">
      <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
      <java-class>java.lang.String</java-class>
    </data-type>

    <data-type name="cmis:html">
      <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
      <java-class>java.lang.String</java-class>
    </data-type>

  </data-types>

  <constraints>

    <constraint name="cmis:allowedValuesForContentStreamAllowed" type="LIST">
      <parameter name="allowedValues">
        <list>
          <value>notallowed</value>
          <value>allowed</value>
          <value>required</value>
        </list>
      </parameter>
    </constraint>

  </constraints>

  <types>

    <type name="cmis:object">
      <properties>
        <property name="cmis:objectId">
          <title>Object Id</title>
          <description>The unique object id (a node ref)</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:objectTypeId">
          <title>Object Type Id</title>
          <description>Id of the object’s type</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:baseTypeId">
          <title>Base Type Id</title>
          <description>Id of the base object type for the object</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>true</tokenised>
          </index>
        </property>
        <property name="cmis:createdBy">
          <title>Created by</title>
          <description>The authority who created this object</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:creationDate">
          <title>Creation Date</title>
          <description>The object creation date</description>
          <type>d:datetime</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:lastModifiedBy">
          <title>Last Modified By</title>
          <description>The authority who last modified this object</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:lastModificationDate">
          <title>Last Modified Date</title>
          <description>The date this object was last modified</description>
          <type>d:datetime</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:changeToken">
          <title>Change token</title>
          <description>Change Token</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
      </properties>
    </type>

    <!--  TODO: mark as abstract -->
    <type name="cmis:filesystemobject">
      <parent>cmis:object</parent>
      <properties>
        <property name="cmis:name">
          <title>Name</title>
          <description>Name</description>
          <type>d:text</type>
          <protected>false</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>both</tokenised>
          </index>
        </property>
      </properties>
    </type>

    <type name="cmis:document">
      <title>Document</title>
      <description>Document Type</description>
      <parent>cmis:filesystemobject</parent>
      <properties>
        <property name="cmis:isImmutable">
          <title>Is Immutable</title>
          <description>Is the document immutable?</description>
          <type>d:boolean</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:isLatestVersion">
          <title>Is Latest Version</title>
          <description>Is this the latest version of the document?</description>
          <type>d:boolean</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:isMajorVersion">
          <title>Is Major Version</title>
          <description>Is this a major version of the document?</description>
          <type>d:boolean</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:isLatestMajorVersion">
          <title>Is Latest Major Version</title>
          <description>Is this the latest major version of the document?</description>
          <type>d:boolean</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:versionLabel">
          <title>Version Label</title>
          <description>The version label</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false"/>
        </property>
        <property name="cmis:versionSeriesId">
          <title>Version series id</title>
          <description>The version series id</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false"/>
        </property>
        <property name="cmis:isVersionSeriesCheckedOut">
          <title>Is Version Series Checked Out</title>
          <description>Is the version series checked out?</description>
          <type>d:boolean</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:versionSeriesCheckedOutBy">
          <title>Version Series Checked Out By</title>
          <description>The authority who checked out this document version series</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:versionSeriesCheckedOutId">
          <title>Version Series Checked Out Id</title>
          <description>The checked out version series id</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:checkinComment">
          <title>Checkin Comment</title>
          <description>The checkin comment</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:contentStreamLength">
          <title>Content Stream Length</title>
          <description>The length of the content stream</description>
          <type>d:long</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:contentStreamMimeType">
          <title>Content Stream MIME Type</title>
          <description>The content stream MIME type</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:contentStreamFileName">
          <title>Content Stream Filename</title>
          <description>The content stream filename</description>
          <type>d:text</type>
          <protected>false</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>true</tokenised>
          </index>
        </property>
        <property name="cmis:contentStreamId">
          <title>Content Stream Id</title>
          <description>Id of the stream</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
      </properties>
    </type>

    <type name="cmis:folder">
      <title>Folder</title>
      <description>Folder Type</description>
      <parent>cmis:filesystemobject</parent>
      <properties>
        <property name="cmis:parentId">
          <title>Parent Id</title>
          <description>The parent id of the folder</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="true">
            <tokenised>false</tokenised>
          </index>
        </property>
        <property name="cmis:path">
          <title>Path</title>
          <description>The fully qualified path to this folder/description</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false"/>
        </property>
        <property name="cmis:allowedChildObjectTypeIds">
          <title>Allowed Child Object Types Ids</title>
          <description>The allowed child object type ids</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="false">false</mandatory>
          <multiple>true</multiple>
          <index enabled="false" />
        </property>
      </properties>
    </type>

    <type name="cmis:relationship">
      <title>Relationship</title>
      <description>Relationship Type</description>
      <parent>cmis:filesystemobject</parent>
      <properties>
        <property name="cmis:sourceId">
          <title>Source Id</title>
          <description>The source id for the relationship</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
        <property name="cmis:targetId">
          <title>Target Id</title>
          <description>The target id for the relationship</description>
          <type>cmis:id</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
      </properties>
    </type>

    <type name="cmis:policy">
      <title>Policy</title>
      <description>Policy Type</description>
      <parent>cmis:object</parent>
      <properties>
        <property name="cmis:policyText">
          <title>Policy Text</title>
          <description>The policy text</description>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory enforced="true">true</mandatory>
          <multiple>false</multiple>
          <index enabled="false" />
        </property>
      </properties>
    </type>

  </types>

</model>