10-15-2017 02:59 AM
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>
10-16-2017 05:58 AM
Hi,
I think you are declaring twice the same property "d:text"
<property name="my:contractNumber">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<!-- <property name="my:contractNumber">
<type>d:text</type>
<mandatory>true</mandatory>
</property> -->
I think, you don´t have two properties with the same name.
Regards,
clv
10-16-2017 11:09 AM
Hi Yuvraj,
Property names have to be unique. Put them on an aspect, a super type or in different name spaces. If they are the same property you need to define an aspect or create a super type and inherit the common properties
Please refer this data dictionary guide for more information
Thanks,
Kalpesh
ContCentric
Explore our Alfresco products with the links below. Use labels to filter content by product module.