olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r949486 - in /websites/staging/olingo/trunk/content: ./ doc/odata4/tutorials/read/tutorial_read.html
Date Tue, 28 Apr 2015 12:36:10 GMT
Author: buildbot
Date: Tue Apr 28 12:36:10 2015
New Revision: 949486

Log:
Staging update by buildbot for olingo

Modified:
    websites/staging/olingo/trunk/content/   (props changed)
    websites/staging/olingo/trunk/content/doc/odata4/tutorials/read/tutorial_read.html

Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Apr 28 12:36:10 2015
@@ -1 +1 @@
-1676514
+1676515

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 Tue Apr 28 12:36:10 2015
@@ -301,8 +301,10 @@ This document defines the contract, such
 <p>Furthermore, OData specifies the usage of the so-called service document
 Here, the user can see which Entity Collections are offered by an OData service.</p>
 <p>The service document can be invoked via the following URI:</p>
-<p><code>html
- &lt;serviceroot&gt;/</code></p>
+<div class="codehilite"><pre><span class="nt">&lt;serviceroot&gt;</span>/
+</pre></div>
+
+
 <p>The information that is given by these 2 URIs, has to be implemented in the service code.
 Olingo provides API for it and we’ll use it in the implementation of our <em>EdmProvider.</em></p>
 <h3 id="412-create-class">4.1.2. Create class</h3>
@@ -342,18 +344,18 @@ Select the mentioned methods and press O
 <p>Let’s have a closer look at the methods in detail.</p>
 <p>First, we need to declare some constants, to be used in below code</p>
 <div class="codehilite"><pre><span class="c1">// Service Namespace</span>
-<span class="n">public</span> <span class="k">static</span> <span class="k">final</span> <span class="n">String</span> <span class="no">NAMESPACE</span> <span class="o">=</span> <span class="s">&quot;com.example.model&quot;</span><span class="p">;</span>
+<span class="kd">public</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">NAMESPACE</span> <span class="o">=</span> <span class="s">&quot;com.example.model&quot;</span><span class="o">;</span>
 
 <span class="c1">// EDM Container</span>
-<span class="n">public</span> <span class="k">static</span> <span class="k">final</span> <span class="n">String</span> <span class="no">CONTAINER_NAME</span> <span class="o">=</span> <span class="s">&quot;Container&quot;</span><span class="p">;</span>
-<span class="n">public</span> <span class="k">static</span> <span class="k">final</span> <span class="n">FullQualifiedName</span> <span class="no">CONTAINER</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FullQualifiedName</span><span class="p">(</span><span class="no">NAMESPACE</span><span class="p">,</span> <span class="no">CONTAINER_NAME</span><span class="p">);</span>
+<span class="kd">public</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">CONTAINER_NAME</span> <span class="o">=</span> <span class="s">&quot;Container&quot;</span><span class="o">;</span>
+<span class="kd">public</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">FullQualifiedName</span> <span class="n">CONTAINER</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FullQualifiedName</span><span class="o">(</span><span class="n">NAMESPACE</span><span class="o">,</span> <span class="n">CONTAINER_NAME</span><span class="o">);</span>
 
 <span class="c1">// Entity Types Names</span>
-<span class="n">public</span> <span class="k">static</span> <span class="k">final</span> <span class="n">String</span> <span class="no">ET_PRODUCT_NAME</span> <span class="o">=</span> <span class="s">&quot;Product&quot;</span><span class="p">;</span>
-<span class="n">public</span> <span class="k">static</span> <span class="k">final</span> <span class="n">FullQualifiedName</span> <span class="no">ET_PRODUCT_FQN</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FullQualifiedName</span><span class="p">(</span><span class="no">NAMESPACE</span><span class="p">,</span> <span class="no">ET_PRODUCT_NAME</span><span class="p">);</span>
+<span class="kd">public</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">ET_PRODUCT_NAME</span> <span class="o">=</span> <span class="s">&quot;Product&quot;</span><span class="o">;</span>
+<span class="kd">public</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">FullQualifiedName</span> <span class="n">ET_PRODUCT_FQN</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FullQualifiedName</span><span class="o">(</span><span class="n">NAMESPACE</span><span class="o">,</span> <span class="n">ET_PRODUCT_NAME</span><span class="o">);</span>
 
 <span class="c1">// Entity Set Names</span>
-<span class="n">public</span> <span class="k">static</span> <span class="k">final</span> <span class="n">String</span> <span class="no">ES_PRODUCTS_NAME</span> <span class="o">=</span> <span class="s">&quot;Products&quot;</span><span class="p">;</span>
+<span class="kd">public</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">ES_PRODUCTS_NAME</span> <span class="o">=</span> <span class="s">&quot;Products&quot;</span><span class="o">;</span>
 </pre></div>
 
 
@@ -365,32 +367,32 @@ Such information is provided by the <em>
 <p>The name of the EntityType: “Product”<br />
 The properties: name and type and additional info, e.g. “ID” of type “edm.int32”<br />
 Which of the properties is the “key” property: a reference to the “ID” property.  </p>
