AnsweredAssumed Answered

content-model.xml

Question asked by yuva on Oct 15, 2017
Latest reply on Oct 16, 2017 by kalpesh.c2

Hi

I have created a content model like below, In this file,It is not take two properties with same name in different types, can see the commented tags in second type named as contractNumber.If i uncomment it, it throws an error containing duplicate. Why it is not accepting? And how can i declare it?

Can anyone help me to get a clarification on this issue?

 

Thank you.

 

content-model.xml  :

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- Definition of new Model -->

<!-- The important part here is the name - Note: the use of the my: namespace
which is defined further on in the document -->
<model name="my:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

<!-- Optional meta-data about the model -->
<description>Example Custom Model</description>
<author></author>
<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 -->
<!-- NOTE: The following namespace my.new.model should be changed to reflect your own namespace -->
<namespaces>
<namespace uri="http://www.mycompany.com/model/content/1.0" prefix="my"/>
</namespaces>

<types>
<type name="my:salesCustomerCare">
<title>Sales and Customer care</title>
<parent>cm:content</parent>
</type>
<type name="my:contractCopies">
<title>Contract Copies</title>
<parent>my:salesCustomerCare</parent>
<properties>
<property name="my:contractType">
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="my:contractNumber">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="my:clientName">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="my:contractStart">
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="my:contractEnd">
<type>d:date</type>
<mandatory>false</mandatory>
</property>
</properties>
</type>
<type name="my:wrcTenancyCertificate">
<title>WRC Tenancy Certificate</title>
<parent>my:salesCustomerCare</parent>
<properties>
<property name="my:dateOfApplication">
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="my:referenceNumber">
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="my:leaseIssueDate">
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="my:leaseExpiryDate">
<type>d:date</type>
<mandatory>true</mandatory>
</property>
<!-- <property name="my:contractNumber">
<type>d:text</type>
<mandatory>true</mandatory>
</property> -->
<property name="my:tenantName">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="my:tenantCompany">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</type>
</types>

</model>

Outcomes