You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Christophe Lombart <ch...@gmail.com> on 2008/02/07 14:25:44 UTC

[OCM] The ocm:discriminator

Hi all,

I would like to make some simplifications in the OCM framework.
One point to solve is certainly the ObjectContentManager setup. In order to
run correctly, the mixin node type "ocm:disciminator" has be created into
the JCR repo. This mixin node type is used internally by the
ObjectContentManager to store the classname for nodes based on generic types
like nt:unstructured. It is also used  for mananing object inheritance tree.


but ....

I think I misunderstood the JCR node types.

If I apply a node type to a node, it is still possible to add other
properties to this node without creating a mixin node type (just call the
method setProperty(...) - right ? I made a test and it seems to work.
Is it specific to Jackrabbit ?


If I can do it, the mixin node type "ocm:disciminator" is not necessary, we
can replace it by a simple property "ocm_classname".
Of course, It is no necessary to map this property into a object attribute.
It is still used internally by the ocm.

By this way, the JCR repo has not be initialised correctly for OCM
applications.

WDYT  ?


br,
Christophe

Re: [OCM] The ocm:discriminator

Posted by Christophe Lombart <ch...@gmail.com>.
Why not. it is a good suggestion.

Christophe

On Feb 7, 2008 6:09 PM, Padraic Hannon <pi...@wasabicowboy.com> wrote:

> It seems that the discriminator is only needed for the case where you
> want to map multiple objects to a single node type. Perhaps we can
> force its use only for that condition? That would allow many use cases
> to exist without the need for registering special mixin types and
> without the need for forcing odd data into the repository.
>
> -paddy
>
> On Feb 7, 2008, at 8:23 AM, Christophe Lombart wrote:
>
> > Anyway, forget my solution it is not working in all case (of
> > course). it is
> > time to go at home.
> >
> >
> > On Feb 7, 2008 4:08 PM, Alex Lukin <lu...@stu.cn.ua> wrote:
> >
> >> I think that mixin node for ocm is right solution. You may just hide
> >> ocm:discriminator node type registration
> >> somewhere behind implementation to simplify OCM initialization.
> >>
> >
> > That means the ObjectContentManager can be used only with Jackrabbit
> > because
> > node type registration is not standard.
> >
> >
> > Christophe
>
>
>

Re: [OCM] The ocm:discriminator

Posted by Padraic Hannon <pi...@wasabicowboy.com>.
It seems that the discriminator is only needed for the case where you  
want to map multiple objects to a single node type. Perhaps we can  
force its use only for that condition? That would allow many use cases  
to exist without the need for registering special mixin types and  
without the need for forcing odd data into the repository.

-paddy

On Feb 7, 2008, at 8:23 AM, Christophe Lombart wrote:

> Anyway, forget my solution it is not working in all case (of  
> course). it is
> time to go at home.
>
>
> On Feb 7, 2008 4:08 PM, Alex Lukin <lu...@stu.cn.ua> wrote:
>
>> I think that mixin node for ocm is right solution. You may just hide
>> ocm:discriminator node type registration
>> somewhere behind implementation to simplify OCM initialization.
>>
>
> That means the ObjectContentManager can be used only with Jackrabbit  
> because
> node type registration is not standard.
>
>
> Christophe



Re: [OCM] The ocm:discriminator

Posted by Christophe Lombart <ch...@gmail.com>.
We are still under jsr-170, not yet under jsr-283

On Feb 7, 2008 6:20 PM, Alex Lukin <lu...@stu.cn.ua> wrote:

> Thursday 07 February 2008 18:23:00 Christophe Lombart написав:
>
> > That means the ObjectContentManager can be used only with Jackrabbit
> > because node type registration is not standard.
>
> Not exactly. See JSR-283  ch. 6.10 and Appendix B. This is optional
> features for  Level 2.
> Well, code may check this feature as specified in p. 6.10 and register new
> minxin type if it is possible.
> If repository can not register node types, your code may just add needed
> properties.
> And yes, CND is standard, not XML you currently use.
>
> Anyway, it's your code and you are decision maker.
> --
> SY, Alex Lukin
> RIPE NIC HDL: LEXA1-RIPE
>

Re: [OCM] The ocm:discriminator

Posted by Alex Lukin <lu...@stu.cn.ua>.
Thursday 07 February 2008 18:23:00 Christophe Lombart написав:

> That means the ObjectContentManager can be used only with Jackrabbit
> because node type registration is not standard.

Not exactly. See JSR-283  ch. 6.10 and Appendix B. This is optional features for  Level 2.
Well, code may check this feature as specified in p. 6.10 and register new minxin type if it is possible.
If repository can not register node types, your code may just add needed properties.
And yes, CND is standard, not XML you currently use.
 
Anyway, it's your code and you are decision maker. 
-- 
SY, Alex Lukin
RIPE NIC HDL: LEXA1-RIPE

Re: [OCM] The ocm:discriminator

Posted by Christophe Lombart <ch...@gmail.com>.
Anyway, forget my solution it is not working in all case (of course). it is
time to go at home.


On Feb 7, 2008 4:08 PM, Alex Lukin <lu...@stu.cn.ua> wrote:

> I think that mixin node for ocm is right solution. You may just hide
> ocm:discriminator node type registration
> somewhere behind implementation to simplify OCM initialization.
>

That means the ObjectContentManager can be used only with Jackrabbit because
node type registration is not standard.


Christophe

Re: [OCM] The ocm:discriminator

Posted by Alex Lukin <lu...@stu.cn.ua>.
Thursday 07 February 2008 15:25:44 Christophe Lombart написав:
[skiped]
>
> If I can do it, the mixin node type "ocm:disciminator" is not necessary, we
> can replace it by a simple property "ocm_classname".
> Of course, It is no necessary to map this property into a object attribute.
> It is still used internally by the ocm.
>
> By this way, the JCR repo has not be initialised correctly for OCM
> applications.
>
> WDYT  ?
I think that mixin node for ocm is right solution. You may just hide ocm:discriminator node type registration
somewhere behind implementation to simplify OCM initialization.

As I understand JCR specifications, purpose of mixin node type is to mark some node as capable of some extra functionality.
That's exactly what OCM does. It adds some functionality to node, e.g. ability to be mapped to some class and object tree.
Does not matter that you can create any property for any node. It will be just additional propery which may be misused.

OCM is not mandatory part of JSR-283, even not mentioned there so... you are who makes the fashion :) 


-- 
SY, Alex Lukin
RIPE NIC HDL: LEXA1-RIPE