-<div class="codehilite"><pre><span class="p">@</span><span class="n">Override</span>
-<span class="n">public</span> <span class="n">EntityType</span> <span class="n">getEntityType</span><span class="p">(</span><span class="n">FullQualifiedName</span> <span class="n">entityTypeName</span><span class="p">)</span> <span class="n">throws</span> <span class="n">ODataException</span> <span class="p">{</span>
+<div class="codehilite"><pre><span class="nd">@Override</span>
+<span class="kd">public</span> <span class="n">EntityType</span> <span class="nf">getEntityType</span><span class="o">(</span><span class="n">FullQualifiedName</span> <span class="n">entityTypeName</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">ODataException</span> <span class="o">{</span>
 
-    <span class="o">//</span> <span class="n">this</span> <span class="n">method</span> <span class="n">is</span> <span class="n">called</span> <span class="k">for</span> <span class="n">one</span> <span class="n">of</span> <span class="n">the</span> <span class="n">EntityTypes</span> <span class="n">that</span> <span class="n">are</span> <span class="n">configured</span> <span class="n">in</span> <span class="n">the</span> <span class="n">Schema</span>
-    <span class="k">if</span><span class="p">(</span><span class="n">entityTypeName</span><span class="p">.</span><span class="n">equals</span><span class="p">(</span><span class="n">ET_PRODUCT_FQN</span><span class="p">)){</span>
+    <span class="c1">// this method is called for one of the EntityTypes that are configured in the Schema</span>
+    <span class="k">if</span><span class="o">(</span><span class="n">entityTypeName</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">ET_PRODUCT_FQN</span><span class="o">)){</span>
 
-        <span class="o">//</span><span class="n">create</span> <span class="n">EntityType</span> <span class="k">properties</span>
-        <span class="n">Property</span> <span class="n">id</span> <span class="p">=</span> <span class="n">new</span> <span class="n">Property</span><span class="p">().</span><span class="n">setName</span><span class="p">(</span>&quot;<span class="n">ID</span>&quot;<span class="p">).</span><span class="n">setType</span><span class="p">(</span><span class="n">EdmPrimitiveTypeKind</span><span class="p">.</span><span class="n">Int32</span><span class="p">.</span><span class="n">getFullQualifiedName</span><span class="p">());</span>
-        <span class="n">Property</span> <span class="n">name</span> <span class="p">=</span> <span class="n">new</span> <span class="n">Property</span><span class="p">().</span><span class="n">setName</span><span class="p">(</span>&quot;<span class="n">Name</span>&quot;<span class="p">).</span><span class="n">setType</span><span class="p">(</span><span class="n">EdmPrimitiveTypeKind</span><span class="p">.</span><span class="n">String</span><span class="p">.</span><span class="n">getFullQualifiedName</span><span class="p">());</span>
-        <span class="n">Property</span>  <span class="n">description</span> <span class="p">=</span> <span class="n">new</span> <span class="n">Property</span><span class="p">().</span><span class="n">setName</span><span class="p">(</span>&quot;<span class="n">Description</span>&quot;<span class="p">).</span><span class="n">setType</span><span class="p">(</span><span class="n">EdmPrimitiveTypeKind</span><span class="p">.</span><span class="n">String</span><span class="p">.</span><span class="n">getFullQualifiedName</span><span class="p">());</span>
-
-        <span class="o">//</span> <span class="n">create</span> <span class="n">PropertyRef</span> <span class="k">for</span> <span class="n">Key</span> <span class="n">element</span>
-        <span class="n">PropertyRef</span> <span class="n">propertyRef</span> <span class="p">=</span> <span class="n">new</span> <span class="n">PropertyRef</span><span class="p">();</span>
-        <span class="n">propertyRef</span><span class="p">.</span><span class="n">setPropertyName</span><span class="p">(</span>&quot;<span class="n">ID</span>&quot;<span class="p">);</span>
-
-        <span class="o">//</span> <span class="n">configure</span> <span class="n">EntityType</span>
-        <span class="n">EntityType</span> <span class="n">entityType</span> <span class="p">=</span> <span class="n">new</span> <span class="n">EntityType</span><span class="p">();</span>
-        <span class="n">entityType</span><span class="p">.</span><span class="n">setName</span><span class="p">(</span><span class="n">ET_PRODUCT_NAME</span><span class="p">);</span>
-        <span class="n">entityType</span><span class="p">.</span><span class="n">setProperties</span><span class="p">(</span><span class="n">Arrays</span><span class="p">.</span><span class="n">asList</span><span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">name</span> <span class="p">,</span> <span class="n">description</span><span class="p">));</span>
-        <span class="n">entityType</span><span class="p">.</span><span class="n">setKey</span><span class="p">(</span><span class="n">Arrays</span><span class="p">.</span><span class="n">asList</span><span class="p">(</span><span class="n">propertyRef</span><span class="p">));</span>
+        <span class="c1">//create EntityType properties</span>
+        <span class="n">Property</span> <span class="n">id</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Property</span><span class="o">().</span><span class="na">setName</span><span class="o">(</span><span class="s">&quot;ID&quot;</span><span class="o">).</span><span class="na">setType</span><span class="o">(</span><span class="n">EdmPrimitiveTypeKind</span><span class="o">.</span><span class="na">Int32</span><span class="o">.</span><span class="na">getFullQualifiedName</span><span class="o">());</span>
+        <span class="n">Property</span> <span class="n">name</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Property</span><span class="o">().</span><span class="na">setName</span><span class="o">(</span><span class="s">&quot;Name&quot;</span><span class="o">).</span><span class="na">setType</span><span class="o">(</span><span class="n">EdmPrimitiveTypeKind</span><span class="o">.</span><span class="na">String</span><span class="o">.</span><span class="na">getFullQualifiedName</span><span class="o">());</span>
+        <span class="n">Property</span>  <span class="n">description</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Property</span><span class="o">().</span><span class="na">setName</span><span class="o">(</span><span class="s">&quot;Description&quot;</span><span class="o">).</span><span class="na">setType</span><span class="o">(</span><span class="n">EdmPrimitiveTypeKind</span><span class="o">.</span><span class="na">String</span><span class="o">.</span><span class="na">getFullQualifiedName</span><span class="o">());</span>
+
+        <span class="c1">// create PropertyRef for Key element</span>
+        <span class="n">PropertyRef</span> <span class="n">propertyRef</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PropertyRef</span><span class="o">();</span>
+        <span class="n">propertyRef</span><span class="o">.</span><span class="na">setPropertyName</span><span class="o">(</span><span class="s">&quot;ID&quot;</span><span class="o">);</span>
+
+        <span class="c1">// configure EntityType</span>
+        <span class="n">EntityType</span> <span class="n">entityType</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EntityType</span><span class="o">();</span>
+        <span class="n">entityType</span><span class="o">.</span><span class="na">setName</span><span class="o">(</span><span class="n">ET_PRODUCT_NAME</span><span class="o">);</span>
+        <span class="n">entityType</span><span class="o">.</span><span class="na">setProperties</span><span class="o">(</span><span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span><span class="n">id</span><span class="o">,</span> <span class="n">name</span> <span class="o">,</span> <span class="n">description</span><span class="o">));</span>
+        <span class="n">entityType</span><span class="o">.</span><span class="na">setKey</span><span class="o">(</span><span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span><span class="n">propertyRef</span><span class="o">));</span>
 
-        <span class="k">return</span> <span class="n">entityType</span><span class="p">;</span>
-    <span class="p">}</span>
+        <span class="k">return</span> <span class="n">entityType</span><span class="o">;</span>
+    <span class="o">}</span>
 
-    <span class="k">return</span> <span class="n">null</span><span class="p">;</span>
-<span class="p">}</span>
+    <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -398,47 +400,47 @@ Which of the properties is the “key
 <p>The procedure for declaring the <em>EntitySets</em> is similar.
 An <em>EntitySet</em> is a crucial resource, when an OData service is used to request data.
 In our example, we’ll invoke the following URL, which we expect to provide us a list of products:</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">DemoService</span><span class="o">/</span><span class="n">DemoServlet</span><span class="p">.</span><span class="n">svc</span><span class="o">/</span><span class="n">Products</span>
