Author: buildbot
Date: Wed Dec 9 09:38:11 2015
New Revision: 975054
Log:
Staging update by buildbot for olingo
Modified:
websites/staging/olingo/trunk/content/ (props changed)
websites/staging/olingo/trunk/content/doc/odata2/sample-setup.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/action/tutorial_action.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/media/tutorial_media.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/navigation/tutorial_navigation.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/read/tutorial_read.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/readep/tutorial_readep.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html
websites/staging/olingo/trunk/content/doc/odata4/tutorials/write/tutorial_write.html
websites/staging/olingo/trunk/content/support.html
Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Dec 9 09:38:11 2015
@@ -1 +1 @@
-1718785
+1718790
Modified: websites/staging/olingo/trunk/content/doc/odata2/sample-setup.html
==============================================================================
--- websites/staging/olingo/trunk/content/doc/odata2/sample-setup.html
(original)
+++ websites/staging/olingo/trunk/content/doc/odata2/sample-setup.html Wed Dec
9 09:38:11 2015
@@ -97,13 +97,13 @@
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink,
h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink,
dt:hover > .elementid-permalink { visibility: visible }</style>
<h1 id="sample-project-setup">Sample Project Setup<a class="headerlink"
href="#sample-project-setup" title="Permanent link">¶</a></h1>
-<p>Olingo has prepared a very simple sample car service that can work as a
starting point for implementing a custom OData service.
+<p>Olingo has prepared a very simple sample car service that can work as a
starting point for implementing a custom OData service.
This service consists of a very simple EDM with two entity sets that are cars
and manufactures and a memory based data provider that is a simple hash map.
-Therefore the project implements a very basic single OData processor
supporting a minimal readonly scenario.
+Therefore the project implements a very basic single OData processor
supporting a minimal readonly scenario.
If build with Maven the build result is a web application (<code>war</code>
file) which can be deployed to any JEE compliant web application server (e.g.
<a href="http://tomcat.apache.org">Tomcat</a>).</p>
<hr />
<h3 id="maven-archetype">Maven Archetype<a class="headerlink"
href="#maven-archetype" title="Permanent link">¶</a></h3>
-<p>Apache Olingo supports Maven archetypes that are a kind of project template
for setting up new projects from scratch.
+<p>Apache Olingo supports Maven archetypes that are a kind of project template
for setting up new projects from scratch.
Currently exists an archetype with an <code>ODataSingleProcessor</code>
implementation as <code>olingo-odata2-sample-cars-service-archetype</code> and
an archetype with an annotation based <code>ODataService</code> implementation
as <code>olingo-odata2-sample-cars-annotation-archetype</code>.</p>
<p>To generate the sample project for the <code>ODataSingleProcessor</code>
implementation start with:</p>
<div class="codehilite"><pre><span class="n">mvn</span> <span
class="n">archetype</span><span class="p">:</span><span
class="n">generate</span> <span class="o">\</span>
@@ -130,7 +130,7 @@ Currently exists an archetype with an <c
<p>If an archetype is not available via Maven standard configuration then an
additional parameter
<code>-DarchetypeRepository=http://repository.apache.org/snapshots</code> can
solve the issue.</p>
-<p>Based on the Olingo project template Maven will generate a new project with
the specified GAV*) coordinates:
<code>com.sample:my-car-service:1.0.0-SNAPSHOT</code>.
+<p>Based on the Olingo project template Maven will generate a new project with
the specified GAV*) coordinates:
<code>com.sample:my-car-service:1.0.0-SNAPSHOT</code>.
GAV coordinates can be freely chosen during generation with the interactive
mode. To enable the interactive mode <code>-DinteractiveMode</code> must be set
to true or omitted (to use Maven default setting of <code>true</code>).</p>
<p>The result is a new and ready to build Maven project. Switch to
<em>my-car-service</em> directory and execute:</p>
<div class="codehilite"><pre><span class="n">mvn</span> <span
class="n">clean</span> <span class="n">install</span>
@@ -156,23 +156,23 @@ GAV coordinates can be freely chosen dur
</pre></div>
-<p>Maven will build the project with the result
<strong>car-service.war</strong> in the Maven <em>target</em> directory which
can be deployed to any JEE compliant web application server.
+<p>Maven will build the project with the result
<strong>car-service.war</strong> in the Maven <em>target</em> directory which
can be deployed to any JEE compliant web application server.
To call the deployed and running OData service enter this URI in a browser:</p>
<div class="codehilite"><pre><span class="n">http</span><span
class="p">:</span><span class="o">//</span><span
class="n">localhost</span><span class="p">:</span>8080<span
class="o">/</span><span class="n">my</span><span class="o">-</span><span
class="n">car</span><span class="o">-</span><span class="n">service</span><span
class="o">/</span>
</pre></div>
-<p>Which show a entry page for the generated sample service with links to the
<em>Metadata</em> (<code>$metadata</code>), <em>Service Document</em> and some
<em>sample data</em> which it provides. </p>
+<p>Which show a entry page for the generated sample service with links to the
<em>Metadata</em> (<code>$metadata</code>), <em>Service Document</em> and some
<em>sample data</em> which it provides.</p>
<p>*) GAV means a Maven groupId, artifactId and version.</p>
<h3 id="eclipse-ide-support">Eclipse IDE Support<a class="headerlink"
href="#eclipse-ide-support" title="Permanent link">¶</a></h3>
-<p>The archetype template supports Eclipse as IDE.
+<p>The archetype template supports Eclipse as IDE.
Additionally to a Maven clean and install it is possible to call the following
Maven goal:</p>
<div class="codehilite"><pre><span class="n">mvn</span> <span
class="n">eclipse</span><span class="p">:</span><span class="n">clean</span>
<span class="n">eclipse</span><span class="p">:</span><span
class="n">eclipse</span>
</pre></div>
-<p>This will generate Eclipse project files including all transitive
dependencies and the web application facet.
-Import the project to Eclipse and it should be recognized as a web application
project.
+<p>This will generate Eclipse project files including all transitive
dependencies and the web application facet.
+Import the project to Eclipse and it should be recognized as a web application
project.
Deploy the Eclipse project to a server and it should run as well.</p><div
align="center">
<p>Copyright © 2013-2015, The Apache Software Foundation<br>
Apache Olingo, Olingo, Apache,
the Apache feather, and
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/action/tutorial_action.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/action/tutorial_action.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/action/tutorial_action.html
Wed Dec 9 09:38:11 2015
@@ -652,7 +652,7 @@ A cleverer implementation can handle bot
<p>Further topics to be covered by follow-up tutorials:</p>
<ul>
<li>Tutorial OData V4 service part 1: <a
href="/doc/odata4/tutorials/read/tutorial_read.html">Read Entity
Collection</a></li>
-<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a> </li>
+<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a></li>
<li>Tutorial OData V4 service part 3: <a
href="/doc/odata4/tutorials/write/tutorial_write.html">Write (Create, Update,
Delete Entity)</a></li>
<li>Tutorial OData V4 service, part 4: <a
href="/doc/odata4/tutorials/navigation/tutorial_navigation.html">Navigation</a></li>
<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a></li>
@@ -661,6 +661,8 @@ A cleverer implementation can handle bot
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: Action and Function Imports</li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/media/tutorial_media.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/media/tutorial_media.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/media/tutorial_media.html
Wed Dec 9 09:38:11 2015
@@ -102,7 +102,7 @@ h2:hover > .headerlink, h3:hover > .head
<p>In the present tutorial, we will implement a media entity set.</p>
<p><strong>Note:</strong>
The final source code can be found in the project <a
href="https://git-wip-us.apache.org/repos/asf/olingo-odata4">git repository</a>.
-A detailed description how to checkout the tutorials can be found <a
href="/doc/odata4/tutorials/prerequisites/prerequisites.html">here</a>. <br />
+A detailed description how to checkout the tutorials can be found <a
href="/doc/odata4/tutorials/prerequisites/prerequisites.html">here</a>.
This tutorial can be found in subdirectory /samples/tutorials/p10_media</p>
<p><strong>Table of Contents</strong></p>
<div class="toc">
@@ -215,7 +215,7 @@ This tutorial can be found in subdirecto
<p>And finally announce the entity type and entity set:</p>
<div class="codehilite"><pre><span class="nd">@Override</span>
-<span class="kd">public</span> <span class="n">List</span><span
class="o"><</span><span class="n">CsdlSchema</span><span
class="o">></span> <span class="n">getSchemas</span><span
class="o">()</span> <span class="o">{</span>
+<span class="kd">public</span> <span class="n">List</span><span
class="o"><</span><span class="n">CsdlSchema</span><span
class="o">></span> <span class="n">getSchemas</span><span
class="o">()</span> <span class="o">{</span>
<span class="c1">// ...</span>
<span class="n">entityTypes</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span
class="n">getEntityType</span><span class="o">(</span><span
class="n">ET_ADVERTISEMENT_FQN</span><span class="o">));</span>
<span class="c1">// ...</span>
@@ -284,7 +284,7 @@ All methods have to be implemented in cl
<span class="n">advertisements</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="n">entity</span><span
class="o">);</span>
<span class="n">entity</span> <span class="o">=</span> <span
class="k">new</span> <span class="n">Entity</span><span class="o">();</span>
- <span class="n">entity</span><span class="o">.</span><span
class="na">addProperty</span><span class="o">(</span><span class="k">new</span>
<span class="n">Property</span><span class="o">(</span><span
class="kc">null</span><span class="o">,</span> <span
class="s">"ID"</span><span class="o">,</span> <span
class="n">ValueType</span><span class="o">.</span><span
class="na">PRIMITIVE</span><span class="o">,</span>
+ <span class="n">entity</span><span class="o">.</span><span
class="na">addProperty</span><span class="o">(</span><span class="k">new</span>
<span class="n">Property</span><span class="o">(</span><span
class="kc">null</span><span class="o">,</span> <span
class="s">"ID"</span><span class="o">,</span> <span
class="n">ValueType</span><span class="o">.</span><span
class="na">PRIMITIVE</span><span class="o">,</span>
<span class="n">UUID</span><span class="o">.</span><span
class="na">fromString</span><span class="o">(</span><span
class="s">"db2d2186-1c29-4d1e-88ef-a127f521b9c67"</span><span
class="o">)));</span>
<span class="n">entity</span><span class="o">.</span><span
class="na">addProperty</span><span class="o">(</span><span class="k">new</span>
<span class="n">Property</span><span class="o">(</span><span
class="kc">null</span><span class="o">,</span> <span
class="s">"Name"</span><span class="o">,</span> <span
class="n">ValueType</span><span class="o">.</span><span
class="na">PRIMITIVE</span><span class="o">,</span> <span class="s">"Early
morning start, need coffee"</span><span class="o">));</span>
<span class="n">entity</span><span class="o">.</span><span
class="na">addProperty</span><span class="o">(</span><span class="k">new</span>
<span class="n">Property</span><span class="o">(</span><span
class="kc">null</span><span class="o">,</span> <span
class="s">"AirDate"</span><span class="o">,</span> <span
class="n">ValueType</span><span class="o">.</span><span
class="na">PRIMITIVE</span><span class="o">,</span> <span
class="n">Timestamp</span><span class="o">.</span><span
class="na">valueOf</span><span class="o">(</span><span
class="s">"2000-02-29 00:00:00"</span><span class="o">)));</span>
@@ -342,7 +342,7 @@ All methods have to be implemented in cl
<span class="k">return</span> <span class="kc">null</span><span
class="o">;</span>
<span class="o">}</span>
-<span class="kd">public</span> <span class="kt">void</span> <span
class="nf">updateEntityData</span><span class="o">(</span><span
class="n">EdmEntitySet</span> <span class="n">edmEntitySet</span><span
class="o">,</span> <span class="n">List</span><span class="o"><</span><span
class="n">UriParameter</span><span class="o">></span> <span
class="n">keyParams</span><span class="o">,</span>
+<span class="kd">public</span> <span class="kt">void</span> <span
class="nf">updateEntityData</span><span class="o">(</span><span
class="n">EdmEntitySet</span> <span class="n">edmEntitySet</span><span
class="o">,</span> <span class="n">List</span><span class="o"><</span><span
class="n">UriParameter</span><span class="o">></span> <span
class="n">keyParams</span><span class="o">,</span>
<span class="n">Entity</span> <span class="n">updateEntity</span><span
class="o">,</span> <span class="n">HttpMethod</span> <span
class="n">httpMethod</span><span class="o">)</span> <span
class="kd">throws</span> <span class="n">ODataApplicationException</span> <span
class="o">{</span>
<span class="n">EdmEntityType</span> <span class="n">edmEntityType</span>
<span class="o">=</span> <span class="n">edmEntitySet</span><span
class="o">.</span><span class="na">getEntityType</span><span
class="o">();</span>
@@ -376,13 +376,13 @@ All methods have to be implemented in cl
<span class="cm">/*</span>
<span class="cm"> * In this tutorial, the content of the media entity is
stored in a special property.</span>
<span class="cm"> * So no additional steps to delete the content of the
media entity are necessary.</span>
-<span class="cm"> * </span>
+<span class="cm"> *</span>
<span class="cm"> * A real service may store the content on the file
system. So we have to take care to</span>
-<span class="cm"> * delete external files too. </span>
-<span class="cm"> * </span>
+<span class="cm"> * delete external files too.</span>
+<span class="cm"> *</span>
<span class="cm"> * DELETE request to /Advertisements(ID) will be
dispatched to the deleteEntity(...) method</span>
<span class="cm"> * DELETE request to /Advertisements(ID)/$value will be
dispatched to the deleteMediaEntity(...) method</span>
-<span class="cm"> * </span>
+<span class="cm"> *</span>
<span class="cm"> * So it is a good idea handle deletes in a central
place.</span>
<span class="cm"> */</span>
@@ -412,7 +412,7 @@ All methods have to be implemented in cl
<span class="kd">final</span> <span class="n">SerializerResult</span>
<span class="n">serializerResult</span> <span class="o">=</span> <span
class="n">odata</span><span class="o">.</span><span
class="na">createSerializer</span><span class="o">(</span><span
class="n">responseFormat</span><span class="o">)</span>
<span class="o">.</span><span
class="na">entity</span><span class="o">(</span><span
class="n">serviceMetadata</span><span class="o">,</span> <span
class="n">edmEntitySet</span><span class="o">.</span><span
class="na">getEntityType</span><span class="o">(),</span> <span
class="n">entity</span><span class="o">,</span> <span
class="n">opts</span><span class="o">);</span>
- <span class="kd">final</span> <span class="n">String</span> <span
class="n">location</span> <span class="o">=</span> <span
class="n">request</span><span class="o">.</span><span
class="na">getRawBaseUri</span><span class="o">()</span> <span
class="o">+</span> <span class="sc">'/'</span>
+ <span class="kd">final</span> <span class="n">String</span> <span
class="n">location</span> <span class="o">=</span> <span
class="n">request</span><span class="o">.</span><span
class="na">getRawBaseUri</span><span class="o">()</span> <span
class="o">+</span> <span class="sc">'/'</span>
<span class="o">+</span> <span class="n">odata</span><span
class="o">.</span><span class="na">createUriHelper</span><span
class="o">().</span><span class="na">buildCanonicalURL</span><span
class="o">(</span><span class="n">edmEntitySet</span><span class="o">,</span>
<span class="n">entity</span><span class="o">);</span>
<span class="n">response</span><span class="o">.</span><span
class="na">setContent</span><span class="o">(</span><span
class="n">serializerResult</span><span class="o">.</span><span
class="na">getContent</span><span class="o">());</span>
@@ -458,7 +458,7 @@ All methods have to be implemented in cl
<p>Updating a media entity in our scenario is quite similar to read an entity.
The first step is to analyse the URI, than fetch the entity from data store.
Afer that we call the <code>updateMediaEntity</code> method. In our case we do
not return any content. If we would return content, we must return the recently
uploaded content of the media entity (<a
href="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398338">OData
Version 4.0 Part 1: Protocol</a>).</p>
<div class="codehilite"><pre><span class="nd">@Override</span>
<span class="kd">public</span> <span class="kt">void</span> <span
class="nf">updateMediaEntity</span><span class="o">(</span><span
class="n">ODataRequest</span> <span class="n">request</span><span
class="o">,</span> <span class="n">ODataResponse</span> <span
class="n">response</span><span class="o">,</span> <span
class="n">UriInfo</span> <span class="n">uriInfo</span><span class="o">,</span>
- <span class="n">ContentType</span> <span
class="n">requestFormat</span><span class="o">,</span> <span
class="n">ContentType</span> <span class="n">responseFormat</span><span
class="o">)</span>
+ <span class="n">ContentType</span> <span
class="n">requestFormat</span><span class="o">,</span> <span
class="n">ContentType</span> <span class="n">responseFormat</span><span
class="o">)</span>
<span class="kd">throws</span> <span
class="n">ODataApplicationException</span><span class="o">,</span> <span
class="n">ODataLibraryException</span> <span class="o">{</span>
<span class="kd">final</span> <span class="n">UriResource</span> <span
class="n">firstResoucePart</span> <span class="o">=</span> <span
class="n">uriInfo</span><span class="o">.</span><span
class="na">getUriResourceParts</span><span class="o">().</span><span
class="na">get</span><span class="o">(</span><span class="mi">0</span><span
class="o">);</span>
@@ -488,20 +488,20 @@ All methods have to be implemented in cl
<p>After building and deploying the project, we can invoke our OData
service.</p>
<ul>
<li>
-<p>Read media entity set <br />
-<strong>GET</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements</a></p>
+<p>Read media entity set
+ <strong>GET</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements</a></p>
</li>
<li>
-<p>Read media entity <br />
-<strong>GET</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)</a></p>
+<p>Read media entity
+ <strong>GET</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)</a></p>
</li>
<li>
-<p>Read media entity content <br />
-<strong>GET</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-
4cd4-b330-db93c25ff3c7)/$value">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value</a></p>
+<p>Read media entity content
+ <strong>GET</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-
4cd4-b330-db93c25ff3c7)/$value">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value</a></p>
</li>
<li>
-<p>Create a new Media Entity <br />
-<strong>POST</strong>
[http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements </p>
+<p>Create a new Media Entity
+ <strong>POST</strong>
[http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements</p>
</li>
</ul>
<p>Content-Type: image/svg+xml</p>
@@ -515,8 +515,8 @@ All methods have to be implemented in cl
<ul>
-<li>Update the content of a media entity <br />
-<strong>PUT</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value</a>
</li>
+<li>Update the content of a media entity
+ <strong>PUT</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value</a></li>
</ul>
<p>Content-Type: text/plain</p>
<div class="codehilite"><pre>Super super nice content
@@ -524,8 +524,8 @@ All methods have to be implemented in cl
<ul>
-<li>Update the properties of a media entity <br />
-<strong>PUT</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)</a>
</li>
+<li>Update the properties of a media entity
+<strong>PUT</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)</a></li>
</ul>
<p>Content-Type: application/json</p>
<div class="codehilite"><pre><span class="p">{</span>
@@ -537,12 +537,12 @@ All methods have to be implemented in cl
<ul>
<li>
-<p>Delete a media entity <br />
-<strong>DELETE</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)</a></p>
+<p>Delete a media entity
+ <strong>DELETE</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(f89dee73-af9f-4cd4-b330-db93c25ff3c7)">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)</a></p>
</li>
<li>
-<p>Delete a media entity <br />
-<strong>DELETE</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(db2d2186-1c29-4d1e-88ef-127f521b9c67)/$value">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(db2d2186-1c29-4d1e-88ef-127f521b9c67)/$value</a></p>
+<p>Delete a media entity
+ <strong>DELETE</strong> <a
href="http://localhost:8080/DemoService-Media/DemoService.svc/Advertisments(db2d2186-1c29-4d1e-88ef-127f521b9c67)/$value">http://localhost:8080/DemoService-Media/DemoService.svc/Advertisements(db2d2186-1c29-4d1e-88ef-127f521b9c67)/$value</a></p>
</li>
</ul>
<h1 id="links">Links<a class="headerlink" href="#links" title="Permanent
link">¶</a></h1>
@@ -550,7 +550,7 @@ All methods have to be implemented in cl
<p>Further topics to be covered by follow-up tutorials:</p>
<ul>
<li>Tutorial OData V4 service part 1: <a
href="/doc/odata4/tutorials/read/tutorial_read.html">Read Entity
Collection</a></li>
-<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a> </li>
+<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a></li>
<li>Tutorial OData V4 service part 3: <a
href="/doc/odata4/tutorials/write/tutorial_write.html">Write (Create, Update,
Delete Entity)</a></li>
<li>Tutorial OData V4 service, part 4: <a
href="/doc/odata4/tutorials/navigation/tutorial_navigation.html">Navigation</a></li>
<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a></li>
@@ -559,6 +559,8 @@ All methods have to be implemented in cl
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial OData V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial OData V4 service, part 7: Media Entities</li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/navigation/tutorial_navigation.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/navigation/tutorial_navigation.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/navigation/tutorial_navigation.html
Wed Dec 9 09:38:11 2015
@@ -823,6 +823,8 @@ Check the <em>Links</em> section for mor
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/read/tutorial_read.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/read/tutorial_read.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/read/tutorial_read.html
Wed Dec 9 09:38:11 2015
@@ -716,7 +716,7 @@ Because the <code>readEntityCollection(.
In our tutorial, to keep the code as simple as possible, we use a little
helper method that delivers some hardcoded entries.
Since we are supposed to deliver the data inside an
<code>EntityCollection</code> instance, we create the instance, ask it for the
(initially empty) list of entities and add some new entities to it.
We create the entities and their properties according to what we declared in
our <code>DemoEdmProvider</code> class. So we have to take care to provide the
correct names to the new property objects.
-If a client requests the response in <a
href="http://docs.oasis-open.org/odata/odata-atom-format/v4.0/odata-atom-format-v4.0.html">ATOM
format</a>, each entity have to provide it`s own entity id.
+If a client requests the response in <a
href="http://docs.oasis-open.org/odata/odata-atom-format/v4.0/odata-atom-format-v4.0.html">ATOM
format</a>, each entity have to provide it`s own entity id.
The method <em>createId</em> allows us to create an id in a convenient way.</p>
<div class="codehilite"><pre><span class="kd">private</span> <span
class="n">EntityCollection</span> <span class="nf">getData</span><span
class="o">(</span><span class="n">EdmEntitySet</span> <span
class="n">edmEntitySet</span><span class="o">){</span>
@@ -939,7 +939,7 @@ A detailed description how to checkout t
<p>Further topics to be covered by follow-up tutorials:</p>
<ul>
<li>Tutorial OData V4 service part 1: Read Entity Collection</li>
-<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a> </li>
+<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a></li>
<li>Tutorial OData V4 service part 3: <a
href="/doc/odata4/tutorials/write/tutorial_write.html">Write (Create, Update,
Delete Entity)</a></li>
<li>Tutorial OData V4 service, part 4: <a
href="/doc/odata4/tutorials/navigation/tutorial_navigation.html">Navigation</a></li>
<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a></li>
@@ -948,6 +948,8 @@ A detailed description how to checkout t
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/readep/tutorial_readep.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/readep/tutorial_readep.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/readep/tutorial_readep.html
Wed Dec 9 09:38:11 2015
@@ -841,15 +841,17 @@ It has been based on a simple OData mode
<h3 id="tutorials">Tutorials<a class="headerlink" href="#tutorials"
title="Permanent link">¶</a></h3>
<ul>
<li>Tutorial OData V4 service part 1: <a
href="/doc/odata4/tutorials/read/tutorial_read.html">Read Entity
Collection</a></li>
-<li>Tutorial OData V4 service part 2: Read Entity, Read Property </li>
+<li>Tutorial OData V4 service part 2: Read Entity, Read Property</li>
<li>Tutorial OData V4 service part 3: <a
href="/doc/odata4/tutorials/write/tutorial_write.html">Write (Create, Update,
Delete Entity)</a></li>
<li>Tutorial OData V4 service, part 4: <a
href="/doc/odata4/tutorials/navigation/tutorial_navigation.html">Navigation</a></li>
-<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a> </li>
+<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a></li>
<li>Tutorial OData V4 service, part 5.2: <a
href="/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html">System Query Options
$select, $expand</a></li>
<li>Tutorial OData V4 service, part 5.3: <a
href="/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.html">System Query Options
$orderby</a></li>
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html
Wed Dec 9 09:38:11 2015
@@ -418,7 +418,7 @@ Also, the <code>expandOption</code> has
<span
class="o">.</span><span class="na">contextURL</span><span
class="o">(</span><span class="n">contextUrl</span><span class="o">)</span>
<span
class="o">.</span><span class="na">select</span><span class="o">(</span><span
class="n">selectOption</span><span class="o">)</span>
<span
class="o">.</span><span class="na">expand</span><span class="o">(</span><span
class="n">expandOption</span><span class="o">)</span>
- <span
class="o">.</span><span class="na">id</span><span class="o">(</span><span
class="n">id</span><span class="o">)</span>
+ <span
class="o">.</span><span class="na">id</span><span class="o">(</span><span
class="n">id</span><span class="o">)</span>
<span
class="o">.</span><span class="na">build</span><span class="o">();</span>
</pre></div>
@@ -539,6 +539,8 @@ The same system query option expressions
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html
Wed Dec 9 09:38:11 2015
@@ -631,6 +631,8 @@ This method is been called if the curren
<li>Tutorial OData V4 service, part 5.4: System Query Options $filter (this
page)</li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.html
Wed Dec 9 09:38:11 2015
@@ -363,6 +363,8 @@ We have decided to not go for the advanc
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html
Wed Dec 9 09:38:11 2015
@@ -99,47 +99,47 @@ h2:hover > .headerlink, h3:hover > .head
<h1 id="how-to-build-an-odata-service-with-olingo-v4">How to build an OData
Service with Olingo V4<a class="headerlink"
href="#how-to-build-an-odata-service-with-olingo-v4" title="Permanent
link">¶</a></h1>
<h1 id="part-51-system-query-options-top-skip-count">Part 5.1: System Query
Options <code>$top</code>, <code>$skip</code>, <code>$count</code><a
class="headerlink" href="#part-51-system-query-options-top-skip-count"
title="Permanent link">¶</a></h1>
<h2 id="introduction">Introduction<a class="headerlink" href="#introduction"
title="Permanent link">¶</a></h2>
-<p>In the present tutorial, weâll learn how to implement <strong>system
query options</strong>.<br />
-Query options are used to refine the result of a query.<br />
+<p>In the present tutorial, weâll learn how to implement <strong>system
query options</strong>.
+Query options are used to refine the result of a query.
The <a
href="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part2-url-conventions/odata-v4.0-errata02-os-part2-url-conventions-complete.html#_Toc406398093">OData
V4 specification document</a> gives the following definition:</p>
<blockquote>
<p>âSystem query options are query string parameters that control the amount
and order of the data returned for the resource identified by the URL. The
names of all system query options are prefixed with a dollar ($)
character.â</p>
</blockquote>
<p>Query options are not part of the resource path, theyâre appended to the
URL after the <code>?</code>.
As an example the URL <a
href="http://localhost:8080/my/page?example=true">http://localhost:8080/my/page?example=true</a>
has <em>example</em> as <em>query option</em> with the value <em>true</em>.</p>
-<p>As an example for a system query option in Odata:<br />
-When querying the list of products, the order of the returned entries is
defaulted by the OData service.<br />
+<p>As an example for a system query option in Odata:
+When querying the list of products, the order of the returned entries is
defaulted by the OData service.
However, the user can change the order of the list by specifying the query
option <code>$orderby</code>.</p>
-<p>Examples for system query options that are commonly used: </p>
+<p>Examples for system query options that are commonly used:</p>
<ul>
-<li><code>$top</code> </li>
-<li><code>$skip</code> </li>
-<li><code>$count</code> </li>
-<li><code>$select</code> </li>
-<li><code>$orderby</code> </li>
-<li><code>$filter</code> </li>
-<li><code>$expand</code> </li>
+<li><code>$top</code></li>
+<li><code>$skip</code></li>
+<li><code>$count</code></li>
+<li><code>$select</code></li>
+<li><code>$orderby</code></li>
+<li><code>$filter</code></li>
+<li><code>$expand</code></li>
</ul>
<p>The present tutorial focuses on the first three query options:
<code>$top</code>, <code>$skip</code> and <code>$count</code></p>
<p><strong>Examples</strong></p>
<p>The following example calls are based on our sample service and illustrate
the usage of these 3 query options.</p>
-<p>First, just to remember, the ânormalâ query of the product without
query options:<br />
+<p>First, just to remember, the ânormalâ query of the product without
query options:
<a
href="http://localhost:8080/DemoService/DemoService.svc/Products">http://localhost:8080/DemoService/DemoService.svc/Products</a></p>
<p><img alt="AllProductsNoQueryOption" src="responseFull.jpg" title="The full
list of Products" /></p>
-<p>The following URL provides only the first 2 entries and ignores all the
rest:<br />
+<p>The following URL provides only the first 2 entries and ignores all the
rest:
<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$top=2">http://localhost:8080/DemoService/DemoService.svc/Products?$top=2</a></p>
<p><img alt="ProductsWith$top" src="responseTop2.jpg" title="The first 2
entries of the list of Products" /></p>
<p>The following request returns the products starting with the 3rd and
ignores the first 2 entries:
<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=2">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=2</a></p>
<p><img alt="ProductsWith$skip" src="responseSkip2.jpg" title="Skipping the
first 2 entries of the list of Products" /></p>
-<p>The following request returns the total number of products and includes it
in the payload:<br />
+<p>The following request returns the total number of products and includes it
in the payload:
<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$count=true">http://localhost:8080/DemoService/DemoService.svc/Products?$count=true</a></p>
<p><img alt="ProductsWith$count" src="responseCount.jpg" title="The full list
of Products with the count added in the payload" /></p>
-<p><strong>Note:</strong><br />
+<p><strong>Note:</strong>
TThe final source code can be found in the project <a
href="https://git-wip-us.apache.org/repos/asf/olingo-odata4">git repository</a>.
-A detailed description how to checkout the tutorials can be found <a
href="/doc/odata4/tutorials/prerequisites/prerequisites.html">here</a>. <br />
+A detailed description how to checkout the tutorials can be found <a
href="/doc/odata4/tutorials/prerequisites/prerequisites.html">here</a>.
This tutorial can be found in subdirectory
<em>\samples\tutorials\p5_queryoptions-tcs</em></p>
-<p><strong>Disclaimer:</strong><br />
+<p><strong>Disclaimer:</strong>
Again, in the present tutorial, weâll focus only on the relevant
implementation, in order to keep the code small and simple. The sample code
shouldnât be reused for advanced scenarios.</p>
<p><strong>Table of Contents</strong></p>
<ol>
@@ -167,7 +167,7 @@ Again, in the present tutorial, weâ
<hr />
<h1 id="3-implementing-system-query-options">3. Implementing system query
options<a class="headerlink" href="#3-implementing-system-query-options"
title="Permanent link">¶</a></h1>
<p>The system query options weâre focusing on are applied to the entity
collection only (for example, it doesnât make sense to apply a
<code>$top</code> to a READ request of a single entity)</p>
-<p>Therefore our implementation for all three query options is done in the
class<br />
+<p>Therefore our implementation for all three query options is done in the
class
<code>myservice.mynamespace.service.DemoEntityCollectionProcessor</code></p>
<p>The general sequence of the implementation remains unchanged:</p>
<ol>
@@ -176,7 +176,7 @@ Again, in the present tutorial, weâ
<li>Serialize</li>
<li>Configure the response</li>
</ol>
-<p>The only difference is that we apply the query options after getting the
data from the backend (our database-mock).<br />
+<p>The only difference is that we apply the query options after getting the
data from the backend (our database-mock).
So the procedure will be:</p>
<ol>
<li>Analyze the URI</li>
@@ -185,49 +185,49 @@ So the procedure will be:</p>
<li>Serialize</li>
<li>Configure the response</li>
</ol>
-<p>The following sections describe how such system query options are
implemented.<br />
-The procedure will be similar in all 3 cases: </p>
+<p>The following sections describe how such system query options are
implemented.
+The procedure will be similar in all 3 cases:</p>
<ol>
-<li>Get the query option from the UriInfo. If null is returned then nothing
has to be done. </li>
-<li>Get the value from the query option </li>
-<li>Analyze the value </li>
-<li>Modify the EntityCollection </li>
+<li>Get the query option from the UriInfo. If null is returned then nothing
has to be done.</li>
+<li>Get the value from the query option</li>
+<li>Analyze the value</li>
+<li>Modify the EntityCollection</li>
</ol>
<h2 id="31-implement-count">3.1. Implement <code>$count</code><a
class="headerlink" href="#31-implement-count" title="Permanent
link">¶</a></h2>
-<p><strong>Background</strong><br />
-The <code>$count</code> allows users to request a count of the matching
resources.<br />
+<p><strong>Background</strong>
+The <code>$count</code> allows users to request a count of the matching
resources.
The number will be included with the resources in the response (see screenshot
above).</p>
-<p>The user specifies the <code>$count</code> as follows:<br />
-<code>$count=true</code><br />
-<code>$count=false</code> </p>
+<p>The user specifies the <code>$count</code> as follows:
+<code>$count=true</code>
+<code>$count=false</code></p>
<p>If the value of <code>$count</code> is set to <em>false</em>, then no
number is returned, the same like if <code>$count</code> is not specified at
all. However, this case has to be considered in our code as well.</p>
-<p>Note:<br />
-For those who are used to OData V2:<br />
+<p>Note:
+For those who are used to OData V2:
In V2, the query option <code>$inlinecount</code> has now been replaced in V4
by <code>$count=true</code>.
-In V2, the <code>/$count</code> that was part of the resource path, has now
been removed in V4. </p>
-<p>Thereâs one more important detail that we have to consider before writing
the code:<br />
-<code>$count</code> always returns the original number of entities, without
considering <em>$top</em> and <code>$skip</code>.<br />
-This is specified by the <a
href="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398308">OData
V4 specification</a>: </p>
+In V2, the <code>/$count</code> that was part of the resource path, has now
been removed in V4.</p>
+<p>Thereâs one more important detail that we have to consider before writing
the code:
+<code>$count</code> always returns the original number of entities, without
considering <em>$top</em> and <code>$skip</code>.
+This is specified by the <a
href="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398308">OData
V4 specification</a>:</p>
<blockquote>
-<p>âThe <code>$count</code> system query option ignores any $top,
<code>$skip</code>, or <code>$expand</code> query options, and returns the
total count of results across all pages including only those results matching
any specified <code>$filter</code> and $search.â </p>
+<p>âThe <code>$count</code> system query option ignores any $top,
<code>$skip</code>, or <code>$expand</code> query options, and returns the
total count of results across all pages including only those results matching
any specified <code>$filter</code> and $search.â</p>
</blockquote>
<p>Therefore, in our sample code, the <code>$count</code> will be the first to
be implemented, to make sure that the data provided by the backend is not
modified at the moment when we "count" it.</p>
-<p><strong>Implementation</strong><br />
-As in the previous tutorials, the data is fetched from the backend.<br />
-It is provided as <code>EntityCollection</code> which we can ask for the list
of contained <code>Entity</code> instances.<br />
-The size of this genuine list is the relevant information for our
<code>$count</code>.<br />
-Furthermore, we create a new instance of an <code>EntityCollection</code>
object, which will carry the modified list of entities after applying all the
query options. </p>
+<p><strong>Implementation</strong>
+As in the previous tutorials, the data is fetched from the backend.
+It is provided as <code>EntityCollection</code> which we can ask for the list
of contained <code>Entity</code> instances.
+The size of this genuine list is the relevant information for our
<code>$count</code>.
+Furthermore, we create a new instance of an <code>EntityCollection</code>
object, which will carry the modified list of entities after applying all the
query options.</p>
<div class="codehilite"><pre><span class="n">EntityCollection</span> <span
class="n">entityCollection</span> <span class="o">=</span> <span
class="n">storage</span><span class="o">.</span><span
class="na">readEntitySetData</span><span class="o">(</span><span
class="n">edmEntitySet</span><span class="o">);</span>
<span class="n">List</span><span class="o"><</span><span
class="n">Entity</span><span class="o">></span> <span
class="n">entityList</span> <span class="o">=</span> <span
class="n">entityCollection</span><span class="o">.</span><span
class="na">getEntities</span><span class="o">();</span>
<span class="n">EntityCollection</span> <span
class="n">returnEntityCollection</span> <span class="o">=</span> <span
class="k">new</span> <span class="n">EntityCollection</span><span
class="o">();</span>
</pre></div>
-<p>Then we proceed with the 4 steps as described above: </p>
+<p>Then we proceed with the 4 steps as described above:</p>
<ol>
-<li>Get the query option from the <code>UriInfo</code>. If null is returned
then nothing has to be done. </li>
-<li>Get the value from the query option </li>
-<li>Analyze the value </li>
+<li>Get the query option from the <code>UriInfo</code>. If null is returned
then nothing has to be done.</li>
+<li>Get the value from the query option</li>
+<li>Analyze the value</li>
<li>Modify the <code>EntityCollection</code></li>
</ol>
<p>And this is the sample code:</p>
@@ -241,12 +241,12 @@ Furthermore, we create a new instance of
</pre></div>
-<p><strong>Note:</strong><br />
+<p><strong>Note:</strong>
We donât need to check if the value of the <code>$count</code> is incorrect
(e.g. <code>$count=xxx</code>), as this is handled by the <em>Olingo OData
V4</em> library.</p>
-<p>One additional step has to be considered:<br />
-As we know, if <code>$count=true</code> is specified, the structure of the
response payload is different.<br />
-So we have to inform the serializer.that <code>$count</code> has to be
considered.<br />
-So we have to modify the line of code, where the
<code>EntityCollectionSerializerOptions</code> is created: </p>
+<p>One additional step has to be considered:
+As we know, if <code>$count=true</code> is specified, the structure of the
response payload is different.
+So we have to inform the serializer.that <code>$count</code> has to be
considered.
+So we have to modify the line of code, where the
<code>EntityCollectionSerializerOptions</code> is created:</p>
<div class="codehilite"><pre><span
class="n">EntityCollectionSerializerOptions</span> <span class="n">opts</span>
<span class="o">=</span> <span
class="n">EntityCollectionSerializerOptions</span><span class="o">.</span><span
class="na">with</span><span class="o">()</span>
<span class="o">.</span><span
class="na">contextURL</span><span class="o">(</span><span
class="n">contextUrl</span><span class="o">)</span>
<span class="o">.</span><span
class="na">id</span><span class="o">(</span><span class="n">id</span><span
class="o">)</span>
@@ -264,22 +264,22 @@ So we have to modify the line of code, w
<h2 id="32-implement-skip">3.2. Implement <code>$skip</code><a
class="headerlink" href="#32-implement-skip" title="Permanent
link">¶</a></h2>
-<p><strong>Background</strong><br />
-With the query option <code>$skip</code>, the user of an OData service can
specify the number of entries that should be ignored at the beginning of a
collection.<br />
+<p><strong>Background</strong>
+With the query option <code>$skip</code>, the user of an OData service can
specify the number of entries that should be ignored at the beginning of a
collection.
So if a user specifies <code>$skip=n</code> then our OData service has to
return the list of entries starting at position n+1</p>
-<p>One important rule that we have to consider is described by the <a
href="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398306">OData
V4 specification</a>: </p>
+<p>One important rule that we have to consider is described by the <a
href="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398306">OData
V4 specification</a>:</p>
<blockquote>
-<p>âWhere <code>$top</code> and <code>$skip</code> are used together,
<code>$skip</code> MUST be applied before $top, regardless of the order in
which they appear in the request.â </p>
+<p>âWhere <code>$top</code> and <code>$skip</code> are used together,
<code>$skip</code> MUST be applied before $top, regardless of the order in
which they appear in the request.â</p>
</blockquote>
<p>This means for us that we add the code for <code>$skip</code> before the
code for <code>$top</code>.</p>
<p><strong>Implementation</strong></p>
-<p>Again we follow the 4 mentioned steps.<br />
-We get the <code>SkipOption</code> object from the <code>UriInfo</code>.<br />
-If the <code>SkipOption</code> is null, then it hasnât been specified by the
user.<br />
-Since it is not mandatory to specify any query option, we can ignore the case
of <code>SkipOption</code> being null.<br />
-We ask the <code>SkipOption</code> object for the value that has been
specified by the user.<br />
-Since the user might give invalid numbers, we have to check that and throw an
exception with HTTP status as âBad Requestâ.<br />
-Then we can do the actual job, which is adapting the backend-data according to
the specified <code>$skip</code>. </p>
+<p>Again we follow the 4 mentioned steps.
+We get the <code>SkipOption</code> object from the <code>UriInfo</code>.
+If the <code>SkipOption</code> is null, then it hasnât been specified by the
user.
+Since it is not mandatory to specify any query option, we can ignore the case
of <code>SkipOption</code> being null.
+We ask the <code>SkipOption</code> object for the value that has been
specified by the user.
+Since the user might give invalid numbers, we have to check that and throw an
exception with HTTP status as âBad Requestâ.
+Then we can do the actual job, which is adapting the backend-data according to
the specified <code>$skip</code>.</p>
<div class="codehilite"><pre><span class="n">SkipOption</span> <span
class="n">skipOption</span> <span class="o">=</span> <span
class="n">uriInfo</span><span class="o">.</span><span
class="na">getSkipOption</span><span class="o">();</span>
<span class="k">if</span> <span class="o">(</span><span
class="n">skipOption</span> <span class="o">!=</span> <span
class="kc">null</span><span class="o">)</span> <span class="o">{</span>
<span class="kt">int</span> <span class="n">skipNumber</span> <span
class="o">=</span> <span class="n">skipOption</span><span
class="o">.</span><span class="na">getValue</span><span class="o">();</span>
@@ -297,7 +297,7 @@ Then we can do the actual job, which is
</pre></div>
-<p>After applying the query option, we have the desired set of entities in the
variable <code>entityList</code>.<br />
+<p>After applying the query option, we have the desired set of entities in the
variable <code>entityList</code>.
Now we have to populate the <code>EntityCollection</code> instance, that we
created in the section above, with these entities, before we can pass it to the
serializer:</p>
<div class="codehilite"><pre><span class="k">for</span><span
class="o">(</span><span class="n">Entity</span> <span class="n">entity</span>
<span class="o">:</span> <span class="n">entityList</span><span
class="o">){</span>
<span class="n">returnEntityCollection</span><span class="o">.</span><span
class="na">getEntities</span><span class="o">().</span><span
class="na">add</span><span class="o">(</span><span class="n">entity</span><span
class="o">);</span>
@@ -306,7 +306,7 @@ Now we have to populate the <code>Entity
<h2 id="33-implement-top">3.3. Implement $top<a class="headerlink"
href="#33-implement-top" title="Permanent link">¶</a></h2>
-<p><strong>Background</strong><br />
+<p><strong>Background</strong>
With the query option <code>$top</code>, the user of an OData service can
specify the maximum number of entries that should be returned, starting from
the beginning.</p>
<p><strong>Implementation</strong></p>
<p>Again we follow the 4 mentioned steps, the code is very similar, only the
logic for reducing the entityList is different:</p>
@@ -397,7 +397,7 @@ With the query option <code>$top</code>,
<span
class="o">.</span><span class="na">id</span><span class="o">(</span><span
class="n">id</span><span class="o">)</span>
<span
class="o">.</span><span class="na">count</span><span class="o">(</span><span
class="n">countOption</span><span class="o">)</span>
<span
class="o">.</span><span class="na">build</span><span class="o">();</span>
- <span class="n">SerializerResult</span> <span
class="n">serializerResult</span> <span class="o">=</span> <span
class="n">serializer</span><span class="o">.</span><span
class="na">entityCollection</span><span class="o">(</span><span
class="n">serviceMetadata</span><span class="o">,</span> <span
class="n">edmEntityType</span><span class="o">,</span>
+ <span class="n">SerializerResult</span> <span
class="n">serializerResult</span> <span class="o">=</span> <span
class="n">serializer</span><span class="o">.</span><span
class="na">entityCollection</span><span class="o">(</span><span
class="n">serviceMetadata</span><span class="o">,</span> <span
class="n">edmEntityType</span><span class="o">,</span>
<span
class="n">returnEntityCollection</span><span class="o">,</span> <span
class="n">opts</span><span class="o">);</span>
<span class="c1">// 5th: configure the response object: set the body,
headers and status code</span>
@@ -410,40 +410,40 @@ With the query option <code>$top</code>,
<hr />
<h1 id="4-run-the-implemented-service">4. Run the implemented service<a
class="headerlink" href="#4-run-the-implemented-service" title="Permanent
link">¶</a></h1>
-<p>After building and deploying your service to your server, you can try the
following URLs: </p>
+<p>After building and deploying your service to your server, you can try the
following URLs:</p>
<ul>
<li>
-<p>The full collection, no query option<br />
-<a
href="http://localhost:8080/DemoService/DemoService.svc/Products">http://localhost:8080/DemoService/DemoService.svc/Products</a></p>
+<p>The full collection, no query option
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products">http://localhost:8080/DemoService/DemoService.svc/Products</a></p>
</li>
<li>
-<p>First 2 products only<br />
-<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$top=2">http://localhost:8080/DemoService/DemoService.svc/Products?$top=2</a></p>
+<p>First 2 products only
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$top=2">http://localhost:8080/DemoService/DemoService.svc/Products?$top=2</a></p>
</li>
<li>
-<p>Exclude the first 2 products<br />
-<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=2">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=2</a></p>
+<p>Exclude the first 2 products
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=2">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=2</a></p>
</li>
<li>
-<p>Add the full number of all products to the response payload<br />
-<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$count=true">http://localhost:8080/DemoService/DemoService.svc/Products?$count=true</a></p>
+<p>Add the full number of all products to the response payload
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$count=true">http://localhost:8080/DemoService/DemoService.svc/Products?$count=true</a></p>
</li>
<li>
<p>Combine <code>$top</code> and <code>$skip</code>
- <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1</a><br
/>
-<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$top=1&$skip=1">http://localhost:8080/DemoService/DemoService.svc/Products?$top=1&$skip=1</a><br
/>
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1</a>
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$top=1&$skip=1">http://localhost:8080/DemoService/DemoService.svc/Products?$top=1&$skip=1</a>
Regardless of the order, the result should be the same</p>
</li>
<li>
-<p>Combine all 3 query options<br />
-<a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1&$count=true">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1&$count=true</a></p>
+<p>Combine all 3 query options
+ <a
href="http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1&$count=true">http://localhost:8080/DemoService/DemoService.svc/Products?$skip=1&$top=1&$count=true</a></p>
</li>
</ul>
<hr />
<h1 id="5-summary">5. Summary<a class="headerlink" href="#5-summary"
title="Permanent link">¶</a></h1>
<p>In this tutorial we have learned how enhance our OData service to support
system query options.
-In a first step, weâve covered <code>$top</code>, <code>$skip</code> and
<code>$count</code>.<br />
-More system query options will be treated in the subsequent tutorials. </p>
+In a first step, weâve covered <code>$top</code>, <code>$skip</code> and
<code>$count</code>.
+More system query options will be treated in the subsequent tutorials.</p>
<hr />
<h1 id="6-links">6. Links<a class="headerlink" href="#6-links"
title="Permanent link">¶</a></h1>
<h3 id="tutorials">Tutorials<a class="headerlink" href="#tutorials"
title="Permanent link">¶</a></h3>
@@ -458,6 +458,8 @@ More system query options will be treate
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/write/tutorial_write.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/write/tutorial_write.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/write/tutorial_write.html
Wed Dec 9 09:38:11 2015
@@ -445,13 +445,15 @@ It has been based on a simple OData mode
<li>Tutorial OData V4 service part 1: <a
href="/doc/odata4/tutorials/read/tutorial_read.html">Read Entity
Collection</a></li>
<li>Tutorial OData V4 service part 2: <a
href="/doc/odata4/tutorials/readep/tutorial_readep.html">Read Entity, Read
Property</a></li>
<li>Tutorial OData V4 service part 3: Write (Create, Update, Delete Entity</li>
-<li>Tutorial OData V4 service, part 4: <a
href="/doc/odata4/tutorials/navigation/tutorial_navigation.html">Navigation</a>
</li>
-<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a> </li>
-<li>Tutorial OData V4 service, part 5.2: <a
href="/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html">System Query Options
$select, $expand</a> </li>
+<li>Tutorial OData V4 service, part 4: <a
href="/doc/odata4/tutorials/navigation/tutorial_navigation.html">Navigation</a></li>
+<li>Tutorial OData V4 service, part 5.1: <a
href="/doc/odata4/tutorials/sqo_tcs/tutorial_sqo_tcs.html">System Query Options
$top, $skip, $count (this page)</a></li>
+<li>Tutorial OData V4 service, part 5.2: <a
href="/doc/odata4/tutorials/sqo_es/tutorial_sqo_es.html">System Query Options
$select, $expand</a></li>
<li>Tutorial OData V4 service, part 5.3: <a
href="/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.html">System Query Options
$orderby</a></li>
<li>Tutorial OData V4 service, part 5.4: <a
href="/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html">System Query Options
$filter</a></li>
<li>Tutorial ODATA V4 service, part 6: <a
href="/doc/odata4/tutorials/action/tutorial_action.html">Action and Function
Imports</a></li>
<li>Tutorial ODATA V4 service, part 7: <a
href="/doc/odata4/tutorials/media/tutorial_media.html">Media Entities</a></li>
+<li>Tutorial OData V4 service, part 8: <a
href="/doc/odata4/tutorials/batch/tutorial_batch.html">Batch Request
support</a></li>
+<li>Tutorial OData V4 service, part 9: <a
href="/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html">Handling
"Deep Insert" requests</a></li>
</ul>
<h3 id="code-and-repository">Code and Repository<a class="headerlink"
href="#code-and-repository" title="Permanent link">¶</a></h3>
<ul>
Modified: websites/staging/olingo/trunk/content/support.html
==============================================================================
--- websites/staging/olingo/trunk/content/support.html (original)
+++ websites/staging/olingo/trunk/content/support.html Wed Dec 9 09:38:11 2015
@@ -135,6 +135,7 @@ h2:hover > .headerlink, h3:hover > .head
<li><a href="https://git-wip-us.apache.org/repos/asf/olingo-odata4-js">Source
Code Repository (OData V4.0 Javascript)</a></li>
<li><a href="https://git-wip-us.apache.org/repos/asf/olingo-odata3-js">Source
Code Repository (OData V3.0 Javascript)</a></li>
<li><a href="https://git-wip-us.apache.org/repos/asf/olingo-odata2">Source
Code Repository (OData V2.0 Java)</a></li>
+<li><a href="/contribute.html">How to contribute</a></li>
<li><a href="https://issues.apache.org/jira/browse/OLINGO">JIRA</a></li>
<li><a href="https://builds.apache.org/view/M-R/view/Olingo/">CI
Builds</a></li>
<li><a
href="https://analysis.apache.org/dashboard/index?id=org.apache.olingo%3Aodata-parent">Apache
Analyse (SonarQube)</a></li>