olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r967928 - in /websites/staging/olingo/trunk/content: ./ doc/odata4/tutorials/action/tutorial_action.html
Date Tue, 06 Oct 2015 11:12:20 GMT
Author: buildbot
Date: Tue Oct  6 11:12:20 2015
New Revision: 967928

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 Tue Oct  6 11:12:20 2015
@@ -1 +1 @@
-1706988
+1706991

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
Tue Oct  6 11:12:20 2015
@@ -181,7 +181,7 @@ root.</p>
 
 <p>The parameters are passed within the body of the request. In this case such a body
could look like the following (JSON - Syntax):</p>
 <div class="codehilite"><pre><span class="p">{</span>
-     &quot;<span class="n">Amount</span>&quot;<span class="p">:</span>
2
+     <span class="nt">&quot;Amount&quot;</span><span class="p">:</span>
<span class="mi">2</span>
 <span class="p">}</span>
 </pre></div>
 
@@ -412,28 +412,28 @@ Add the following lines to the method <e
 
 
 <p>We also create two methods to reset the data of our service.</p>
-<div class="codehilite"><pre><span class="n">public</span> <span
class="n">void</span> <span class="n">resetDataSet</span><span class="p">(</span><span
class="n">final</span> <span class="n">int</span> <span class="n">amount</span><span
class="p">)</span> <span class="p">{</span>
-    <span class="o">//</span> <span class="n">Replace</span> <span
class="n">the</span> <span class="n">old</span> <span class="n">lists</span>
<span class="n">with</span> <span class="n">empty</span> <span
class="nb">ones</span>
-    <span class="n">productList</span> <span class="p">=</span> <span
class="n">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span
class="n">Entity</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">categoryList</span> <span class="p">=</span>
<span class="n">new</span> <span class="n">ArrayList</span><span
class="o">&lt;</span><span class="n">Entity</span><span class="o">&gt;</span><span
class="p">();</span>
-
-    <span class="o">//</span> <span class="n">Create</span> <span
class="n">new</span> <span class="n">sample</span> <span class="n">data</span>
-    <span class="n">initProductSampleData</span><span class="p">();</span>
-    <span class="n">initCategorySampleData</span><span class="p">();</span>
-
-    <span class="o">//</span> <span class="n">Truncate</span> <span
class="n">the</span> <span class="n">lists</span>
-    <span class="k">if</span><span class="p">(</span><span class="n">amount</span>
<span class="o">&lt;</span> <span class="n">productList</span><span
class="p">.</span><span class="nb">size</span><span class="p">())</span>
<span class="p">{</span>
-        <span class="n">productList</span> <span class="p">=</span>
<span class="n">productList</span><span class="p">.</span><span
class="n">subList</span><span class="p">(</span>0<span class="p">,</span>
<span class="n">amount</span><span class="p">);</span>
-        <span class="o">//</span> <span class="n">Products</span>
0<span class="p">,</span> 1 <span class="n">are</span> <span class="n">linked</span>
<span class="n">to</span> <span class="n">category</span> 0
-        <span class="o">//</span> <span class="n">Products</span>
2<span class="p">,</span> 3 <span class="n">are</span> <span class="n">linked</span>
<span class="n">to</span> <span class="n">category</span> 1
-        <span class="o">//</span> <span class="n">Products</span>
4<span class="p">,</span> 5 <span class="n">are</span> <span class="n">linked</span>
<span class="n">to</span> <span class="n">category</span> 2
-        <span class="n">categoryList</span> <span class="p">=</span>
<span class="n">categoryList</span><span class="p">.</span><span
class="n">subList</span><span class="p">(</span>0<span class="p">,</span>
<span class="p">(</span><span class="n">amount</span> <span class="o">/</span>
2<span class="p">)</span> <span class="o">+</span> 1<span class="p">);</span>
-    <span class="p">}</span>
-<span class="p">}</span>
+<div class="codehilite"><pre><span class="kd">public</span> <span
class="kt">void</span> <span class="nf">resetDataSet</span><span class="o">(</span><span
class="kd">final</span> <span class="kt">int</span> <span class="n">amount</span><span
class="o">)</span> <span class="o">{</span>
+    <span class="c1">// Replace the old lists with empty ones</span>
+    <span class="n">productList</span> <span class="o">=</span> <span
class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span
class="n">Entity</span><span class="o">&gt;();</span>
+    <span class="n">categoryList</span> <span class="o">=</span>
<span class="k">new</span> <span class="n">ArrayList</span><span
class="o">&lt;</span><span class="n">Entity</span><span class="o">&gt;();</span>
+
+    <span class="c1">// Create new sample data</span>
+    <span class="n">initProductSampleData</span><span class="o">();</span>
+    <span class="n">initCategorySampleData</span><span class="o">();</span>
+
+    <span class="c1">// Truncate the lists</span>
+    <span class="k">if</span><span class="o">(</span><span class="n">amount</span>
<span class="o">&lt;</span> <span class="n">productList</span><span
class="o">.</span><span class="na">size</span><span class="o">())</span>
<span class="o">{</span>
+        <span class="n">productList</span> <span class="o">=</span>
<span class="n">productList</span><span class="o">.</span><span
class="na">subList</span><span class="o">(</span><span class="mi">0</span><span
class="o">,</span> <span class="n">amount</span><span class="o">);</span>
+        <span class="c1">// Products 0, 1 are linked to category 0</span>
+        <span class="c1">// Products 2, 3 are linked to category 1</span>
+        <span class="c1">// Products 4, 5 are linked to category 2</span>
+        <span class="n">categoryList</span> <span class="o">=</span>
<span class="n">categoryList</span><span class="o">.</span><span
class="na">subList</span><span class="o">(</span><span class="mi">0</span><span
class="o">,</span> <span class="o">(</span><span class="n">amount</span>
<span class="o">/</span> <span class="mi">2</span><span class="o">)</span>
<span class="o">+</span> <span class="mi">1</span><span class="o">);</span>
+    <span class="o">}</span>
+<span class="o">}</span>
 
-<span class="n">public</span> <span class="n">void</span> <span
class="n">resetDataSet</span><span class="p">()</span> <span class="p">{</span>
-    <span class="n">resetDataSet</span><span class="p">(</span><span
class="n">Integer</span><span class="p">.</span><span class="n">MAX_VALUE</span><span
class="p">);</span>
-<span class="p">}</span>
+<span class="kd">public</span> <span class="kt">void</span> <span
class="nf">resetDataSet</span><span class="o">()</span> <span class="o">{</span>
+    <span class="n">resetDataSet</span><span class="o">(</span><span
class="n">Integer</span><span class="o">.</span><span class="na">MAX_VALUE</span><span
class="o">);</span>
+<span class="o">}</span>
 </pre></div>
 
 



Mime
View raw message