+<div class="codehilite"><pre>http://localhost:8080/DemoService/DemoServlet.svc/Products
 </pre></div>
 
 
 <p>When declaring an <em>EntitySet</em>, we need to define the type of entries which are contained in the list. Such type is an <em>EntityType</em>.
 In our example, we set our previously created <em>EntityType</em>, which is referred by a <em>FullQualifiedName</em>.</p>
-<div class="codehilite"><pre><span class="p">@</span><span class="n">Override</span>
-<span class="n">public</span> <span class="n">EntitySet</span> <span class="n">getEntitySet</span><span class="p">(</span><span class="n">FullQualifiedName</span> <span class="n">entityContainer</span><span class="p">,</span> <span class="n">String</span> <span class="n">entitySetName</span><span class="p">)</span> <span class="n">throws</span> <span class="n">ODataException</span> <span class="p">{</span>
+<div class="codehilite"><pre><span class="nd">@Override</span>
+<span class="kd">public</span> <span class="n">EntitySet</span> <span class="nf">getEntitySet</span><span class="o">(</span><span class="n">FullQualifiedName</span> <span class="n">entityContainer</span><span class="o">,</span> <span class="n">String</span> <span class="n">entitySetName</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">ODataException</span> <span class="o">{</span>
 
-    <span class="k">if</span><span class="p">(</span><span class="n">entityContainer</span><span class="p">.</span><span class="n">equals</span><span class="p">(</span><span class="n">CONTAINER</span><span class="p">)){</span>
-        <span class="k">if</span><span class="p">(</span><span class="n">entitySetName</span><span class="p">.</span><span class="n">equals</span><span class="p">(</span><span class="n">ES_PRODUCTS_NAME</span><span class="p">)){</span>
-            <span class="n">EntitySet</span> <span class="n">entitySet</span> <span class="p">=</span> <span class="n">new</span> <span class="n">EntitySet</span><span class="p">();</span>
-            <span class="n">entitySet</span><span class="p">.</span><span class="n">setName</span><span class="p">(</span><span class="n">ES_PRODUCTS_NAME</span><span class="p">);</span>
-            <span class="n">entitySet</span><span class="p">.</span><span class="n">setType</span><span class="p">(</span><span class="n">ET_PRODUCT_FQN</span><span class="p">);</span>
-
-            <span class="k">return</span> <span class="n">entitySet</span><span class="p">;</span>
-        <span class="p">}</span>
-    <span class="p">}</span>
+    <span class="k">if</span><span class="o">(</span><span class="n">entityContainer</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">CONTAINER</span><span class="o">)){</span>
+        <span class="k">if</span><span class="o">(</span><span class="n">entitySetName</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">ES_PRODUCTS_NAME</span><span class="o">)){</span>
+            <span class="n">EntitySet</span> <span class="n">entitySet</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EntitySet</span><span class="o">();</span>
+            <span class="n">entitySet</span><span class="o">.</span><span class="na">setName</span><span class="o">(</span><span class="n">ES_PRODUCTS_NAME</span><span class="o">);</span>
+            <span class="n">entitySet</span><span class="o">.</span><span class="na">setType</span><span class="o">(</span><span class="n">ET_PRODUCT_FQN</span><span class="o">);</span>
+
+            <span class="k">return</span> <span class="n">entitySet</span><span class="o">;</span>
+        <span class="o">}</span>
+    <span class="o">}</span>
 
-    <span class="k">return</span> <span class="n">null</span><span class="p">;</span>
-<span class="p">}</span>
+    <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
 <p><strong><em>getEntityContainer()</em></strong></p>
 <p>In order to provide data, our OData service needs an <em>EntityContainer</em> that carries the <em>EntitySets</em>.
 In our example, we have only one <em>EntitySet</em>, so we create one <em>EntityContainer</em> and set our <em>EntitySet</em>.</p>
-<div class="codehilite"><pre><span class="p">@</span><span class="n">Override</span>
-<span class="n">public</span> <span class="n">EntityContainer</span> <span class="n">getEntityContainer</span><span class="p">()</span> <span class="n">throws</span> <span class="n">ODataException</span> <span class="p">{</span>
+<div class="codehilite"><pre><span class="nd">@Override</span>
+<span class="kd">public</span> <span class="n">EntityContainer</span> <span class="nf">getEntityContainer</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">ODataException</span> <span class="o">{</span>
 
-    <span class="o">//</span> <span class="n">create</span> <span class="n">EntitySets</span>
-    <span class="n">List</span><span class="o">&lt;</span><span class="n">EntitySet</span><span class="o">&gt;</span> <span class="n">entitySets</span> <span class="p">=</span> <span class="n">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">EntitySet</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">entitySets</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">getEntitySet</span><span class="p">(</span><span class="n">CONTAINER</span><span class="p">,</span> <span class="n">ES_PRODUCTS_NAME</span><span class="p">));</span>
-
-    <span class="o">//</span> <span class="n">create</span> <span class="n">EntityContainer</span>
-    <span class="n">EntityContainer</span> <span class="n">entityContainer</span> <span class="p">=</span> <span class="n">new</span> <span class="n">EntityContainer</span><span class="p">();</span>
-    <span class="n">entityContainer</span><span class="p">.</span><span class="n">setName</span><span class="p">(</span><span class="n">CONTAINER_NAME</span><span class="p">);</span>
-    <span class="n">entityContainer</span><span class="p">.</span><span class="n">setEntitySets</span><span class="p">(</span><span class="n">entitySets</span><span class="p">);</span>
+    <span class="c1">// create EntitySets</span>
+    <span class="n">List</span><span class="o">&lt;</span><span class="n">EntitySet</span><span class="o">&gt;</span> <span class="n">entitySets</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">EntitySet</span><span class="o">&gt;();</span>
+    <span class="n">entitySets</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">getEntitySet</span><span class="o">(</span><span class="n">CONTAINER</span><span class="o">,</span> <span class="n">ES_PRODUCTS_NAME</span><span class="o">));</span>
+
+    <span class="c1">// create EntityContainer</span>
+    <span class="n">EntityContainer</span> <span class="n">entityContainer</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EntityContainer</span><span class="o">();</span>
+    <span class="n">entityContainer</span><span class="o">.</span><span class="na">setName</span><span class="o">(</span><span class="n">CONTAINER_NAME</span><span class="o">);</span>
+    <span class="n">entityContainer</span><span class="o">.</span><span class="na">setEntitySets</span><span class="o">(</span><span class="n">entitySets</span><span class="o">);</span>
 
-    <span class="k">return</span> <span class="n">entityContainer</span><span class="p">;</span>
-<span class="p">}</span>
+    <span class="k">return</span> <span class="n">entityContainer</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -449,43 +451,43 @@ While the model of an OData service can
 So, in our example, we create a list of schemas, where we add one new <em>Schema</em> object.<br />
 The schema is configured with a <em>Namespace</em>, which serves to uniquely identify all elements.<br />
 Then our elements are added to the Schema.</p>
-<div class="codehilite"><pre><span class="p">@</span><span class="n">Override</span>
-<span class="n">public</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">Schema</span><span class="o">&gt;</span> <span class="n">getSchemas</span><span class="p">()</span> <span class="n">throws</span> <span class="n">ODataException</span> <span class="p">{</span>
+<div class="codehilite"><pre><span class="nd">@Override</span>
+<span class="kd">public</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">Schema</span><span class="o">&gt;</span> <span class="n">getSchemas</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">ODataException</span> <span class="o">{</span>
 
-    <span class="o">//</span> <span class="n">create</span> <span class="n">Schema</span>
-    <span class="n">Schema</span> <span class="n">schema</span> <span class="p">=</span> <span class="n">new</span> <span class="n">Schema</span><span class="p">();</span>
-    <span class="n">schema</span><span class="p">.</span><span class="n">setNamespace</span><span class="p">(</span><span class="n">NAMESPACE</span><span class="p">);</span>
-
-    <span class="o">//</span> <span class="n">add</span> <span class="n">EntityTypes</span>
-    <span class="n">List</span><span class="o">&lt;</span><span class="n">EntityType</span><span class="o">&gt;</span> <span class="n">entityTypes</span> <span class="p">=</span> <span class="n">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">EntityType</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">entityTypes</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">getEntityType</span><span class="p">(</span><span class="n">ET_PRODUCT_FQN</span><span class="p">));</span>
-    <span class="n">schema</span><span class="p">.</span><span class="n">setEntityTypes</span><span class="p">(</span><span class="n">entityTypes</span><span class="p">);</span>
-
-    <span class="o">//</span> <span class="n">add</span> <span class="n">EntityContainer</span>
-    <span class="n">schema</span><span class="p">.</span><span class="n">setEntityContainer</span><span class="p">(</span><span class="n">getEntityContainer</span><span class="p">());</span>
-
-    <span class="o">//</span> <span class="n">finally</span>
-    <span class="n">List</span><span class="o">&lt;</span><span class="n">Schema</span><span class="o">&gt;</span> <span class="n">schemas</span> <span class="p">=</span> <span class="n">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Schema</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">schemas</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">schema</span><span class="p">);</span>
+    <span class="c1">// create Schema</span>
+    <span class="n">Schema</span> <span class="n">schema</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Schema</span><span class="o">();</span>
+    <span class="n">schema</span><span class="o">.</span><span class="na">setNamespace</span><span class="o">(</span><span class="n">NAMESPACE</span><span class="o">);</span>
+
+    <span class="c1">// add EntityTypes</span>
+    <span class="n">List</span><span class="o">&lt;</span><span class="n">EntityType</span><span class="o">&gt;</span> <span class="n">entityTypes</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">EntityType</span><span class="o">&gt;();</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_PRODUCT_FQN</span><span class="o">));</span>
+    <span class="n">schema</span><span class="o">.</span><span class="na">setEntityTypes</span><span class="o">(</span><span class="n">entityTypes</span><span class="o">);</span>
+
+    <span class="c1">// add EntityContainer</span>
+    <span class="n">schema</span><span class="o">.</span><span class="na">setEntityContainer</span><span class="o">(</span><span class="n">getEntityContainer</span><span class="o">());</span>
+
+    <span class="c1">// finally</span>
+    <span class="n">List</span><span class="o">&lt;</span><span class="n">Schema</span><span class="o">&gt;</span> <span class="n">schemas</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Schema</span><span class="o">&gt;();</span>
+    <span class="n">schemas</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">schema</span><span class="o">);</span>
 
-    <span class="k">return</span> <span class="n">schemas</span><span class="p">;</span>
-<span class="p">}</span>
+    <span class="k">return</span> <span class="n">schemas</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
 <p><strong><em>getEntityContainerInfo()</em></strong></p>
