You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by bu...@apache.org on 2013/10/02 10:24:13 UTC
svn commit: r880829 - in /websites/staging/olingo/trunk/content: ./
doc/tutorials/read_media-resource.html
Author: buildbot
Date: Wed Oct 2 08:24:13 2013
New Revision: 880829
Log:
Staging update by buildbot for olingo
Modified:
websites/staging/olingo/trunk/content/ (props changed)
websites/staging/olingo/trunk/content/doc/tutorials/read_media-resource.html
Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Oct 2 08:24:13 2013
@@ -1 +1 @@
-1528347
+1528352
Modified: websites/staging/olingo/trunk/content/doc/tutorials/read_media-resource.html
==============================================================================
--- websites/staging/olingo/trunk/content/doc/tutorials/read_media-resource.html (original)
+++ websites/staging/olingo/trunk/content/doc/tutorials/read_media-resource.html Wed Oct 2 08:24:13 2013
@@ -72,13 +72,13 @@
<h1 id="media-resources">Media Resources</h1>
<hr />
-<h2 id="how-to-guide-extend-read-scenario-with-support-for-media-resources">How To Guide - Extend read scenario with support for media resources</h2>
+<h3 id="how-to-guide-extend-read-scenario-with-support-for-media-resources">How To Guide - Extend read scenario with support for media resources</h3>
<p>This How To Guide shows how to extend the read scenario (with <code>$expand</code> extension) with support for Media Link Entries and Media Resources.</p>
<p>The tutorial introduces a new resource (Driver), shows how to extend the according <code>readEntitySet(...)</code> and <code>readEntity(...)</code> and introduces the new method <code>readEntityMedia(uriInfo:GetMediaResourceUriInfo, contentType:String):ODataResponse</code> within the <code>MyODataSingleProcessor</code>.</p>
-<h2 id="prerequisites">Prerequisites</h2>
+<h3 id="prerequisites">Prerequisites</h3>
<p>Setup of <a href="read_expand">Read Scenario with <code>$expand</code></a> extension
(which has as prerequisite Setup of <a href="basicread">Basic Read Scenario</a>)</p>
-<h2 id="shortcut">Shortcut</h2>
+<h3 id="shortcut">Shortcut</h3>
<p>If you like to directly experiment with the results of the extented basic read scenario, you can use this shortcut: </p>
<ul>
<li>Download and unzip the <a href="apache-olingo-tutorial-adv_read_mediaresource">Olingo Tutorial 'Basic Read with Media Resource extension' Project</a> to your local drive which is your OData Tutorial project folder (referenced as <code>$ODATA_PROJECT_HOME</code> in the turorial).</li>
@@ -93,11 +93,11 @@
</ul>
</li>
</ul>
-<h2 id="hints">Hints</h2>
+<h3 id="hints">Hints</h3>
<ul>
<li>Sometimes a code extension needs one or more new/additional imports. These are not shown in the examples because it would blow up the source code examples and normally the IDE should support an auto fix of missing imports during typing of the code or after an insert of copied code. </li>
</ul>
-<h2 id="extend-read-scenario">Extend Read Scenario</h2>
+<h3 id="extend-read-scenario">Extend Read Scenario</h3>
<p>The steps to extend the read scenario (already with <code>$expand</code> support) with support for a Driver which is a media link entry with an associated media resource and therefore contains an image as media is to override and implement the <code>readEntityMedia(uriInfo:GetMediaResourceUriInfo, contentType:String):ODataResponse</code> method within the <code>MyODataSingleProcessor</code>.</p>
<p>All $value requests - where $value is the next segment to an entity type instance identified by an EntitySet with key predicate or a navigation property (to one relation or key predicate for to many relation) - to the service are delegated to this method which then handles the creation of the according response. </p>
<h3 id="extend-myedmprovider-and-myodatasingleprocessor">Extend MyEdmProvider and MyODataSingleProcessor</h3>
@@ -120,7 +120,7 @@ If nothing is copied/created the sample
The Driver gets a Key (Id) and some properties (Name, Surname, Nickname, Updates. For simplification currently we do not add any associations to another entities.</p>
<p>To mark the Driver as a media link entry with an associated media resource extension it is mandatory to set the stream property to true via the <code>setHasStream(true)</code> method when creating the <code>EntityType</code>.</p>
<p>As conclusion the <code>getEntityType(â¦)</code> method is extended as follows:</p>
-<h4 id="sample-code">Sample Code</h4>
+<h5 id="sample-code">Sample Code</h5>
<div class="codehilite"><pre><span class="err">â¦</span>
<span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">ENTITY_TYPE_1_3</span><span class="o">.</span><span class="na">getName</span><span class="o">().</span><span class="na">equals</span><span class="o">(</span><span class="n">edmFQName</span><span class="o">.</span><span class="na">getName</span><span class="o">()))</span> <span class="o">{</span>
<span class="n">List</span><span class="o"><</span><span class="n">Property</span><span class="o">></span> <span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o"><</span><span class="n">Property</span><span class="o">>();</span>