You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by baxxt3r <ca...@gmail.com> on 2012/02/07 09:17:48 UTC

How to register a custom node type as versionable ?

Hi, 

I am new to JCR and I have this problem registering a custom node type as
versionable (i hope I got this right)
To explain a little better, I am using Magnolia CMS and my goal is to
version my custom nodes in order to give the possibility to the editor of
the page to have a list of versions and to be able to see the changes.

My nodetypes.xml looks something like this:
<nodeTypes
    xmlns:rep="internal"
    xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
    xmlns:mgnl="http://www.magnolia.info/jcr/mgnl"
    xmlns:jcr="http://www.jcp.org/jcr/1.0">

    <nodeType name="mgnl:product" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
        <supertypes>
            <supertype>mgnl:content</supertype>
            <supertype>mix:referenceable</supertype>
        </supertypes>
    </nodeType>
    <nodeType name="mgnl:productCar" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
        <supertypes>
            <supertype>mgnl:product</supertype>
        </supertypes>
    </nodeType>
.........................................................................................
</nodeTypes>

I have to say that mgnl:content already has mix:referenceable as a supertype
and I expected to see some inheritance... but the node of type mgnl:product
was not versionable in the end.
Is there something else that I must configure or it's just the XML
containing the node types?

Any help will be highly appreciated.

Thanks a lot, 
Catalin


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-register-a-custom-node-type-as-versionable-tp4364043p4364043.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to register a custom node type as versionable ?

Posted by baxxt3r <ca...@gmail.com>.
You are right, as it turns, in Magnolia a node is never being versioned. 
They seem to be versioning a copy of the node into a separate repository...
I will do some more investigation on this matter.

Thanks very much for the reply, 
Catalin

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-register-a-custom-node-type-as-versionable-tp4364043p4364819.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to register a custom node type as versionable ?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Feb 7, 2012 at 1:46 PM, baxxt3r <ca...@gmail.com> wrote:
> The problem is that in magnolia cms, mix:versionable had some problems
> which slowed the system and they decided to use mix:referenceable instead.

If I understand the Magnolia implementation correctly, they
implemented their own versioning mechanism on the application level.
That's a valid approach, especially if you need a more complex or
flexible versioning model than the one provided by the JCR spec.
However, when you do that, you can't use the JCR versioning tools to
manage versionable content.

> What i cannot understand is why the node type mgnl:content which has
> mix:versionable and nt:hierarchyNode as supertypes works fine and has
> version... And shouldn't mgnl:product inherit from mgnl:content?

That's a question probably best addressed to the Magnolia community.

BR,

Jukka Zitting

Re: How to register a custom node type as versionable ?

Posted by baxxt3r <ca...@gmail.com>.
Hi, 

Thank you for the reply!

The problem is that in magnolia cms, mix:versionable had some problems which
slowed the system and they decided to use mix:referenceable instead. I
looked on all the related forums and everyone said pretty much the same
thing...

What i cannot understand is why the node type mgnl:content which has
mix:versionable and nt:hierarchyNode as supertypes works fine and has
version... And shouldn't mgnl:product inherit from mgnl:content?

Thanks, 
Catalin



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-register-a-custom-node-type-as-versionable-tp4364043p4364616.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to register a custom node type as versionable ?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Feb 7, 2012 at 9:17 AM, baxxt3r <ca...@gmail.com> wrote:
> I have to say that mgnl:content already has mix:referenceable as a supertype
> and I expected to see some inheritance... but the node of type mgnl:product
> was not versionable in the end.

The supertype you want is mix:versionable instead of mix:referenceable.

BR,

Jukka Zitting