-<div class="codehilite"><pre><span class="p">@</span><span class="n">Override</span>
-<span class="n">public</span> <span class="n">EntityContainerInfo</span> <span class="n">getEntityContainerInfo</span><span class="p">(</span><span class="n">FullQualifiedName</span> <span class="n">entityContainerName</span><span class="p">)</span> <span class="n">throws</span> <span class="n">ODataException</span> <span class="p">{</span>
+<div class="codehilite"><pre><span class="nd">@Override</span>
+<span class="kd">public</span> <span class="n">EntityContainerInfo</span> <span class="nf">getEntityContainerInfo</span><span class="o">(</span><span class="n">FullQualifiedName</span> <span class="n">entityContainerName</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">ODataException</span> <span class="o">{</span>
 
-<span class="o">//</span> <span class="n">This</span> <span class="n">method</span> <span class="n">is</span> <span class="n">invoked</span> <span class="n">when</span> <span class="n">displaying</span> <span class="n">the</span> <span class="n">service</span> <span class="n">document</span> <span class="n">at</span> <span class="n">e</span><span class="p">.</span><span class="n">g</span><span class="p">.</span> <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">DemoService</span><span class="o">/</span><span class="n">DemoService</span><span class="p">.</span><span class="n">svc</span>
-    <span class="k">if</span><span class="p">(</span><span class="n">entityContainerName</span> <span class="o">==</span> <span class="n">null</span> <span class="o">||</span> <span class="n">entityContainerName</span><span class="p">.</span><span class="n">equals</span><span class="p">(</span><span class="n">CONTAINER</span><span class="p">)){</span>
-        <span class="n">EntityContainerInfo</span> <span class="n">entityContainerInfo</span> <span class="p">=</span> <span class="n">new</span> <span class="n">EntityContainerInfo</span><span class="p">();</span>
-        <span class="n">entityContainerInfo</span><span class="p">.</span><span class="n">setContainerName</span><span class="p">(</span><span class="n">CONTAINER</span><span class="p">);</span>
-        <span class="k">return</span> <span class="n">entityContainerInfo</span><span class="p">;</span>
-    <span class="p">}</span>
+<span class="c1">// This method is invoked when displaying the service document at e.g. http://localhost:8080/DemoService/DemoService.svc</span>
+    <span class="k">if</span><span class="o">(</span><span class="n">entityContainerName</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">||</span> <span class="n">entityContainerName</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">CONTAINER</span><span class="o">)){</span>
+        <span class="n">EntityContainerInfo</span> <span class="n">entityContainerInfo</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EntityContainerInfo</span><span class="o">();</span>
+        <span class="n">entityContainerInfo</span><span class="o">.</span><span class="na">setContainerName</span><span class="o">(</span><span class="n">CONTAINER</span><span class="o">);</span>
+        <span class="k">return</span> <span class="n">entityContainerInfo</span><span class="o">;</span>
+    <span class="o">}</span>
 
-    <span class="k">return</span> <span class="n">null</span><span class="p">;</span>
-<span class="p">}</span>
+    <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -494,10 +496,9 @@ We have created a class that declares th
 We have declared the main elements of an OData service: <em>EntityType</em>, <em>EntitySet</em>, <em>EntityContainer</em> and <em>Schema</em>.</p>
 <p>At runtime of an OData service, such metadata can be viewed by invoking the Metadata Document.</p>
 <p>In our example:</p>
