jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Help on versioning
Date Thu, 17 Sep 2009 17:06:34 GMT
On Thu, Sep 17, 2009 at 16:44, freak182 <eman.nollase@gmail.com> wrote:
> Can you have some pointers or line of codes on proper way to versioned a
> file? im little bit confused now.

http://wiki.apache.org/jackrabbit/ExamplesPage

For overwriting the data of your existing nt:file node, simply do

file.checkout();
file.getNode("jcr:content").setProperty("jcr:data", inputStream);
// maybe update jcr:lastModified etc.
file.save();
file.checkin();

If you want to change existing versions (because I noted you did
rootNode.getNode(baseVersion))  - that's not possible, versions are
read-only.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message