jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Kratz" <thomas.kr...@eiswind.de>
Subject AW: WG: Still Stuck with Versioning
Date Sun, 07 Dec 2008 09:04:04 GMT
Hi, I still don't get this ...
I tried this with a late 1.5.0 build because of a dependency conflict.

Even if I have only the nt:file node versionable it doesn't work. Can someone point me to
a testcase or sth where I can have a look how to do it ?

Regards Thomas

-----Ursprüngliche Nachricht-----
Von: 류대원 [mailto:dworyu@nhncorp.com] 
Gesendet: Montag, 24. November 2008 03:46
An: users@jackrabbit.apache.org
Betreff: RE: WG: Still Stuck with Versioning

Well, I don't think you have to make child node (nt:file) versionable, you just have to give
the mix:versionale to the parent node.

I guess the problem is from the bug of the jackrabbit.
What version of the jackrabbit-core are you using? There are some versioning bugs on the core-1.4,
so replace it with core-1.4.6.
I guess it will help you.

By won

-----Original Message-----
From: Thomas Kratz [mailto:thomas.kratz@eiswind.de] 
Sent: Monday, November 24, 2008 12:28 AM
To: users@jackrabbit.apache.org
Subject: WG: WG: Still Stuck with Versioning

This is how I store the new version, from the comments you can see what I ve
been trying:

public void persistDocumentAsNewVersion(Long userId, byte[] file,
			 DocumentPath path) throws Exception {
		if (path.getKeyNodeUuid() == null) {
			throw new UnsupportedOperationException(
					"Document cant have new version");
		Repository repository = Server.getRepository();
		Session session = repository.login(new
SimpleCredentials("system", ""

		try {

			Node key = null;
			key = session.getNodeByUUID(path.getKeyNodeUuid());


			User user = userDAO.findUserById(userId);
			key.setProperty("user", user.getLogin());
			key.setProperty("userid", userId);

			Node fileNode = null;

			try {
				fileNode = key.getNode(path.getFilename());
			} catch (PathNotFoundException x) {
				throw new IllegalStateException("File Not
found in node", x);
//			 fileNode.checkout();

			Node resNode = fileNode.getNode("jcr:content");
//			 resNode.checkout();
			resNode.setProperty("jcr:data", new
			Calendar lastModified = Calendar.getInstance();

//			 resNode.checkin();
//			 fileNode.checkin();

		} catch (Exception x) {
			log.error("Adding Version", x);
			throw x;
		} finally {

I can get a versioned node of the nt:unstructured, but when I access the
nt:file like

					VersionHistory h =
					VersionIterator ito =
					while (ito.hasNext()) {
						Version v =

						NodeIterator ito2 =
						if (ito2.hasNext()) {
							Node nextNode =

							try {

I get an nt:file as child of the frozen node that has no content and no

Regards Thomas

-----Ursprüngliche Nachricht-----
Von: Julian Reschke [mailto:julian.reschke@gmx.de] 
Gesendet: Sonntag, 23. November 2008 16:09
An: users@jackrabbit.apache.org
Betreff: Re: WG: Still Stuck with Versioning

Thomas Kratz wrote:
> I investigated somewhat further.
> Now I have made the nt:file child versionable, the versioned parent node
> nt:unstructured truly has a child of nt:file but I don't get it right. The
> nt:file child has no neither a uuid (as the original node has)  and is not
> of nt:frozenNode (what I would have expected). I would expect to see
> frozenNodes as children of my VersionHistory node ???
> ...

The nt:versionHistory node should have child nodes of type nt:version.

BR, Julian

View raw message