-<div class="codehilite"><pre>http://localhost:8080/DemoService/DemoService.svc/<span class="p">$</span><span class="nv">metadata</span>
-
-
+<div class="codehilite"><pre>http://localhost:8080/DemoService/DemoService.svc/$metadata
 
+:::xml
 <span class="cp">&lt;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&gt;</span>
 <span class="nt">&lt;edmx:Edmx</span> <span class="na">Version=</span><span class="s">&quot;4.0&quot;</span> <span class="na">xmlns:edmx=</span><span class="s">&quot;http://docs.oasis-open.org/odata/ns/edmx&quot;</span><span class="nt">&gt;</span>
   <span class="nt">&lt;edmx:DataServices&gt;</span>
@@ -520,18 +521,18 @@ We have declared the main elements of an
 
 
 <p>The Service Document can be invoked to view the Entity Sets, like in our example at</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">DemoService</span><span class="o">/</span><span class="n">DemoService</span><span class="p">.</span><span class="n">svc</span><span class="o">/</span>
-
+<div class="codehilite"><pre>http://localhost:8080/DemoService/DemoService.svc/
 
 
-<span class="p">{</span>
-  &quot;<span class="p">@</span><span class="n">odata</span><span class="p">.</span><span class="n">context</span>&quot; <span class="p">:</span> &quot;<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">DemoService</span><span class="o">/</span><span class="n">DemoService</span><span class="p">.</span><span class="n">svc</span><span class="o">/</span>$<span class="n">metadata</span>&quot;<span class="p">,</span>
-  &quot;<span class="n">value</span>&quot; <span class="p">:</span> <span class="p">[</span>
-  <span class="p">{</span>
-    &quot;<span class="n">name</span>&quot; <span class="p">:</span> &quot;<span class="n">Products</span>&quot;<span class="p">,</span>
-    &quot;<span class="n">url</span>&quot; <span class="p">:</span> &quot;<span class="n">Products</span>&quot;
-  <span class="p">}</span> <span class="p">]</span>
-<span class="p">}</span>
+:::json
+{
+  &quot;@odata.context&quot; : &quot;http://localhost:8080/DemoService/DemoService.svc/$metadata&quot;,
+  &quot;value&quot; : [
+  {
+    &quot;name&quot; : &quot;Products&quot;,
+    &quot;url&quot; : &quot;Products&quot;
+  } ]
+}
 </pre></div>
 
 
@@ -586,14 +587,14 @@ For example, the property names have to
 The <em>Olingo</em> framework initializes the processor with an instance of the <em>OData</em> object.
 According to the Javadoc, this object is the “Root object for serving factory tasks…”
 We’ll need it later, so we store it as member variable.</p>
-<div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">(</span><span class="n">OData</span> <span class="n">odata</span><span class="p">,</span> <span class="n">ServiceMetadata</span> <span class="n">serviceMetadata</span><span class="p">)</span> <span class="p">{</span>
-    <span class="n">this</span><span class="p">.</span><span class="n">odata</span> <span class="p">=</span> <span class="n">odata</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">init</span><span class="o">(</span><span class="n">OData</span> <span class="n">odata</span><span class="o">,</span> <span class="n">ServiceMetadata</span> <span class="n">serviceMetadata</span><span class="o">)</span> <span class="o">{</span>
+    <span class="k">this</span><span class="o">.</span><span class="na">odata</span> <span class="o">=</span> <span class="n">odata</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
 <p>Don’t forget to declare the member variable</p>
-<div class="codehilite"><pre><span class="n">private</span> <span class="n">OData</span> <span class="n">odata</span><span class="p">;</span>
+<div class="codehilite"><pre><span class="kd">private</span> <span class="n">OData</span> <span class="n">odata</span><span class="o">;</span>
 </pre></div>
 
 
@@ -652,7 +653,8 @@ Because the <em>readEntityCollection</em
   The response object has been passed to us in the method signature. We use it to set the serialized data (the <em>InputStream</em> object).<br />
   Furthermore, we have to set the HTTP status code, which means that we have the opportunity to do proper error handling.<br />
   And finally we have to set the content type.</p>
