You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by mpankaj <mp...@yahoo.com> on 2013/12/04 01:19:01 UTC

Re: Jackrabbit 2.2.8 Retrieval of JCR:data node from VersionHistory ( not available)

I have tried what was suggesed to get jcr:data, but I still get path not
found error. Is there a solution. I will truly appreciate if you have any
idea.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-2-2-8-Retrieval-of-JCR-data-node-from-VersionHistory-not-available-tp3860061p4660016.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: Jackrabbit 2.2.8 Retrieval of JCR:data node from VersionHistory ( not available)

Posted by Tobias Bocanegra <tr...@apache.org>.
but the jcr:data should be on the jcr:content.
regards, toby

On Wed, Dec 4, 2013 at 1:19 AM, mpankaj <mp...@yahoo.com> wrote:
> I have tried what was suggesed to get jcr:data, but I still get path not
> found error. Is there a solution. I will truly appreciate if you have any
> idea.
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-2-2-8-Retrieval-of-JCR-data-node-from-VersionHistory-not-available-tp3860061p4660016.html
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: Jackrabbit 2.2.8 Retrieval of JCR:data node from VersionHistory ( not available)

Posted by mpankaj <mp...@yahoo.com>.
The reason jcr:data is not found is becuase the root version does not have
it. So while going through the loop of all versions, skip the first node.

		VersionManager versionMgr = session.getWorkspace().getVersionManager();
		VersionHistory history = versionMgr.getVersionHistory(path to
jcr:content);
		VersionIterator ito = history.getAllVersions();

		while (ito.hasNext()) {

			Version v = ito.nextVersion();
			String version = v.getName();
			if (version.startsWith("jcr:"))
			{
				continue; // skip root version
			}
			
			Node frozenNode = v.getFrozenNode();
                        // now you can see jcr:data property
		}	




--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-2-2-8-Retrieval-of-JCR-data-node-from-VersionHistory-not-available-tp3860061p4660024.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.