You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Christian Wurbs <Ch...@itemic.com> on 2010/01/23 00:41:44 UTC

How do I remove the mix:versionable functionality of a versionable node

Hallo all,

first I want to say sorry for not updating you on the
NamespaceRegistry-Issue with clustering. But no time for testing it so far.
I really appreciate your quick answers.

Maybe you can help me out with the next issue I’m faced with:

* How can I remove the “mix:versionable” MixinType of a node. The node
already has the “mix:versionable” MixinType assigned and already has a
version history. I would like to delete the complete VersionHistory of that
node and use the Last Revision of that node as normal node.

* I tried the following two ways:

	1st)	(NodeType nodeType : node.getMixinNodeTypes()){
			if (nodeType.isNodeType("mix:versionable")){
				node.removeMixin("mix:versionable");
				node.save()
			}
		}

	2nd)	for (NodeType nodeType : node.getMixinNodeTypes()){
			if (nodeType.isNodeType("mix:versionable")){
				node.checkout();
				node.removeMixin("mix:versionable");
				session.save();
				node.checkin();
			}
		}

==> Both of them produced no Exceptions.
==> But when I try to change the node later Jackrabbit (1.6.0) throws an
exception stating that the "node is checked-in."
		
If there is no real way to do this there might be a workaround like copying
the versionized node(revision) to a new unversionized node? But I think
copying also copies the mixintypes - Am I right?

Thank you in advance
Christian Wurbs