-<p>public void readEntityCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat)
+<p>:::java
+public void readEntityCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat)
                      throws ODataApplicationException, SerializerException {</p>
 <div class="codehilite"><pre><span class="c1">// 1st retrieve the requested EntitySet from the uriInfo (representation of the parsed URI)</span>
 <span class="n">List</span><span class="o">&lt;</span><span class="n">UriResource</span><span class="o">&gt;</span> <span class="n">resourcePaths</span> <span class="o">=</span> <span class="n">uriInfo</span><span class="p">.</span><span class="n">getUriResourceParts</span><span class="p">();</span>
@@ -690,28 +692,28 @@ Because the <em>readEntityCollection</em
 In our tutorial, to keep the code as simple as possible, we use a little helper method that delivers some hardcoded entries.<br />
 Since we’re supposed to deliver the data inside an <em>EntitySet</em> instance, we create the instance, ask it for the (initially empty) list of entities and add some new entities to it.<br />
 We create the entities and their properties according to what we declared in our <em>ExampleEdmProvider</em> class. So we have to take care to provide the correct names to the new property objects.</p>
-<div class="codehilite"><pre><span class="n">private</span> <span class="n">EntitySet</span> <span class="n">getData</span><span class="p">(</span><span class="n">EdmEntitySet</span> <span class="n">edmEntitySet</span><span class="p">){</span>
+<div class="codehilite"><pre><span class="kd">private</span> <span class="n">EntitySet</span> <span class="nf">getData</span><span class="o">(</span><span class="n">EdmEntitySet</span> <span class="n">edmEntitySet</span><span class="o">){</span>
 
-    <span class="n">EntitySet</span> <span class="n">entitySet</span> <span class="p">=</span> <span class="n">new</span> <span class="n">EntitySetImpl</span><span class="p">();</span>
-    <span class="n">List</span><span class="o">&lt;</span><span class="n">Entity</span><span class="o">&gt;</span> <span class="n">entityList</span> <span class="p">=</span> <span class="n">entitySet</span><span class="p">.</span><span class="n">getEntities</span><span class="p">();</span>
+    <span class="n">EntitySet</span> <span class="n">entitySet</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EntitySetImpl</span><span class="o">();</span>
+    <span class="n">List</span><span class="o">&lt;</span><span class="n">Entity</span><span class="o">&gt;</span> <span class="n">entityList</span> <span class="o">=</span> <span class="n">entitySet</span><span class="o">.</span><span class="na">getEntities</span><span class="o">();</span>
 
-    <span class="o">//</span> <span class="n">add</span> <span class="n">some</span> <span class="n">sample</span> <span class="n">product</span> <span class="n">entities</span>
-    <span class="n">entityList</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">new</span> <span class="n">EntityImpl</span><span class="p">()</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">ID</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> 1<span class="p">))</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">Name</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> &quot;<span class="n">Notebook</span> <span class="n">Basic</span> 15&quot;<span class="p">))</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">Description</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> &quot;<span class="n">Notebook</span> <span class="n">Basic</span><span class="p">,</span> 1<span class="p">.</span>7<span class="n">GHz</span> <span class="o">-</span> 15 <span class="n">XGA</span> <span class="o">-</span> 1024<span class="n">MB</span> <span class="n">DDR2</span> <span class="n">SDRAM</span> <span class="o">-</span> 40<span class="n">GB</span>&quot;<span class="p">)));</span>
-    <span class="n">entityList</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">new</span> <span class="n">EntityImpl</span><span class="p">()</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">ID</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> 2<span class="p">))</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">Name</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> &quot;1<span class="n">UMTS</span> <span class="n">PDA</span>&quot;<span class="p">))</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">Description</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> &quot;<span class="n">Ultrafast</span> 3<span class="n">G</span> <span class="n">UMTS</span><span class="o">/</span><span class="n">HSDPA</span> <span class="n">Pocket</span> <span class="n">PC</span><span class="p">,</span> <span class="n">supports</span> <span class="n">GSM</span> <span class="n">network</span>&quot;<span class="p">)));</span>
-
-    <span class="n">entityList</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">new</span> <span class="n">EntityImpl</span><span class="p">()</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">ID</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> 3<span class="p">))</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">Name</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> &quot;<span class="n">Ergo</span> <span class="n">Screen</span>&quot;<span class="p">))</span>
-        <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">new</span> <span class="n">PropertyImpl</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> &quot;<span class="n">Description</span>&quot;<span class="p">,</span> <span class="n">ValueType</span><span class="p">.</span><span class="n">PRIMITIVE</span><span class="p">,</span> &quot;17 <span class="n">Optimum</span> <span class="n">Resolution</span> 1024 <span class="n">x</span> 768 <span class="p">@</span> 85<span class="n">Hz</span><span class="p">,</span> <span class="n">resolution</span> 1280 <span class="n">x</span> 960&quot;<span class="p">)));</span>
+    <span class="c1">// add some sample product entities</span>
+    <span class="n">entityList</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">EntityImpl</span><span class="o">()</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;ID&quot;</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="mi">1</span><span class="o">))</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;Name&quot;</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">&quot;Notebook Basic 15&quot;</span><span class="o">))</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;Description&quot;</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">&quot;Notebook Basic, 1.7GHz - 15 XGA - 1024MB DDR2 SDRAM - 40GB&quot;</span><span class="o">)));</span>
+    <span class="n">entityList</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">EntityImpl</span><span class="o">()</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;ID&quot;</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="mi">2</span><span class="o">))</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;Name&quot;</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">&quot;1UMTS PDA&quot;</span><span class="o">))</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;Description&quot;</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">&quot;Ultrafast 3G UMTS/HSDPA Pocket PC, supports GSM network&quot;</span><span class="o">)));</span>
+
+    <span class="n">entityList</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">EntityImpl</span><span class="o">()</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;ID&quot;</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="mi">3</span><span class="o">))</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;Name&quot;</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">&quot;Ergo Screen&quot;</span><span class="o">))</span>
+        <span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="k">new</span> <span class="n">PropertyImpl</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="s">&quot;Description&quot;</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">&quot;17 Optimum Resolution 1024 x 768 @ 85Hz, resolution 1280 x 960&quot;</span><span class="o">)));</span>
 
-    <span class="k">return</span> <span class="n">entitySet</span><span class="p">;</span>
-<span class="p">}</span>
+    <span class="k">return</span> <span class="n">entitySet</span><span class="o">;</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -735,30 +737,30 @@ Furthermore, the <em>ODataHttpHandler</e
 <div class="codehilite"><pre><span class="c1">// This class represents a standard HttpServlet implementation.</span>
 <span class="c1">// It is used as main entry point for the web application that carries the OData service.</span>
 <span class="c1">// The implementation of this HttpServlet simply delegates the user requests to the ODataHttpHandler</span>
