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/12/03 12:51:47 UTC

svn commit: r888906 - in /websites/staging/olingo/trunk/content: ./ doc/tutorials/Olingo_Tutorial_BasicRead_EDM.html

Author: buildbot
Date: Tue Dec  3 11:51:47 2013
New Revision: 888906

Log:
Staging update by buildbot for olingo

Added:
    websites/staging/olingo/trunk/content/doc/tutorials/Olingo_Tutorial_BasicRead_EDM.html
Modified:
    websites/staging/olingo/trunk/content/   (props changed)

Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Dec  3 11:51:47 2013
@@ -1 +1 @@
-1546325
+1547350

Added: websites/staging/olingo/trunk/content/doc/tutorials/Olingo_Tutorial_BasicRead_EDM.html
==============================================================================
--- websites/staging/olingo/trunk/content/doc/tutorials/Olingo_Tutorial_BasicRead_EDM.html (added)
+++ websites/staging/olingo/trunk/content/doc/tutorials/Olingo_Tutorial_BasicRead_EDM.html Tue Dec  3 11:51:47 2013
@@ -0,0 +1,127 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
+    <head>
+        <meta charset="utf-8">
+            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+                <title></title>
+                <meta name="description" content="Apache Olingo (incubating) provides libraries which enable developers to implement OData producers and OData consumers. The available OData Java library implements OData version 2.0. In future on goal is to provide an OData 4.0 compliant library once the OData standard is published at OASIS. The focus within the community is currently on the Java technology but it is up to the community to discuss if other environments find interest.">
+                    <meta name="viewport" content="width=device-width">
+                        
+		<link rel="stylesheet" href="/css/bootstrap.min.css">
+                            <style>
+                                body {
+                                    padding-top: 60px;
+                                    padding-bottom: 40px;
+                                }
+                                </style>
+		<link rel="stylesheet" href="/css/bootstrap-responsive.min.css">
+		<link rel="stylesheet" href="/css/main.css">
+                                    
+		<script src="j/s/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
+                                    </head>
+    <body>
+        <!--[if lt IE 7]>
+         <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
+         <![endif]-->
+        
+        <!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->
+        <div class="navbar navbar-inverse  navbar-fixed-top">
+            <div class="navbar-inner">
+                <div class="container">
+                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                        <span class="icon-bar"></span>
+                        <span class="icon-bar"></span>
+                        <span class="icon-bar"></span>
+                    </a>
+                    <a class="brand" href="#">Apache Olingo™</a>
+                    <div class="nav-collapse collapse">
+                        <ul class="nav">
+                            <li class="dropdown">
+                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a>
+                                <ul class="dropdown-menu">
+                                    <li><a href="http://www.apache.org/foundation/">ASF Home</a></li>
+                                    <li><a href="http://projects.apache.org/">Projects</a></li>
+                                    <li><a href="http://people.apache.org/">People</a></li>
+                                    <li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved</a></li>
+                                    <li><a href="http://www.apache.org/dyn/closer.cgi">Download</a></li>
+									<li><a href="http://www.apache.org/security/">Security</a></li>
+                                    <li><a href="http://www.apache.org/foundation/sponsorship.html">Support Apache</a></li>
+                                </ul>
+                            </li>
+                            <li><a href="/">Home</a></li>
+                            <li><a href="/download.html">Download</a></li>
+                            <li><a href="/documentation.html">Documentation</a></li>
+                            <li><a href="/support.html">Support</a></li>
+                        </ul>
+                        <form class="navbar-form pull-right" name="search" id="search" action="http://www.google.com/search" method="get">
+                            <input value="olingo.incubator.apache.org" name="sitesearch" type="hidden"/>
+                            <input class="span2" type="text" name="q" id="query">
+                                <input class="btn"type="submit" id="submit" value="Search">
+                                    </form>
+                    </div><!--/.nav-collapse -->
+                </div>
+            </div>
+        </div>
+        
+        <div class="container">
+            
+            
+            
+            <h1 id="how-to-use-edmx-source-as-edm-provider-within-an-odata-service">How to use EDMX source as EDM Provider within an OData Service</h1>
+<h2 id="how-to-guide-for-the-using-an-edm-parser">How To Guide for the using an EDM Parser</h2>
+<p>The EDM Parser is designed to parse the metadata document.
+To make the parser accessible from the API, we have to implement the method readMetadata from interface com.sap.core.odata.api.ep.EntityProviderInterface:</p>
+<div class="codehilite"><pre> <span class="p">@</span><span class="n">Override</span>
+ <span class="n">public</span> <span class="n">Edm</span> <span class="n">readMetadata</span><span class="p">(</span><span class="n">final</span> <span class="n">InputStream</span> <span class="n">inputStream</span><span class="p">,</span> <span class="n">final</span> <span class="n">boolean</span> <span class="n">validate</span><span class="p">)</span> <span class="n">throws</span> <span class="n">EntityProviderException</span> <span class="p">{</span>
+   <span class="n">EdmProvider</span> <span class="n">provider</span> <span class="p">=</span> <span class="n">new</span> <span class="n">EdmxProvider</span><span class="p">().</span><span class="n">parse</span><span class="p">(</span><span class="n">inputStream</span><span class="p">,</span> <span class="n">validate</span><span class="p">);</span>
+   <span class="k">return</span> <span class="n">new</span> <span class="n">EdmImplProv</span><span class="p">(</span><span class="n">provider</span><span class="p">);</span>
+  <span class="p">}</span>
+</pre></div>
+
+
+<p>The signature contains the InputStream that represents a data stream read from a file and flag validate. If validate is set to true, the structure of the metadata will be checked according to the CSDL after parsing. For example: it will be validated that each EntityType defines a key element or derives from a BaseType that for its part defines a key.</p>
+<p>To start the parsing we have to follow the next steps:</p>
+<ul>
+<li>create an object of the class EdmxProvider. This class derives from EdmProvider and provides implementations for all of its abstract methods </li>
+<li>invoke the method parse(InputStream, boolean) of this object </li>
+</ul>
+<p>Returned is an EDM object that contains the complete information from parsed metadata.</p>
+            
+            
+            
+            
+            <hr>
+            
+            <footer>
+                <h5>Disclaimer</h5>
+                
+                <p>Apache Olingo™ is an effort undergoing incubation at The Apache Software Foundation (ASF) sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</p>
+                
+                <p>&copy; Copyright 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
+				<hr>
+				<div align="center"><small><a href="/doc/privacy.html">Privacy</a></small></div>
+            </footer>
+            
+        </div> <!-- /container -->
+        
+        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
+        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
+        
+        <script src="js/vendor/bootstrap.min.js"></script>
+        
+        <script src="js/main.js"></script>
+        
+<script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-44963757-1', 'apache.org');
+  ga('send', 'pageview');
+
+</script>    </body>
+</html>