In most cases, a oData service is available when creating an SAPUI5 application. For times when a oData service is not available, it is possible to build apps with SAP Web IDE with a file-based data model (EDMX-file) and then run on simulated data (Mock Data Server in SAP Web IDE).
Once the data service is available, the app can then be configured to run against the live service rather than the mock data with no other changes. The mock data approach is also useful if you want to prototype an app and have realistic data appear in the UI.
A metadata document (EDMX-file) is defined in the Common Schema Definition Language (CSDL)
Related link http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part3-csdl.html
Typical construction of a EDMX-file:
This sample illustrates a simple relation between employees and skills.
Component | Description |
XML declaration | Not necessary for .edmx files, but useful to include if you want to view the file in an editor that supports XML syntax highlighting |
Edmx and DataServiceselements | The “wrapper” for your data model |
Schema | Container for the EntityTypes, Associations and EntityContainer elements |
EntityType 1 | Employee collection |
EntityType 2 | Skill collection |
Association | Defines the nature of the connection between the two collections (employee and skills) |
EntityContainer | Exposes the OData collection |
Complete sample EDMX-file https://wiki.scn.sap.com/wiki/display/Snippets/EDMX+-+Enterprise+Data+Modeling+for+Web+IDE
The completed model can now be imported into a SAP Web IDE project. During working on your model you can take advantage of the oData Model Editor (which is a plug-in to SAP Web IDE). To enable it, select Tools > Preferences in Web IDE, click on Plugins, locate the OData Model Editor plugin, click the slider to “on”, then Save and Web IDE will reload.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |