Author: buildbot
Date: Thu Apr  3 08:53:02 2014
New Revision: 904754

Log:
Staging update by buildbot for olingo

Added:
    websites/staging/olingo/trunk/content/doc/tutorials/batchClientApi.html
Modified:
    websites/staging/olingo/trunk/content/   (props changed)

Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Apr  3 08:53:02 2014
@@ -1 +1 @@
-1584283
+1584286

Added: websites/staging/olingo/trunk/content/doc/tutorials/batchClientApi.html
==============================================================================
--- websites/staging/olingo/trunk/content/doc/tutorials/batchClientApi.html 
(added)
+++ websites/staging/olingo/trunk/content/doc/tutorials/batchClientApi.html Thu 
Apr  3 08:53:02 2014
@@ -0,0 +1,176 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
+    <head>
+        <meta charset="utf-8">
+        <meta http-equiv="expires" content="0">
+            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+                <title></title>
+                <meta name="description" content="Apache Olingo (incubating) 
provides libraries which enable developers to implement OData producers and 
OData consumers. The available OData Java library implements OData version 2.0. 
In future on goal is to provide an OData 4.0 compliant library once the OData 
standard is published at OASIS. The focus within the community is currently on 
the Java technology but it is up to the community to discuss if other 
environments find interest.">
+                    <meta name="viewport" content="width=device-width">
+                        
+                    <link rel="stylesheet" href="/css/bootstrap.min.css">
+                            <style>
+                                body {
+                                    padding-top: 60px;
+                                    padding-bottom: 40px;
+                                }
+                                </style>
+                                <link rel="stylesheet" 
href="/css/bootstrap-responsive.min.css">
+                                <link rel="stylesheet" href="/css/main.css">
+                                    
+                                <script 
src="/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
+                                    </head>
+    <body>
+        <!--[if lt IE 7]>
+         <p class="chromeframe">You are using an <strong>outdated</strong> 
browser. Please <a href="http://browsehappy.com/";>upgrade your browser</a> or 
<a href="http://www.google.com/chromeframe/?redirect=true";>activate Google 
Chrome Frame</a> to improve your experience.</p>
+         <![endif]-->
+        
+        <!-- This code is taken from 
http://twitter.github.com/bootstrap/examples/hero.html -->
+        <div class="navbar navbar-inverse  navbar-fixed-top">
+            <div class="navbar-inner">
+                <div class="container">
+                    <a class="btn btn-navbar" data-toggle="collapse" 
data-target=".nav-collapse">
+                        <span class="icon-bar"></span>
+                        <span class="icon-bar"></span>
+                        <span class="icon-bar"></span>
+                    </a>
+                    <img class="brand" src="/img/OlingoOrangeTM.png" 
style="width:42px;" />
+                    <a class="brand" href="/">Apache Olingo&trade;</a>
+                   <div class="nav-collapse collapse">
+                        <ul class="nav">
+                            <li class="dropdown">
+                                <a href="#" class="dropdown-toggle" 
data-toggle="dropdown">ASF <b class="caret"></b></a>
+                                <ul class="dropdown-menu">
+                                    <li><a 
href="http://www.apache.org/foundation/";>ASF Home</a></li>
+                                    <li><a 
href="http://projects.apache.org/";>Projects</a></li>
+                                    <li><a 
href="http://people.apache.org/";>People</a></li>
+                                    <li><a 
href="http://www.apache.org/foundation/getinvolved.html";>Get Involved</a></li>
+                                    <li><a 
href="http://www.apache.org/dyn/closer.cgi";>Download</a></li>
+                                    <li><a 
href="http://www.apache.org/security/";>Security</a></li>
+                                    <li><a 
href="http://www.apache.org/foundation/sponsorship.html";>Support Apache</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/">Home</a></li>
+                            <li><a 
href="http://www.apache.org/licenses/";>License</a></li> 
+                            <li><a href="/download.html">Download</a></li>
+                            <li><a 
href="/documentation.html">Documentation</a></li>
+                            <li><a href="/support.html">Support</a></li>
+                        </ul>
+                        <form class="navbar-form pull-right" name="search" 
id="search" action="http://www.google.com/search"; method="get">
+                            <input value="olingo.incubator.apache.org" 
name="sitesearch" type="hidden"/>
+                            <input class="span2" type="text" name="q" 
id="query">
+                                <input class="btn"type="submit" id="submit" 
value="Search">
+                                    </form>
+                    </div><!--/.nav-collapse -->
+                </div>
+            </div>
+        </div>
+        
+        <div class="container">
+            
+            
+            
+            <h2 id="batch-request-construction">Batch Request construction</h2>
+<p><strong>Query Request construction</strong></p>
+<p>A BatchQueryPart is a representation of a single retrieve request. You can 
use the following methods in order to fill out a request:</p>
+<ul>
+<li>method(String) </li>
+<li>uri(String) </li>
+<li>contentId(String) </li>
+<li>
+<p>headers(List<String>)</p>
+<p>BatchQueryPart request = 
BatchQueryPart.method("GET").uri("$metadata").build();</p>
+</li>
+</ul>
+<p><strong>Note:</strong> The valid method value is GET.</p>
+<p><strong>ChangeSet construction</strong>
+A BatchChangeSetPart is a representation of a single change request. You can 
use the following methods in order to fill out a change request:</p>
+<ul>
+<li>method(String)</li>
+<li>uri(String)</li>
+<li>headers(List<String>)</li>
+<li>contentId(String)</li>
+<li>
+<p>body(String)</p>
+<p>Map<String, String> changeSetHeaders = new HashMap<String, String>();
+changeSetHeaders.put("content-type", "application/json;odata=verbose");</p>
+<p>BatchChangeSetPart changeRequest = BatchChangeSetPart.method("PUT")
+        .uri("Employees('2')/EmployeeName")
+        .headers(changeSetHeaders)
+        .body("{\"EmployeeName\":\"Frederic Fall MODIFIED\"}")
+    .build();
+ ...</p>
+</li>
+</ul>
+<p><strong>Note:</strong> The valid method values are POST, PUT, DELETE or 
MERGE.</p>
+<p>The change request has to become a part of a changeSet. For that you need 
to create a changeSet object and to attach the change request to this 
object.</p>
+<div class="codehilite"><pre><span class="p">...</span>
+<span class="n">BatchChangeSet</span> <span class="n">changeSet</span> <span 
class="p">=</span> <span class="n">BatchChangeSet</span><span 
class="p">.</span><span class="n">newBuilder</span><span 
class="p">().</span><span class="n">build</span><span class="p">();</span>
+<span class="n">changeSet</span><span class="p">.</span><span 
class="n">add</span><span class="p">(</span><span 
class="n">changeRequest</span><span class="p">);</span>
+</pre></div>
+
+
+<p><strong>Batch request payload construction</strong>
+After you collected all created parts, you can call the method 
writeBatchRequestBody(..) provided by EntityProvider</p>
+<div class="codehilite"><pre><span class="p">...</span>
+<span class="n">List</span><span class="o">&lt;</span><span 
class="n">BatchPart</span><span class="o">&gt;</span> <span 
class="n">batchParts</span> <span class="p">=</span> <span class="n">new</span> 
<span class="n">ArrayList</span><span class="o">&lt;</span><span 
class="n">BatchPart</span><span class="o">&gt;</span><span class="p">();</span>
+<span class="n">batchParts</span><span class="p">.</span><span 
class="n">add</span><span class="p">(</span><span class="n">request</span><span 
class="p">);</span>
+<span class="n">batchParts</span><span class="p">.</span><span 
class="n">add</span><span class="p">(</span><span 
class="n">changeSet</span><span class="p">);</span>
+
+<span class="n">InputStream</span> <span class="n">payload</span> <span 
class="p">=</span> <span class="n">EntityProvider</span><span 
class="p">.</span><span class="n">writeBatchRequest</span><span 
class="p">(</span><span class="n">batchParts</span><span class="p">,</span> 
<span class="n">BOUNDARY</span><span class="p">);</span>
+</pre></div>
+
+
+<p>The second parameter BOUNDARY is necessary information for the construction 
of the batch request payload. It is the value of the boundary parameter, that 
is set in Content-Type header of the batch request.</p>
+<p><strong>Batch Response interpretation</strong>
+Interpretation of the batch response payload
+You receive a list of single response by calling 
EntityProvider.parseBatchResponse(..)</p>
+<div class="codehilite"><pre><span class="n">List</span><span 
class="o">&lt;</span><span class="n">BatchSingleResponse</span><span 
class="o">&gt;</span> <span class="n">responses</span> <span class="p">=</span> 
<span class="n">EntityProvider</span><span class="p">.</span><span 
class="n">parseBatchResponse</span><span class="p">(</span><span 
class="n">responseBody</span><span class="p">,</span> <span 
class="n">contentType</span><span class="p">);</span>
+<span class="k">for</span> <span class="p">(</span><span 
class="n">BatchSingleResponse</span> <span class="n">response</span> <span 
class="p">:</span> <span class="n">responses</span><span class="p">)</span> 
<span class="p">{</span>
+      <span class="n">response</span><span class="p">.</span><span 
class="n">getStatusCode</span><span class="p">());</span>
+      <span class="n">response</span><span class="p">.</span><span 
class="n">getStatusInfo</span><span class="p">());</span>
+      <span class="n">response</span><span class="p">.</span><span 
class="n">getHeader</span><span class="p">(</span><span 
class="n">HttpHeaders</span><span class="p">.</span><span 
class="n">CONTENT_TYPE</span><span class="p">);</span>
+      <span class="n">response</span><span class="p">.</span><span 
class="n">getBody</span><span class="p">();</span>
+      <span class="n">response</span><span class="p">.</span><span 
class="n">getContentId</span><span class="p">();</span>
+</pre></div>
+
+
+<p>}</p>
+            
+            
+            
+            
+            <hr>
+            
+            <footer>                 
+                <div align="center"><p>Copyright © 2013-2014, The Apache 
Software Foundation<br>
+                Apache Olingo, Olingo, Apache, the Apache feather, and 
+the Apache Olingo project logo are trademarks of the Apache Software 
+Foundation.</p></div>
+        <hr>
+        <div align="center"><small><a 
href="http://olingo.staging.apache.org/doc/privacy.html";>Privacy</a></small></div>
+            </footer>
+            
+        </div> <!-- /container -->
+        
+        <script 
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
+        <script>window.jQuery || document.write('<script 
src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
+        
+        <script src="/js/vendor/bootstrap.min.js"></script>
+        
+        <script src="/js/main.js"></script>
+        
+<script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
+  
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-44963757-1', 'apache.org');
+  ga('send', 'pageview');
+
+</script>    </body>
+</html>


Reply via email to