You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by wa...@apache.org on 2021/06/05 19:50:17 UTC

[olingo-site] 13/15: cleanup of odata4 docs

This is an automated email from the ASF dual-hosted git repository.

wave pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/olingo-site.git

commit e39676e432c18172bc70bd476fcdd24c68018d5d
Author: Dave Fisher <da...@davefisher.tech>
AuthorDate: Sat Jun 5 12:04:34 2021 -0700

    cleanup of odata4 docs
---
 .../tutorials/navigation/tutorial_navigation.md    | 12 +--
 content/doc/odata4/tutorials/read/tutorial_read.md | 18 ++---
 .../doc/odata4/tutorials/readep/tutorial_readep.md | 94 +++++++++++-----------
 .../doc/odata4/tutorials/sqo_f/tutorial_sqo_f.md   |  2 +-
 .../doc/odata4/tutorials/sqo_o/tutorial_sqo_o.md   | 14 ++--
 .../doc/odata4/tutorials/write/tutorial_write.md   | 30 +++----
 6 files changed, 85 insertions(+), 85 deletions(-)

diff --git a/content/doc/odata4/tutorials/navigation/tutorial_navigation.md b/content/doc/odata4/tutorials/navigation/tutorial_navigation.md
index a1b0349..5846fa4 100755
--- a/content/doc/odata4/tutorials/navigation/tutorial_navigation.md
+++ b/content/doc/odata4/tutorials/navigation/tutorial_navigation.md
@@ -62,10 +62,10 @@ All three cases are covered by the present tutorial.
   1. Prerequisites
   2. Preparation
   3. Implementating the navigation
-    1. Declare the Metadata
-    2. Implement the to-many navigation
-    3. Implement the to-one navigation
-    4. Implement the to-many navigation with key access
+     1. Declare the Metadata
+     2. Implement the to-many navigation
+     3. Implement the to-one navigation
+     4. Implement the to-many navigation with key access
   4. Run the implemented service
   5. Summary
   6. Links
@@ -394,9 +394,9 @@ Now let’s focus on the second case, the navigation.
 
 Our tasks are:
   1. depending on the chosen key of the first segment, we have to compute which and how many entities exactly have to be returned. With other words, find the right data in the backend
-  e.g. for the category “monitors”, we have to find the right products that are monitors
+     e.g. for the category “monitors”, we have to find the right products that are monitors
   2. find out, which entity set has to be returned (can be products, categories, etc)
-  This `EdmEntitySet` is required in order to properly build the context URL
+     This `EdmEntitySet` is required in order to properly build the context URL
 
 The following sections explain how to do that.
 
diff --git a/content/doc/odata4/tutorials/read/tutorial_read.md b/content/doc/odata4/tutorials/read/tutorial_read.md
index 83d81d3..bf61619 100644
--- a/content/doc/odata4/tutorials/read/tutorial_read.md
+++ b/content/doc/odata4/tutorials/read/tutorial_read.md
@@ -71,17 +71,17 @@ And the browser will display the following collection of data:
   1. Prerequisites
   2. Preparation
   3. Create Project
-      * Create Project
-      * Edit `pom.xml` file
-      * Check build path
-      * Build the project
+     * Create Project
+     * Edit `pom.xml` file
+     * Check build path
+     * Build the project
   4. Implementation - Read scenario to request the EntitySet “Products”
-    1. Declare the metadata
-    2. Provide the data
-    3. Web application implementation
+     1. Declare the metadata
+     2. Provide the data
+     3. Web application implementation
   5. Run the service
-      * Run with Eclipse
-      * The Service URLs
+     * Run with Eclipse
+     * The Service URLs
   6. Summary
 
 ---
diff --git a/content/doc/odata4/tutorials/readep/tutorial_readep.md b/content/doc/odata4/tutorials/readep/tutorial_readep.md
index aa32c0e..1cf6ba2 100755
--- a/content/doc/odata4/tutorials/readep/tutorial_readep.md
+++ b/content/doc/odata4/tutorials/readep/tutorial_readep.md
@@ -30,18 +30,18 @@ The sample code shouldn't be reused for advanced scenarios.
 
   1. Prerequisites
   2. Preparation
-    1. Create data class
-    2. Adapt the servlet class
-    3. Modify the DemoEntityCollectionProcessor
-    4. Create utility class
+     1. Create data class
+     2. Adapt the servlet class
+     3. Modify the DemoEntityCollectionProcessor
+     4. Create utility class
   3. Implementation of Read Single Entity
-    1. Implement the EntityProcessor interface
-    2. Adapt the DemoServlet class
-    3. Run the service
+     1. Implement the EntityProcessor interface
+     2. Adapt the DemoServlet class
+     3. Run the service
   4. Implementation of Read Single Property
-    1. Implement the PrimitiveProcessor interface
-    2. Adapt the DemoServlet class
-    3. Run the service
+     1. Implement the PrimitiveProcessor interface
+     2. Adapt the DemoServlet class
+     3. Run the service
   5. Summary
   6. Links
   7. Appendix: PrimitiveValueProcessor
