jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bocanegra <tri...@day.com>
Subject Re: Restore deleted node
Date Mon, 20 Jul 2009 12:16:22 GMT
of course you can restore a deleted node, using:

Node.restore(Version version, String relPath, boolean removeExisting);

the tricky part is to find the correct version. in order to do that,
you can use the search or traverse the version storage.
since a versionable node can be moved around without loosing it's id,
the path is not recorded in the version. but i might make sense to
add a "path" property to you node before the checkin, so you can use
that later to find the deleted version.

as example, in our CMS we record the "parentPath" and the "name" of
the node in the node itself prior to a checkin.
so a deleted node can be easily found when searching for all versions
having a given parent path.

regards, toby

On Mon, Jul 20, 2009 at 1:58 PM, Wulf Rowek |
THESISdigital<rowek@thesisdigital.de> wrote:
> Hi,
> i've asked this already in another thread, but I think it is better to open
> an own one.
> It looks like it is not the intention of the version system (at least in the
> the meaning of jcr-170), but maybe (hopefully) i'm wrong:
> is it possible to restore a deleted versioned node? I cannot understand why
> it should not, because all information (except the former path) is contained
> in the version history.
> Is there any simple method like workspace.restore(String uuid, String
> pathToRestoreNode)?
> I will appreciate any comment to this.
> regards,
> Wulf
> --
> THESIS digital GmbH | Wulf Rowek
> Boxhagener Stra├če 76-78, 10245 Berlin
> Aufgang 3, 4. Obergeschoss
> Fon (030) 91 68 44-55
> Fax (030) 91 68 44-99
> Gsm (0170) 541 38 39
> Mail rowek@thesisdigital.de
> Web www.thesisdigital.de

View raw message