Hi,
I might have found a solution that seems to work at first sight, but would like
to hear if this isn't breaking something.
I use the restore method and then remove the latest version again. So I get
something like:
final VersionManager vm = session.getWorkspace().getVersionManager();
vm.restore(session.getWorkspace().getVersionManager().getBaseVersion(path),
true);
final Node baseVersion = vm.getBaseVersion(path);
final VersionHistory vh = vm.getVersionHistory(path);
vh.removeVersion(baseVersion.getName());
Is this an OK solution?
Thanks
Dieter Wachters
Architect
direct:
[email protected]
LetterGen
Groene Hofstraat 31
2850 Boom
Belgium
www.lettergen.com
tel: +32 3 450 89 80
fax: +32 3 450 89 89
- DISCLAIMER -
This message contains confidential information and is intended only for
[email protected]. If you are not [email protected], you
should not disseminate, distribute or copy this e-mail. Please notify
[email protected] immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system. E-mail transmission
cannot be guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain
viruses. Dieter Wachters therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy version.
--------------------------------------------------------------------------
-----Original Message-----
From: Dieter Wachters [mailto:[email protected]]
Sent: woensdag 9 juni 2010 9:35
To: [email protected]
Subject: RE: Cancel checkout
Hi,
That is not really a solution or workaround for me, because the first
requirement is that the node isn't checked out anymore.
I find it strange why this is not possible in the JCR standard.
Any other ideas?
Dieter Wachters
Architect
direct:
[email protected]
LetterGen
Groene Hofstraat 31
2850 Boom
Belgium
www.lettergen.com
tel: +32 3 450 89 80
fax: +32 3 450 89 89
- DISCLAIMER -
This message contains confidential information and is intended only for
[email protected]. If you are not [email protected], you
should not disseminate, distribute or copy this e-mail. Please notify
[email protected] immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system. E-mail transmission
cannot be guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain
viruses. Dieter Wachters therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy version.
--------------------------------------------------------------------------
-----Original Message-----
From: John Doe [mailto:[email protected]]
Sent: dinsdag 8 juni 2010 3:03
To: [email protected]
Subject: Re: Cancel checkout
Hi,
One solution (more like a workaround) is to restore the properties' values.
Node frozenNode = node.getBaseVersion().get("nt:frozenNode");
// for each of your node property, get the value from the frozen node an set it
to the node
session.save();
This workaround leaves one problem: the node remains checked out.
________________________________
From: Dieter Wachters <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Tue, June 8, 2010 3:39:03 PM
Subject: Cancel checkout
Hi all,
When a node is checked out and optionally changes are done on this node, I want
to be able to discard these changes and undo the checkout without creating a
new version.
I already found a thread about this:
http://jackrabbit.510166.n4.nabble.com/Cancel-checkout-td517753.html
But this solution was the one I'm already using and always generates a new
version.
My code currently looks like this:
session.getWorkspace().getVersionManager().restore(session.getWorkspace().getVersionManager().getBaseVersion(path),
true);
Can someone help me to stop generating the new version on this 'uncheckout'
functionality?
Kind regards,
Dieter Wachters
Dieter Wachters
Architect
direct:
[email protected]
LetterGen
Groene Hofstraat 31
2850 Boom
Belgium
www.lettergen.com
tel: +32 3 450 89 80
fax: +32 3 450 89 89
- DISCLAIMER -
This message contains confidential information and is intended only for
[email protected]. If you are not [email protected], you
should not disseminate, distribute or copy this e-mail. Please notify
[email protected] immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system. E-mail transmission
cannot be guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain
viruses. Dieter Wachters therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy version.
--------------------------------------------------------------------------