| 1 |
<%@ page import="java.net.URI" %> |
| 2 |
<%@ page import="org.apache.jackrabbit.j2ee.JcrRemotingServlet" %> |
| 3 |
<%@ page import="org.apache.jackrabbit.util.Text" %> |
| 4 |
<%-- |
| 5 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 6 |
contributor license agreements. See the NOTICE file distributed with |
| 7 |
this work for additional information regarding copyright ownership. |
| 8 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 9 |
(the "License"); you may not use this file except in compliance with |
| 10 |
the License. You may obtain a copy of the License at |
| 11 |
|
| 12 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 13 |
|
| 14 |
Unless required by applicable law or agreed to in writing, software |
| 15 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 16 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 |
See the License for the specific language governing permissions and |
| 18 |
limitations under the License. |
| 19 |
--%><% |
| 20 |
|
| 21 |
URI uri = new URI(request.getRequestURL().toString()); |
| 22 |
String href = |
| 23 |
uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort() |
| 24 |
+ request.getContextPath() |
| 25 |
+ JcrRemotingServlet.getPathPrefix(pageContext.getServletContext()); |
| 26 |
href = Text.encodeIllegalXMLCharacters(href); |
| 27 |
href += "/default/jcr:root"; |
| 28 |
|
| 29 |
%><jsp:include page="header.jsp"/> |
| 30 |
<div id="content"> |
| 31 |
<h2>Read</h2> |
| 32 |
<h3><a name="default_read">Default Reading</a></h3> |
| 33 |
<p>Reading remotely from the repository generally follows the rules described in |
| 34 |
<a href="http://jackrabbit.apache.org/JCR_Webdav_Protocol.doc">JCR_Webdav_Protocol.zip</a>. |
| 35 |
</p> |
| 36 |
<h3><a name="batch_read">Batch Read</a></h3> |
| 37 |
<p>Batch read is triggered by adding a <b>'.json'</b> extension to the resource |
| 38 |
href. Optionally the client may explicitely specify the desired batch |
| 39 |
read depth by appending <b>'.depth.json'</b> extension. If no json extension |
| 40 |
is present the GET request is processed by applied the default |
| 41 |
remoting rules. |
| 42 |
</p> |
| 43 |
<p>The response to a batch read request contains a plain text representing |
| 44 |
a JSON object. Its member either represent nodes or properties. |
| 45 |
<ul> |
| 46 |
<li>The name element of the Item path is added as key</li> |
| 47 |
<li>The value of a Node entry is a JSON object.</li> |
| 48 |
<li>The value of a Property entry is either a JSON array or a simple JSON value.</li> |
| 49 |
</ul> |
| 50 |
</p> |
| 51 |
<p>In order to cope with property types that cannot be expressed with JSON |
| 52 |
a couple of special rules are defined: |
| 53 |
<ul> |
| 54 |
<li>Binary properties: The key gets a leading ":", the value represents the |
| 55 |
length of the property. In order to retrieve the binary value, the |
| 56 |
client must follow the default rules (see above).</li> |
| 57 |
<li>Date, Name, Path and Reference properties: The type information is passed with a separate JSON pair.</li> |
| 58 |
<li>The value of a Property entry is either a JSON array or a simple JSON value.</li> |
| 59 |
</ul> |
| 60 |
</p> |
| 61 |
See <a href="read_batch.jsp">Example: Batch Write</a> for a demostration of |
| 62 |
the batch read functionality. |
| 63 |
</p> |
| 64 |
</div> |
| 65 |
<jsp:include page="footer.jsp"/> |