AnsweredAssumed Answered

Adding custom models as XML

Question asked by ally311 on Jan 15, 2018
Latest reply on Jan 15, 2018 by ally311

I'm trying to add a custom model to my alfresco server using an XML model definition file, however every time I try to activate the model it gives the message "could not update details".

 

I imagine the issue is something to do with how I've written it, but I've based it on the version found on the Jeff Pots tutorial (Working With Custom Content Types in Alfresco | ECMArchitect | Alfresco Developer Tutorials).

The original version outlined in the tutorial works, but my edited version doesn't and I just can't see why.

Any help will be greatly appreciated.

My code is as follows:

 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Definition of new Model -->
<model name="tst:document" xmlns="http://www.alfresco.org/model/dictionary/1.0">
      <!-- Optional meta-data about the model -->
      <description>Test Document Model</description>
      <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://127.0.0.1:8080/model/testDoc/1.0" prefix="tst" />
      </namespaces>

      <types>
            <!-- Enterprise-wide generic document type -->
            <type name="tst:doc">
            <title>Test Document</title>
            <parent>cm:content</parent>
            </type>
      </types>

      <aspects>
            <aspect name="tst:current">
                  <title>Active Document</title>
                  <properties>
                        <property name="tst:currentVersion">
                              <type>d:boolean</type>
                              <default>true</default>
                              <mandatory>true</mandatory>
                        </property>
                  </properties>
            </aspect>
      </aspects>

</model>

Outcomes