You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2013/09/30 16:28:47 UTC
svn commit: r1527591 -
/incubator/olingo/site/trunk/content/doc/tutorials/basicread.mdtext
Author: sklevenz
Date: Mon Sep 30 14:28:47 2013
New Revision: 1527591
URL: http://svn.apache.org/r1527591
Log:
CMS commit to olingo by sklevenz
Modified:
incubator/olingo/site/trunk/content/doc/tutorials/basicread.mdtext
Modified: incubator/olingo/site/trunk/content/doc/tutorials/basicread.mdtext
URL: http://svn.apache.org/viewvc/incubator/olingo/site/trunk/content/doc/tutorials/basicread.mdtext?rev=1527591&r1=1527590&r2=1527591&view=diff
==============================================================================
--- incubator/olingo/site/trunk/content/doc/tutorials/basicread.mdtext (original)
+++ incubator/olingo/site/trunk/content/doc/tutorials/basicread.mdtext Mon Sep 30 14:28:47 2013
@@ -39,6 +39,7 @@ As a shortcut you can download the [Olin
###### Sample Code
+ :::xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
@@ -78,6 +79,7 @@ As a shortcut you can download the [Olin
+ :::java
package org.apache.olingo.odata2.sample.service;
import org.apache.olingo.odata2.api.ODataService;
@@ -116,7 +118,8 @@ In this paragraph you will implement the
- As we have a static model we define constants for all top level elements of the schema (declared in the `MyEdmProvider` class).
###### Sample Code
-
+
+ :::java
static final String ENTITY_SET_NAME_MANUFACTURERS = "Manufacturers";
static final String ENTITY_SET_NAME_CARS = "Cars";
static final String ENTITY_NAME_MANUFACTURER = "Manufacturer";
@@ -144,6 +147,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
public List<Schema> getSchemas() throws ODataException {
List<Schema> schemas = new ArrayList<Schema>();
@@ -191,6 +195,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
@Override
public EntityType getEntityType(FullQualifiedName edmFQName) throws ODataException {
if (NAMESPACE.equals(edmFQName.getNamespace())) {
@@ -264,6 +269,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
public ComplexType getComplexType(FullQualifiedName edmFQName) throws ODataException {
if (NAMESPACE.equals(edmFQName.getNamespace())) {
if (COMPLEX_TYPE.getName().equals(edmFQName.getName())) {
@@ -289,6 +295,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
public Association getAssociation(FullQualifiedName edmFQName) throws ODataException {
if (NAMESPACE.equals(edmFQName.getNamespace())) {
if (ASSOCIATION_CAR_MANUFACTURER.getName().equals(edmFQName.getName())) {
@@ -305,6 +312,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
public EntityContainerInfo getEntityContainerInfo(String name) throws ODataException {
if (name == null || "ODataCarsEntityContainer".equals(name)) {
return new EntityContainerInfo().setName("ODataCarsEntityContainer").setDefaultEntityContainer(true);
@@ -318,7 +326,7 @@ In this paragraph you will implement the
###### Sample Code
-
+ :::java
public EntitySet getEntitySet(String entityContainer, String name) throws ODataException {
if (ENTITY_CONTAINER.equals(entityContainer)) {
if (ENTITY_SET_NAME_CARS.equals(name)) {
@@ -336,6 +344,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
public AssociationSet getAssociationSet(String entityContainer, FullQualifiedName association, String sourceEntitySetName, String sourceEntitySetRole) throws ODataException {
if (ENTITY_CONTAINER.equals(entityContainer)) {
if (ASSOCIATION_CAR_MANUFACTURER.equals(association)) {
@@ -354,6 +363,7 @@ In this paragraph you will implement the
###### Sample Code
+ :::java
public FunctionImport getFunctionImport(String entityContainer, String name) throws ODataException {
if (ENTITY_CONTAINER.equals(entityContainer)) {
if (FUNCTION_IMPORT.equals(name)) {
@@ -379,6 +389,7 @@ You already created the `MyODataSinglePr
###### Sample Code
+ :::java
package org.apache.olingo.odata2.sample.service;
import static org.apache.olingo.odata2.sample.service.MyEdmProvider.ENTITY_SET_NAME_CARS;
@@ -396,6 +407,7 @@ You already created the `MyODataSinglePr
###### Sample Code
+ :::java
package org.apache.olingo.odata2.sample.service;
import java.util.ArrayList;
@@ -557,6 +569,7 @@ You already created the `MyODataSinglePr
###### Sample Code
+ :::java
public ODataResponse readEntity(GetEntityUriInfo uriInfo, String contentType) throws ODataException {
if (uriInfo.getNavigationSegments().size() == 0) {