cancel
Showing results for 
Search instead for 
Did you mean: 

duplicate property definition in parallel types?

aweber1nj
Champ in-the-making
Champ in-the-making
I am trying to get my content model finished (or at least 1.0 of it).  However, when running the model through the TestModel class, it is complaining about a "duplicate property definition" within two classes.  The two properties are named exactly the same, because they apply to both type-definitions, but not to the parent, nor to the type-siblings.

For example take the following, rudimentary types:
TypeA
–>TypeA.1
–>TypeA.2
–>TypeA.3
–>TypeA.4

Where TypeA.x are all siblings, with the same parent: TypeA.

While they all need the parent's properties to be inherited, only "TypeA.1" and "TypeA.2" require the property "td:agent" to be present on the type.  That's how it's defined, but the TestModel is complaining that I somehow am not allowed to do that?  (For programming and consistency purposes, I want the two properties on the two siblings to be identical in every way, including name.)

I do understand that an Aspect cutting across the two types would probably work here, but I'm unclear that would be a useful bit of overhead just for one property, across two sibling-types.

Can someone clarify why this is not allowed and what the recommendation might be?

Thanks in advance,
AJ
2 REPLIES 2

lementree
Champ on-the-rise
Champ on-the-rise
Hi

For this case Aspect is the way to achieve your goal.

Type A
–>Type A.1 and Type A.2 are two siblings of Type A, so they will share all the properties from Type A.

you are trying to use same property "td:agent" for both TypeA.1 and A.2 so here you would get a duplicate for the same property "td:agent".

aweber1nj
Champ in-the-making
Champ in-the-making
So I started to tweak my configuration, and with some testing, it would appear that Alfresco mandates that property names be unique across the entire repository?

That is, the limitation of re-using a property's name appears to be "global", not just limited to siblings of a class/type?  Is that correct?  That would be a pretty strict "rule"/limitation that I would've thought would be spelled-out somewhere.

-AJ