jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Converting node-type
Date Sun, 02 Jul 2006 05:35:21 GMT

On 7/1/06, Eric Peukert <eric.peukert@mail.inf.tu-dresden.de> wrote:
> I try to convert a node and its node-type after it was already created.
> Does anyone have an idea how that can be achieved?

You can add or remove the mixin types of a node, but you can not
change its primary type. The best way to achieve the what you are
trying to do, is make an in-memory copy of the node content, remove
the node from the workspace, and create a new node with the copied
content but a different primary type.

What is your use case for trying to do this? The primary type is a
fundamental property of a node, even more than its name that can be
changed with Session.move(). You can think of the primary type of a
node as the class of a Java object, i.e. there is no way to change
that short of making a manual copy of the instance.

If this is common use case for you, you might want to consider having
a more generic primary type and using mixin types for dynamic node


Jukka Zitting

Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

View raw message