Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 6.49 KB

OData_V4_Tutorial_bcdbde6.md

File metadata and controls

82 lines (62 loc) · 6.49 KB
loio
bcdbde6911bd4fc68fd435cf8e306ed0

OData V4 Tutorial

In this tutorial, we explore how features of OData V4 can be used in OpenUI5. We write a small app that consumes data from an OData V4 service to understand how to access, modify, aggregate, and filter data in an OData V4 model.

OData is a standard protocol for creating and consuming data by using simple HTTP and REST APIs for create, read, update, delete (CRUD) operations.

We start with an initial app that simply retrieves data from an OData V4 service and displays it as a plain list.



Tip:

You don't have to do all tutorial steps sequentially, you can jump directly to any step you want. In each step, download the code from the previous step, copy it to your workspace, and make sure that the application runs by calling the webapp/index.html file.

You can view and download the samples for all steps in the Demo Kit at OData V4. Depending on your development environment you might have to adjust resource paths and configuration entries.

For more information check the Downloading Code for a Tutorial Step section of the tutorials overview page Get Started: Setup, Tutorials, and Demo Apps.

  1. Step 1: The Initial App
    We start by setting up a simple app that loads data from an OData service and displays it in a table. We use a mock server to simulate requests to and responses from the service.
  2. Step 2: Data Access and Client-Server Communication
    In this step, we see how the Table that is bound to the People entity set initially requests its data, and how the data can be refreshed. We use the Console tab in the browser developer tools to monitor the communication between the browser and the server. We see the initial request as well as the requests for refreshing the data.
  3. Step 3: Automatic Data Type Detection
    In this step, we use the automatic data type detection of the OData V4 model to parse, validate, and format user entries. The service metadata contains type information for the properties of each entity.
  4. Step 4: Filtering, Sorting, and Counting
    In this step, we add features to filter, sort, and count the user data by using the OData V4 model API to apply OData system query options $filter, $orderby, and $count.
  5. Step 5: Batch Groups
    In this step, we have a closer look at batch groups. Batch groups are used to group multiple requests into one server request to improve the overall performance.
  6. Step 6: Create and Edit
    In this step, we will make it possible to create and edit (update) user data from the user interface and send the data to the back end.
  7. Step 7: Delete
    In this step, we make it possible to delete user data.
  8. Step 8: OData Operations
    Our OData service provides one OData operation: the ResetDataSource action. In this step, we add a button that resets all data changes we made during the tutorial to their original state using this action.
  9. Step 9: List-Detail Scenario
    In this step we add a detail area with additional information.
  10. Step 10: Enable Data Reuse
    In this step we avoid unnecessary back-end requests by preventing the destruction of data shown in the detail area when sorting or filtering the list.
  11. Step 11: Add Table with :n Navigation to Detail Area
    In this step we add a table with additional information to the detail area.

Related Information

OData Standard Protocol

OData V4 Model

Basic Tutorial on the OData Home Page