@@ -496,44 +496,44 @@ and he receives the following response in the browser:
 The steps to be followed in the implementation of the `readEntity(...)` method are the same that we followed in the previous tutorial, when we implemented the `readEntityCollection(...)` method:
 
   1. **Which data is requested?**  
-    Check the UriInfo instance for information about which *EntityCollection* has been requested.  
-    Note that in the code, we directly access the first segment of the URI and cast it to `UriResourceEntitySet`
-
-    ```java
+     Check the UriInfo instance for information about which *EntityCollection* has been requested.  
+     Note that in the code, we directly access the first segment of the URI and cast it to `UriResourceEntitySet`
+     
+     ```java
         UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourcePaths.get(0);
-    ```
-    
-    This is only possible, because in our current sample scenario we only support simple URIs. In a real production environment OData service, which supports navigation and other OData V4 features, the code would be more complex.
+     ```
+     
+     This is only possible, because in our current sample scenario we only support simple URIs. In a real production environment OData service, which supports navigation and other OData V4 features, the code would be more complex.
 
   2. **Fetch the data from backend**  
-    In the backend, which in our sample is represented by the `Storage` class, we have a list with products.
-    From this list we have to pick that one that is requested by the user.
-    The information, which one is requested, is contained in the so-called *KeyPredicates*.
-    In our OData model, we have only one property that is marked as “key”, it is the property with name *ID*
-    In other models, the key could also be composed by multiple properties. In such a case, all key-properties are mentioned in the URI.
-    That’s why the *KeyPredicate* information is provided as a list:
-
-    ```java
+     In the backend, which in our sample is represented by the `Storage` class, we have a list with products.
+     From this list we have to pick that one that is requested by the user.
+     The information, which one is requested, is contained in the so-called *KeyPredicates*.
+     In our OData model, we have only one property that is marked as “key”, it is the property with name *ID*
+     In other models, the key could also be composed by multiple properties. In such a case, all key-properties are mentioned in the URI.
+     That’s why the *KeyPredicate* information is provided as a list:
+     
+     ```java
         List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();
-    ```
-
-    Now our task is to loop over all product entities that we have in our backend and to find that one that matches all keys. Which means that we have to loop over all key params.
-    In our sample code, we have moved this logic to the *Util* class that has a *findEntity()* method, which loops over all existing product entities, and a *entityMatchesAllKeys()* method that checks if the given entity is the right one.
+     ```
+     
+     Now our task is to loop over all product entities that we have in our backend and to find that one that matches all keys. Which means that we have to loop over all key params.
+     In our sample code, we have moved this logic to the *Util* class that has a *findEntity()* method, which loops over all existing product entities, and a *entityMatchesAllKeys()* method that checks if the given entity is the right one.
 
   3. **Transform the data**  
-    After fetching the Entity object from the backend, we have to convert it to an `InputStream`, using the proper `ODataSerializer` method:
-
-    ```java
+     After fetching the Entity object from the backend, we have to convert it to an `InputStream`, using the proper `ODataSerializer` method:
+     
+     ```java
         ODataSerializer serializer = odata.createSerializer(responseFormat);
         SerializerResult serializerResult = serializer.entity(serviceMetadata, entityType, entity, options);
         InputStream entityStream = serializerResult.getContent();
-    ```
-
-    **Note:**
-    The `ODataSerializer` object has to be configured with a `ContextURL` (in case that it is requested) and with `EntitySerializerOptions`. In our sample we keep the code simple, since we know that we don’t support advanced operations.
+     ```
+     
+     **Note:**
+     The `ODataSerializer` object has to be configured with a `ContextURL` (in case that it is requested) and with `EntitySerializerOptions`. In our sample we keep the code simple, since we know that we don’t support advanced operations.
 
   4. **Configure the response**  
-    As usual, we have to set the body, the content type and the HTTP status code, as required by the specification.
+     As usual, we have to set the body, the content type and the HTTP status code, as required by the specification.
 
 
 The following snippet shows the implementation of the `readEntity(...)` method.
@@ -690,21 +690,21 @@ We have to create a Constructor that takes the `Storage` instance and stores it
 Again, we have the following 4 steps to follow:
 
   1. Which data is requested?  
-    From the `UriInfo` object, we not only have to retrieve the information about the `EntitySet` that is requested, but as well the desired property.
+     From the `UriInfo` object, we not only have to retrieve the information about the `EntitySet` that is requested, but as well the desired property.
 
   2. Fetch the data from backend  
-    Based on this information, we can retrieve the backend-data for the entity, just like we did in the `readEntity()` method, described above.
-    The property value can then be extracted from it.
+     Based on this information, we can retrieve the backend-data for the entity, just like we did in the `readEntity()` method, described above.
+     The property value can then be extracted from it.
 
   3. Transform the data  
