jackalope/jackalope — Issue #80: Use Jackrabbits diff/patch methods to save content for the jackalope transport
Author: chregu
Created: 2012-01-25 13:19:09+00:00
State: open

as a long (or middle) term goal we should thinking about switching to
the diff/patch format, which could boost write performance and make it
easier. Jackalope just replays on .save() what was done before, so one
would just have to record that logfile and replay it.

eg.

```
Node f = root.addNode("foo");
f.addNode("a");
f.addNode("b");
Node c = f.addNode("c");
c.setProperty("foo","bar");
f.orderBefore("a","c");
f.orderBefore("b","a");
c.remove();
f.addNode("c");
s.save();*
```

ends up in

```
+/foo : {"jcr:primaryType":"nt:unstructured"}
+/foo[4]/a : {"jcr:primaryType":"nt:unstructured"}
+/foo[4]/b : {"jcr:primaryType":"nt:unstructured"}
+/foo[4]/c : {"jcr:primaryType":"nt:unstructured"}
^/foo[4]/c/foo : "bar"
> /foo[4]/a : c#before
> /foo[4]/b : a#before
-/foo[4]/c :
+/foo[4]/c : {"jcr:primaryType":"nt:unstructured"}
```

This needs quite some changes/additions in jackalope (we have to call
the transport on every write operations, so that it can record the
history, if needed and not only on save like we do now. Or build up our
own log, which the transport can read on save), but should simplify
things, afaics now