Found duplicate property definition...
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2008 10:43 AM
Hi
I have just started looking into Alfresco and here is a problem I have. I have created these three types:
* fa:base_document - this is a base type which contains some common attributes:
* fa:document - this is my document type, this adds only approvedOn attribute
* fa:folder - this is my new folder type, adds two attributes (approvedOn can be set when all documents in this folder are also approved)
As you can see there is a fa
roductRef attribute both in fa:document and in fa:folder - this is a field which is common for these two types.
Now, when I validate this model I get:
kbryd@mob:~/tmp/alfresco/tomcat$ ./modelValiddate.sh
Testing dictionary model definitions…
alfresco/model/dictionaryModel.xml
alfresco/model/systemModel.xml
org/alfresco/repo/security/authentication/userModel.xml
alfresco/model/contentModel.xml
alfresco/model/wcmModel.xml
alfresco/model/applicationModel.xml
alfresco/model/bpmModel.xml
alfresco/extension/testModel.xml
Found an invalid model…
Could not import bootstrap model alfresco/extension/testModel.xml
Failed to compile model fa:testmodel
Found duplicate property definition fa
roductRef within class fa:folder and class fa:base_document
I have read somewhere that the name of attribute must be globally unique, but I don't understand why and first of all how one should proceed in such situations like mine (I don't like the idea to change name of a property each time)? Should I create an aspect instead of that attribute?
Thanks
Karol
I have just started looking into Alfresco and here is a problem I have. I have created these three types:
* fa:base_document - this is a base type which contains some common attributes:
<type name="fa:base_document"> <title>Base Document</title> <parent>cm:content</parent> <properties> <property name="fa:documentType"> <type>d:text</type> </property> <property name="fa:productRef"> <type>d:text</type> </property> <property name="fa:description"> <type>d:text</type> </property> </properties> </type>
* fa:document - this is my document type, this adds only approvedOn attribute
<type name="fa:document"> <title>Document</title> <parent>fa:base_document</parent> <properties> <property name="fa:approvedOn"> <type>d:date</type> </property> </properties> </type>
* fa:folder - this is my new folder type, adds two attributes (approvedOn can be set when all documents in this folder are also approved)
<type name="fa:folder"> <title>Folder</title> <parent>cm:folder</parent> <properties> <property name="fa:productRef"> <type>d:text</type> </property> <property name="fa:approvedOn"> <type>d:date</type> </property> </properties> </type>
As you can see there is a fa

Now, when I validate this model I get:
kbryd@mob:~/tmp/alfresco/tomcat$ ./modelValiddate.sh
Testing dictionary model definitions…
alfresco/model/dictionaryModel.xml
alfresco/model/systemModel.xml
org/alfresco/repo/security/authentication/userModel.xml
alfresco/model/contentModel.xml
alfresco/model/wcmModel.xml
alfresco/model/applicationModel.xml
alfresco/model/bpmModel.xml
alfresco/extension/testModel.xml
Found an invalid model…
Could not import bootstrap model alfresco/extension/testModel.xml
Failed to compile model fa:testmodel
Found duplicate property definition fa

I have read somewhere that the name of attribute must be globally unique, but I don't understand why and first of all how one should proceed in such situations like mine (I don't like the idea to change name of a property each time)? Should I create an aspect instead of that attribute?
Thanks
Karol
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2008 10:11 AM
The real issue here is the namespace applied in your model to make things unique, not the types per se. If I define
<namespaces>
<namespace uri="custom.model" prefix="custom"/>
</namespaces>
<types>
<type name="custom
ressrelease">
Then I can only have one custom
ressrelease in that model. If you need to utilize the same attribute name across types, you should either leverage:
• Subtyping / inheritance
• aspects
If applicable, or in any case – you can always create a separate model with its own namespace to avoid the clash.
<namespaces>
<namespace uri="custom.model" prefix="custom"/>
</namespaces>
<types>
<type name="custom

Then I can only have one custom

• Subtyping / inheritance
• aspects
If applicable, or in any case – you can always create a separate model with its own namespace to avoid the clash.
