Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92B6715D3 for ; Tue, 26 Apr 2011 13:29:19 +0000 (UTC) Received: (qmail 1696 invoked by uid 500); 26 Apr 2011 13:29:18 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 1663 invoked by uid 500); 26 Apr 2011 13:29:18 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Delivered-To: moderator for users@jackrabbit.apache.org Received: (qmail 89686 invoked by uid 99); 26 Apr 2011 13:22:39 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bruno.dusausoy@yp5.be designates 91.121.85.197 as permitted sender) X-Virus-Scanned: Debian amavisd-new at jumper.yp5.be Message-ID: <4DB6C701.9080707@yp5.be> Date: Tue, 26 Apr 2011 15:22:09 +0200 From: Bruno Dusausoy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Jackrabbit Users ML Subject: JCR 2.0 Versioning Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Copyrighted-Material: Please visit http://www.yp5.be X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have a node of primary type "jcr:content" which is versionable ("mix:simpleVersionable"). When I update it, I create a new version with the sequence : 1) checkout 2) modification 3) save 4) checkin Everything is ok at this point, a new version is indeed created. But when I look at the version history, like this : Workspace workspace = session.getWorkspace(); VersionManager manager = workspace.getVersionManager(); VersionHistory history = manager.getVersionHistory("/1/instruction/jcr:content"); VersionIterator iter = history.getAllLinearVersions(); System.out.println(frozen.getProperty("jcr:data").getString()); while (iter.hasNext()) { Version v = iter.nextVersion(); NodeIterator ni = v.getNodes(); while (ni.hasNext()) { Node node = ni.nextNode(); System.out.println(node.getName()); for (PropertyIterator pi = node.getProperties(); pi.hasNext();){ Property prop = pi.nextProperty(); System.out.println("Property : " + prop.getName()); } } } I get the result : jcr:frozenNode Property : jcr:frozenUuid Property : jcr:uuid Property : jcr:frozenPrimaryType Property : jcr:frozenMixinTypes Property : jcr:primaryType jcr:frozenNode Property : jcr:frozenUuid Property : jcr:lastModifiedBy Property : jcr:uuid Property : jcr:data Property : jcr:frozenPrimaryType Property : jcr:lastModified Property : jcr:frozenMixinTypes Property : jcr:primaryType What I'm interested in here is the jcr:data property, of course. But as you can see in the output, there is no such property for the first one. Here's the code snippet for the creation of this node : content = instruction.addNode("jcr:content", "nt:resource"); content.addMixin("mix:simpleVersionable"); content.setProperty("jcr:data", new BinaryImpl(input)); session.save(); I've also tried with these lines after the session.save(); line : VersionManager versionManager = workspace.getVersionManager(); versionManager.checkin(absPath); (where absPath points to the right node, of course) but it doesn't work either. Can someone tell me what I've missed ? Regards. -- Bruno Dusausoy YP5 Software -- Pensez environnement : limitez l'impression de ce mail. Please don't print this e-mail unless you really need to.