Author: buildbot
Date: Wed Oct 21 07:53:13 2015
New Revision: 969720
Log:
Staging update by buildbot for olingo
Modified:
websites/staging/olingo/trunk/content/ (props changed)
websites/staging/olingo/trunk/content/doc/odata4/tutorials/action/tutorial_action.html
Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Oct 21 07:53:13 2015
@@ -1 +1 @@
-1709736
+1709737
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 Oct 21 07:53:13 2015
@@ -99,26 +99,27 @@
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="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-6-action-imports-and-function-imports">Part 6: Action Imports and
Function Imports<a class="headerlink"
href="#part-6-action-imports-and-function-imports" title="Permanent
link">¶</a></h1>
-<p>In the present tutorial, weâll implement a function import and an action
import as well.</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 />
-This tutorial can be found in subdirectory
<code>/samples/tutorials/p9_action</code></p>
<p><strong>Table of Contents</strong></p>
<div class="toc">
<ul>
<li><a href="#how-to-build-an-odata-service-with-olingo-v4">How to build an
OData Service with Olingo V4</a></li>
-<li><a href="#part-6-action-imports-and-function-imports">Part 6: Action
Imports and Function Imports</a></li>
+<li><a href="#part-6-action-imports-and-function-imports">Part 6: Action
Imports and Function Imports</a><ul>
<li><a href="#1-introduction">1. Introduction</a></li>
-<li><a href="#2-preparation">2. Preparation</a></li>
+</ul>
+</li>
+<li><a href="#2-preparation">2. Preparation</a><ul>
<li><a href="#31-implementation">3.1 Implementation</a><ul>
<li><a href="#31-extend-the-metadata-model">3.1 Extend the Metadata
model</a></li>
+</ul>
+</li>
<li><a href="#32-extend-the-data-store">3.2 Extend the data store</a></li>
-<li><a
href="#33-extend-the-entity-collection-and-the-entity-processor-to-handle-function-imports">3.3
Extend the entity collection and the entity processor to handle function
imports</a></li>
+<li><a
href="#33-extend-the-entity-collection-and-the-entity-processor-to-handle-function-imports">3.3
Extend the entity collection and the entity processor to handle function
imports</a><ul>
<li><a href="#34-implement-an-action-processor">3.4 Implement an action
processor</a></li>
</ul>
</li>
<li><a href="#4-run-the-implemented-service">4. Run the implemented
service</a></li>
+</ul>
+</li>
<li><a href="#5-links">5. Links</a><ul>
<li><a href="#tutorials">Tutorials</a></li>
<li><a href="#code-and-repository">Code and Repository</a></li>
@@ -127,7 +128,12 @@ This tutorial can be found in subdirecto
</li>
</ul>
</div>
-<h1 id="1-introduction">1. Introduction<a class="headerlink"
href="#1-introduction" title="Permanent link">¶</a></h1>
+<h2 id="1-introduction">1. Introduction<a class="headerlink"
href="#1-introduction" title="Permanent link">¶</a></h2>
+<p>In the present tutorial, weâll implement a function import and an action
import as well.</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 />
+This tutorial can be found in subdirectory
<code>/samples/tutorials/p9_action</code></p>
<p>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#_Toc406398201">OData
V4 specification</a> gives us a definition what <em>Functions</em>,
<em>Actions</em> are:</p>
<blockquote>
<p>Operations allow the execution of custom logic on parts of a data
@@ -205,7 +211,7 @@ root.</p>
<p>You should read the previous tutorials first to have an idea how to read
entities and entity collections. In addition the following code is based on the
write tutorial merged with the navigation tutorial.</p>
<p>As a shortcut you should checkout the prepared tutorial project in the <a
href="https://git-wip-us.apache.org/repos/asf/olingo-odata4">git repository</a>
in folder /samples/tutorials/p9_action_preparation.</p>
<p>Afterwards do a Deploy and run: it should be working. At this state you can
perform CRUD operations and do navigations between products and categories.</p>
-<h1 id="31-implementation">3.1 Implementation<a class="headerlink"
href="#31-implementation" title="Permanent link">¶</a></h1>
+<h2 id="31-implementation">3.1 Implementation<a class="headerlink"
href="#31-implementation" title="Permanent link">¶</a></h2>
<p>We will using the given data model you are familiar with. To keep things
simple we implement one function import and one action import.</p>
<p><strong>Function Import: CountCategories</strong> <br />
This function takes a mandatory parameter â<em>Amount</em>â. The function
returns a collection of categories with the very same number of related
products.</p>
@@ -236,7 +242,7 @@ This action takes an optional parameter
<li>Extend the entity collection and the entity processor to handle function
imports</li>
<li>Implement an action processor</li>
</ul>
-<h2 id="31-extend-the-metadata-model">3.1 Extend the Metadata model<a
class="headerlink" href="#31-extend-the-metadata-model" title="Permanent
link">¶</a></h2>
+<h3 id="31-extend-the-metadata-model">3.1 Extend the Metadata model<a
class="headerlink" href="#31-extend-the-metadata-model" title="Permanent
link">¶</a></h3>
<p>Create the following constants in the DemoEdmProvider. These constants are
used to address the operations.</p>
<div class="codehilite"><pre><span class="c1">// Action</span>
<span class="kd">public</span> <span class="kd">static</span> <span
class="kd">final</span> <span class="n">String</span> <span
class="n">ACTION_RESET</span> <span class="o">=</span> <span
class="s">"Reset"</span><span class="o">;</span>
@@ -564,7 +570,7 @@ A cleverer implementation can handle bot
</pre></div>
-<h2 id="34-implement-an-action-processor">3.4 Implement an action processor<a
class="headerlink" href="#34-implement-an-action-processor" title="Permanent
link">¶</a></h2>
+<h3 id="34-implement-an-action-processor">3.4 Implement an action processor<a
class="headerlink" href="#34-implement-an-action-processor" title="Permanent
link">¶</a></h3>
<p>Create a new class <code>DemoActionProcessor</code> make them implement the
interface <code>ActionVoidProcessor</code>.</p>
<div class="codehilite"><pre><span class="kd">public</span> <span
class="kd">class</span> <span class="nc">DemoActionProcessor</span> <span
class="kd">implements</span> <span class="n">ActionVoidProcessor</span> <span
class="o">{</span>
@@ -621,7 +627,7 @@ A cleverer implementation can handle bot
</pre></div>
-<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>
+<h2 id="4-run-the-implemented-service">4. Run the implemented service<a
class="headerlink" href="#4-run-the-implemented-service" title="Permanent
link">¶</a></h2>
<p>After building and deploying your service to your server, you can try the
following requests:</p>
<p><strong>Functions (Called via GET)</strong> </p>
<ul>