01-15-2018 05:48 AM
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>
01-15-2018 07:29 AM
You have entered the incorrect metamodel sequence for property element. To get information on that visit http://docs.alfresco.com/5.2/concepts/metadata-model-props.html
Replace the code in aspect.
<aspect name="tst:current">
<title>Active Document</title>
<properties>
<property name="tst:currentVersion">
<type>d:boolean</type>
<mandatory>true</mandatory>
<default>true</default>
</property>
</properties>
</aspect>
01-15-2018 07:29 AM
You have entered the incorrect metamodel sequence for property element. To get information on that visit http://docs.alfresco.com/5.2/concepts/metadata-model-props.html
Replace the code in aspect.
<aspect name="tst:current">
<title>Active Document</title>
<properties>
<property name="tst:currentVersion">
<type>d:boolean</type>
<mandatory>true</mandatory>
<default>true</default>
</property>
</properties>
</aspect>
01-15-2018 07:48 AM
thanks, also I can't seem to find the answer, but can you give a type a mandatory aspect that is outlined in the same document? (i.e setting tst:current as mandatory for tst:doc)
01-15-2018 08:01 AM
<type name="tst:doc">
<title>Test Document</title>
<parent>cm:content</parent>
<mandatory-aspects>
<aspect>tst:current</aspect>
</mandatory-aspects>
</type>
01-15-2018 08:08 AM
thanks, I had tried that, but it seems I'd been using the version with <default> in the wrong place....
Explore our Alfresco products with the links below. Use labels to filter content by product module.