From commits-return-13238-apmail-jackrabbit-commits-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue Mar 20 14:57:23 2012 Return-Path: X-Original-To: apmail-jackrabbit-commits-archive@www.apache.org Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A7E86996C for ; Tue, 20 Mar 2012 14:57:23 +0000 (UTC) Received: (qmail 23296 invoked by uid 500); 20 Mar 2012 14:57:23 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 23200 invoked by uid 500); 20 Mar 2012 14:57:23 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 23193 invoked by uid 99); 20 Mar 2012 14:57:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 14:57:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 14:57:21 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 7CBB96C3; Tue, 20 Mar 2012 14:57:01 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Tue, 20 Mar 2012 14:57:01 -0000 Message-ID: <20120320145701.41139.46224@eos.apache.org> Subject: =?utf-8?q?=5BJackrabbit_Wiki=5D_Update_of_=22Jsop=22_by_JulianReschke?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" fo= r change notification. The "Jsop" page has been changed by JulianReschke: http://wiki.apache.org/jackrabbit/Jsop?action=3Ddiff&rev1=3D38&rev2=3D39 =3D=3D Jsop =3D=3D - = <> = =3D=3D Overview =3D=3D - = "Jsop" is the idea of a lightweight HTTP protocol for manipulating JSON-b= ased object models. = - See [[http://www.slideshare.net/uncled/jsop | David N=C3=BCscheler's slid= es]] for an initial proposal. + See [[http://www.slideshare.net/uncled/jsop|David N=C3=BCscheler's slides= ]] for an initial proposal. = This protocol would include = @@ -20, +18 @@ = * one or more formats expression changes in a JSON structure = - = =3D=3D JCR-JSON mapping =3D=3D - = TBD. = =3D=3D Identifier Notation =3D=3D - = TBD (I believe raw JCR paths work as they subset JSON names and never nee= d the "/"; but what about namespace prefixes? The current use is compact bu= t doesn't necessarily yield stable identifiers ) = =3D=3D=3D IETF Work on Identifier Notation =3D=3D=3D - = Internet Draft: = - * a pointer syntax for identifying objects in an object tree: http://too= ls.ietf.org/html/draft-ietf-appsawg-json-pointer (note that this uses "/" = as separator, and "^" as escape character so that a "/" can be part of a na= me; if we used that syntax we'd still need to treat "^" as escape character= even though we would never need it to escape "/") + * a pointer syntax for identifying objects in an object tree: http://too= ls.ietf.org/html/draft-ietf-appsawg-json-pointer (note that this uses "/" a= s separator, and "^" as escape character so that a "/" can be part of a nam= e; if we used that syntax we'd still need to treat "^" as escape character = even though we would never need it to escape "/") = =3D=3D HTTP binding =3D=3D - = It needs to be defined how JCR nodes and JCR events are mapped to HTTP UR= Is; this includes the name mapping, the granularity, and more. = For instance: @@ -56, +49 @@ TODO: describe the current implementation in jcr-server = =3D=3D Diff Formats =3D=3D - = =3D=3D=3D IETF Work on Diff Formats =3D=3D=3D - = Internet Draft: = * a model for patch operations and an associated syntax in JSON: http://= tools.ietf.org/html/draft-ietf-appsawg-json-patch -- this captures patch op= erations inside a JSON container (not a custom format as discussed below) @@ -72, +63 @@ Both these issues have been raised as potential enhancements on the IETF = apps-discuss mailing list. = =3D=3D=3D Draft Implementations: JSOP-Diff =3D=3D=3D - = - The definitions below are based on the format used by [[http://svn.apache= .org/viewvc/jackrabbit/tags/2.3.2/jackrabbit-jcr-server/src/main/java/org/a= pache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java?view=3Dmarku= p|JCR Server]] but diverge in some areas. This is still work in progress an= d definitions may change at anytime. = + The definitions below are based on the format used by [[http://svn.apache= .org/viewvc/jackrabbit/tags/2.3.2/jackrabbit-jcr-server/src/main/java/org/a= pache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java?view=3Dmarku= p|JCR Server]] but diverge in some areas. This is still work in progress an= d definitions may change at anytime. = * [[http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/|Jackrab= bit Microkernel]] = * DavExRemoting in Jackrabbit WebDAV - = = =3D=3D=3D=3D Compact Syntax =3D=3D=3D=3D {{{ @@ -105, +94 @@ STRING ::=3D /* See RFC 4627, Section 2.5 */ NUMBER ::=3D /* See RFC 4627, Section 2.4 */ }}} - = - A [[http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrab= bit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/jso= n/JsopParser.java?view=3Dmarkup | parser]], and a simple [[http://svn.apach= e.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/sr= c/test/java/org/apache/jackrabbit/spi2microkernel/json/JsopParserTest.java?= view=3Dmarkup | test case]] for this syntax is available from the sandbox. = + A [[http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrab= bit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/jso= n/JsopParser.java?view=3Dmarkup|parser]], and a simple [[http://svn.apache.= org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/= test/java/org/apache/jackrabbit/spi2microkernel/json/JsopParserTest.java?vi= ew=3Dmarkup|test case]] for this syntax is available from the sandbox. = - Also available are a [[http://svn.apache.org/viewvc/jackrabbit/sandbox/mi= crokernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java?vi= ew=3Dmarkup | tokenizer]], a [[http://svn.apache.org/viewvc/jackrabbit/sand= box/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.jav= a?view=3Dmarkup | builder]], and a [[http://svn.apache.org/viewvc/jackrabbi= t/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopStrea= m.java?view=3Dmarkup | Jsop writer / reader]]. Those implementations are to= ken based, and therefore not limited to the JSOP format described here. + Also available are a [[http://svn.apache.org/viewvc/jackrabbit/sandbox/mi= crokernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java?vi= ew=3Dmarkup|tokenizer]], a [[http://svn.apache.org/viewvc/jackrabbit/sandbo= x/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java?= view=3Dmarkup|builder]], and a [[http://svn.apache.org/viewvc/jackrabbit/sa= ndbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopStream.ja= va?view=3Dmarkup|Jsop writer / reader]]. Those implementations are token ba= sed, and therefore not limited to the JSOP format described here. = =3D=3D=3D=3D Syntax =3D=3D=3D=3D - = '''jsop:''' + = * diff * diff jsop = A Jsop string contains one or multiple Jsop diff lines. = '''diff:''' + = * addNodeDiff * addPropertyDiff * setPropertyDiff @@ -132, +121 @@ A diff line can contain the information about adding nodes (possibly mult= iple nested nodes), adding a property to a node, setting a property, moving= a node, or removing a node or property. There is a special metadata diff l= ine. = '''addNodeDiff:''' + = * + pathString: object = The added node may contain child nodes. The order of child node is preser= ved, that means, when requesting the object, the child nodes will appear in= the same order as they appear when the node was added. This only applies t= o child nodes however; it does not apply to the order of properties. For ex= ample, an implementation may sort the properties by name. = '''addPropertyDiff:''' + = * + pathString: propertyValue = '''setPropertyDiff:''' + = * ^ pathString: propertyValue = '''moveNodeDiff:''' + = * > pathString: newPathString * > pathString: { positionString: newPathString } = '''copyNodeDiff:''' + = * * pathString: newPathString * * pathString: { positionString: newPathString } = '''positionString:''' + = * "before" * "after" = '''removeNodeDiff:''' + = * - pathString = '''removePropertyDiff:''' + = * ^ pathString: null = Setting the value to null will remove the property. = '''propertyValue:''' + = * string * number * array @@ -172, +170 @@ A property value can be any value, except for a object itself. = '''testProperty:''' + = * =3D pathString: { propertyValue | null } = + Before applying the rest of patch, the value is verified. If it does not = match, then the subsequent line(s) will not be applied. The exact semantics= are not yet defined however and will most likely be implementation specifi= c - for example it is undefined whether a mismatch will result in an except= ion or not, and whether all following lines of the commit belong to the sam= e atomic operation or not. This addition allows to construct atomic commits. - Before applying the rest of patch, the value is verified. If it does not = match, - then the subsequent line(s) will not be applied. The exact semantics are - not yet defined however and will most likely be implementation specific - - for example it is undefined whether a mismatch will result in an exception - or not, and whether all following lines of the commit belong to the same - atomic operation or not. This addition allows to construct atomic commits. = '''metaData:''' + = * @ object = + The metadata line contains metadata about the following diff lines. Metad= ata typically includes the timestamp (when did the change occur), the user,= the commit message. A jsop object can contain multiple metadata lines. It = depends on the implementation whether or not metadata is used, and how it i= s used. - The metadata line contains metadata about the following diff lines. Metad= ata typically includes the timestamp (when did the change occur), - the user, the commit message. A jsop object can contain multiple metadata= lines. It depends on the implementation whether or not metadata is used, a= nd how it is used. = '''object:''' + = * {} * { members } = '''members:''' + = * pair * pair, members = '''pair:''' + = * string: value = '''array:''' + = * [] * [ elements ] = '''elements:''' + = - * value = + * value * value, elements = '''value:''' + = * string * number * object