You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by hsp <pi...@ibest.com.br> on 2014/02/27 19:08:23 UTC

Exception in adding mixin with same name property

Hi,

I am facing a situation where when adding a mixin to a node raises a
exception:

"
javax.jcr.nodetype.ConstraintViolationException: The property definition for
'{http://www.type/prop/1.0}theme' in node type
'{http://www.type/1.0}typeOne' conflicts with node type
'{http://www.type/1.0}typeTwo': ambiguous property definition
"

In other words, its possible to define two mixin with properties with same
name in both, BUT, a node will not accept be owner of two properties with
same name (even if it was origined by two different mixin), rigth??? Is
there this constraint in the specification JSR283? I think I missed it when
I designed the node types...

Ok, but now, what can I do in this case? The application has millions of
nodes...
I have to alter the name of the property in one of those mixin type, is it
possible?
The user, in our application, will need to apply those two mixin in some
nodes in certain situation...

Hoping by any help, thanks!
Helio.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Exception-in-adding-mixin-with-same-name-property-tp4660381.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Exception in adding mixin with same name property

Posted by hsp <pi...@ibest.com.br>.
Is there a way to do this?
Remove or rename a property from an already registered node type?
Best Regards,
Helio.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Exception-in-adding-mixin-with-same-name-property-tp4660381p4660419.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Exception in adding mixin with same name property

Posted by hsp <pi...@ibest.com.br>.
Tobias,

The repository is already in production, and the nodes already have the
mixin "typeOne" and must have in some cases the other mixin "typeTwo", but
the constraint prevents...
I already use in other node types declarations these mixins with
inheritance, so to alter the mixins with inheritance is out of question.
The mixins I mentioned have many other properties, I just cited the one that
is with the same name in both mixin.

So I need to see the possibility of changing the name of one of the
properties in one mixin, because  them are already registered and being used
in whole repository.

Regards,
Helio.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Exception-in-adding-mixin-with-same-name-property-tp4660381p4660386.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Exception in adding mixin with same name property

Posted by Tobias Bocanegra <tr...@day.com>.
Hi,
I see, IMO it should work, since both property definitions are equal.
however, I think that Lukas' suggestion is better to solve the problem
with inheritance.

regards, toby

On Thu, Feb 27, 2014 at 11:20 AM, hsp <pi...@ibest.com.br> wrote:
> I defined node types always with xml, basically can resume as:
>
>
>
>
> The name "prop:theme" is ambigous, but the values would be different. Let's
> say that this was a "mistake" when defined the mixin types...
> Initially the nodes (typePrimary) would only get one of those mixin, but now
> the rule has changed and the node can get both mixin, but because the
> constraint the use case is broken...
>
> I Appreciate some ideas,
> Best Regards!
>
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Exception-in-adding-mixin-with-same-name-property-tp4660381p4660384.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Exception in adding mixin with same name property

Posted by hsp <pi...@ibest.com.br>.
I defined node types always with xml, basically can resume as:


 		

The name "prop:theme" is ambigous, but the values would be different. Let's
say that this was a "mistake" when defined the mixin types...
Initially the nodes (typePrimary) would only get one of those mixin, but now
the rule has changed and the node can get both mixin, but because the
constraint the use case is broken...

I Appreciate some ideas,
Best Regards!




--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Exception-in-adding-mixin-with-same-name-property-tp4660381p4660384.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Exception in adding mixin with same name property

Posted by Tobias Bocanegra <tr...@apache.org>.
can you provide the CND of the 2 mixins?
regards, toby

On Thu, Feb 27, 2014 at 10:08 AM, hsp <pi...@ibest.com.br> wrote:
> Hi,
>
> I am facing a situation where when adding a mixin to a node raises a
> exception:
>
> "
> javax.jcr.nodetype.ConstraintViolationException: The property definition for
> '{http://www.type/prop/1.0}theme' in node type
> '{http://www.type/1.0}typeOne' conflicts with node type
> '{http://www.type/1.0}typeTwo': ambiguous property definition
> "
>
> In other words, its possible to define two mixin with properties with same
> name in both, BUT, a node will not accept be owner of two properties with
> same name (even if it was origined by two different mixin), rigth??? Is
> there this constraint in the specification JSR283? I think I missed it when
> I designed the node types...
>
> Ok, but now, what can I do in this case? The application has millions of
> nodes...
> I have to alter the name of the property in one of those mixin type, is it
> possible?
> The user, in our application, will need to apply those two mixin in some
> nodes in certain situation...
>
> Hoping by any help, thanks!
> Helio.
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Exception-in-adding-mixin-with-same-name-property-tp4660381.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.