jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@adobe.com>
Subject Re: [Jackrabbit Wiki] Update of "Jsop" by MichaelDürig
Date Wed, 02 Nov 2011 16:07:16 GMT
Hi,

Thanks Thomas and Michael for documenting your JSOP use.

I have one comment:

> + DIFFS    ::= (ADD | SET | REMOVE | MOVE)*
> + ADD      ::= "+" STRING ":" (OBJECT | ATOM)
> + SET      ::= "^" STRING ":" ATOM
> + REMOVE   ::= "-" STRING

I see there is ADD support for properties but no REMOVE support. I think ADD support is not
needed, because SET does it all. This not only makes the syntax cleaner but also its use.

If we keep ADD support for properties, we would -- for symmetry reasons -- have to add REMOVE
support for properties. But this is not possible (since properties and nodes can have the
same name). But then REMOVE support for properties would not help anything, since setting
a property to  null is the same.

I look at this from the perspective of converting a JSOP document (or string or text or file
or HTTP request) into a series of JCR API calls. In such a scenario, I would have easy support
for SET and REMOVE but would have two issues for supporting ADD:
(1) I would have to inspect the argument to ADD to find out whether it is an addNode or setProperty
call
(2) I would have to handle SET and ADD-for-property with the same setProperty call

This feels wrong.

Regards
Felix

PS: I seem to remember the ancient JCR 1.0 days where there was a discussion on whether we
need addProperty and setProperty or setProperty would be just enough..... ;-)
Mime
View raw message