-<span class="n">public</span> <span class="k">class</span> <span class="n">DemoServlet</span> <span class="k">extends</span> <span class="n">HttpServlet</span> <span class="p">{</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">DemoServlet</span> <span class="kd">extends</span> <span class="n">HttpServlet</span> <span class="o">{</span>
 
-    <span class="n">private</span> <span class="k">static</span> <span class="k">final</span> <span class="n">long</span> <span class="n">serialVersionUID</span> <span class="o">=</span> <span class="mh">1</span><span class="no">L</span><span class="p">;</span>
-    <span class="n">private</span> <span class="k">static</span> <span class="k">final</span> <span class="n">Logger</span> <span class="no">LOG</span> <span class="o">=</span> <span class="n">LoggerFactory</span><span class="p">.</span><span class="n">getLogger</span><span class="p">(</span><span class="n">DemoServlet</span><span class="p">.</span><span class="k">class</span><span class="p">);</span>
+    <span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="kt">long</span> <span class="n">serialVersionUID</span> <span class="o">=</span> <span class="mi">1L</span><span class="o">;</span>
+    <span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">Logger</span> <span class="n">LOG</span> <span class="o">=</span> <span class="n">LoggerFactory</span><span class="o">.</span><span class="na">getLogger</span><span class="o">(</span><span class="n">DemoServlet</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
 
-    <span class="p">@</span><span class="n">Override</span>
-    <span class="k">protected</span> <span class="k">void</span> <span class="n">service</span><span class="p">(</span><span class="k">final</span> <span class="n">HttpServletRequest</span> <span class="n">req</span><span class="p">,</span> <span class="k">final</span> <span class="n">HttpServletResponse</span> <span class="n">resp</span><span class="p">)</span> <span class="n">throws</span> <span class="n">ServletException</span><span class="p">,</span> <span class="n">IOException</span> <span class="p">{</span>
+    <span class="nd">@Override</span>
+    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">service</span><span class="o">(</span><span class="kd">final</span> <span class="n">HttpServletRequest</span> <span class="n">req</span><span class="o">,</span> <span class="kd">final</span> <span class="n">HttpServletResponse</span> <span class="n">resp</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">ServletException</span><span class="o">,</span> <span class="n">IOException</span> <span class="o">{</span>
 
-        <span class="n">try</span> <span class="p">{</span>
+        <span class="k">try</span> <span class="o">{</span>
             <span class="c1">// create odata handler and configure it with EdmProvider and Processor</span>
-            <span class="n">OData</span> <span class="n">odata</span> <span class="o">=</span> <span class="n">OData</span><span class="p">.</span><span class="n">newInstance</span><span class="p">();</span>
-            <span class="n">ServiceMetadata</span> <span class="n">edm</span> <span class="o">=</span> <span class="n">odata</span><span class="p">.</span><span class="n">createServiceMetadata</span><span class="p">(</span><span class="k">new</span> <span class="n">ExampleEdmProvider</span><span class="p">(),</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">EdmxReference</span><span class="o">&gt;</span><span class="p">());</span>
-            <span class="n">ODataHttpHandler</span> <span class="n">handler</span> <span class="o">=</span> <span class="n">odata</span><span class="p">.</span><span class="n">createHandler</span><span class="p">(</span><span class="n">edm</span><span class="p">);</span>
-            <span class="n">handler</span><span class="p">.</span><span class="n">register</span><span class="p">(</span><span class="k">new</span> <span class="n">DemoEntityCollectionProcessor</span><span class="p">());</span>
+            <span class="n">OData</span> <span class="n">odata</span> <span class="o">=</span> <span class="n">OData</span><span class="o">.</span><span class="na">newInstance</span><span class="o">();</span>
+            <span class="n">ServiceMetadata</span> <span class="n">edm</span> <span class="o">=</span> <span class="n">odata</span><span class="o">.</span><span class="na">createServiceMetadata</span><span class="o">(</span><span class="k">new</span> <span class="n">ExampleEdmProvider</span><span class="o">(),</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">EdmxReference</span><span class="o">&gt;());</span>
+            <span class="n">ODataHttpHandler</span> <span class="n">handler</span> <span class="o">=</span> <span class="n">odata</span><span class="o">.</span><span class="na">createHandler</span><span class="o">(</span><span class="n">edm</span><span class="o">);</span>
+            <span class="n">handler</span><span class="o">.</span><span class="na">register</span><span class="o">(</span><span class="k">new</span> <span class="n">DemoEntityCollectionProcessor</span><span class="o">());</span>
 
             <span class="c1">// let the handler do the work</span>
-            <span class="n">handler</span><span class="p">.</span><span class="n">process</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">resp</span><span class="p">);</span>
+            <span class="n">handler</span><span class="o">.</span><span class="na">process</span><span class="o">(</span><span class="n">req</span><span class="o">,</span> <span class="n">resp</span><span class="o">);</span>
 
-        <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">RuntimeException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-            <span class="no">LOG</span><span class="p">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;Server Error ocurred in DemoServlet&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">);</span>
-            <span class="n">throw</span> <span class="k">new</span> <span class="n">ServletException</span><span class="p">(</span><span class="n">e</span><span class="p">);</span>
-        <span class="p">}</span>
-    <span class="p">}</span>
-<span class="p">}</span>
+        <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">RuntimeException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">LOG</span><span class="o">.</span><span class="na">error</span><span class="o">(</span><span class="s">&quot;Server Error ocurred in DemoServlet&quot;</span><span class="o">,</span> <span class="n">e</span><span class="o">);</span>
+            <span class="k">throw</span> <span class="k">new</span> <span class="nf">ServletException</span><span class="o">(</span><span class="n">e</span><span class="o">);</span>
+        <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -811,24 +813,24 @@ If you face problems related to the serv
 <h3 id="the-service-urls">The service-URLs</h3>
 <p>Try the following URLs:</p>
 <p><strong>Service Document</strong></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">DemoService</span><span class="o">/</span><span class="n">DemoService</span><span class="p">.</span><span class="n">svc</span><span class="o">/</span>
+<div class="codehilite"><pre>http://localhost:8080/DemoService/DemoService.svc/
 </pre></div>
 
 
 <p>The expected result is the service document which displays our <em>EntityContainerInfo</em>:</p>
 <div class="codehilite"><pre><span class="p">{</span>
-  &quot;<span class="p">@</span><span class="n">odata</span><span class="p">.</span><span class="n">context</span>&quot; <span class="p">:</span> &quot;<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">DemoService</span><span class="o">/</span><span class="n">DemoService</span><span class="p">.</span><span class="n">svc</span><span class="o">/</span>$<span class="n">metadata</span>&quot;<span class="p">,</span>
-  &quot;<span class="n">value</span>&quot; <span class="p">:</span> <span class="p">[</span>
+  <span class="nt">&quot;@odata.context&quot;</span> <span class="p">:</span> <span class="s2">&quot;http://localhost:8080/DemoService/DemoService.svc/$metadata&quot;</span><span class="p">,</span>
+  <span class="nt">&quot;value&quot;</span> <span class="p">:</span> <span class="p">[</span>
   <span class="p">{</span>
-    &quot;<span class="n">name</span>&quot; <span class="p">:</span> &quot;<span class="n">Products</span>&quot;<span class="p">,</span>
-    &quot;<span class="n">url</span>&quot; <span class="p">:</span> &quot;<span class="n">Products</span>&quot;
+    <span class="nt">&quot;name&quot;</span> <span class="p">:</span> <span class="s2">&quot;Products&quot;</span><span class="p">,</span>
+    <span class="nt">&quot;url&quot;</span> <span class="p">:</span> <span class="s2">&quot;Products&quot;</span>
   <span class="p">}</span> <span class="p">]</span>
 <span class="p">}</span>
 </pre></div>
 
 
 <p><strong>Metadata Document</strong></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">ExampleService1</span><span class="o">/</span><span class="n">ExampleService1</span><span class="p">.</span><span class="n">svc</span><span class="o">/</span>$<span class="n">metadata</span>
+<div class="codehilite"><pre>http://localhost:8080/ExampleService1/ExampleService1.svc/$metadata
 </pre></div>
 
 
@@ -861,22 +863,22 @@ If you face problems related to the serv
 
 <p>The expected result is the hardcoded list of product entries, which we have coded in our processor implementation:</p>
 <div class="codehilite"><pre><span class="p">{</span>
-  &quot;<span class="p">@</span><span class="n">odata</span><span class="p">.</span><span class="n">context</span>&quot;<span class="p">:</span>&quot;$<span class="n">metadata</span>#<span class="n">Products</span>&quot;<span class="p">,</span>&quot;
-  <span class="n">value</span>&quot;<span class="p">:[</span>
+  <span class="nt">&quot;@odata.context&quot;</span><span class="p">:</span><span class="s2">&quot;$metadata#Products&quot;</span><span class="p">,</span><span class="nt">&quot;</span>
+<span class="nt">  value&quot;</span><span class="p">:[</span>
     <span class="p">{</span>
-      &quot;<span class="n">ID</span>&quot;<span class="p">:</span>1<span class="p">,</span>
-      &quot;<span class="n">Name</span>&quot;<span class="p">:</span>&quot;<span class="n">Notebook</span> <span class="n">Basic</span> 15&quot;<span class="p">,</span>
-      &quot;<span class="n">Description</span>&quot;<span class="p">:</span>&quot;<span class="n">Notebook</span> <span class="n">Basic</span><span class="p">,</span> 1<span class="p">.</span>7<span class="n">GHz</span> <span class="o">-</span> 15 <span class="n">XGA</span> <span class="o">-</span> 1024<span class="n">MB</span> <span class="n">DDR2</span> <span class="n">SDRAM</span> <span class="o">-</span> 40<span class="n">GB</span>&quot;
+      <span class="nt">&quot;ID&quot;</span><span class="p">:</span><span class="mi">1</span><span class="p">,</span>
+      <span class="nt">&quot;Name&quot;</span><span class="p">:</span><span class="s2">&quot;Notebook Basic 15&quot;</span><span class="p">,</span>
+      <span class="nt">&quot;Description&quot;</span><span class="p">:</span><span class="s2">&quot;Notebook Basic, 1.7GHz - 15 XGA - 1024MB DDR2 SDRAM - 40GB&quot;</span>
     <span class="p">},</span>
     <span class="p">{</span>
-      &quot;<span class="n">ID</span>&quot;<span class="p">:</span>2<span class="p">,</span>
-      &quot;<span class="n">Name</span>&quot;<span class="p">:</span>&quot;1<span class="n">UMTS</span> <span class="n">PDA</span>&quot;<span class="p">,</span>
-      &quot;<span class="n">Description</span>&quot;<span class="p">:</span>&quot;<span class="n">Ultrafast</span> 3<span class="n">G</span> <span class="n">UMTS</span><span class="o">/</span><span class="n">HSDPA</span> <span class="n">Pocket</span> <span class="n">PC</span><span class="p">,</span> <span class="n">supports</span> <span class="n">GSM</span> <span class="n">network</span>&quot;
+      <span class="nt">&quot;ID&quot;</span><span class="p">:</span><span class="mi">2</span><span class="p">,</span>
+      <span class="nt">&quot;Name&quot;</span><span class="p">:</span><span class="s2">&quot;1UMTS PDA&quot;</span><span class="p">,</span>
+      <span class="nt">&quot;Description&quot;</span><span class="p">:</span><span class="s2">&quot;Ultrafast 3G UMTS/HSDPA Pocket PC, supports GSM network&quot;</span>
     <span class="p">},</span>
     <span class="p">{</span>
-      &quot;<span class="n">ID</span>&quot;<span class="p">:</span>3<span class="p">,</span>
-      &quot;<span class="n">Name</span>&quot;<span class="p">:</span>&quot;<span class="n">Ergo</span> <span class="n">Screen</span>&quot;<span class="p">,</span>
-      &quot;<span class="n">Description</span>&quot;<span class="p">:</span>&quot;17 <span class="n">Optimum</span> <span class="n">Resolution</span> 1024 <span class="n">x</span> 768 <span class="p">@</span> 85<span class="n">Hz</span><span class="p">,</span> <span class="n">resolution</span> 1280 <span class="n">x</span> 960&quot;
+      <span class="nt">&quot;ID&quot;</span><span class="p">:</span><span class="mi">3</span><span class="p">,</span>
+      <span class="nt">&quot;Name&quot;</span><span class="p">:</span><span class="s2">&quot;Ergo Screen&quot;</span><span class="p">,</span>
+      <span class="nt">&quot;Description&quot;</span><span class="p">:</span><span class="s2">&quot;17 Optimum Resolution 1024 x 768 @ 85Hz, resolution 1280 x 960&quot;</span>
   <span class="p">}]</span>
 <span class="p">}</span>
 </pre></div>



Mime
View raw message