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>
Solved! Go to Solution.
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>
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>
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)
<type name="tst:doc">
<title>Test Document</title>
<parent>cm:content</parent>
<mandatory-aspects>
<aspect>tst:current</aspect>
</mandatory-aspects>
</type>
thanks, I had tried that, but it seems I'd been using the version with <default> in the wrong place....
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.