-    The third step is to serialize the backend data into an `InputStream` object.  
-    For the current use case, the `ODataSerializer` instance offers a method called `primitive(...)`
+     The third step is to serialize the backend data into an `InputStream` object.  
+     For the current use case, the `ODataSerializer` instance offers a method called `primitive(...)`
 
   4. Configure the response  
-    When reading a property, we have to consider that the value of the property can be empty.  
-    If this is the case, when configuring the response object, we don’t provide response body and header.
-
-    ```java
+     When reading a property, we have to consider that the value of the property can be empty.  
+     If this is the case, when configuring the response object, we don’t provide response body and header.
+     
+     ```java
         public void readPrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat)
                                   throws ODataApplicationException, SerializerException {
 
@@ -761,7 +761,7 @@ Again, we have the following 4 steps to follow:
                        response.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
                    }
       }
-    ```
+     ```
 
 ## 4.2. Adapt the DemoServlet class
 
diff --git a/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.md b/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.md
index d037815..bfaedfa 100644
--- a/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.md
+++ b/content/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.md
@@ -20,7 +20,7 @@ This tutorial can be found in subdirectory *\samples\tutorials\p8_queryoptions-f
 
   1. Preparation
   2. Implementation
-    1. Implement `$filter`
+     1. Implement `$filter`
   3. Run the implemented service
   4. Summary
   5. Links
diff --git a/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.md b/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.md
index 01fd27e..4a3a061 100644
--- a/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.md
+++ b/content/doc/odata4/tutorials/sqo_o/tutorial_sqo_o.md
@@ -18,13 +18,13 @@ Again, in the present tutorial, we will focus only on the relevant implementatio
 
 **Table of Contents**
 
-  1.	Prerequisites
-  2.	Preparation
-  3.	Implementation
-    1. Implement `$orderby`
-  4.	Run the implemented service
-  5.	Summary
-  6.	Links
+  1. Prerequisites
+  2. Preparation
+  3. Implementation
+     1. Implement `$orderby`
+  4. Run the implemented service
+  5. Summary
+  6. Links
 
 __
 
diff --git a/content/doc/odata4/tutorials/write/tutorial_write.md b/content/doc/odata4/tutorials/write/tutorial_write.md
index 3848740..ceb40a3 100644
--- a/content/doc/odata4/tutorials/write/tutorial_write.md
+++ b/content/doc/odata4/tutorials/write/tutorial_write.md
@@ -29,14 +29,14 @@ The sample code shouldn't be reused for advanced scenarios.
   1. Prerequisites
   1. Preparation
   1. Implementation of Read Single Entity
-    1. Implement the `createEntity(...)` method
-    1. Implement the `updateEntity(...)` method
-    1. Implement the `deleteEntity(...)` method
+     1. Implement the `createEntity(...)` method
+     1. Implement the `updateEntity(...)` method
+     1. Implement the `deleteEntity(...)` method
   1. Run the implemented service
-    1. Example for **CREATE**
-    1. Example for **UPDATE (PUT)**
-    1. Example for **UPDATE (PATCH)**
-    1. Example for **DELETE**
+     1. Example for **CREATE**
+     1. Example for **UPDATE (PUT)**
+     1. Example for **UPDATE (PATCH)**
+     1. Example for **DELETE**
   1. Summary
   1. Links
 
@@ -282,7 +282,7 @@ The implementation is rather simple:
   - Delete the data in backend.
   - Configure the response object with the proper status code **204 – no content**.
 
-```java
+    ```java
     public void deleteEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo)
                             throws ODataApplicationException {
 
@@ -299,7 +299,7 @@ The implementation is rather simple:
       //3. configure the response object
       response.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
     }
-```
+    ```
 
 
 # 4. Run the service
@@ -329,13 +329,13 @@ The following sections provide examples for executing the requests:
   - Header: `Content-Type: application/json; odata.metadata=minimal`
   - Request body:
 
-```json
+    ```json
         {
           "ID":6,
           "Name":"Gamer Mouse",
           "Description":"optical mouse - gamer edition"
         }
-```
+    ```
 
 **Note:** The value for the ID property is arbitrary, as it will be generated by our OData service implementation
 
@@ -347,13 +347,13 @@ The following sections provide examples for executing the requests:
   - Header: `Content-Type: application/json; odata.metadata=minimal`
   - Request body:
 
-```json
+    ```json
         {
           "ID":3,
           "Name":"Ergo Screen updated Name",
           "Description":"updated description"
         }
-```
+    ```
 
 
 ### 4.3. Example for UPDATE (PATCH):
@@ -363,11 +363,11 @@ The following sections provide examples for executing the requests:
   - Header: `Content-Type: application/json; odata.metadata=minimal`
   - Request body:
 
-```json
+    ```json
         {
           "Description": "patched description"
         }
-```
+    ```
 
 ### 4.4. Example for DELETE: