├── .eslintrc ├── .gitignore ├── LICENSE ├── LICENSES └── Apache-2.0.txt ├── README.md ├── REUSE.toml ├── _i18n ├── i18n.properties ├── i18n_de.properties ├── i18n_en.properties └── i18n_fr.properties ├── app ├── capabilities.cds ├── field-control.cds ├── labels.cds ├── layouts.cds ├── services.cds └── test-resources │ └── ext │ ├── ObjectPageExtension.controller.js │ └── fragment │ ├── CustomSection.fragment.xml │ ├── CustomSection.js │ ├── Popover.fragment.xml │ └── Trees4Tickets.fragment.xml ├── db ├── common.cds ├── data │ ├── sap.common-Countries.csv │ ├── sap.common-Countries.texts.csv │ ├── sap.common-Currencies.csv │ ├── sap.common-Currencies.texts.csv │ ├── sap.fe.cap.travel-Airline.csv │ ├── sap.fe.cap.travel-Airport.csv │ ├── sap.fe.cap.travel-Booking.csv │ ├── sap.fe.cap.travel-BookingStatus.csv │ ├── sap.fe.cap.travel-BookingStatus.texts.csv │ ├── sap.fe.cap.travel-BookingSupplement.csv │ ├── sap.fe.cap.travel-Flight.csv │ ├── sap.fe.cap.travel-FlightConnection.csv │ ├── sap.fe.cap.travel-Passenger.csv │ ├── sap.fe.cap.travel-Supplement.csv │ ├── sap.fe.cap.travel-Supplement.texts.csv │ ├── sap.fe.cap.travel-SupplementType.csv │ ├── sap.fe.cap.travel-Travel.csv │ ├── sap.fe.cap.travel-TravelAgency.csv │ ├── sap.fe.cap.travel-TravelStatus.csv │ └── sap.fe.cap.travel-TravelStatus.texts.csv ├── master-data.cds └── schema.cds ├── exercises ├── ex0 │ ├── README.md │ └── images │ │ ├── 00_00_0010.png │ │ ├── 00_00_0020.png │ │ ├── 00_00_0030.png │ │ ├── 00_00_0040.png │ │ ├── 00_00_0050.png │ │ ├── 00_00_0060.png │ │ ├── 00_00_0065.png │ │ ├── 00_00_0066.png │ │ ├── 00_00_0070.png │ │ ├── 00_00_0080.png │ │ ├── 00_00_0081.png │ │ ├── 00_00_0110.png │ │ ├── 00_00_0120.png │ │ ├── 00_00_0130.png │ │ ├── click-clone-from-git.png │ │ ├── cloneCommand.png │ │ ├── enter-github-repository.png │ │ ├── fieldicon03.png │ │ ├── fieldicon04.png │ │ ├── img_039.png │ │ ├── img_039a.png │ │ ├── img_040.png │ │ ├── img_041.png │ │ ├── open_clone_repo.png │ │ ├── select_repo_location.png │ │ └── wsopen.png ├── ex1 │ ├── README.md │ └── images │ │ ├── fieldicon.png │ │ ├── fieldicon00.png │ │ ├── fieldicon01.png │ │ ├── fieldicon02.png │ │ ├── fieldicon03.png │ │ ├── fieldicon04.png │ │ ├── fieldicon05.png │ │ ├── fieldicon06.png │ │ ├── fieldicon07.png │ │ ├── fieldicon08.png │ │ ├── fieldicon09.png │ │ ├── fieldicon10.png │ │ ├── fieldicon11.png │ │ ├── fieldicon12.png │ │ ├── fieldicon13.png │ │ ├── fieldicon14.png │ │ ├── fieldicon15.png │ │ ├── fieldicon16.png │ │ ├── img_0.png │ │ ├── img_001.png │ │ ├── img_002.png │ │ ├── img_003.png │ │ ├── img_004.png │ │ ├── img_005.png │ │ ├── img_006.png │ │ ├── img_007.png │ │ ├── img_008.png │ │ ├── img_009.png │ │ ├── img_010.png │ │ ├── img_011.png │ │ ├── img_012.png │ │ ├── img_0121.png │ │ ├── img_013.png │ │ ├── img_014.png │ │ ├── img_015.png │ │ ├── img_016.png │ │ ├── img_017.png │ │ ├── img_018.png │ │ ├── img_0181.png │ │ ├── img_019.png │ │ ├── img_0191.png │ │ ├── img_020.png │ │ ├── img_021.png │ │ └── img_022.png ├── ex2 │ ├── README.md │ └── images │ │ ├── TextArea.png │ │ ├── fieldicon.png │ │ ├── fieldicon00.png │ │ ├── fieldicon01.png │ │ ├── fieldicon02.png │ │ ├── fieldicon03.png │ │ ├── fieldicon04.png │ │ ├── fieldicon05.png │ │ ├── fieldicon06.png │ │ ├── fieldicon07.png │ │ ├── fieldicon08.png │ │ ├── fieldicon09.png │ │ ├── fieldicon10.png │ │ ├── fieldicon11.png │ │ ├── fieldicon12.png │ │ ├── fieldicon13.png │ │ ├── fieldicon14.png │ │ ├── fieldicon15.png │ │ ├── fieldicon16.png │ │ ├── fieldicon17.png │ │ ├── fieldicon18.png │ │ ├── fieldicon19.png │ │ ├── fieldicon20.png │ │ ├── fieldicon21.png │ │ ├── fieldicon22.png │ │ ├── fieldicon23.png │ │ ├── fieldicon24.png │ │ ├── fieldicon25.png │ │ ├── fieldicon26.png │ │ ├── fieldicon27.png │ │ ├── fieldicon28.png │ │ ├── fieldicon29.png │ │ ├── fieldicon30.png │ │ ├── fieldicon_83.png │ │ ├── img_0.png │ │ ├── img_000.png │ │ ├── img_001.png │ │ ├── img_002.png │ │ ├── img_003.png │ │ ├── img_0035.png │ │ ├── img_004.png │ │ ├── img_0045.png │ │ ├── img_005.png │ │ ├── img_006.png │ │ ├── img_007.png │ │ ├── img_008.png │ │ ├── img_009.png │ │ ├── img_010.png │ │ ├── img_011.png │ │ ├── img_012.png │ │ ├── img_013.png │ │ ├── img_014.png │ │ ├── img_015.png │ │ ├── img_016.png │ │ ├── img_017.png │ │ ├── img_018.png │ │ ├── img_019.png │ │ ├── img_020.png │ │ ├── img_021.png │ │ ├── img_022.png │ │ ├── img_023.png │ │ ├── img_024.png │ │ ├── img_025.png │ │ └── img_026.png ├── ex3 │ ├── README.md │ └── images │ │ ├── fieldicon.png │ │ ├── fieldicon00.png │ │ ├── fieldicon01.png │ │ ├── fieldicon02.png │ │ ├── fieldicon_15.png │ │ ├── fieldicon_17.png │ │ ├── fieldicon_1700.png │ │ ├── fieldicon_2.png │ │ ├── fieldicon_20.png │ │ ├── fieldicon_22.png │ │ ├── fieldicon_25.png │ │ ├── fieldicon_5.png │ │ ├── img_0.png │ │ ├── img_000.png │ │ ├── img_001.png │ │ ├── img_002.png │ │ ├── img_003.png │ │ ├── img_004.png │ │ ├── img_005.png │ │ ├── img_006.png │ │ ├── img_007.png │ │ ├── img_008.png │ │ ├── img_009.png │ │ ├── img_010.png │ │ └── img_011.png ├── ex4 │ ├── README.md │ └── images │ │ ├── fieldicon.png │ │ ├── fieldicon00.png │ │ ├── fieldicon01.png │ │ ├── fieldicon02.png │ │ ├── fieldicon03.png │ │ ├── fieldicon04.png │ │ ├── fieldicon05.png │ │ ├── fieldicon06.png │ │ ├── fieldicon07.png │ │ ├── fieldicon08.png │ │ ├── fieldicon09.png │ │ ├── fieldicon10.png │ │ ├── fieldicon11.png │ │ ├── fieldicon12.png │ │ ├── fieldicon13.png │ │ ├── fieldicon14.png │ │ ├── fieldicon15.png │ │ ├── fieldicon16.png │ │ ├── fieldicon17.png │ │ ├── fieldicon18.png │ │ ├── fieldicon19.png │ │ ├── fieldicon20.png │ │ ├── img_0.png │ │ ├── img_000.png │ │ ├── img_001.png │ │ ├── img_002.png │ │ ├── img_003.png │ │ ├── img_004.png │ │ ├── img_005.png │ │ ├── img_006.png │ │ ├── img_007.png │ │ ├── img_008.png │ │ ├── img_009.png │ │ ├── img_010.png │ │ ├── img_010a.png │ │ ├── img_011.png │ │ ├── img_012.png │ │ ├── img_013.png │ │ ├── img_014.png │ │ ├── img_015.png │ │ ├── img_016.png │ │ ├── img_017.png │ │ ├── img_018.png │ │ ├── img_019.png │ │ ├── img_020.png │ │ ├── img_021.png │ │ ├── img_022.png │ │ ├── img_023.png │ │ └── img_024.png ├── ex5 │ ├── README.md │ └── images │ │ ├── fieldicon.png │ │ ├── fieldicon00.png │ │ ├── fieldicon01.png │ │ ├── fieldicon02.png │ │ ├── fieldicon03.png │ │ ├── fieldicon04.png │ │ ├── fieldicon05.png │ │ ├── fieldicon06.png │ │ ├── fieldicon07.png │ │ ├── fieldicon08.png │ │ ├── fieldicon09.png │ │ ├── fieldicon_16.png │ │ ├── fieldicon_20.png │ │ ├── fieldicon_24.png │ │ ├── fieldicon_26.png │ │ ├── img_0.png │ │ ├── img_000.png │ │ ├── img_001.png │ │ ├── img_002.png │ │ ├── img_003.png │ │ ├── img_004.png │ │ ├── img_005.png │ │ ├── img_006.png │ │ ├── img_007.png │ │ └── img_008.png ├── ex6 │ ├── README.md │ └── images │ │ ├── fieldicon.png │ │ ├── fieldicon00.png │ │ ├── fieldicon01.png │ │ ├── fieldicon02.png │ │ ├── fieldicon03.png │ │ ├── fieldicon04.png │ │ ├── fieldicon05.png │ │ ├── fieldicon06.png │ │ ├── fieldicon07.png │ │ ├── fieldicon08.png │ │ ├── fieldicon09.png │ │ ├── img_0.png │ │ ├── img_000.png │ │ ├── img_001.png │ │ ├── img_002.png │ │ ├── img_003.png │ │ ├── img_004.png │ │ ├── img_005.png │ │ ├── img_006.png │ │ ├── img_007.png │ │ ├── img_008.png │ │ ├── img_009.png │ │ ├── img_010.png │ │ ├── img_011.png │ │ ├── img_012.png │ │ └── img_013.png └── ex7 │ ├── README.md │ └── images │ ├── fieldicon.png │ ├── fieldicon00.png │ ├── fieldicon01.png │ ├── fieldicon02.png │ ├── fieldicon03.png │ ├── fieldicon04.png │ ├── fieldicon05.png │ ├── fieldicon_59.png │ ├── fieldicon_62.png │ ├── img_0.png │ ├── img_000.png │ ├── img_002.png │ ├── img_003.png │ ├── img_004.png │ ├── img_005.png │ ├── img_006.png │ ├── img_007.png │ ├── img_008.png │ ├── img_009.png │ ├── img_010.png │ └── img_011.png ├── package-lock.json ├── package.json ├── srv ├── travel-service.cds ├── travel-service.js ├── value-helps.cds └── workarounds.js └── test └── odata.test.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "node": true, 5 | "es6": true, 6 | "jest": true 7 | }, 8 | "parserOptions": { 9 | "ecmaVersion": 2021 10 | }, 11 | "globals": { 12 | "SELECT": true, 13 | "INSERT": true, 14 | "UPDATE": true, 15 | "DELETE": true, 16 | "CREATE": true, 17 | "DROP": true, 18 | "CDL": true, 19 | "CQL": true, 20 | "CXL": true, 21 | "cds": true, 22 | "sap": true 23 | }, 24 | "rules": { 25 | "no-console": "off", 26 | "require-atomic-updates": "off" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CAP sflight 2 | _out 3 | *.db 4 | connection.properties 5 | default-*.json 6 | gen/ 7 | node_modules/ 8 | target/ 9 | 10 | # Web IDE, App Studio 11 | .che/ 12 | .gen/ 13 | 14 | # MTA 15 | *_mta_build_tmp 16 | *.mtar 17 | mta_archives/ 18 | /Makefile_*.mta 19 | 20 | # Other 21 | .DS_Store 22 | .npmrc 23 | *.orig 24 | *.log 25 | 26 | *.flattened-pom.xml 27 | 28 | srv/src/main/resources/edmx/** 29 | dist/ 30 | /app/resources/ 31 | /app/router/package-lock.json 32 | 33 | 34 | # IDEs 35 | .idea 36 | *.iml 37 | .project 38 | .settings 39 | .classpath 40 | # .vscode/* 41 | # IMPORTANT: Do not exclude .vscode please! 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/teched2021-IIS160)](https://api.reuse.software/info/github.com/SAP-samples/teched2021-IIS160) 2 | 3 | # IIS160 - Accelerate the Development of SAP Fiori Apps Using SAP Fiori Elements 4 | 5 | ## Description 6 | 7 | This repository contains the material for the SAP TechEd 2021 session\ 8 | **IIS160 - Accelerate the Development of SAP Fiori Apps Using SAP Fiori Elements**. 9 | 10 | ## Overview 11 | 12 | The use of SAP Fiori elements with OData V4 and SAP Cloud Application Programming Model allows you to\ 13 | improve the efficiency of developing SAP Fiori apps.\ 14 | In this session you will get hands-on experience developing a standard list report or object page app\ 15 | using SAP Fiori elements, and then extend it using the flexible programming model.\ 16 | Learn how to use the new features provided with SAP Fiori tools to simplify how you add annotations\ 17 | and to personalize the appearance of your app. 18 | 19 | ## Requirements 20 | 21 | There are no special requirements to follow the exercises in this repository. 22 | 23 | ## Exercises 24 | 25 | - [Getting Started - Setting up your Development Environment](exercises/ex0#getting-started---setting-up-your-development-environment) 26 | - [Setting up SAP Business Application Studio in an SAP BTP Trial Account](exercises/ex0#setting-up-business-application-studio-in-an-sap-business-transformation-platform-trial-account) 27 | - [New Trial Users](exercises/ex0#new-trial-users) 28 | - [Existing Trial Users](exercises/ex0#existing-trial-users) 29 | - [Accessing SAP Business Application Studio](exercises/ex0#accessing-sap-business-application-studio) 30 | - [Creating the Development Space](exercises/ex0#creating-the-development-space) 31 | - [Getting the Sample Scenario](exercises/ex0#getting-the-sample-scenario) 32 | 33 | - [Exercise 1 - Generating an SAP Fiori Elements App](/exercises/ex1#exercise-1---generating-an-sap-fiori-elements-app) 34 | - [Exercise 1.1 Using the SAP Fiori tools Application Generator](/exercises/ex1#exercise-11-using-the-sap-fiori-tools-application-generator) 35 | - [Exercise 1.2 Adding an App Preview Script](/exercises/ex1#exercise-12-adding-an-app-preview-script) 36 | - [Exercise 1.3 Starting the App](/exercises/ex1#exercise-13-starting-the-app) 37 | 38 | - [Exercise 2 Enhancing the UI by Using the SAP Fiori tools Page Map](exercises/ex2#exercise-2-enhancing-the-ui-by-using-the-sap-fiori-tools-page-map) 39 | - [Exercise 2.1 Enable Data Load During Start of the App](exercises/ex2#exercise-21-enable-data-load-during-start-of-the-app) 40 | - [Exercise 2.2 Change Sequence of a Table Column in the List Report](exercises/ex2#exercise-22-change-sequence-of-a-table-column-in-the-list-report) 41 | - [Exercise 2.3 Adding Criticality to a Table Column](exercises/ex2#exercise-23-adding-criticality-to-a-table-column) 42 | - [Exercise 2.4 Adding Text and Text Arrangement to a Field](exercises/ex2#exercise-24-adding-text-and-text-arrangement-to-a-field) 43 | - [Exercise 2.5 Change Form Field Order and Display Type](exercises/ex2#exercise-25-change-form-field-order-and-display-type) 44 | - [Exercise 2.6 Adding a new Field Group](exercises/ex2#exercise-26-adding-a-new-field-group) 45 | 46 | - [Exercise 3 - Fine-Tuning the UI](exercises/ex3#exercise-3---fine-tuning-the-ui) 47 | - [Exercise 3.1: Add Table Line Criticality](exercises/ex3#exercise-31-add-table-line-criticality) 48 | - [Exercise 3.2: Adding a side effect to the Trees-4-Tickets property](exercises/ex3#exercise-32-adding-a-side-effect-to-the-trees-4-tickets-property) 49 | - [Exercise 3.3: Adding a Semantic Key](exercises/ex3#exercise-33-adding-a-semantic-key) 50 | 51 | - [Exercise 4 - Flexible Programming Model: Extending the App with Fiori Elements Building Blocks](exercises/ex4#exercise-4---flexible-programming-model-extending-the-app-with-fiori-elements-building-blocks) 52 | - [Flexible Programming Model Overview](exercises/ex4#flexible-programming-model-overview) 53 | - [Exercise 4.1 Remove Existing Section via Page Map](exercises/ex4#exercise-41-remove-existing-section-via-page-map) 54 | - [Exercise 4.2 Adding a Custom Section via Page Map](exercises/ex4#exercise-42-adding-a-custom-section-via-page-map) 55 | - [Exercise 4.3 Replace Generated XML Fragment Content](exercises/ex4#exercise-43-replace-generated-xml-fragment-content) 56 | - [Exercise 4.4 Testing the Building Block](exercises/ex4#exercise-44-testing-the-building-block) 57 | - [Exercise 4.5 Adding a Side Effect](exercises/ex4#exercise-45-adding-a-side-effect) 58 | 59 | - [Exercise 5 - Adding a Micro Chart to the Table Building Block](exercises/ex5#exercise-5---adding-a-micro-chart-to-the-table-building-block) 60 | - [Exercise 5.1 Add Annotations UI.Chart and UI.DataPoint](exercises/ex5#exercise-51-add-annotations-uichart-and-uidatapoint) 61 | - [Exercise 5.2 Enhance UI.LineItem Annotation via Code Completion](exercises/ex5#exercise-52-enhance-uilineitem-annotation-via-code-completion) 62 | - [Exercise 5.3 Add Header Facet to Booking Supplements Page](exercises/ex5#exercise-53-add-header-facet-to-booking-supplements-page) 63 | 64 | - [Exercise 6 - Flexible Programming Model: Using the Chart Building Block](exercises/ex6#exercise-6---flexible-programming-model-using-the-chart-building-block) 65 | - [Exercise 6.1 Extending the Service Definition](exercises/ex6#exercise-61-extending-the-service-definition) 66 | - [Exercise 6.2 Adding Aggregation Capabilities to the Entity Container](exercises/ex6#exercise-62-adding-aggregation-capabilities-to-the-entity-container) 67 | - [Exercise 6.3 Adding the @UI.Chart Annotation](exercises/ex6#exercise-63-adding-the-uichart-annotation) 68 | - [Exercise 6.3 Adding the Chart Building Block to the Custom Section](exercises/ex6#exercise-63-adding-the-chart-building-block-to-the-custom-section) 69 | - [Exercise 6.4 Implementing the Chart's Selection Change Handler](exercises/ex6#exercise-64-implementing-the-charts-selection-change-handler) 70 | - [Exercise 6.5 Testing the Chart's Event Handler](exercises/ex6#exercise-65-testing-the-charts-event-handler) 71 | 72 | - [Exercise 7 - Flexible Programming Model: Changing the Edit Flow by Implementing a Controller Extension](exercises/ex7#exercise-7---flexible-programming-model-changing-the-edit-flow-by-implementing-a-controller-extension) 73 | - [Exercise 7.1 Move XML Fragment and Controller File to App Folder](exercises/ex7#exercise-71-move-xml-fragment-and-controller-file-to-app-folder) 74 | - [Exercise 7.2 Adding a Controller Extension to the Manifest](exercises/ex7#exercise-72-adding-a-controller-extension-to-the-manifest) 75 | - [Exercise 7.3 Testing the Controller Extension](exercises/ex7#exercise-73-testing-the-controller-extension) 76 | 77 | ## How to obtain support 78 | 79 | Support for the content in this repository is available during the actual time of the online session for which this content has been designed. Otherwise, you may request support via the [Issues](../../issues) tab. 80 | 81 | ## License 82 | 83 | Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSES/Apache-2.0.txt) file. 84 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | SPDX-PackageName = "teched2021-[SESSION ID]" 3 | SPDX-PackageSupplier = "[YOUR EMAIL ADDRESS]" 4 | SPDX-PackageDownloadLocation = "https://github.com/sap-samples/teched2021-[SESSION ID]" 5 | SPDX-PackageComment = "The code in this project may include calls to APIs (“API Calls”) of\n SAP or third-party products or services developed outside of this project\n (“External Products”).\n “APIs” means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project’s code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls." 6 | 7 | [[annotations]] 8 | path = "**" 9 | precedence = "aggregate" 10 | SPDX-FileCopyrightText = "2021 SAP SE or an SAP affiliate company and teched2021-[SESSION ID] contributors" 11 | SPDX-License-Identifier = "Apache-2.0" 12 | -------------------------------------------------------------------------------- /_i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for travel_processor 2 | 3 | Travel=Travel 4 | Travels=Travels 5 | TravelUUID=Travel UUID 6 | TravelID=Travel 7 | AgencyID=Agency 8 | AgencyName=Agency Name 9 | TravelAgency=Travel Agency 10 | BeginDate=Starting Date 11 | EndDate=End Date 12 | Dates=Dates 13 | TotalPrice=Total Price 14 | TravelStatus=Travel Status 15 | CustomerID=Customer 16 | CustomerName=Customer Name 17 | BookingFee=Booking Fee 18 | Description=Description 19 | Price=Price 20 | Prices=Prices 21 | ProductPrice=Product Price 22 | ProductID=Product 23 | OverallStatus=Overall Status 24 | GeneralInformation=General Information 25 | 26 | Booking=Booking 27 | Bookings=Bookings 28 | BookingDate=Booking Date 29 | BookingID=Booking ID 30 | FlightPrice=Flight Price 31 | ConnectionID=Flight Number 32 | FlightDate=Flight Date 33 | FlightNumber=Flight Number 34 | BookingStatus=Booking Status 35 | Airline=Airline 36 | AirlineID=Airline 37 | Name=Name 38 | AirlineNumber=Airline Number 39 | Status=Status 40 | 41 | BookingSupplement=Booking Supplement 42 | BookingSupplements=Booking Supplements 43 | BookingSupplementID=Booking. Supp. Number 44 | SupplementDescription=Supplement Description 45 | SupplementID=Supplement 46 | Supplement=Supplement 47 | SupplementType=Supplement Type 48 | 49 | Passenger=Passenger 50 | LastName=Last Name 51 | PlaneType=Plane Type 52 | MaximumSeats=Maximum Seats 53 | OccupiedSeats=Occupied Seats 54 | 55 | FirstName=First name 56 | Title=Title 57 | Street=Street 58 | PostalCode=Postal Code 59 | City=City 60 | CountryCode=Country Code 61 | CurrencyCode=Currency Code 62 | PhoneNumber=Phone Number 63 | EMailAddress=EMail Address 64 | WebAddress=Web Address 65 | 66 | Flight=Flight 67 | 68 | CopyTravel=Copy Travel 69 | AcceptTravel=Accept Travel 70 | RejectTravel=Reject Travel 71 | DeductDiscount=Deduct Discount 72 | -------------------------------------------------------------------------------- /_i18n/i18n_de.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for travel_processor 2 | 3 | Travel=Reise 4 | Travels=Reisen 5 | TravelUUID=Reise-UUID 6 | TravelID=Reise 7 | AgencyID=Agentur 8 | AgencyName=Agenturname 9 | TravelAgency=Veranstalter 10 | BeginDate=Startdatum 11 | EndDate=Enddatum 12 | Dates=Termine 13 | TotalPrice=Gesamtpreis 14 | TravelStatus=Reisestatus 15 | CustomerID=Kunde 16 | CustomerName=Name des Kunden 17 | BookingFee=Reservierungsgebühr 18 | Description=Beschreibung 19 | Price=Preis 20 | Prices=Preise 21 | ProductPrice=Produktpreis 22 | ProductID=Produkt 23 | OverallStatus=Gesamtstatus 24 | GeneralInformation=Allgemeine Informationen 25 | 26 | Booking=Buchung 27 | Bookings=Buchungen 28 | BookingDate=Buchungsdatum 29 | BookingID=Buchungsnummer 30 | BookingNumber=Buchungsnummer 31 | FlightPrice=Flugpreis 32 | ConnectionID=Flugnummer 33 | FlightDate=Flugdatum 34 | FlightNumber=Flugnummer 35 | BookingStatus=Buchungsstatus 36 | Airline=Fluggesellschaft 37 | AirlineID=Fluggesellschaft 38 | Name=Name 39 | AirlineNumber=Fluggesellschaftsnummer 40 | Status=Status 41 | 42 | BookingSupplement=Buchungszusatz 43 | BookingSupplements=Buchungszusätze 44 | BookingSupplementID=Buchungszusatz 45 | SupplementDescription=Zusatzbeschreibung 46 | SupplementID=Zusatz-ID 47 | Supplement=Zusatz 48 | SupplementType=Zusatzart 49 | 50 | Passenger=Passagier 51 | LastName=Nachname 52 | PlaneType=Flugzeugtyp 53 | MaximumSeats=Maximale Sitzplätze 54 | OccupiedSeats=Belegte Plätze 55 | 56 | FirstName=Vorname 57 | Title=Titel 58 | Street=Straße 59 | PostalCode=Postleitzahl 60 | City=Ort 61 | CountryCode=Ländercode 62 | CurrencyCode=Währungscode 63 | PhoneNumber=Telefonnummer 64 | EMailAddress=E-Mail-Addresse 65 | WebAddress=Web-Adresse 66 | 67 | Flight=Flug 68 | 69 | CopyTravel=Reise kopieren 70 | AcceptTravel=Reise akzeptieren 71 | RejectTravel=Reise ablehnen 72 | DeductDiscount=Rabatt abziehen 73 | -------------------------------------------------------------------------------- /_i18n/i18n_en.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for travel_processor 2 | 3 | Travel=Travel 4 | Travels=Travels 5 | TravelUUID=Travel UUID 6 | TravelID=Travel 7 | AgencyID=Agency 8 | AgencyName=Agency Name 9 | TravelAgency=Travel Agency 10 | BeginDate=Starting Date 11 | EndDate=End Date 12 | Dates=Dates 13 | TotalPrice=Total Price 14 | TravelStatus=Travel Status 15 | CustomerID=Customer 16 | CustomerName=Customer Name 17 | BookingFee=Booking Fee 18 | Description=Description 19 | Price=Price 20 | Prices=Prices 21 | ProductPrice=Product Price 22 | ProductID=Product 23 | OverallStatus=Overall Status 24 | GeneralInformation=General Information 25 | 26 | Booking=Booking 27 | Bookings=Bookings 28 | BookingDate=Booking Date 29 | BookingID=Booking ID 30 | BookingNumber=Booking Number 31 | FlightPrice=Flight Price 32 | ConnectionID=Flight Number 33 | FlightDate=Flight Date 34 | FlightNumber=Flight Number 35 | BookingStatus=Booking Status 36 | Airline=Airline 37 | AirlineID=Airline 38 | Name=Name 39 | AirlineNumber=Airline Number 40 | Status=Status 41 | 42 | BookingSupplement=Booking Supplement 43 | BookingSupplements=Booking Supplements 44 | BookingSupplementID=Booking. Supp. Number 45 | SupplementDescription=Supplement Description 46 | SupplementID=Supplement 47 | Supplement=Supplement 48 | SupplementType=Supplement Type 49 | 50 | Passenger=Passenger 51 | LastName=Last Name 52 | PlaneType=Plane Type 53 | MaximumSeats=Maximum Seats 54 | OccupiedSeats=Occupied Seats 55 | 56 | FirstName=First name 57 | Title=Title 58 | Street=Street 59 | PostalCode=Postal Code 60 | City=City 61 | CountryCode=Country Code 62 | CurrencyCode=Currency Code 63 | PhoneNumber=Phone Number 64 | EMailAddress=EMail Address 65 | WebAddress=Web Address 66 | 67 | Flight=Flight 68 | 69 | CopyTravel=Copy Travel 70 | AcceptTravel=Accept Travel 71 | RejectTravel=Reject Travel 72 | DeductDiscount=Deduct Discount 73 | -------------------------------------------------------------------------------- /_i18n/i18n_fr.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for travel_processor 2 | 3 | Travel=Voyage 4 | Travels=Voyages 5 | TravelUUID=UUID voyage 6 | TravelID=Voyage 7 | AgencyID=Agence 8 | AgencyName=Nom de l'agence 9 | TravelAgency=Travel Agency 10 | BeginDate=Date de début 11 | EndDate=Date de fin 12 | Dates=Dates 13 | TotalPrice=Prix total 14 | TravelStatus=Statut du voyage 15 | CustomerID=Client 16 | CustomerName=Nom du client 17 | BookingFee=Frais de réservation 18 | Description=Description 19 | Price=Prix 20 | Prices=Prix 21 | ProductPrice=Prix du produit 22 | ProductID=Produit 23 | OverallStatus=Statut global 24 | GeneralInformation=Informations générales 25 | 26 | Booking=Réservation 27 | Bookings=Réservations 28 | BookingDate=Date d'inscription 29 | BookingID=ID réservation 30 | BookingNumber=Numéro de réservation 31 | FlightPrice=Flight Price 32 | ConnectionID=Flight Number 33 | FlightDate=Date vol 34 | FlightNumber=Nº vol 35 | BookingStatus=Booking Status 36 | Airline=Airline 37 | AirlineID=Airline 38 | Name=Nom 39 | AirlineNumber=Numéro de compagnie aérienne 40 | Status=Statut 41 | 42 | BookingSupplement=Supplément de réservation 43 | BookingSupplements=Réservation de suppléments 44 | BookingSupplementID=Nº Supplément de réservation 45 | SupplementDescription=Description du supplément 46 | SupplementID=Supplément. 47 | Supplement=Supplément 48 | SupplementType=Type de supplément 49 | 50 | Passenger=Passager 51 | LastName=Last Name 52 | PlaneType=Type d'avion 53 | MaximumSeats=Nombre maximal de places 54 | OccupiedSeats=Places occup. 55 | 56 | FirstName=Prénom 57 | Title=Titre 58 | Street=Rue 59 | PostalCode=Code postal 60 | City=Ville 61 | CountryCode=Code pays 62 | CurrencyCode=Currency Code 63 | PhoneNumber=Phone Number 64 | EMailAddress=Numéro de téléphone 65 | WebAddress=Adresse e-mail 66 | 67 | Flight=Vol 68 | 69 | CopyTravel=Copier le voyage 70 | AcceptTravel=Accepter le voyage 71 | RejectTravel=Refuser le voyage 72 | DeductDiscount=Déduire remise -------------------------------------------------------------------------------- /app/capabilities.cds: -------------------------------------------------------------------------------- 1 | using {TravelService} from '../srv/travel-service'; 2 | 3 | annotate TravelService.Travel with @odata.draft.enabled; 4 | //Exercise 3.2: Add Semantic key 5 | 6 | 7 | 8 | //Exercise 6: Add Aggregation Capabilities 9 | -------------------------------------------------------------------------------- /app/field-control.cds: -------------------------------------------------------------------------------- 1 | using TravelService from '../srv/travel-service'; 2 | 3 | // 4 | // annotations that control the behavior of fields and actions 5 | // 6 | 7 | // Workarounds for overly strict OData libs and clients 8 | 9 | annotate cds.UUID with @Core.Computed @odata.Type : 'Edm.String'; 10 | 11 | // Add fields to control enablement of action buttons on UI 12 | extend projection TravelService.Travel with { 13 | // REVISIT: shall be improved by omitting "null as" 14 | virtual null as acceptEnabled : Boolean @UI.Hidden, 15 | virtual null as rejectEnabled : Boolean @UI.Hidden, 16 | virtual null as deductDiscountEnabled : Boolean @UI.Hidden 17 | } 18 | 19 | annotate TravelService.Travel { 20 | 21 | BookingFee @Common.FieldControl : TravelStatus.fieldControl; 22 | BeginDate @Common.FieldControl : TravelStatus.fieldControl; 23 | EndDate @Common.FieldControl : TravelStatus.fieldControl; 24 | to_Agency @Common.FieldControl : TravelStatus.fieldControl; 25 | to_Customer @Common.FieldControl : TravelStatus.fieldControl; 26 | 27 | } actions { 28 | rejectTravel @( 29 | Core.OperationAvailable : in.rejectEnabled, 30 | Common.SideEffects.TargetProperties : [ 31 | 'in/TravelStatus_code', 32 | 'in/acceptEnabled', 33 | 'in/rejectEnabled' 34 | ], 35 | ); 36 | acceptTravel @( 37 | Core.OperationAvailable : in.acceptEnabled, 38 | Common.SideEffects.TargetProperties : [ 39 | 'in/TravelStatus_code', 40 | 'in/acceptEnabled', 41 | 'in/rejectEnabled' 42 | ], 43 | ); 44 | deductDiscount @( 45 | Core.OperationAvailable : in.deductDiscountEnabled, 46 | Common.SideEffects.TargetProperties : ['in/deductDiscountEnabled'], 47 | ); 48 | } 49 | 50 | 51 | annotate TravelService.Booking with @UI.CreateHidden : to_Travel.TravelStatus.createDeleteHidden 52 | @Common : {SideEffects #FlightPrice: { 53 | $Type : 'Common.SideEffectsType', 54 | SourceProperties : [FlightPrice], 55 | TargetProperties : ['to_Travel/TotalPrice'] 56 | }}; 57 | 58 | annotate TravelService.Booking { 59 | 60 | BookingDate @Core.Computed; 61 | ConnectionID @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 62 | FlightDate @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 63 | FlightPrice @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 64 | BookingStatus @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 65 | to_Carrier @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 66 | to_Customer @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 67 | }; 68 | 69 | annotate TravelService.BookingSupplement { 70 | Price @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 71 | to_Supplement @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 72 | to_Booking @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 73 | to_Travel @Common.FieldControl : to_Travel.TravelStatus.fieldControl; 74 | 75 | }; 76 | 77 | //Exercise 3.1: Add side effect on GoGreen property 78 | 79 | 80 | //Exercise 4.5: Add side effect on ConnectionID 81 | -------------------------------------------------------------------------------- /app/labels.cds: -------------------------------------------------------------------------------- 1 | using { sap.fe.cap.travel as schema } from '../db/schema'; 2 | 3 | // 4 | // annotations that control rendering of fields and labels 5 | // 6 | 7 | annotate schema.Travel with @title: '{i18n>Travel}' { 8 | TravelUUID @UI.Hidden; 9 | TravelID @title: '{i18n>TravelID}'; 10 | BeginDate @title: '{i18n>BeginDate}'; 11 | EndDate @title: '{i18n>EndDate}'; 12 | Description @title: '{i18n>Description}' ; 13 | BookingFee @title: '{i18n>BookingFee}' @Measures.ISOCurrency: CurrencyCode_code; 14 | TotalPrice @title: '{i18n>TotalPrice}' @Measures.ISOCurrency: CurrencyCode_code; 15 | GoGreen @title: '{i18n>GoGreen}'; 16 | GreenFee @title: '{i18n>GreenFee}' @Measures.ISOCurrency: CurrencyCode_code; 17 | TreesPlanted @title: 'Trees Planted'; 18 | TravelStatus @title: '{i18n>TravelStatus}' @Common.Text: TravelStatus.name @Common.TextArrangement: #TextOnly; 19 | to_Customer @title: '{i18n>CustomerID}' @Common.Text: to_Customer.LastName; 20 | to_Agency @title: '{i18n>AgencyID}' ; 21 | } 22 | 23 | annotate schema.TravelStatus with { 24 | code @Common.Text: name @Common.TextArrangement: #TextOnly 25 | } 26 | 27 | annotate schema.Booking with @title: '{i18n>Booking}' { 28 | BookingUUID @UI.Hidden; 29 | to_Travel @UI.Hidden; 30 | BookingID @title: '{i18n>BookingID}'; 31 | BookingDate @title: '{i18n>BookingDate}'; 32 | ConnectionID @title: '{i18n>ConnectionID}'; 33 | CurrencyCode @title: '{i18n>CurrencyCode}'; 34 | FlightDate @title: '{i18n>FlightDate}'; 35 | FlightPrice @title: '{i18n>FlightPrice}' @Measures.ISOCurrency: CurrencyCode_code; 36 | BookingStatus @title: '{i18n>BookingStatus}' @Common.Text: BookingStatus.name @Common.TextArrangement: #TextOnly; 37 | to_Carrier @title: '{i18n>AirlineID}' @Common.Text: to_Carrier.Name; 38 | to_Customer @title: '{i18n>CustomerID}' @Common.Text: to_Customer.LastName; 39 | } 40 | 41 | annotate schema.BookingStatus with { 42 | code @Common.Text : name @Common.TextArrangement: #TextOnly 43 | } 44 | 45 | annotate schema.BookingSupplement with @title: '{i18n>BookingSupplement}' { 46 | BookSupplUUID @UI.Hidden; 47 | to_Booking @UI.Hidden; 48 | to_Travel @UI.Hidden; 49 | to_Supplement @title: '{i18n>SupplementID}' @Common.Text: to_Supplement.Description; 50 | Price @title: '{i18n>Price}' @Measures.ISOCurrency: CurrencyCode_code; 51 | BookingSupplementID @title: '{i18n>BookingSupplementID}'; 52 | CurrencyCode @title: '{i18n>CurrencyCode}'; 53 | } 54 | 55 | annotate schema.TravelAgency with @title: '{i18n>TravelAgency}' { 56 | AgencyID @title: '{i18n>AgencyID}' @Common.Text: Name; 57 | Name @title: '{i18n>AgencyName}'; 58 | Street @title: '{i18n>Street}'; 59 | PostalCode @title: '{i18n>PostalCode}'; 60 | City @title: '{i18n>City}'; 61 | CountryCode @title: '{i18n>CountryCode}'; 62 | PhoneNumber @title: '{i18n>PhoneNumber}'; 63 | EMailAddress @title: '{i18n>EMailAddress}'; 64 | WebAddress @title: '{i18n>WebAddress}'; 65 | } 66 | 67 | annotate schema.Passenger with @title: '{i18n>Passenger}' { 68 | CustomerID @title: '{i18n>CustomerID}' @Common.Text: LastName; 69 | FirstName @title: '{i18n>FirstName}'; 70 | LastName @title: '{i18n>LastName}'; 71 | Title @title: '{i18n>Title}'; 72 | Street @title: '{i18n>Street}'; 73 | PostalCode @title: '{i18n>PostalCode}'; 74 | City @title: '{i18n>City}'; 75 | CountryCode @title: '{i18n>CountryCode}'; 76 | PhoneNumber @title: '{i18n>PhoneNumber}'; 77 | EMailAddress @title: '{i18n>EMailAddress}'; 78 | } 79 | 80 | annotate schema.Airline with @title: '{i18n>Airline}' { 81 | AirlineID @title: '{i18n>AirlineID}' @Common.Text: Name; 82 | Name @title: '{i18n>Name}'; 83 | CurrencyCode @title: '{i18n>CurrencyCode}'; 84 | } 85 | 86 | annotate schema.Flight with @title: '{i18n>Flight}' { 87 | AirlineID @title: '{i18n>AirlineID}'; 88 | FlightDate @title: '{i18n>FlightDate}'; 89 | ConnectionID @title: '{i18n>ConnectionID}'; 90 | CurrencyCode @title: '{i18n>CurrencyCode}'; 91 | Price @title: '{i18n>Price}' @Measures.ISOCurrency: CurrencyCode_code; 92 | PlaneType @title: '{i18n>PlaneType}'; 93 | MaximumSeats @title: '{i18n>MaximumSeats}'; 94 | OccupiedSeats @title: '{i18n>OccupiedSeats}'; 95 | } 96 | 97 | annotate schema.Supplement with @title: '{i18n>Supplement}' { 98 | SupplementID @title: '{i18n>SupplementID}' @Common.Text: Description; 99 | Price @title: '{i18n>Price}' @Measures.ISOCurrency: CurrencyCode_code; 100 | CurrencyCode @title: '{i18n>CurrencyCode}'; 101 | Description @title: '{i18n>Description}'; 102 | } 103 | -------------------------------------------------------------------------------- /app/layouts.cds: -------------------------------------------------------------------------------- 1 | using TravelService from '../srv/travel-service'; 2 | using from '../db/schema'; 3 | using from './capabilities'; 4 | 5 | annotate TravelService.Travel with @UI : { 6 | /* 7 | Identification annotation defines actions shown in the object page header 8 | */ 9 | Identification : [ 10 | { $Type : 'UI.DataFieldForAction', Action : 'TravelService.acceptTravel', Label : '{i18n>AcceptTravel}' }, 11 | { $Type : 'UI.DataFieldForAction', Action : 'TravelService.rejectTravel', Label : '{i18n>RejectTravel}' }, 12 | { $Type : 'UI.DataFieldForAction', Action : 'TravelService.deductDiscount', Label : '{i18n>DeductDiscount}' } 13 | ], 14 | /* 15 | HeaderInfo TypeName defines the subtitle on object page header 16 | TypeNamePlural defines the List Report table header 17 | */ 18 | HeaderInfo : { 19 | TypeName : '{i18n>Travel}', 20 | TypeNamePlural : '{i18n>Travels}', 21 | Title : { 22 | $Type : 'UI.DataField', 23 | Value : Description 24 | }, 25 | Description : { 26 | $Type : 'UI.DataField', 27 | Value : TravelID 28 | } 29 | }, 30 | /* 31 | PresentationVariant defines a default sort order considered for List Report selection 32 | */ 33 | PresentationVariant : { 34 | Text : 'Default', 35 | Visualizations : ['@UI.LineItem'], 36 | SortOrder : [{ 37 | $Type : 'Common.SortOrderType', 38 | Property : TravelID, 39 | Descending : true 40 | }] 41 | }, 42 | /* 43 | SelectionFields define the filters shown in the List Report filter bar 44 | */ 45 | SelectionFields : [ 46 | TravelID, 47 | to_Agency_AgencyID, 48 | to_Customer_CustomerID, 49 | TravelStatus_code 50 | ], 51 | /* 52 | LineItem annotation define the table columns. DataFieldForAction defines actions shown in the table toolbar 53 | */ 54 | LineItem : [ 55 | { $Type : 'UI.DataFieldForAction', Action : 'TravelService.acceptTravel', Label : '{i18n>AcceptTravel}' }, 56 | { $Type : 'UI.DataFieldForAction', Action : 'TravelService.rejectTravel', Label : '{i18n>RejectTravel}' }, 57 | { $Type : 'UI.DataFieldForAction', Action : 'TravelService.deductDiscount', Label : '{i18n>DeductDiscount}' }, 58 | { Value : TravelID }, 59 | { Value : to_Agency_AgencyID }, 60 | { Value : to_Customer_CustomerID }, 61 | { Value : BeginDate }, 62 | { Value : EndDate }, 63 | { Value : BookingFee }, 64 | { Value : TotalPrice }, 65 | { Value : TravelStatus_code }, 66 | { Value : Description } 67 | ], 68 | /* 69 | Facets define the layout of the form field groups on the object page 70 | Collection Facets group together reference facets, each representing a form field group 71 | */ 72 | 73 | Facets : [{ 74 | $Type : 'UI.CollectionFacet', 75 | Label : '{i18n>GeneralInformation}', 76 | ID : 'Travel', 77 | Facets : [ 78 | { // travel details 79 | $Type : 'UI.ReferenceFacet', 80 | ID : 'TravelData', 81 | Target : '@UI.FieldGroup#TravelData', 82 | Label : '{i18n>GeneralInformation}' 83 | }, 84 | { // price information 85 | $Type : 'UI.ReferenceFacet', 86 | ID : 'PriceData', 87 | Target : '@UI.FieldGroup#PriceData', 88 | Label : '{i18n>Prices}' 89 | }, 90 | { // date information 91 | $Type : 'UI.ReferenceFacet', 92 | ID : 'DateData', 93 | Target : '@UI.FieldGroup#DateData', 94 | Label : '{i18n>Dates}' 95 | } 96 | ] 97 | }, { // booking list 98 | $Type : 'UI.ReferenceFacet', 99 | Target : 'to_Booking/@UI.PresentationVariant', 100 | Label : '{i18n>Bookings}' 101 | }], 102 | 103 | FieldGroup#TravelData : { Data : [ 104 | { Value : TravelID }, 105 | { Value : to_Agency_AgencyID }, 106 | { Value : to_Customer_CustomerID }, 107 | { Value : Description }, 108 | { 109 | $Type : 'UI.DataField', 110 | Value : TravelStatus_code, 111 | Criticality : TravelStatus.criticality, 112 | Label : '{i18n>Status}' // label only necessary if differs from title of element 113 | } 114 | ]}, 115 | FieldGroup #DateData : {Data : [ 116 | { $Type : 'UI.DataField', Value : BeginDate }, 117 | { $Type : 'UI.DataField', Value : EndDate } 118 | ]}, 119 | FieldGroup #PriceData : {Data : [ 120 | { $Type : 'UI.DataField', Value : BookingFee }, 121 | { $Type : 'UI.DataField', Value : TotalPrice } 122 | ]} 123 | }; 124 | 125 | annotate TravelService.Booking with @UI : { 126 | Identification : [ 127 | { Value : BookingID }, 128 | ], 129 | HeaderInfo : { 130 | TypeName : '{i18n>Bookings}', 131 | TypeNamePlural : '{i18n>Bookings}', 132 | Title : { Value : to_Customer.LastName }, 133 | Description : { Value : BookingID } 134 | }, 135 | // Exercise 5: add chart header facet 136 | 137 | PresentationVariant : { 138 | Text : 'Default', 139 | Visualizations : ['@UI.LineItem'], 140 | }, 141 | SelectionFields : [], 142 | LineItem : { 143 | //Exercise 3.1 Add Table Line Criticality 144 | 145 | $value : [ 146 | { Value : to_Carrier.AirlinePicURL, ![@UI.Importance] : #High}, 147 | { 148 | $Type : 'UI.DataField', 149 | Value : BookingID, 150 | ![@UI.Importance] : #High 151 | }, 152 | // Exercise 5: add chart table column 153 | 154 | { Value : to_Customer_CustomerID, ![@UI.Importance] : #High }, 155 | { Value : to_Carrier_AirlineID, ![@UI.Importance] : #High }, 156 | { Value : ConnectionID, ![@UI.Importance] : #High }, 157 | { Value : FlightDate, ![@UI.Importance] : #High }, 158 | { Value : FlightPrice, ![@UI.Importance] : #High }, 159 | { Value : BookingStatus_code } 160 | ]}, 161 | Facets : [{ 162 | $Type : 'UI.CollectionFacet', 163 | Label : '{i18n>GeneralInformation}', 164 | ID : 'Booking', 165 | Facets : [{ // booking details 166 | $Type : 'UI.ReferenceFacet', 167 | ID : 'BookingData', 168 | Target : '@UI.FieldGroup#GeneralInformation', 169 | Label : '{i18n>Booking}' 170 | }, { // flight details 171 | $Type : 'UI.ReferenceFacet', 172 | ID : 'FlightData', 173 | Target : '@UI.FieldGroup#Flight', 174 | Label : '{i18n>Flight}' 175 | }] 176 | }, { // supplements list 177 | $Type : 'UI.ReferenceFacet', 178 | Target : 'to_BookSupplement/@UI.LineItem', 179 | Label : '{i18n>BookingSupplements}' 180 | }], 181 | FieldGroup #GeneralInformation : { Data : [ 182 | { Value : BookingID }, 183 | { Value : BookingDate, }, 184 | { Value : to_Customer_CustomerID }, 185 | { Value : BookingDate, }, 186 | { Value : BookingStatus_code } 187 | ]}, 188 | FieldGroup #Flight : { Data : [ 189 | { Value : to_Carrier_AirlineID }, 190 | { Value : ConnectionID }, 191 | { Value : FlightDate }, 192 | { Value : FlightPrice } 193 | ]} 194 | }; 195 | annotate TravelService.BookingSupplement with @UI : { 196 | Identification : [ 197 | { Value : BookingSupplementID } 198 | ], 199 | HeaderInfo : { 200 | TypeName : '{i18n>BookingSupplement}', 201 | TypeNamePlural : '{i18n>BookingSupplements}', 202 | Title : { Value : BookingSupplementID }, 203 | Description : { Value : BookingSupplementID } 204 | }, 205 | LineItem : [ 206 | { Value : BookingSupplementID }, 207 | { Value : to_Supplement_SupplementID, Label : '{i18n>ProductID}' }, 208 | { Value : Price, Label : '{i18n>ProductPrice}' } 209 | ], 210 | }; 211 | // Exercise 5: Booking entity Chart annotation 212 | 213 | 214 | // Exercise 6: BookedFlights entity Chart annotation -------------------------------------------------------------------------------- /app/services.cds: -------------------------------------------------------------------------------- 1 | using from './capabilities'; 2 | using from './field-control'; 3 | using from './labels'; 4 | using from './layouts'; 5 | -------------------------------------------------------------------------------- /app/test-resources/ext/ObjectPageExtension.controller.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/ui/core/mvc/ControllerExtension"], 3 | function(ControllerExtension) { 4 | "use strict"; 5 | 6 | return ControllerExtension.extend("sap.fe.cap.managetravels.ext.ObjectPageExtension", { 7 | // this section allows to extend lifecycle hooks or override public methods of the base controller 8 | override: { 9 | editFlow: { 10 | onBeforeSave: function() { 11 | //Check on green flights 12 | if (!this.getView().getBindingContext().getProperty('GoGreen')){ 13 | return new Promise(async function(fnResolve, fnReject) { 14 | var mSettings = { 15 | id: "myFragment", 16 | name: "sap.fe.cap.managetravels.ext.fragment.Trees4Tickets", 17 | controller: this.base.getView().getController(), 18 | contextPath: "/Travel", 19 | initialBindingContext: this.getView().getBindingContext() 20 | } 21 | var oApproveDialog = await this.base.getExtensionAPI().loadFragment(mSettings); 22 | oApproveDialog.setBindingContext(this.getView().getBindingContext()); 23 | let buttons = oApproveDialog.getButtons(); 24 | let saveButton = buttons.find(obj => obj.sId === "myFragment--Save"); 25 | saveButton.attachPress(function() { 26 | oApproveDialog.close(); 27 | oApproveDialog.destroy(); 28 | fnResolve(); }.bind(this)); 29 | 30 | let cancelButton = buttons.find(obj => obj.sId === "myFragment--Cancel"); 31 | cancelButton.attachPress(function() { 32 | oApproveDialog.close(); 33 | oApproveDialog.destroy(); 34 | fnReject(); }.bind(this)); 35 | oApproveDialog.open(); 36 | }.bind(this)); 37 | } 38 | } 39 | } 40 | } 41 | }); 42 | } 43 | ); 44 | -------------------------------------------------------------------------------- /app/test-resources/ext/fragment/CustomSection.fragment.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 30 | 31 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/test-resources/ext/fragment/CustomSection.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/model/json/JSONModel"], function (JSONModel) { 2 | "use strict"; 3 | 4 | return { 5 | onChartSelectionChanged: function (oEvent) { 6 | if (oEvent.getParameter("selected")) { 7 | // 8 | this.editFlow 9 | .getView() 10 | .setModel( 11 | new JSONModel(oEvent.getParameter("data")[0].data),"popup"); 12 | 13 | 14 | // get Popover from xml fragment dependents 15 | this._oPopover = oEvent.getSource().getParent().getDependents()[0]; 16 | if (this._oPopover) { 17 | // open popover at selected chart segment 18 | this._oPopover.openBy( 19 | oEvent.getParameter("data")[0].target 20 | ); 21 | } 22 | } 23 | }, 24 | }; 25 | }); 26 | -------------------------------------------------------------------------------- /app/test-resources/ext/fragment/Popover.fragment.xml: -------------------------------------------------------------------------------- 1 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/test-resources/ext/fragment/Trees4Tickets.fragment.xml: -------------------------------------------------------------------------------- 1 | 7 | 9 | 10 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 46 | 47 | -------------------------------------------------------------------------------- /db/common.cds: -------------------------------------------------------------------------------- 1 | using { User, sap, managed } from '@sap/cds/common'; 2 | 3 | extend sap.common.Currencies with { 4 | // Currencies.code = ISO 4217 alphabetic three-letter code 5 | // with the first two letters being equal to ISO 3166 alphabetic country codes 6 | // See also: 7 | // [1] https://www.iso.org/iso-4217-currency-codes.html 8 | // [2] https://www.currency-iso.org/en/home/tables/table-a1.html 9 | // [3] https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm 10 | numcode : Integer; 11 | exponent : Integer; //> e.g. 2 --> 1 Dollar = 10^2 Cent 12 | minor : String; //> e.g. 'Cent' 13 | } 14 | 15 | ////////////////////////////////////////////////////////////////////////// 16 | // 17 | // Workaround for the above 18 | // 19 | 20 | aspect custom.managed { 21 | createdAt : Timestamp @cds.on.insert : $now; 22 | createdBy : User @cds.on.insert : $user; 23 | LastChangedAt : Timestamp @cds.on.insert : $now @cds.on.update : $now; 24 | LastChangedBy : User @cds.on.insert : $user @cds.on.update : $user; 25 | } 26 | 27 | annotate custom.managed with { 28 | createdAt @UI.HiddenFilter; 29 | createdBy @UI.HiddenFilter; 30 | LastChangedAt @UI.HiddenFilter; 31 | LastChangedBy @UI.HiddenFilter; 32 | } 33 | 34 | // TODO: these annotations would cause a popup requesting input for these fields on "create travel", ... 35 | // annotate custom.managed with { 36 | // createdAt @Core.Immutable; 37 | // createdBy @Core.Immutable; 38 | // } 39 | 40 | annotate custom.managed with { 41 | createdAt @title : '{i18n>CreatedAt}'; 42 | createdBy @title : '{i18n>CreatedBy}'; 43 | LastChangedAt @title : '{i18n>ChangedAt}'; 44 | LastChangedBy @title : '{i18n>ChangedBy}'; 45 | } 46 | 47 | // 48 | ////////////////////////////////////////////////////////////////////////// 49 | -------------------------------------------------------------------------------- /db/data/sap.common-Countries.csv: -------------------------------------------------------------------------------- 1 | code;name;descr 2 | AU;Australia;Commonwealth of Australia 3 | CA;Canada;Canada 4 | CN;China;People's Republic of China (PRC) 5 | FR;France;French Republic 6 | DE;Germany;Federal Republic of Germany 7 | IN;India;Republic of India 8 | IL;Israel;State of Israel 9 | MM;Myanmar;Republic of the Union of Myanmar 10 | GB;United Kingdom;United Kingdom of Great Britain and Northern Ireland 11 | US;United States;United States of America (USA) 12 | EU;European Union;European Union -------------------------------------------------------------------------------- /db/data/sap.common-Countries.texts.csv: -------------------------------------------------------------------------------- 1 | code;locale;name;descr 2 | AU;de;Australien;Commonwealth Australien 3 | CA;de;Kanada;Canada 4 | CN;de;China;Volksrepublik China 5 | FR;de;Frankreich;Republik Frankreich 6 | DE;de;Deutschland;Bundesrepublik Deutschland 7 | IN;de;Indien;Republik Indien 8 | IL;de;Israel;Staat Israel 9 | MM;de;Myanmar;Republik der Union Myanmar 10 | GB;de;Vereinigtes Königreich;Vereinigtes Königreich Großbritannien und Nordirland 11 | US;de;Vereinigte Staaten;Vereinigte Staaten von Amerika 12 | EU;de;Europäische Union;Europäische Union 13 | AU;fr;Australie;Commonwealth d'Australie 14 | CA;fr;Canada;Canada 15 | CN;fr;Chine;République populaire de Chine (RPC) 16 | FR;fr;France;République française 17 | DE;fr;Allemagne;République fédérale d'Allemagne 18 | IN;fr;Inde;République de l'Inde 19 | IL;fr;Israël;État d'Israël 20 | MM;fr;Birmanie;République de l'Union du Myanmar 21 | GB;fr;Royaume-Uni;Royaume-Uni et Irlande du Nord 22 | US;fr;États-Unis;États-Unis d'Amérique (États-Unis) 23 | EU;fr;Union Européenne;Union Européenne 24 | AU;en;Australie;Commonwealth d'Australie 25 | CA;en;Canada;Canada 26 | CN;en;China;People's Republic of China (PRC) 27 | FR;en;France;French Republic 28 | DE;en;Germany;Federal Republic of Germany 29 | IN;en;India;Republic of India 30 | IL;en;Israel;State of Israel 31 | MM;en;Myanmar;Republic of the Union of Myanmar 32 | GB;en;United Kingdom;United Kingdom of Great Britain and Northern Ireland 33 | US;en;United States;United States of America (USA) 34 | EU;en;European Union;European Union -------------------------------------------------------------------------------- /db/data/sap.common-Currencies.csv: -------------------------------------------------------------------------------- 1 | code;symbol;name;descr;numcode;minor;exponent 2 | EUR;€;Euro;European Euro;978;Cent;2 3 | USD;$;US Dollar;United States Dollar;840;Cent;2 4 | CAD;$;Canadian Dollar;Canadian Dollar;124;Cent;2 5 | AUD;$;Australian Dollar;Australian Dollar;036;Cent;2 6 | GBP;£;British Pound;Great Britain Pound;826;Penny;2 7 | ILS;₪;Shekel;Israeli New Shekel;376;Agorat;2 8 | INR;₹;Rupee;Indian Rupee;356;Paise;2 9 | QAR;﷼;Riyal;Katar Riyal;356;Dirham;2 10 | SAR;﷼;Riyal;Saudi Riyal;682;Halala;2 11 | JPY;¥;Yen;Japanese Yen;392;Sen;2 12 | CNY;¥;Yuan;Chinese Yuan Renminbi;156;Jiao;1 13 | SGD;S$;Singapore Dollar;Singapore Dollar;702;Cent;2 -------------------------------------------------------------------------------- /db/data/sap.common-Currencies.texts.csv: -------------------------------------------------------------------------------- 1 | code;locale;name;descr 2 | EUR;de;Euro;European Euro 3 | USD;de;US-Dollar;United States Dollar 4 | CAD;de;Kanadischer Dollar;Kanadischer Dollar 5 | AUD;de;Australischer Dollar;Australischer Dollar 6 | GBP;de;Pfund;Britische Pfund 7 | ILS;de;Schekel;Israelische Schekel 8 | EUR;fr;euro;de la Zone euro 9 | USD;fr;dollar;dollar des États-Unis 10 | CAD;fr;dollar canadien;dollar canadien 11 | AUD;fr;dollar australien;dollar australien 12 | GBP;fr;livre sterling;pound sterling 13 | ILS;fr;Shekel;shekel israelien 14 | EUR;en;euro;euro 15 | USD;en;dollar;US dollar 16 | CAD;en;canadien dollar;canadien dollar 17 | AUD;en;australien dollar;australien dollar 18 | GBP;en;pound sterling;pound sterling 19 | ILS;en;Shekel;shekel -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-Airline.csv: -------------------------------------------------------------------------------- 1 | AirlineID;Name;CurrencyCode_code;AirlinePicURL;VIPCustomerBookings 2 | GA;Green Albatros;CAD;https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Green-Albatross-logo.png;4 3 | FA;Fly Africa;SAR;https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Fly-Africa-logo.png;4 4 | EA;European Airlines;EUR;https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/European-Airlines-logo.png;4 5 | OC;Oceania;USD;https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Oceania-logo.png;4 6 | SW;Sunset Wings;USD;https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Sunset-Wings-logo.png;4 -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-Airport.csv: -------------------------------------------------------------------------------- 1 | AirportID;Name;City;CountryCode_code 2 | FRA;Frankfurt Airport;Frankfurt/Main;DE 3 | HAM;Hamburg Airport;Hamburg;DE 4 | MUC;Munich Airport;Munich;DE 5 | SXF;Berlin Schönefeld Airport;Berlin;DE 6 | THF;Berlin Tempelhof Airport;Berlin;DE 7 | TXL;Berlin Tegel Airport;Berlin;DE 8 | CDG;Charles de Gaulle Airport;Paris;FR 9 | ORY;Orly Airport;Paris;FR 10 | VIE;Vienna International Airport;Vienna;AT 11 | ZRH;Zürich Airport;Zurich;CH 12 | RTM;Rotterdam The Hague Airport;Rotterdam;NL 13 | FCO;Leonardo da Vinci–Fiumicino Airport;Rome;IT 14 | VCE;Venice Marco Polo Airport;Venice;IT 15 | LCY;London City Airport;London;UK 16 | LGW;Gatwick Airport;London;UK 17 | LHR;Heathrow Airport;London;UK 18 | MAD;Adolfo Suárez Madrid–Barajas Airport;Madrid;ES 19 | VKO;Vnukovo International Airport;Moscow;RU 20 | SVO;Sheremetyevo International Airport;Moscow;RU 21 | JFK;John F. Kennedy International Airport;New York City, New York;US 22 | BNA;Nashville International Airport;Nashville, Tennessee;US 23 | BOS;Logan International Airport;Boston, Massachusetts;US 24 | ELP;El Paso International Airport;El Paso, Texas;US 25 | DEN;Denver International Airport;Denver, Colorado;US 26 | HOU;William P. Hobby Airport;Houston, Texas;US 27 | LAS;McCarran International Airport;Las Vegas, Nevada;US 28 | LAX;Los Angeles International Airport;Los Angeles, California;US 29 | MCI;Kansas City International Airport;Kansas City, Missouri;US 30 | MIA;Miami International Airport;Miami, Florida;US 31 | SFO;San Francisco International Airport;San Francisco, California;US 32 | EWR;Newark Liberty International Airport;Newark, New Jersey;US 33 | YOW;Ottawa Macdonald–Cartier Int. Airport;Ottawa, Ontario;CA 34 | ACA;General Juan N. Álvarez Int. Airport;Acapulco, Guerrero;MX 35 | GIG;Rio de Janeiro–Galeão Int. Airport;Rio de Janeiro;BR 36 | HAV;José Martí International Airport;Havana;CU 37 | ASP;Alice Springs Airport;Alice Springs, Northern Territory;AU 38 | ACE;Lanzarote Airport;Lanzarote, Canary Islands;ES 39 | HRE;Harare International Airport;Harare;ZW 40 | GCJ;Grand Central Airport;Johannesburg;SA 41 | NRT;Narita International Airport;Tokyo, Honshu;JP 42 | ITM;Osaka International Airport;Osaka, Honshu;JP 43 | KIX;Kansai International Airport;Osaka, Honshu;JP 44 | HIJ;Hiroshima Airport;Hiroshima, Honshu;JP 45 | SIN;Singapore Changi Airport;Singapore;SG 46 | KUL;Kuala Lumpur International Airport;Kuala Lumpur;MY 47 | HKG;Hong Kong International Airport;Hongkong;CN 48 | BKK;Suvarnabhumi Airport;Bangkok;TH -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-BookingStatus.csv: -------------------------------------------------------------------------------- 1 | code;name 2 | N;New 3 | X;Canceled 4 | B;Booked -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-BookingStatus.texts.csv: -------------------------------------------------------------------------------- 1 | code;locale;name 2 | N;de;Neu 3 | B;de;Bestätigt 4 | X;de;Storniert 5 | N;fr;Nouveau 6 | B;fr;Réservé 7 | X;fr;Annulé 8 | N;it;Nuova 9 | B;it;Prenotato 10 | X;it;Annullato 11 | N;en;New 12 | B;en;Accepted 13 | X;en;Cancelled 14 | -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-Flight.csv: -------------------------------------------------------------------------------- 1 | AirlineID;ConnectionID;FlightDate;Price;CurrencyCode_code;PlaneType;MaximumSeats;OccupiedSeats 2 | EA;0400;2021-08-07;4724;USD;747-400;385;319 3 | EA;0400;2022-06-04;2742;USD;747-400;385;196 4 | EA;0401;2021-08-06;2476;USD;747-400;385;173 5 | EA;0401;2022-06-03;4352;USD;A380-800;475;370 6 | EA;0402;2021-08-02;2498;USD;A380-800;475;213 7 | EA;0402;2022-05-30;3232;USD;747-400;385;231 8 | EA;0403;2021-08-02;4247;USD;A340-600;330;250 9 | EA;0403;2022-05-30;3016;USD;747-400;385;215 10 | FA;0788;2021-08-07;8227;USD;767-200;260;234 11 | FA;0788;2022-06-04;8622;USD;A340-600;330;306 12 | FA;0789;2021-08-06;4270;USD;747-400;385;196 13 | FA;0789;2022-06-03;7004;USD;A340-600;330;264 14 | GA;0015;2021-08-06;2051;USD;A380-800;475;270 15 | GA;0015;2022-06-03;2051;USD;747-400;385;219 16 | GA;0017;2021-08-04;326;USD;A320-200;130;92 17 | GA;0017;2022-06-01;289;USD;A321-200;150;96 18 | GA;0018;2021-08-05;3398;USD;767-200;260;226 19 | GA;0018;2022-06-02;2887;USD;A340-600;330;254 20 | GA;0322;2021-08-08;753;USD;737-800;140;68 21 | GA;0322;2022-06-05;943;USD;737-800;140;86 22 | GA;2678;2021-08-07;355;USD;A319-100;120;91 23 | GA;2678;2022-06-04;208;USD;A320-200;130;58 24 | OC;0407;2021-08-06;4033;USD;767-200;260;127 25 | OC;0407;2022-06-03;4630;USD;747-400;385;219 26 | OC;0408;2021-08-07;6959;USD;A340-600;330;267 27 | OC;0408;2022-06-04;3833;USD;767-200;260;119 28 | SW;0001;2021-08-04;5526;USD;767-200;260;119 29 | SW;0001;2022-06-01;10035;USD;767-200;260;210 30 | SW;0002;2021-08-05;5434;USD;A340-600;330;148 31 | SW;0002;2022-06-02;7933;USD;767-200;260;174 32 | SW;0011;2021-08-05;4178;USD;A340-600;330;277 33 | SW;0011;2022-06-02;3092;USD;A380-800;475;313 34 | SW;0012;2021-08-07;4745;USD;A380-800;475;437 35 | SW;0012;2022-06-04;4894;USD;747-400;385;361 36 | SW;0058;2021-08-02;8369;USD;767-200;260;236 37 | SW;0058;2022-05-30;4996;USD;747-400;385;231 38 | SW;0059;2021-08-03;5353;USD;767-200;260;166 39 | SW;0059;2022-05-31;8109;USD;A340-600;330;293 40 | SW;1537;2021-08-06;1157;USD;A319-100;120;88 41 | SW;1537;2022-06-03;807;USD;A319-100;120;63 -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-FlightConnection.csv: -------------------------------------------------------------------------------- 1 | AirlineID;ConnectionID;DepartureAirport_AirportID;DestinationAirport_AirportID;DepartureTime;ArrivalTime;Distance;DistanceUnit 2 | SW;0001;SFO;SIN;01:15:00;11:50:00;13523;KM 3 | SW;0002;SIN;SFO;06:30:00;09:15:00;13523;KM 4 | SW;0011;NRT;SIN;14:55:00;20:50:00;5363;KM 5 | SW;0012;SIN;NRT;09:53:00;17:54:00;5363;KM 6 | SW;0058;SFO;FRA;13:45:00;09:55:00;9608;KM 7 | SW;0059;FRA;SFO;13:55:00;16:30:00;9608;KM 8 | SW;1537;EWR;MIA;21:56:00;12:47:00;1752;KM 9 | GA;0322;MIA;EWR;20:17:00;23:19:00;1752;KM 10 | GA;0017;MIA;HAV;07:19:00;08:03:00;520;KM 11 | GA;2678;HAV;MIA;06:15:00;10:30:00;520;KM 12 | GA;0015;JFK;SFO;07:13:00;10:04:00;4156;KM 13 | GA;0018;SFO;JFK;06:40:00;15:06:00;4156;KM 14 | EA;0400;FRA;JFK;10:10:00;11:34:00;6162;KM 15 | EA;0401;JFK;FRA;18:30:00;07:45:00;6162;KM 16 | EA;0402;FRA;EWR;13:30:00;15:35:00;6217;KM 17 | EA;0403;EWR;FRA;18:09:00;07:30:00;6217;KM 18 | OC;0407;NRT;FRA;13:23:00;15:56:00;9379;KM 19 | OC;0408;FRA;NRT;20:25:00;15:40:00;9379;KM 20 | FA;0788;VCE;NRT;13:25:00;10:13:00;9595;KM 21 | FA;0789;NRT;VCE;14:26:00;21:31:00;9595;KM -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-Supplement.csv: -------------------------------------------------------------------------------- 1 | SupplementID;Price;Type_code;Description;CurrencyCode_code 2 | BV-0001;2.30;BV;Hot Chocolate;EUR 3 | BV-0002;7.50;BV;Alcohol free Champagne;EUR 4 | BV-0003;3.50;BV;Coke;EUR 5 | BV-0004;3.50;BV;Orange Lemonade;EUR 6 | BV-0005;3.50;BV;Apple Juice;EUR 7 | BV-0006;3.50;BV;Pear Juice;EUR 8 | BV-0007;3.50;BV;Mango Juice;EUR 9 | BV-0008;3.50;BV;Lemon Lemonade;EUR 10 | BV-0009;4.50;BV;Tomato Juice;EUR 11 | ML-0001;3.00;ML;Black Forest Cake;EUR 12 | ML-0002;2.00;ML;Chocolate Cake;EUR 13 | ML-0003;1.50;ML;Apple Pie;EUR 14 | ML-0004;1.50;ML;Pear Pie;EUR 15 | ML-0005;8.00;ML;Nice Salad;EUR 16 | ML-0006;9.00;ML;Paris Salad;EUR 17 | ML-0007;12.00;ML;Hamburg Salad with Eggs;EUR 18 | ML-0008;25.00;ML;Quail with French Salad and Black Forest Cake;EUR 19 | ML-0009;13.00;ML;Duck on Lettuce;EUR 20 | ML-0010;5.00;ML;Carpaccio;EUR 21 | ML-0011;7.00;ML;Seasonal Salad;EUR 22 | ML-0012;16.00;ML;Hamburg Salad with Fresh Shrimps;EUR 23 | ML-0013;17.00;ML;Quail;EUR 24 | ML-0014;14.00;ML;Wiener Schnitzel;EUR 25 | ML-0015;13.00;ML;Pork Schnitzel;EUR 26 | ML-0016;14.00;ML;Schnitzel with Pepper Sauce;EUR 27 | ML-0017;11.00;ML;Chicken and French Fries;EUR 28 | ML-0018;12.00;ML;Turkey Steak;EUR 29 | ML-0019;15.00;ML;Bavarian Duck;EUR 30 | ML-0020;14.00;ML;Knuckle of Pork;EUR 31 | ML-0021;22.00;ML;Fillet of Beef;EUR 32 | ML-0022;21.00;ML;Trout Au Bleu;EUR 33 | ML-0023;20.00;ML;Trout Meuniere;EUR 34 | ML-0024;17.00;ML;Monkfish;EUR 35 | ML-0025;12.00;ML;Sole;EUR 36 | ML-0026;6.00;ML;Mini Fried Sole;EUR 37 | ML-0027;14.00;ML;Salmon in a Bearnaise Sauce;EUR 38 | ML-0028;15.00;ML;Salmon Lasagne;EUR 39 | ML-0029;3.00;ML;Chocolate Ice Cream;EUR 40 | ML-0030;2.50;ML;Vanilla Ice Cream;EUR 41 | ML-0031;4.50;ML;Vanilla Ice Cream with Hot Cherries;EUR 42 | ML-0032;4.50;ML;Vanilla Ice Cream with Hot Raspberries;EUR 43 | ML-0033;4.00;ML;Apple Strudel;EUR 44 | ML-0034;4.00;ML;Raspberry Sorbet;EUR 45 | ML-0035;4.00;ML;Strawberry Sorbet;EUR 46 | LU-0001;40.00;LU;Extra baggage 5 kgs;EUR 47 | LU-0002;15.00;LU;Luggage transfer from airport to hotel;EUR 48 | LU-0003;75.00;LU;Luggage pickup from home and return;EUR 49 | LU-0004;80.00;LU;Bulky goods like sports equipment;EUR -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-Supplement.texts.csv: -------------------------------------------------------------------------------- 1 | SupplementID;locale;Description 2 | BV-0001;de;Heiße Schokolade 3 | BV-0002;de;Alkoholfreier Champagner 4 | BV-0003;de;Cola 5 | BV-0004;de;Orangenlimonade 6 | BV-0005;de;Apfelsaft 7 | BV-0006;de;Birnensaft 8 | BV-0007;de;Mango-Saft 9 | BV-0008;de;Zitronenlimonade 10 | BV-0009;de;Tomatensaft 11 | ML-0001;de;Schwarzwälder Kirschtorte 12 | ML-0002;de;Schokoladenkuchen 13 | ML-0003;de;Apfelkuchen 14 | ML-0004;de;Birnenkuchen 15 | ML-0005;de;Schöner Salat 16 | ML-0006;de;Pariser Salat 17 | ML-0007;de;Hamburger Salat mit Eiern 18 | ML-0008;de;Wachtel mit französischem Salat und Schwarzwälder Kirschtorte 19 | ML-0009;de;Ente auf Salat 20 | ML-0010;de;Carpaccio 21 | ML-0011;de;Saisonaler Salat 22 | ML-0012;de;Hamburger Salat mit frischen Shrimps 23 | ML-0013;de;Wachtel 24 | ML-0014;de;Wiener Schnitzel 25 | ML-0015;de;Schweineschnitzel 26 | ML-0016;de;Schnitzel mit Pfeffersoße 27 | ML-0017;de;Hähnchen und Pommes frites 28 | ML-0018;de;Putenschnitzel 29 | ML-0019;de;Bayerische Ente 30 | ML-0020;de;Schweinshaxe 31 | ML-0021;de;Rinderfilet 32 | ML-0022;de;Forelle Au Bleu 33 | ML-0023;de;Forelle Meuniere 34 | ML-0024;de;Seeteufel 35 | ML-0025;de;Seezunge 36 | ML-0026;de;Mini gebratene Seezunge 37 | ML-0027;de;Lachs in Sauce Béarnaise 38 | ML-0028;de;Lachs-Lasagne 39 | ML-0029;de;Schokoladeneis 40 | ML-0030;de;Vanilleeis 41 | ML-0031;de;Vanilleeis mit heißen Kirschen 42 | ML-0032;de;Vanilleeis mit heißen Himbeeren 43 | ML-0033;de;Apfelstrudel 44 | ML-0034;de;Himbeersorbet 45 | ML-0035;de;Erdbeer-Sorbet 46 | LU-0001;de;Extra-Gepäck 5 kg 47 | LU-0002;de;Gepäcktransport vom Flughafen zum Hotel 48 | LU-0003;de;Gepäcktransport von zu Hause und zurück 49 | LU-0004;de;Sperrige Güter wie Sportgeräte 50 | BV-0010;de;Spaßbrühe 51 | ML-0036;de;Döner mit alles 52 | LU-0005;de;Kleine Handtasche 53 | EX-0001;de;Besondere Wünsche 54 | EX-0003;de;Flugzeugmodell 55 | EX-0004;de;Beisring 56 | LU-0006;de;Alufolie 57 | LU-0007;de;Behälter 58 | BV-0001;en;Hot Chocolate 59 | BV-0002;en;Non-alcoholic champagne 60 | BV-0003;en;Cola 61 | BV-0004;en;Orange Lemonade 62 | BV-0005;en;Apple Juice 63 | BV-0006;en;Pear Juice 64 | BV-0007;en;Mango Juice 65 | BV-0008;en;Lemon Lilmonade 66 | BV-0009;en;Tomato Juice 67 | ML-0001;en;Black Forest Cherry Torte 68 | ML-0002;en;Chocolate Cake 69 | ML-0003;en;Apple Pie 70 | ML-0004;en;Pear Cake 71 | ML-0005;en;Beautiful salad 72 | ML-0006;en;Parisian salad 73 | ML-0007;en;Hamburg salad with eggs 74 | ML-0008;en;Guard with French salad and black forests cherry peat 75 | ML-0009;en;Duke with salad 76 | ML-0010;en;Carpaccio 77 | ML-0011;en;Seasonal salad 78 | ML-0012;en;Hamburg salad with fresh shrimps 79 | ML-0013;en;Guard 80 | ML-0014;en;Wiener Schnitzel 81 | ML-0015;en;Pork schnitzel 82 | ML-0016;en;Sweet schnitzel with pepper sauce 83 | ML-0017;en;Chicken and French fries 84 | ML-0018;en;Turkey schnitzel 85 | ML-0019;en;Bavarian duck 86 | ML-0020;en;Pork Hood 87 | ML-0021;en;Fillet of beef 88 | ML-0022;en;Trout Au Bleu 89 | ML-0023;en;Trout Meuniere 90 | ML-0024;en;Far Fur 91 | ML-0025;en;Sole 92 | ML-0026;en;Mini fried sole 93 | ML-0027;en;Salmon in Béarnaise sauce 94 | ML-0028;en;Salmon lasagna 95 | ML-0029;en;Chocolate Ice Cream 96 | ML-0030;en;Vanilla Ice Cream 97 | ML-0031;en;Vanilla rice with hot cherries 98 | ML-0032;en;Vanilla rice with hot raspberries 99 | ML-0033;en;Apple strudel 100 | ML-0034;en;Raspberry Sorbet 101 | ML-0035;en;Strawberry Sorbet 102 | LU-0001;en;Extra luggage 5 kg 103 | LU-0002;en;Baggage transport from the airport to the hotel 104 | LU-0003;en;Baggage transport from home and back 105 | LU-0004;en;Blocked goods such as sports appliances 106 | BV-0010;en;Fun Broth 107 | ML-0036;en;Döner with everything 108 | LU-0005;en;Small purse 109 | EX-0001;en;Special Requirements 110 | EX-0003;en;Arrival Time 111 | EX-0004;en;Beisring 112 | LU-0006;en;Alu Foil 113 | LU-0007;en;Container 114 | BV-0001;fr;Chocolat chaud 115 | BV-0002;fr;Champagne sans alcool 116 | BV-0003;fr;Cola 117 | BV-0004;fr;Orangenlimonade 118 | BV-0005;fr;Jus de pomme 119 | BV-0006;fr;Jus de poire 120 | BV-0007;fr;Jus de Mangog 121 | BV-0008;fr;citron limonade 122 | BV-0009;fr;Jus de tomate 123 | ML-0001;fr;Église noire 124 | ML-0002;fr;Cuisine de chocolat 125 | ML-0003;fr;Cannes à pommes 126 | ML-0004;fr;Bouchon de poison 127 | ML-0005;fr;Belle salade 128 | ML-0006;fr;Salat de Paris 129 | ML-0007;fr;Salat de Hambourg avec des œufs 130 | ML-0008;fr;Corps avec sel français et tiroir noir 131 | ML-0009;fr;Entre sur sel 132 | ML-0010;fr;Carlocio 133 | ML-0011;fr;Salat saisonnier 134 | ML-0012;fr;Salat de Hambourg avec des shrimps frais 135 | ML-0013;fr;Caisse à claire-voie 136 | ML-0014;fr;Wiener Schnitzel 137 | ML-0015;fr;Indice de porc 138 | ML-0016;fr;Coupe avec poignée 139 | ML-0017;fr;Hâteaux et pommes frites 140 | ML-0018;fr;Section de puce 141 | ML-0019;fr;Ent. Bavière 142 | ML-0020;fr;Tiroirs de porc 143 | ML-0021;fr;Filet bovin 144 | ML-0022;fr;Trout Au Bleu 145 | ML-0023;fr;Trout Meuniere 146 | ML-0024;fr;Ampoule de mer 147 | ML-0025;fr;Sole 148 | ML-0026;fr;Mini fried sole 149 | ML-0027;fr;saumon en sauce Béarnaise 150 | ML-0028;fr;Lasz du saumon 151 | ML-0029;fr;Crise du chocolat 152 | ML-0030;fr;Vanilie 153 | ML-0031;fr;Vanillez avec cerises 154 | ML-0032;fr;Vanillez avec des framboises baptisées 155 | ML-0033;fr;Structure de pommes 156 | ML-0034;fr;Trait de framboise 157 | ML-0035;fr;Sorbet de Fraise 158 | LU-0001;fr;Bagage supplémentaire 5 kg 159 | LU-0002;fr;Transport de bagages de l'aéroport à l'hôtel 160 | LU-0003;fr;Transport de bagages d'un domicile à l'autre et retour 161 | LU-0004;fr;Marchandises volumineuses telles que les appareils sportifs 162 | BV-0010;fr;Équipement de spectacle 163 | ML-0036;fr;Döner avec tout 164 | LU-0005;fr;Petite sac à main 165 | EX-0001;fr;Vos souhaits particuliers 166 | EX-0003;fr;Heure d'arrivée 167 | EX-0004;fr;Beisring 168 | LU-0006;fr;Feuille d'aluminium 169 | LU-0007;fr;Conteneur -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-SupplementType.csv: -------------------------------------------------------------------------------- 1 | code;name 2 | BV;Beverage 3 | ML;Meal 4 | LU;Luggage 5 | EX;Extra -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-TravelAgency.csv: -------------------------------------------------------------------------------- 1 | AgencyID;Name;Street;PostalCode;City;CountryCode_code;PhoneNumber;EMailAddress;WebAddress 2 | 070001;Sunshine Travel;134 West Street;54323;Rochester;US;+1 901-632-5620;info@sunshine-travel.sap;http://www.sunshine-travel.sap 3 | 070002;Fly High;Berliner Allee 11;40880;Duesseldorf;DE;+49 2102 69555;info@flyhigh.sap;http://www.flyhigh.sap 4 | 070003;Happy Hopping;Calvinstr. 36;13467;Berlin;DE;+49 30-8853-0;info@haphop.sap;http://www.haphop.sap 5 | 070004;Pink Panther;Auf der Schanz 54;65936;Frankfurt;DE;+49 69-467653-0;info@pinkpanther.sap;http://www.pinkpanther.sap 6 | 070005;Your Choice;Gustav-Jung-Str. 425;90455;Nuernberg;DE;+49 9256-4548-0;info@yc.sap;http://www.yc.sap 7 | 070006;Bella Italia;Via Marconi 123;00139;Roma;IT;+39 6 893546721;info@tours.it/Adventure/;http://www.tours.it/Adventure/ 8 | 070007;Hot Socks Travel;224 Balnagask Rd;8053;Sydney;AU;+61 2 2004 5000;info@hst.co.au;http://www.hst.co.au 9 | 070008;Burns Nuclear;14 Science Park Drive;118228;Singapore;SG;+65 777-5566;info@burns-burns-burns.sg;http://www.burns-burns-burns.sg 10 | 070009;Honauer Reisen GmbH;Baumgarten 8;4212;Neumarkt;AT;+43 7941 8903;info@honauer.at;http://www.honauer.at 11 | 070010;Travel from Walldorf;Altonaer Str. 24;10557;Berlin;DE;+49 30-622860;info@travel-from-walldorf;http://www.travel-from-walldorf 12 | 070011;Voyager Enterprises;Gustavslundsvaegen 151;70563;Stockholm;SE;+46 8/ 587 70000;info@starfleet.ufp;http://www.starfleet.ufp 13 | 070012;Ben McCloskey Ltd.;74 Court Oak Rd;B17 9TN;Birmingham;GB;+44 121 365-2251;info@ben-mcCloskey.co.uk;http://www.ben-mcCloskey.co.uk 14 | 070013;Pillepalle Trips;Gorki Park 4;8008;Zuerich;CH;+41 1 345-5321;info@pi-pa-tri.sap;http://www.pi-pa-tri.sap 15 | 070014;Kangeroos;Lancaster drive 435;20001;London;GB;+44 171-2937638;info@hopp.sap;http://www.hopp.sap 16 | 070015;Bavarian Castle;Pilnizerstr. 241;01069;Dresden;DE;+49 98-32832732;info@neu.schwanstein.sap;http://www.neu.schwanstein.sap 17 | 070016;Ali's Bazar;45, Mac Arthur Boulevard;19113;Boston;US;+1 508-692-5200;info@ali.sap;http://www.ali.sap 18 | 070017;Super Agency;50 Cranworth St;G12 8AG;Glasgow;GB;+44 141 711-5643;info@super.sap;http://www.super.sap 19 | 070018;Wang Chong;Gagarine Park;150021;Moscow;RU;+7 3287-213321;info@wang.chong.sap;http://www.wang.chong.sap 20 | 070019;Around the World;An der Breiten Wiese 122;30625;Hannover;DE;+49 511-347589-0;info@atw.sap;http://www.atw.sap 21 | 070020;No Return;Wahnheider Str. 57;51105;Koeln;DE;+49 221-5689-100;info@bye-bye.sap;http://www.bye-bye.sap 22 | 070021;Special Agency Peru;Triberger Str. 42;70569;Stuttgart;DE;+49 711-7100;info@sap.com;http://www.sap.com 23 | 070022;Caribian Dreams;Deichstrasse 45;26721;Emden;DE;+49 2670-8560-0;info@cuba-libre.sap;http://www.cuba-libre.sap 24 | 070023;Asia By Plane;6-9 Iidabashi 7-chome;102-0072;Tokyo;JP;+81 3-3239-3501;info@asia-by-plane.co.jp;http://www.asia-by-plane.co.jp 25 | 070024;Everywhere;Regensburger Platz 23;81679;Muenchen;DE;+49 89-2499239;info@everywhere.sap;http://www.everywhere.sap 26 | 070025;Happy Holiday;Rastenburger Str. 12;28779;Bremen;DE;+49 3266-288817;info@haphol.sap;http://www.haphol.sap 27 | 070026;No Name;Schwalbenweg 43;52078;Aachen;DE;+49 241-77729;info@nn.sap;http://www.nn.sap 28 | 070027;Fly Low;Chemnitzer Str. 42;01187;Dresden;DE;+49 351-5423-00;info@fly-low.sap;http://www.fly-low.sap 29 | 070028;Aussie Travel;Queens Road;M8 7RYP;Manchester;GB;+44 161 2052000;info@down-under.sap;http://www.down-under.sap 30 | 070029;Up 'n' Away;Nackenbergerstr. 92;30625;Hannover;DE;+49 511 403266-0;info@una.sap;http://www.una.sap 31 | 070030;Trans World Travel;100 Industrial Drive;60804;Chicago;US;+1 708-454-8723;info@twt.sap;http://www.twt.sap 32 | 070031;Bright Side of Life;340 State Street;30432;San Francisco;US;+1 415-454-9877;info@ruebennase.sap;http://www.ruebennase.sap 33 | 070032;Sunny, Sunny, Sunny;1300 State Street;19003;Philadelphia;US;+1 215-090-7659;info@s3.sap;http://www.s3.sap 34 | 070033;Fly & Smile;Zeppelinstr. 17;60318;Frankfurt;DE;+49 69-99-0;info@fly-and-smile.sap;http://www.fly-and-smile.sap 35 | 070034;Supercheap;1400, Washington Circle;30439;Los Angeles;US;+1 251-369-2510;info@supercheap.sap;http://www.supercheap.sap 36 | 070035;Hitchhiker;21 Rue de Moselle;92132;Issy-les-Moulineaux;FR;+33 1-405-555-888;info@42.sap;http://www.42.sap 37 | 070036;Fly Now, Pay Later;100 Madison;11012;New York;US;+1 512 343-8543;info@fn-pl.sap;http://www.fn-pl.sap 38 | 070037;Real Weird Vacation;949 5th Street;V6T 1Z4;Vancouver;CA;+1 604 827-8024;info@reweva.sap;http://www.reweva.sap 39 | 070038;Cap Travels Ltd.;10 Mandela St;2128;Johannesburg;ZA;+27 11 886-8981;info@cap-travels.co.za;http://www.cap-travels.co.za 40 | 070039;Rainy, Stormy, Cloudy;Lindenstr. 462;70563;Stuttgart;DE;+49 711-7992-00;info@windy.sap/rsc/;http://www.windy.sap/rsc/ 41 | 070040;Women only;Kirchstr. 53;55124;Mainz;DE;+49 6131-543-00;info@women-only.sap;http://www.women-only.sap 42 | 070041;Maxitrip;Flugfeld 17;65128;Wiesbaden;DE;+49 611-55 66 77;info@maxitrip.sap;http://www.maxitrip.sap 43 | 070042;The Ultimate Answer;Manchester Rd 20;AB1 1SA;Avon;GB;+44 934-66799;info@thulan.sap;http://www.thulan.sap 44 | 070043;Intertravel;Michigan Ave;60154;Chicago;US;+1 788 798-6555;info@intertravel.sap;http://www.intertravel.sap 45 | 070044;Ultimate Goal;300 Peach tree street Sou;01069;Atlanta;US;+1 874-654-6686;info@ultimate-goal.sap;http://www.ultimate-goal.sap 46 | 070045;Submit and Return;20890 East Central Ave;30987;Palo Alto;US;+1 652 645-5236;info@sar.sap;http://www.sar.sap 47 | 070046;Hendrik's;1200 Industrial Drive;60153;Chicago;US;+1 08-924-9884;info@essen.sap/150596;http://www.essen.sap/150596 48 | 070047;All British Air Planes;224 Tomato Lane;08965;Vineland;US;+44 609-896-Moore;info@abap.sap;http://www.abap.sap 49 | 070048;Rocky Horror Tours;789 Santa Monica Blvd.;08934;Santa Monica;US;+1 64351-6455-654;info@frank.furter.sap;http://www.frank.furter.sap 50 | 070049;Miles and More;777 Arlington Blvd.;46515;Elkhart;US;+1 646 867-6888;info@mam.sap;http://www.mam.sap 51 | 070050;Not Only By Bike;Saalburgstr. 765;60385;Frankfurt;DE;+49 69 465789-0;info@nobb.sap;http://www.nobb.sap -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-TravelStatus.csv: -------------------------------------------------------------------------------- 1 | code;name;criticality;fieldControl;createDeleteHidden 2 | O;Open;2;7;0 3 | A;Accepted;3;1;1 4 | X;Canceled;0;7;1 -------------------------------------------------------------------------------- /db/data/sap.fe.cap.travel-TravelStatus.texts.csv: -------------------------------------------------------------------------------- 1 | code;locale;name 2 | O;en;Open 3 | A;en;Accepted 4 | X;en;Canceled 5 | O;de;Offen 6 | A;de;Genehmigt 7 | X;de;Abgelehnt 8 | O;fr;Ouverte 9 | A;fr;Acceptée 10 | X;fr;Rejetée 11 | O;it;Apri 12 | A;it;Accettata 13 | X;it;Rifiutata -------------------------------------------------------------------------------- /db/master-data.cds: -------------------------------------------------------------------------------- 1 | using { Currency, Country, custom.managed, sap } from './common'; 2 | namespace sap.fe.cap.travel; 3 | 4 | aspect MasterData {} 5 | 6 | entity Airline : MasterData { 7 | key AirlineID : String(3); 8 | Name : String(40); 9 | CurrencyCode : Currency; 10 | AirlinePicURL : String @UI : {IsImageURL : true}; 11 | }; 12 | 13 | entity Airport : MasterData { 14 | key AirportID : String(3); 15 | Name : String(40); 16 | City : String(40); 17 | CountryCode : Country; 18 | }; 19 | 20 | 21 | entity Supplement : managed, MasterData { 22 | key SupplementID : String(10); 23 | Price : Decimal(16, 3); 24 | Type : Association to SupplementType; 25 | Description : localized String(1024); 26 | CurrencyCode : Currency; 27 | }; 28 | 29 | entity Flight : MasterData { 30 | // TODO: 31 | // when cuid is added, the to_Airline & to_Connection can be made managed association, 32 | // furthermore the AirlineID and ConnectionID can be removed, 33 | // they will be replaced by the generate FKs for to_Airline & to_Connection 34 | key AirlineID : String(3); 35 | key FlightDate : Date; 36 | key ConnectionID : String(4); 37 | 38 | Price : Decimal(16, 3); 39 | CurrencyCode : Currency; 40 | PlaneType : String(10); 41 | MaximumSeats : Integer; 42 | OccupiedSeats : Integer; 43 | 44 | to_Airline : Association to Airline on to_Airline.AirlineID = AirlineID; 45 | to_Connection : Association to FlightConnection on to_Connection.AirlineID = AirlineID 46 | and to_Connection.ConnectionID = ConnectionID; 47 | }; 48 | 49 | entity FlightConnection : MasterData { 50 | // TODO: 51 | // once the TODO in Flight is done, similar change can be applied here 52 | // to_Airline can be managed association and AirlineID can be removed 53 | // and will be replaced with the generated FK 54 | key ConnectionID : String(4); 55 | key AirlineID : String(3); 56 | DepartureAirport : Association to Airport; 57 | DestinationAirport : Association to Airport; 58 | DepartureTime : Time; 59 | ArrivalTime : Time; 60 | Distance : Integer; 61 | DistanceUnit : String(3); 62 | 63 | to_Airline : Association to Airline 64 | on to_Airline.AirlineID = AirlineID; 65 | }; 66 | 67 | // showcasing unique constrains ?? 68 | // @assert.unique.email: [EMailAddress] 69 | entity Passenger : managed, MasterData { 70 | key CustomerID : String(6); 71 | FirstName : String(40); 72 | LastName : String(40); 73 | Title : String(10); 74 | Street : String(60); 75 | PostalCode : String(10); 76 | City : String(40); 77 | CountryCode : Country; 78 | PhoneNumber : String(30); 79 | EMailAddress : String(256); 80 | }; 81 | 82 | entity TravelAgency : MasterData { 83 | key AgencyID : String(6); 84 | Name : String(80); 85 | Street : String(60); 86 | PostalCode : String(10); 87 | City : String(40); 88 | CountryCode : Country; 89 | PhoneNumber : String(30); 90 | EMailAddress : String(256); 91 | WebAddress : String(256); 92 | }; 93 | 94 | 95 | // 96 | // Code Lists 97 | // 98 | 99 | entity SupplementType : sap.common.CodeList { 100 | key code : String enum { 101 | Beverage = 'BV'; 102 | Meal = 'ML'; 103 | Luggage = 'LU'; 104 | Extra = 'EX'; 105 | }; 106 | } 107 | -------------------------------------------------------------------------------- /db/schema.cds: -------------------------------------------------------------------------------- 1 | using { Currency, custom.managed, sap.common.CodeList } from './common'; 2 | using { 3 | sap.fe.cap.travel.Airline, 4 | sap.fe.cap.travel.Passenger, 5 | sap.fe.cap.travel.TravelAgency, 6 | sap.fe.cap.travel.Supplement, 7 | sap.fe.cap.travel.Flight 8 | } from './master-data'; 9 | 10 | namespace sap.fe.cap.travel; 11 | 12 | entity Travel : managed { 13 | key TravelUUID : UUID; 14 | TravelID : Integer @readonly default 0; 15 | BeginDate : Date; 16 | EndDate : Date; 17 | BookingFee : Decimal(16, 3); 18 | TotalPrice : Decimal(16, 3) @readonly; 19 | CurrencyCode : Currency; 20 | Description : String(1024); 21 | TravelStatus : Association to TravelStatus @readonly; 22 | GoGreen : Boolean default false; 23 | GreenFee : Decimal(16, 3) @Core.Computed @readonly; 24 | TreesPlanted : Integer @Core.Computed @readonly; 25 | to_Agency : Association to TravelAgency; 26 | to_Customer : Association to Passenger; 27 | to_Booking : Composition of many Booking on to_Booking.to_Travel = $self; 28 | }; 29 | entity Booking : managed { 30 | key BookingUUID : UUID; 31 | BookingID : Integer @Core.Computed; 32 | BookingDate : Date; 33 | ConnectionID : String(4); 34 | FlightDate : Date; 35 | FlightPrice : Decimal(16, 3); 36 | CurrencyCode : Currency; 37 | BookingStatus : Association to BookingStatus; 38 | to_BookSupplement : Composition of many BookingSupplement on to_BookSupplement.to_Booking = $self; 39 | to_Carrier : Association to Airline; 40 | to_Customer : Association to Passenger; 41 | to_Travel : Association to Travel; 42 | to_Flight : Association to Flight on to_Flight.AirlineID = to_Carrier.AirlineID 43 | and to_Flight.FlightDate = FlightDate 44 | and to_Flight.ConnectionID = ConnectionID; 45 | }; 46 | 47 | entity BookingSupplement : managed { 48 | key BookSupplUUID : UUID; 49 | BookingSupplementID : Integer @Core.Computed; 50 | Price : Decimal(16, 3); 51 | CurrencyCode : Currency; 52 | to_Booking : Association to Booking; 53 | to_Travel : Association to Travel; 54 | to_Supplement : Association to Supplement; 55 | }; 56 | 57 | // 58 | // Code Lists 59 | // 60 | 61 | entity BookingStatus : CodeList { 62 | key code : String enum { 63 | New = 'N'; 64 | Booked = 'B'; 65 | Canceled = 'X'; 66 | }; 67 | }; 68 | 69 | entity TravelStatus : CodeList { 70 | key code : String enum { 71 | Open = 'O'; 72 | Accepted = 'A'; 73 | Canceled = 'X'; 74 | } default 'O'; //> will be used for foreign keys as well 75 | criticality : Integer; // 2: yellow colour, 3: green colour, 0: unknown 76 | fieldControl: Integer @odata.Type:'Edm.Byte'; // 1: #ReadOnly, 7: #Mandatory 77 | createDeleteHidden: Boolean; 78 | } 79 | 80 | //TechEd extensions 81 | 82 | //Exercise 5: Bookings table micro chart 83 | extend Booking with { 84 | criticality : Integer default 0 @Core.Computed @UI.Hidden; 85 | BookedFlights: Integer @Core.Computed; 86 | EligibleForPrime: Integer @Core.Computed @UI.Hidden; 87 | }; 88 | 89 | extend Airline with { 90 | VIPCustomerBookings : Integer @UI.Hidden; 91 | }; 92 | 93 | //Exercise 6: Using the Chart Building Block 94 | 95 | -------------------------------------------------------------------------------- /exercises/ex0/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started - Setting up your Development Environment 2 | 3 | Welcome to the workshop **Accelerate the Development of SAP Fiori Apps Using SAP Fiori Elements**.\ 4 | This workshop will guide you step-by-step through the process of creating a **Fiori elements floorplans for OData V4** app.\ 5 | Based on a **SAP Cloud Application Programming Model** service equipped with basic UI annotations, you will learn how to generate and enhance a 6 | **List Report/Object Page** Fiori elements application with the help of **SAP Fiori tools** and the **SAP Fiori Elements Flexible Programming Model**. 7 | 8 | ## Setting up Business Application Studio in an SAP BTP Trial Account 9 | 10 | If you don't have an **SAP BTP account** already, you can create your own [here](https://www.sap.com/products/cloud-platform/get-started.html). 11 | 12 | ### New Trial Users 13 | 14 | After having registered your new user, start your trial via [this link](https://account.hanatrial.ondemand.com/register)\ 15 | At first time log in, you'll be asked to select your preferred region. 16 | This will start the set-up of your account. 17 | 18 | ![Trial Setup](../ex0/images/00_00_0010.png) 19 | 20 | Your subaccount, org and space is created automatically, along with the necessary role configurations and subscriptions.\ 21 | When done, the subaccount overview page is shown. 22 | 23 | ### Existing Trial Users 24 | 25 | Depending on when you created the SAP BTP Trial account, the subscription to **SAP Business Application Studio** might already be added in the subaccount.\ 26 | If you are not subscribed to SAP Business Application Studio, follow [this step](https://developers.sap.com/tutorials/appstudio-onboarding.html#005500bf-bf4a-44cb-bbef-f2221d061b5c) to add the subscription to a subaccount. 27 | 28 | 29 | ### Accessing SAP Business Application Studio 30 | 31 | Click on the Quick Tool Access icon **SAP Business Application Studio**. 32 | 33 | ![Welcome SAP BTP Trial](../ex0/images/00_00_0020.png) 34 | 35 | ## Creating the Development Space 36 | 37 | Click on the button **Create Dev Space**. 38 | 39 | ![Create Dev Space](../ex0/images/00_00_0030.png) 40 | 41 | Enter a name for your development space and select application profile **Full Stack Cloud Application**. 42 | 43 | ![Select Profile](../ex0/images/00_00_0040.png) 44 | 45 | In the lower right corner of the page press button **Create Dev Space**. 46 | 47 | ![confirm](../ex0/images/00_00_0050.png)
48 | 49 | Once your development space has status running, click on the development space name to open it. 50 | 51 | ![enter dev space](../ex0/images/00_00_0060.png) 52 | 53 | ## Getting the Sample Scenario 54 | 55 | Get the GitHub repository clone Url from the repository's [landing page](https://github.com/SAP-samples/teched2021-IIS160).\ 56 | Click on button **Code** (1), then click icon (2). 57 | 58 | ![copy link](../ex0/images/00_00_0070.png) 59 | 60 | In the dev space, you will see a **Welcome Page**.\ 61 | Click on tile **Clone from Git**. 62 | 63 | ![Click on link "Clone from Git"](../ex0/images/click-clone-from-git.png) 64 | 65 | Alternatively, you can go via menu **View->Find Command...** and search for command **git clone**. 66 | 67 | ![command git clone](../ex0/images/cloneCommand.png) 68 | 69 | Paste the repository link into the input field. 70 | 71 | ```abap 72 | https://github.com/SAP-samples/teched2021-IIS160.git 73 | ``` 74 | 75 | ![Enter the github repository URL](../ex0/images/enter-github-repository.png) 76 | 77 | If asked, select repository location. 78 | 79 | ![Select repository location](../ex0/images/select_repo_location.png) 80 | 81 | When the cloning is finished, open the cloned repository. 82 | 83 | ![Open cloned repository](../ex0/images/open_clone_repo.png) 84 | 85 | Alternatively, you can open a workspace via the file menu. 86 | 87 | ![open workspace](../ex0/images/00_00_0065.png) 88 | 89 | Select folder **teched2021-IIS160** and click **Open**. This will restart SAP Business Application Studio. 90 | 91 | ![select ws folder](../ex0/images/00_00_0066.png) 92 | 93 | In the **Explorer** pane on the left side of SAP Business Application Studio, you can see the workspace content. 94 | 95 | ![select ws folder](../ex0/images/wsopen.png) 96 | 97 | ## Summary 98 | 99 | With the setup procedure done, you now have completed: 100 | 101 | - Setting up the SAP BTP trial account 102 | - Access to SAP Business Application Studio 103 | - Creation of your development space 104 | - Setting up the sample OData V4 service in SAP Business Application Studio 105 | 106 | Continue to - [Exercise 1 - Generating an SAP Fiori Elements App](../ex1/README.md) 107 | -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0010.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0020.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0030.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0040.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0050.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0060.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0065.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0066.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0070.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0080.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0081.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0110.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0120.png -------------------------------------------------------------------------------- /exercises/ex0/images/00_00_0130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/00_00_0130.png -------------------------------------------------------------------------------- /exercises/ex0/images/click-clone-from-git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/click-clone-from-git.png -------------------------------------------------------------------------------- /exercises/ex0/images/cloneCommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/cloneCommand.png -------------------------------------------------------------------------------- /exercises/ex0/images/enter-github-repository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/enter-github-repository.png -------------------------------------------------------------------------------- /exercises/ex0/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex0/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex0/images/img_039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/img_039.png -------------------------------------------------------------------------------- /exercises/ex0/images/img_039a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/img_039a.png -------------------------------------------------------------------------------- /exercises/ex0/images/img_040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/img_040.png -------------------------------------------------------------------------------- /exercises/ex0/images/img_041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/img_041.png -------------------------------------------------------------------------------- /exercises/ex0/images/open_clone_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/open_clone_repo.png -------------------------------------------------------------------------------- /exercises/ex0/images/select_repo_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/select_repo_location.png -------------------------------------------------------------------------------- /exercises/ex0/images/wsopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex0/images/wsopen.png -------------------------------------------------------------------------------- /exercises/ex1/README.md: -------------------------------------------------------------------------------- 1 | # Exercise 1 - Generating an SAP Fiori Elements App 2 | 3 | In this exercise, you will create a **SAP Fiori elements** application of type **List Report Object Page**, based on the given 4 | SAP Cloud Application Programming Model sample service. 5 | For this you will make usage of the **SAP Fiori tools Application Generator**. 6 | 7 | ## Exercise 1.1 Using the SAP Fiori tools Application Generator 8 | 9 | In the **SAP Business Application Studio**, the **Welcome page** is shown. 10 | 11 | \(1\) Click **Start from template** . 12 | 13 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_0.png "mydevspace - SAP Business Application Studio - Google Chrome") 14 | 15 | If the Welcome page is not shown, you can start the **Template Wizard** via the Command Palette 16 | (menu View -\>Find Command... or ctrl+shift+p(Win)/cmd+shift+p(Mac))\ 17 | In the search field, type **Open Template Wizard**.\ 18 | Choose the corresponding list entry. 19 | 20 | \(2\) Click on tile **SAP Fiori application**. 21 | 22 | \(3\) Click ![icon](images/fieldicon.png). 23 | 24 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_001.png "mydevspace - SAP Business Application Studio - Google Chrome") 25 | 26 | \(4\) In the wizard step **Floorplan Selection**, click on the tile **List Report Object Page**. 27 | 28 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_002.png "mydevspace - SAP Business Application Studio - Google Chrome") 29 | 30 | \(5\) Click ![icon](images/fieldicon00.png). 31 | 32 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_003.png "mydevspace - SAP Business Application Studio - Google Chrome") 33 | 34 | In the wizard step **Datasource and Service Selection**, click \(6\). 35 | 36 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_004.png "mydevspace - SAP Business Application Studio - Google Chrome") 37 | 38 | \(7\) Select **Use a Local CAP Project**. 39 | 40 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_005.png "mydevspace - SAP Business Application Studio - Google Chrome") 41 | 42 | \(8\) Click the **Browse for folder** icon to select the **CAP project folder path**. 43 | 44 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_006.png "mydevspace - SAP Business Application Studio - Google Chrome") 45 | 46 | \(9\) Select folder **teched2021-IIS160** and click ![Open](images/fieldicon04.png). 47 | 48 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_007.png "mydevspace - SAP Business Application Studio - Google Chrome") 49 | 50 | \(10\) Click ![icon](images/fieldicon05.png) to open the **OData service** drop-down. 51 | 52 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_008.png "mydevspace - SAP Business Application Studio - Google Chrome") 53 | 54 | \(11\) Select ![option](images/fieldicon06.png). 55 | 56 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_009.png "mydevspace - SAP Business Application Studio - Google Chrome") 57 | 58 | \(12\) Click ![icon](images/fieldicon07.png). 59 | 60 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_010.png "mydevspace - SAP Business Application Studio - Google Chrome") 61 | 62 | \(13\) In the wizard step **Entity Selection**, open drop-down **Main Entity**, and select **Travel**.\ 63 | The data of the main entity is shown in the list report and the first object page. 64 | 65 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_011.png "mydevspace - SAP Business Application Studio - Google Chrome") 66 | 67 | \(14\) Open drop-down **Navigation Entity**, and select **to_Booking**.\ 68 | This will add an additional routing target allowing navigation from the object page to an additional sub object page. 69 | 70 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_012.png "mydevspace - SAP Business Application Studio - Google Chrome") 71 | 72 | Set the option **Automatically add table columns** to **No**.\ 73 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_0121.png "mydevspace - SAP Business Application Studio - Google Chrome") 74 | 75 | \(15\) Click ![icon](images/fieldicon10.png). 76 | 77 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_013.png "mydevspace - SAP Business Application Studio - Google Chrome") 78 | 79 | In the wizard step **Project Attributes**, add the following attributes to the application project: 80 | 81 | - **Module Name**: managetravels\ 82 | (module name has to match exactly for some of the subsequent exercises to work properly) 83 | 84 | - **Application Title**: Manage Travels\ 85 | (or a title by your choice) 86 | 87 | - **Application Namespace**: sap.fe.cap\ 88 | (namespace has to match exactly for some of the subsequent exercises to work properly) 89 | 90 | - **Minimum SAPUI5 version**: Stick to the latest version available (preselected). 91 | 92 | \(16\) Select **Yes** in order to configure advanced options. 93 | 94 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_014.png "mydevspace - SAP Business Application Studio - Google Chrome") 95 | 96 | \(17\) Click to open the drop-down **UI5 theme**. 97 | 98 | \(18\) Select **SAP Horizon (experimental)**. 99 | 100 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_015.png "mydevspace - SAP Business Application Studio - Google Chrome") 101 | 102 | Please note that the screenshots in the subsequent exercises show the UI with the SAP Quartz theme.\ 103 | The SAP Horizon theme was published after the creation of the exercises. 104 | 105 | \(19\) Select **Yes** in order to skip generation of an additional associated annotation.cds file.\ 106 | The sample service already provides a basic set of UI annotations with file app/layouts.cds. 107 | 108 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_016.png "mydevspace - SAP Business Application Studio - Google Chrome") 109 | 110 | \(20\) Click ![image](images/fieldicon13.png).\ 111 | This will start the app generation.\ 112 | When finished, you can review the generated artifacts in the **Explorer** pane of SAP Business Application Studio.\ 113 | The generated artifacts are located in folder **app/managetravels** (the path reflects the module name you have entered during app generation). 114 | 115 | ## Exercise 1.2 Adding an App Preview Script 116 | 117 | Besides the common way of starting a CAP service via **cds watch**, another convenient way to start the service and app at the same time is to add an additional **npm script** to file **package.json** of the root folder.\ 118 | In **exercises 4 ff.**, we will extend the app based on **xml fragments**. We need to make sure that the browser view cache is deactivated during testing our development, so that changes applied to the xml fragments get properly updated when refreshing the UI.\ 119 | (21) Open file **package.json** of the root folder.\ 120 | (22) Scroll to section **scripts**, put a comma at the end of the last script line, and press enter to make a new line.\ 121 | Enter the following script: 122 | 123 | ```js 124 | "watch-managetravels": "PORT=4004 cds watch --open managetravels/webapp/index.html?sap-ui-xx-viewCache=false#fe-lrop-v4" 125 | ``` 126 | 127 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_017.png "mydevspace - SAP Business Application Studio - Google Chrome") 128 | 129 | Please note the additional parameter **sap-ui-xx-viewCache=false** added to the app start Url. 130 | 131 | If a popup appears asking for project migration, please decline with **Don't ask again** (a fix for this is in the making). 132 | ## Exercise 1.3 Starting the App 133 | 134 | After completing these steps you will have started and tested the generated app. 135 | 136 | Instead of using **cds watch** in the terminal in order to start the service, we will use the new script we have added to file **package.json** for that purpose.\ 137 | If **cds watch** is already running in a terminal, please end it by pressing keyboard keys **control+c**, otherwise the default port 4004 will already be in use by the existing server process. 138 | 139 | \(23\) Click **Preview Application** on tab **Application information** that is automatically displayed after app generation.\ 140 | If the tab is closed, you can open it again via menu command **View->Find Command...->Fiori: Open Application Info**. 141 | 142 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_018.png "mydevspace - SAP Business Application Studio - Google Chrome") 143 | 144 | Alternatively, you can select **Preview Application** via the context menu of the app folder. 145 | 146 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_0181.png "mydevspace - SAP Business Application Studio - Google Chrome") 147 | 148 | This opens a drop-down at the top offering all **cds run** and **cds watch** based scripts maintained in the scripts section of file **package.json**. 149 | 150 | \(24\) Select the start script **watch-managetravels** we have added to the package.json. 151 | 152 | ![Manage Travels - Google Chrome](images/img_019.png "Manage Travels - Google Chrome") 153 | 154 | This runs the service in an Application Modeler terminal session and automatically starts the Fiori application. 155 | 156 | ![Manage Travels - Google Chrome](images/img_0191.png "Manage Travels - Google Chrome") 157 | 158 | - If the preview doesn't get opened in a new tab, check if the pop-ub blocker of your browser prevented that.\ 159 | Make sure you enable pop-ups 160 | for SAP Business Application Studio, then restart with **Preview Application** as described above. 161 | 162 | ![Manage Travels - Google Chrome](images/img_021.png "Manage Travels - Google Chrome") 163 | 164 | **Please note that there are currently some minor issues with app preview with a fix in the making:** 165 | 166 | - App preview sometimes stops with an error in the Application Modeler terminal pane.\ 167 | In that case, close the terminal pane and restart with **Preview Application** as described above 168 | - Restarting app preview sometimes leads to an error due to a blocked preview port.\ 169 | In that case, just increase the port in the npm script you have added, 170 | for example change **PORT=4004** to **PORT=4005**, then restart app preview 171 | 172 | ```js 173 | "watch-managetravels": "PORT=4005 cds watch --open managetravels/webapp/index.html?sap-ui-xx-viewCache=false#fe-lrop-v4" 174 | ``` 175 | 176 | \(25\) On the List Report page of the Fiori application, click ![icon](images/fieldicon16.png) to trigger selection. 177 | 178 | ![Manage Travels - Google Chrome](images/img_020.png "Manage Travels - Google Chrome") 179 | 180 | Make yourself familiar with the application: 181 | 182 | - on the List Report, use the **selection fields** to set a filter 183 | - Click on a list item to **navigate** to the object page 184 | - Click on **Edit** on the object page to create a **draft version** of the displayed object and to set the UI to edit mode.\ 185 | (Please note that travels with status **Accepted** will only allow editing of field **Description**) 186 | - Change the value of an input field to automatically **update the draft** when input field focus is changed, or when you navigate back to the List Report. 187 | - The draft is saved back to the active instance by pressing **Save** on the bottom of the Object Page. 188 | 189 | ## Summary 190 | 191 | You've now successfully generated and tested the Fiori elements app. 192 | 193 | Continue to - [Exercise 2 - Configuring the UI by Using the SAP Fiori tools Page Map](../ex2/README.md) 194 | -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon05.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon06.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon07.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon08.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon09.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon10.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon11.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon12.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon13.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon14.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon15.png -------------------------------------------------------------------------------- /exercises/ex1/images/fieldicon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/fieldicon16.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_001.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_009.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_010.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_011.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_012.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_0121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_0121.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_013.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_014.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_015.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_016.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_017.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_018.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_0181.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_0181.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_019.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_0191.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_0191.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_020.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_021.png -------------------------------------------------------------------------------- /exercises/ex1/images/img_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex1/images/img_022.png -------------------------------------------------------------------------------- /exercises/ex2/README.md: -------------------------------------------------------------------------------- 1 | # Exercise 2 Enhancing the UI by Using the SAP Fiori tools Page Map 2 | 3 | In this exercise, you will learn how to use some of the new configuration features provided by the **SAP Fiori tools Page Map**. 4 | ## Exercise 2.1 Enable Data Load During Start of the App 5 | 6 | When starting the app, per default the user has to press the 7 | **Go** button in order to trigger the selection.\ 8 | This allows defining filters before the query is executed.\ 9 | The default behaviour can be changed in a way that selection is immediately 10 | triggered when the app is started. 11 | 12 | In the SAP Business Application Studio, open the SAP Fiori Page Map by clicking on tile (1) of the **Application Info** tab. 13 | 14 | ![tools - SAP Business Application Studio - Google Chrome](images/img_0.png "tools - SAP Business Application Studio - Google Chrome") 15 | 16 | Alternatively, you can open the Page Map via context menu on project's folder **app** or via **View -> Command Palette...Fiori: Show Page Map**). 17 | 18 | \(2\) On the tile **List Report**, click icon **Configure Page**. 19 | 20 | ![tools - SAP Business Application Studio - Google Chrome](images/img_000.png "tools - SAP Business Application Studio - Google Chrome") 21 | 22 | \(3\) In the page editor, click ![](images/fieldicon01.png). 23 | 24 | \(4\) In the drop-down box **Initial Load**, select **Enabled**.\ 25 | The configuration is automatically saved. 26 | 27 | ![tools - SAP Business Application Studio - Google Chrome](images/img_001.png "tools - SAP Business Application Studio - Google Chrome") 28 | 29 | Switch to the preview browser tab. After a couple of seconds, the app should reload automatically.\ 30 | Data will now be immediately loaded in the List Report page when starting the app. 31 | 32 | \(5\) In the List Report, we can see that in case of small screen resolution, column **Travel Status** is currently only shown when toolbar button **Show Details** is pressed.\ 33 | As status information is considered as being important, let us change its sequence in the next exercise. 34 | 35 | ![Manage Travels - Google Chrome](images/img_002.png "Manage Travels - Google Chrome") 36 | 37 | ## Exercise 2.2 Change Sequence of a Table Column in the List Report 38 | 39 | \(6\) Switch back to the Page Editor and expand section **Columns**. 40 | 41 | Drag column **Travel Status** \(7\) and drop it in between columns **Travel** and **Agency** \(8\). 42 | 43 | ![tools - SAP Business Application Studio - Google Chrome](images/img_003.png "tools - SAP Business Application Studio - Google Chrome") 44 | 45 | ## Exercise 2.3 Adding Criticality to a Table Column 46 | 47 | It is considered as best practice providing a criticality color for status information displayed on the UI.\ 48 | For column **Travel Status**, we will now configure this via the Page Map.\ 49 | The service model's entity **Travel** already contains property **criticality** in file **db/schema.cds**: 50 | 51 | ![tools - SAP Business Application Studio - Google Chrome](images/img_0035.png "tools - SAP Business Application Studio - Google Chrome") 52 | 53 | \(9\) Select column **Travel Status** in the page editor's section **Columns**. 54 | 55 | \(10\) In the properties pane, expand drop-down box **Criticality**. 56 | 57 | ![tools - SAP Business Application Studio - Google Chrome](images/img_004.png "tools - SAP Business Application Studio - Google Chrome") 58 | 59 | \(11\) Select list entry **TravelStatus/criticality**. 60 | 61 | ![tools - SAP Business Application Studio - Google Chrome](images/fieldicon07.png "tools - SAP Business Application Studio - Google Chrome"). 62 | 63 | ## Exercise 2.4 Adding Text and Text Arrangement to a Field 64 | In the List Report, we can see that column **Agency** is only showing the identifier, not the agency name. 65 | 66 | ![tools - SAP Business Application Studio - Google Chrome](images/img_0045.png "tools - SAP Business Application Studio - Google Chrome") 67 | 68 | We will now configure the **display text** and the **text arrangement** in order to show the agency name along with the identifier. 69 | 70 | \(12\) Select column **Agency** in the page editor's section **Columns**. 71 | 72 | \(13\) In pane **Properties**, scroll to property **Text** and expand the drop-down box. 73 | 74 | \(14\) Select entry ![](images/fieldicon10.png). 75 | 76 | ![tools - SAP Business Application Studio - Google Chrome](images/img_005.png "tools - SAP Business Application Studio - Google Chrome") 77 | 78 | An additional property **Text Arrangement** is now shown in the properties pane.\ 79 | \(15\) Expand the drop-down box. 80 | 81 | \(16\) Make sure that list entry **Text First** is selected.\ 82 | With it, column **Agency** will show values in format ** ()**. 83 | 84 | ![tools - SAP Business Application Studio - Google Chrome](images/img_006.png "tools - SAP Business Application Studio - Google Chrome") 85 | 86 | Switch to the preview browser tab. 87 | 88 | \(17\) Column **Travel Status** is now being displayed with criticality coloring at its new position in the table. 89 | 90 | \(18\) Column **Agency** is now displayed with the configured text arrangement. 91 | 92 | ![Manage Travels - Google Chrome](images/img_007.png "Manage Travels - Google Chrome") 93 | 94 | ## Exercise 2.5 Change Form Field Order and Display Type 95 | 96 | On the object page, in field group **Travel** we want to exchange the positioning of fields **Customer** and **Agency**.\ 97 | For Field **Description**, in order to have long descriptions properly displayed in edit mode, we will switch the field's display type by using the SAP Fiori tools Page Map. 98 | 99 | ![tools - SAP Business Application Studio - Google Chrome](images/TextArea.png "tools - SAP Business Application Studio - Google Chrome") 100 | 101 | \(19\) In the Page Editor, click on ![](images/fieldicon13.png). 102 | 103 | ![tools - SAP Business Application Studio - Google Chrome](images/img_008.png "tools - SAP Business Application Studio - Google Chrome") 104 | 105 | \(20\) On the **Object Page** tile, click icon **Configure Page** ![](images/fieldicon14.png). 106 | 107 | ![tools - SAP Business Application Studio - Google Chrome](images/img_009.png "tools - SAP Business Application Studio - Google Chrome") 108 | 109 | \(21\) Expand section **Sections->Travel->Subsections->Travel->Form->Fields**. 110 | 111 | \(22\) At field **Agency**, click icon **Move Up** ![](images/fieldicon16.png) in order to exchange its position with field **Customer**.\ 112 | Alternatively, you can also use **drag & drop**. 113 | 114 | ![tools - SAP Business Application Studio - Google Chrome](images/img_010.png "tools - SAP Business Application Studio - Google Chrome") 115 | 116 | Now let's switch the display type for field **Description**. 117 | 118 | \(23\) Select field **Description**. 119 | 120 | \(24\) In pane **Properties**, open the drop-down box for property **Display Type** and select list entry **Text Area**. 121 | 122 | ![tools - SAP Business Application Studio - Google Chrome](images/img_011.png "tools - SAP Business Application Studio - Google Chrome") 123 | 124 | Switch to the preview browser tab.\ 125 | \(25\) On the object page, click button ![icon](images/fieldicon19.png). 126 | 127 | ![Travel - Google Chrome](images/img_012.png "Travel - Google Chrome") 128 | 129 | 130 | \(26\) Field **Description** is now shown as a **text area**, and the position of fields **Agency** and **Customer** has changed. 131 | 132 | ![Travel - Google Chrome](images/img_013.png "Travel - Google Chrome") 133 | 134 | Click button ![image](images/fieldicon30.png) in order to switch back to display mode. 135 | 136 | ## Exercise 2.6 Adding a new Field Group 137 | 138 | For a **sustainability initiative**, the travel service has been extended to provide some additional fields for the new green flight offering which are not yet shown in the UI.\ 139 | In this exercise, we will add a new **subsection Sustainability** to section **Travel** of the object page by using the **Add Form Section** functionality of the **SAP Fiori tools Page Map**. 140 | 141 | \(27\) In the SAP Fiori tools Page Map's **page editor** for the object page, 142 | expand **Page Layout - Sections - Travel - Subsections** and click icon **Add Sections** ![icon](images/fieldicon20.png). 143 | 144 | ![tools - SAP Business Application Studio - Google Chrome](images/img_014.png "tools - SAP Business Application Studio - Google Chrome") 145 | 146 | \(28\) Select list entry ![](images/fieldicon21.png). This opens up a **dialog**. 147 | 148 | ![tools - SAP Business Application Studio - Google Chrome](images/img_015.png "tools - SAP Business Application Studio - Google Chrome") 149 | 150 | 151 | \(29\) In the dialog, enter label **Sustainability** and click icon ![](images/fieldicon22.png) in order to substitute it with an **i18n text reference**. 152 | 153 | ![tools - SAP Business Application Studio - Google Chrome](images/img_016.png "tools - SAP Business Application Studio - Google Chrome") 154 | 155 | 156 | \(30\) Confirm text key substitution by clicking ![](images/fieldicon23.png). 157 | 158 | ![tools - SAP Business Application Studio - Google Chrome](images/img_017.png "tools - SAP Business Application Studio - Google Chrome") 159 | 160 | 161 | \(31\) Click button **Add** to complete the **Add Form Section** dialog. 162 | 163 | ![tools - SAP Business Application Studio - Google Chrome](images/img_018.png "tools - SAP Business Application Studio - Google Chrome") 164 | 165 | 166 | \(32\) Expand the form of the the new subsection **Sustainability** and click icon **Add Fields** ![](images/fieldicon26.png) \(33\) and choose **Add Basic Fields**\(33.a\) from the menu. 167 | 168 | ![tools - SAP Business Application Studio - Google Chrome](images/img_019.png "tools - SAP Business Application Studio - Google Chrome") 169 | 170 | \(34\) In dialog **Add Fields**, expand drop-down box **Fields**. 171 | 172 | \(35\) Select fields **GoGreen, GreenFee and TreesPlanted**. 173 | 174 | ![tools - SAP Business Application Studio - Google Chrome](images/img_020.png "tools - SAP Business Application Studio - Google Chrome") 175 | 176 | \(36\) Click button **Add** to complete the **Add Fields** dialog. 177 | 178 | ![tools - SAP Business Application Studio - Google Chrome](images/img_021.png "tools - SAP Business Application Studio - Google Chrome") 179 | 180 | \(37\) Verify that the fields have been added to the new subsection. 181 | 182 | ![tools - SAP Business Application Studio - Google Chrome](images/img_022.png "tools - SAP Business Application Studio - Google Chrome") 183 | 184 | Switch to the preview browser tab. The new subsection **Sustainability** is shown on the object page.\ 185 | \(38\) Click button ![](images/fieldicon29.png). 186 | 187 | ![Travel - Google Chrome](images/img_023.png "Travel - Google Chrome") 188 | 189 | 190 | \(39\) Select **Trees\-4\-Tickets** check box. 191 | 192 | ![Travel - Google Chrome](images/img_024.png "Travel - Google Chrome") 193 | 194 | \(40\) Click button ![](images/fieldicon30.png). 195 | 196 | ![Travel - Google Chrome](images/img_025.png "Travel - Google Chrome") 197 | 198 | 199 | \(41\) With Trees-4-Tickets selected, fields Green Flight Fee and Trees Planted show calculated values after having saved changes. 200 | 201 | ![Travel - Google Chrome](images/img_026.png "Travel - Google Chrome") 202 | 203 | ## Summary 204 | 205 | By using the SAP Fiori Page Map, you've now configured **initial loading** during app start, changed the **position of a table column and a form field**,\ 206 | added **criticality coloring** to a table column, added **text** and **text arrangement** to the identifier field, and added a **new subsection**‚ to section Travel. 207 | 208 | Continue to - [Exercise 3 - Fine-Tuning the UI](../ex3/README.md) -------------------------------------------------------------------------------- /exercises/ex2/images/TextArea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/TextArea.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon05.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon06.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon07.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon08.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon09.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon10.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon11.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon12.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon13.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon14.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon15.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon16.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon17.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon18.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon19.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon20.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon21.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon22.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon23.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon24.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon25.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon26.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon27.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon28.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon29.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon30.png -------------------------------------------------------------------------------- /exercises/ex2/images/fieldicon_83.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/fieldicon_83.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_000.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_001.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_0035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_0035.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_0045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_0045.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_009.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_010.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_011.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_012.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_013.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_014.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_015.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_016.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_017.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_018.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_019.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_020.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_021.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_022.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_023.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_024.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_025.png -------------------------------------------------------------------------------- /exercises/ex2/images/img_026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex2/images/img_026.png -------------------------------------------------------------------------------- /exercises/ex3/README.md: -------------------------------------------------------------------------------- 1 | # Exercise 3 - Fine-Tuning the UI 2 | 3 | In this exercise we will apply some fine-tuning to the UI in order to achieve a better **user experience**. 4 | 5 | ## Exercise 3.1: Add Table Line Criticality 6 | 7 | In exercise 2.6 we have added an additional **subsection Sustainability** to the object page.\ 8 | By adding a **criticality** annotation to the bookings table, we can **highlight the table lines** when the Trees-4-Tickets checkbox is selected. 9 | 10 | \(1\) Open file **app/layouts.cds** and scroll to section **Exercise 3.1: Add Table Line Criticality**\ 11 | \(2\) Create an empty line below and enter the following code snippet: 12 | 13 | ```js 14 | ![@UI.Criticality]: criticality, 15 | ``` 16 | 17 | Please note the **specific CDS format** of the annotation **![@UI.Criticality]** put in brackets which is required since it is added inline to the **@UI.LineItem** annotation. 18 | 19 | ![tools - SAP Business Application Studio - Google Chrome](images/img_0.png "tools - SAP Business Application Studio - Google Chrome") 20 | 21 | Switch the the preview browser tab and navigate to the object page.\ 22 | \(3\) Click button ![image](images/fieldicon.png). 23 | 24 | ![Travel - Google Chrome](images/img_000.png "Travel - Google Chrome") 25 | 26 | \(4\) Click checkbox **Trees-4-Tickets**. 27 | 28 | ![Travel - Google Chrome](images/img_001.png "Travel - Google Chrome") 29 | 30 | \(5\) Click ![image](images/fieldicon00.png). 31 | 32 | ![Travel - Google Chrome](images/img_002.png "Travel - Google Chrome") 33 | 34 | \(6\) The items of table **Bookings** now show a green color highlight at the beginning of the line. 35 | 36 | ![Travel - Google Chrome](images/img_003.png "Travel - Google Chrome") 37 | 38 | ## Exercise 3.2: Adding a side effect to the Trees-4-Tickets property 39 | 40 | When selecting the Trees-4-Tickets checkbox, the service backend calculates the values for properties **Green Flight Fee**, **Trees Planted**, and **Total Price**.\ 41 | The updated values are currently only shown on the UI after refreshing the UI manually or after having saved the changes.\ 42 | We will therefore add a side effect on property **GoGreen** of entity **Travel** in order to update the values immediately after the checkbox was clicked.\ 43 | Additionally, the side effect will trigger a **refresh to the bookings table** so that the table line highlighting is also immediately visible. 44 | 45 | \(7\) Open file **app/field-control.cds** and scroll to section **Exercise 3.1: Add side effect on GoGreen property**.\ 46 | \(8\) Enter the following code snippet. 47 | 48 | ```js 49 | annotate TravelService.Travel with @Common : {SideEffects : { 50 | $Type : 'Common.SideEffectsType', 51 | SourceProperties : [GoGreen], 52 | TargetProperties : ['TotalPrice', 'GreenFee', 'TreesPlanted'], 53 | TargetEntities : [to_Booking] 54 | }}; 55 | ``` 56 | 57 | ![tools - SAP Business Application Studio - Google Chrome](images/img_004.png "tools - SAP Business Application Studio - Google Chrome") 58 | 59 | In **SourceProperties**, property **GoGreen** defines the trigger of the side effect.\ 60 | In **TargetProperties**, we list all properties that should immediately be refreshed.\ 61 | The property values are defined as Strings in that case, allowing to also define an asterisk '*' which allows refreshing all properties of the entity.\ 62 | In **TargetEntities**, we define association **to_Booking** which will refresh the data shown in table **Bookings**. 63 | 64 | Switch to the preview browser tab. 65 | 66 | \(9\) With the object page in edit mode, select checkbox **Trees\-4\-Tickets**. 67 | 68 | 69 | \(10\) Fields **Green Flight Fee** and **Trees Planted** are immediately updated. 70 | 71 | \(11\) Field **Total Price** is also updated. 72 | 73 | \(12\) Table **Bookings** immediately shows the line color highlighting. 74 | 75 | ![Travel - Google Chrome](images/img_005.png "Travel - Google Chrome") 76 | 77 | ## Exercise 3.3: Adding a Semantic Key 78 | 79 | Per default, in the browser Url a combination of the selected entity item key (TravelUUID in this case) and draft administrative property **IsActiveEntity** is shown.\ 80 | The Url changes when switching from display mode to edit mode, by either referring to the active document \(13\) or the draft document \(14\). 81 | 82 | ![Travel - Google Chrome](images/img_006.png "Travel - Google Chrome") 83 | 84 | ![Travel - Google Chrome](images/img_007.png "Travel - Google Chrome") 85 | 86 | In order to get a stable Url that can be easily shared and which is also slightly better readable, we will define property **TravelID** as the semantic key of entity **Travel**.\ 87 | Furthermore, defining a semantic key additionally displays the corresponding List Report table column values in bold, and for unsaved items, a **draft indicator** is shown. 88 | 89 | Open file **app/Capabilities.cds** (15) and scroll to section **Exercise 3.2: Add Semantic key**. 90 | 91 | (16) Enter the following code snippet: 92 | 93 | ```js 94 | annotate TravelService.Travel with @Common.SemanticKey: [TravelID]; 95 | ``` 96 | 97 | ![tools - SAP Business Application Studio - Google Chrome](images/img_008.png "tools - SAP Business Application Studio - Google Chrome") 98 | 99 | Switch to the preview browser tab and navigate from the list report to the object page. 100 | 101 | \(17\) For the select travel, the semantic key is shown in the browser Url. 102 | 103 | \(18\) Click button ![image](images/fieldicon.png) to switch to edit mode. 104 | 105 | ![Travel - Google Chrome](images/img_009.png "Travel - Google Chrome") 106 | 107 | \(19\) The browser Url stays stable for both display and edit mode. 108 | 109 | ![Travel - Google Chrome](images/img_010.png "Travel - Google Chrome") 110 | 111 | \(20\) Navigate back to the List Report.\ 112 | Column *Travel** now shows values in bold, and the **draft indicator** is shown.\ 113 | ![Travel - Google Chrome](images/img_011.png "Travel - Google Chrome") 114 | 115 | ## Summary 116 | 117 | We have learned about **criticality coloring in table lines**, how to define a **side effect** in order to have dependent data immediately refreshed during editing, and the advantages of using a **semantic key** annotation. 118 | 119 | Continue to - [Exercise 4 - Extending the App with Fiori Elements Building Blocks](../ex4/README.md) -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_15.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_17.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_1700.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_1700.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_2.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_20.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_22.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_25.png -------------------------------------------------------------------------------- /exercises/ex3/images/fieldicon_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/fieldicon_5.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_000.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_001.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_009.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_010.png -------------------------------------------------------------------------------- /exercises/ex3/images/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex3/images/img_011.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon05.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon06.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon07.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon08.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon09.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon10.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon11.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon12.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon13.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon14.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon15.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon16.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon17.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon18.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon19.png -------------------------------------------------------------------------------- /exercises/ex4/images/fieldicon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/fieldicon20.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_000.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_001.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_009.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_010.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_010a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_010a.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_011.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_012.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_013.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_014.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_015.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_016.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_017.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_018.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_019.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_020.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_021.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_022.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_023.png -------------------------------------------------------------------------------- /exercises/ex4/images/img_024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex4/images/img_024.png -------------------------------------------------------------------------------- /exercises/ex5/README.md: -------------------------------------------------------------------------------- 1 | # Exercise 5 - Adding a Micro Chart to the Table Building Block 2 | 3 | In this exercise, we will add a micro chart column to the **table building block**.\ 4 | The micro chart shall show the **Customer VIP Status** per booking, based on all cumulated bookings for the corresponding airline.\ 5 | While the **flexible programming model** offers the means to adding it by using the building block micro chart and a custom column fragment,\ 6 | the table **per standard** supports pure annotation based micro charts columns, which perfectly fits this use case.\ 7 | As a rule of thumb, **leveraging standard functionality** should always be the preferred way of enhancing the UI, using extensions should be\ 8 | the option of choice where the standard doesn't offer a certain functionality.\ 9 | You can find an example implementation for a [custom column](https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/customElements/customElementsOverview/customColumnContent) and the [building block micro chart](https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/buildingBlocks/microchart/microChartDefault) in the [Flexible Programming Model Explorer](https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/overview/introduction). 10 | 11 | ## Exercise 5.1 Add Annotations UI.Chart and UI.DataPoint 12 | 13 | The data required for the micro chart are already provided in the service model in file **db/schema.cds** (1) as an extension to the **Booking** entity (2). 14 | 15 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_0.png "mydevspace - SAP Business Application Studio - Google Chrome") 16 | 17 | The properties are annotated with **@Core.Computed**, which means that the values are calculated in a read handler implementation for entity **Booking** 18 | in file **srv/travel-service.js** (3), section **Exercise 5: Data for Bookings table micro chart** (4). 19 | 20 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_000.png "mydevspace - SAP Business Application Studio - Google Chrome") 21 | 22 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_001.png "mydevspace - SAP Business Application Studio - Google Chrome") 23 | 24 | With the optional property **Criticality**, the coloring of the radial chart is defined.\ 25 | In order to add a micro chart to a table, you have to define an annotation of type **@UI.DataPoint**. Its mandatory properties are **value** and a **target value**.\ 26 | The data point needs to be referenced in the **measure attributes** of annotation **@UI.Chart**.\ 27 | Chart type **#Donut** displays a **radial chart**. Properties **Measures** and **MeasureAttributes** are mandatory. 28 | 29 | \(5\) Open file **app/layouts.cds**. 30 | 31 | Scroll down to section **Exercise 5: Booking entity Chart annotation** and add the following code snippet: 32 | 33 | ```js 34 | annotate TravelService.Booking with @( 35 | UI: { 36 | Chart #RadialCriticalityPath : { 37 | $Type : 'UI.ChartDefinitionType', 38 | Title : 'Customer VIP Status', 39 | Description : 'VIP Customers are Eligible for Lounge Access', 40 | ChartType : #Donut, 41 | Measures : [BookedFlights], 42 | MeasureAttributes : [{ 43 | $Type : 'UI.ChartMeasureAttributeType', 44 | Measure : BookedFlights, 45 | Role : #Axis1, 46 | DataPoint : '@UI.DataPoint#RadialValuePath' 47 | }] 48 | }, 49 | DataPoint #RadialValuePath : { 50 | Value : BookedFlights, 51 | TargetValue : to_Carrier.VIPCustomerBookings, 52 | Criticality : EligibleForPrime 53 | } 54 | } 55 | ); 56 | ``` 57 | 58 | The screenshot shows annotations **@UI.Chart** (6) and **@UI.DataPoint** (7) 59 | 60 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_002.png "mydevspace - SAP Business Application Studio - Google Chrome") 61 | 62 | ## Exercise 5.2 Enhance UI.LineItem Annotation via Code Completion 63 | 64 | With annotation **@UI.Chart** in place, we will now add it to annotation **@UI.LineItem** of entity **Bookings**.\ 65 | For this, we will add a record of type **DataFieldForAnnotation**.\ 66 | In file **app/layouts.cds**, scroll to section **Exercise 5: add chart table column**. 67 | 68 | \(8\) Trigger code completion by pressing ctrl+space and select ![icon](images/fieldicon02.png). 69 | 70 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_003.png "mydevspace - SAP Business Application Studio - Google Chrome") 71 | 72 | The annotation is added along with its basic structural elements.\ 73 | (9) With the cursor inside the quotes ' ' of property **Target**, trigger code completion (ctrl+space) and select ![icon](images/fieldicon03.png). 74 | 75 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_004.png "mydevspace - SAP Business Application Studio - Google Chrome") 76 | . 77 | 78 | Use code completion to add property **Label** and put **Customer VIP Status** inside the quotes. 79 | 80 | (10) Trigger code completion again in order to add inline annotation **![@UI.Importance] : #High**. 81 | 82 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_005.png "mydevspace - SAP Business Application Studio - Google Chrome") 83 | 84 | Annotation **@UI.Importance** makes sure that table columns are always displayed inline in case of small screen sizes. 85 | 86 | The entered code snippet should match the following: 87 | ```js 88 | { 89 | $Type : 'UI.DataFieldForAnnotation', 90 | Target : '@UI.Chart#RadialCriticalityPath', 91 | Label : 'Customer VIP Status', 92 | ![@UI.Importance] : #High, 93 | }, 94 | ``` 95 | 96 | ## Exercise 5.3 Add Header Facet to Booking Supplements Page 97 | 98 | We will now add the same chart as a header facet in sub object page **Booking Supplements**.\ 99 | (11) In file **app/layouts.cds**, scroll to section **Exercise 5: add chart header facet**. 100 | 101 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_006.png "mydevspace - SAP Business Application Studio - Google Chrome") 102 | 103 | You can use code completion to add the following code snippet as shown in the above screenshot: 104 | 105 | ```js 106 | HeaderFacets : [ 107 | { 108 | $Type : 'UI.ReferenceFacet', 109 | Target : '@UI.Chart#RadialCriticalityPath', 110 | Label : 'Customer VIP Status' 111 | }, 112 | ], 113 | ``` 114 | 115 | Switch to the preview browser tab.\ 116 | (12) On the Object Page, the table now shows the micro chart column.\ 117 | (13) Click on a table line in order to navigate to the bookings supplement page. 118 | 119 | ![Travel - Google Chrome](images/img_007.png "Travel - Google Chrome") 120 | 121 | \(14\) The sub object page header now shows the same micro chart. 122 | 123 | ![Bookings - Google Chrome](images/img_008.png "Bookings - Google Chrome") 124 | 125 | ## Summary 126 | 127 | We've now successfully added a **chart annotation** to the service and added a **micro chart column** to the table\ 128 | and a **micro chart header facet** to the sub object page. 129 | 130 | Continue to - [Exercise 6 - Flexible Programming Model:Using the Chart Building Block](../ex6/README.md) -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon05.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon06.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon07.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon08.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon09.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon_16.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon_20.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon_24.png -------------------------------------------------------------------------------- /exercises/ex5/images/fieldicon_26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/fieldicon_26.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_000.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_001.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex5/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex5/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon05.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon06.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon07.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon08.png -------------------------------------------------------------------------------- /exercises/ex6/images/fieldicon09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/fieldicon09.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_000.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_001.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_009.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_010.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_011.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_012.png -------------------------------------------------------------------------------- /exercises/ex6/images/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex6/images/img_013.png -------------------------------------------------------------------------------- /exercises/ex7/README.md: -------------------------------------------------------------------------------- 1 | # Exercise 7 - Flexible Programming Model: Changing the Edit Flow by Implementing a Controller Extension 2 | 3 | In this exercise we will learn how to change the **edit flow** of an app by implementing a [controller extension](https://ui5.sap.com/#/api/sap.fe.core.controllerextensions.EditFlow).\ 4 | In order to promote the new **green flight offering**, we will intercept the **save action** by overriding function **onBeforeSave** of the\ 5 | **edit flow API**, and execute some custom code in order to check whether Trees-4-Tickets has been selected for the travel.\ 6 | Additionally, we will make usage of the **form element building block** in order to display a form in a save dialog. 7 | 8 | ## Exercise 7.1 Move XML Fragment and Controller File to App Folder 9 | 10 | The **xml fragment** containing the dialog definition and the **controller extension file** are provided in the project.\ 11 | We need to move it to the corresponding app's sub folders in order to make usage of them: 12 | 13 | Open project folder **app/test-resources/ext/fragment**.\ 14 | Drag and drop file **Trees4Tickets.fragment.xml** \(1\) to folder **app/managetravels/webapp/ext/fragment** \(2\). 15 | 16 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_0.png "mydevspace - SAP Business Application Studio - Google Chrome") 17 | 18 | The XML fragment defines a dialog containing some UI5 controls and two buttons for saving and canceling.\ 19 | The most interesting part is the **form element building block** used in \(3\) and \(4\). 20 | 21 | - with property **metaPath** pointing to a property of the current binding context, we can show the property as a form field, having the same behaviour as a standard field. 22 | - property **visible** shows and hides the form elements depending on the path value. We are using boolean property **GoGreen** for that purpose, which is set when the checkbox is selected. 23 | 24 | 25 | For the **controller extension**, we will now move the corresponding controller file to the app's sub folder: 26 | 27 | Open project folder **app/test-resources/ext**.\ 28 | Drag and drop file **ObjectPageExtension.controller.js** \(5\) to folder **app/managetravels/webapp/ext** \(6\).\ 29 | Make sure the controller file is dropped to folder **ext**, not to sub folder **fragment** as the XML fragment we moved before. 30 | 31 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_000.png "mydevspace - SAP Business Application Studio - Google Chrome") 32 | 33 | In the controller file, the editFlow API function **onBeforeSave** is implemented \(7\).\ 34 | The **override function** is called when pressing the **Save** button on the object page, allowing to influence the save procedure.\ 35 | For more details about the override function, please refer to the [API reference](https://ui5.sap.com/#/api/sap.fe.core.controllerextensions.EditFlow%23methods/onBeforeSave). 36 | 37 | ## Exercise 7.2 Adding a Controller Extension to the Manifest 38 | 39 | We now need to **register the controller extension** in the **application manifest**.\ 40 | \(8\) Open file **app/managetravels/webapp/manifest.json**.\ 41 | Scroll down to **section models**.\ 42 | **Right above of it**, enter the following snippet : 43 | 44 | ```js 45 | "extends": { 46 | "extensions": { 47 | "sap.ui.controllerExtensions": { 48 | "sap.fe.templates.ObjectPage.ObjectPageController": { 49 | "controllerName": "sap.fe.cap.managetravels.ext.ObjectPageExtension" 50 | } 51 | } 52 | } 53 | }, 54 | ``` 55 | 56 | \(9\) Compare the inserted snippet with the screenshot below. 57 | 58 | ![mydevspace - SAP Business Application Studio - Google Chrome](images/img_002.png "mydevspace - SAP Business Application Studio - Google Chrome") 59 | ## Exercise 7.3 Testing the Controller Extension 60 | 61 | \(10\) Switch to the preview browser tab and click ![image](images/fieldicon01.png). 62 | 63 | ![Travel - Google Chrome](images/img_003.png "Travel - Google Chrome") 64 | 65 | \(11\) Make sure that the Trees-4-Tickets flag is not set in the sustainability field group, then press ![image](images/fieldicon02.png). 66 | 67 | ![Travel - Google Chrome](images/img_004.png "Travel - Google Chrome") 68 | 69 | The dialog is shown.\ 70 | \(12\) Select check box **Trees-4-Tickets**.\ 71 | This triggers an automatic draft save in the background. 72 | 73 | ![Travel - Google Chrome](images/img_005.png "Travel - Google Chrome") 74 | 75 | \(13\) Additional form fields with updated data are shown. 76 | 77 | \(14\) Click ![image](images/fieldicon03.png). 78 | 79 | ![Travel - Google Chrome](images/img_006.png "Travel - Google Chrome") 80 | 81 | \(15\) The object is saved and the UI switches back to display mode. 82 | 83 | ![Travel - Google Chrome](images/img_007.png "Travel - Google Chrome") 84 | 85 | ## Summary 86 | 87 | You've now successfully completed the hands-on workshop. Congratulations! 88 | -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon00.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon01.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon02.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon03.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon04.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon05.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon_59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon_59.png -------------------------------------------------------------------------------- /exercises/ex7/images/fieldicon_62.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/fieldicon_62.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_0.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_000.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_002.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_003.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_004.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_005.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_006.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_007.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_008.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_009.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_010.png -------------------------------------------------------------------------------- /exercises/ex7/images/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/teched2021-IIS160/9cbbdf8a2a0b3a10fd56c8f6c5d8e720ac7e3e02/exercises/ex7/images/img_011.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@capire/sflight", 3 | "version": "1.0.0", 4 | "description": "CAP flight demo scenario", 5 | "repository": "https://github.com/SAP-samples/cap-sflight", 6 | "dependencies": { 7 | "@sap/audit-logging": "^5.5.3", 8 | "@sap/cds": "^6.8.1", 9 | "@sap/xsenv": "^3.2.2", 10 | "@sap/xssec": ">=3.6.0", 11 | "express": "^4.18.1", 12 | "hdb": "^0.18.3", 13 | "passport": ">=0.6.0" 14 | }, 15 | "devDependencies": { 16 | "chai": "^4.3.6", 17 | "chai-as-promised": "^7.1.1", 18 | "chai-subset": "^1.6.0", 19 | "jest": "^27.5.1", 20 | "qunit": "^2.19.1", 21 | "sqlite3": "^5.0.8" 22 | }, 23 | "engines": { 24 | "node": ">=14" 25 | }, 26 | "scripts": { 27 | "start": "cds run", 28 | "test": "jest --runInBand" 29 | }, 30 | "cds": { 31 | "requires": { 32 | "db": { 33 | "kind": "sql" 34 | }, 35 | "uaa": { 36 | "kind": "xsuaa" 37 | }, 38 | "auth": { 39 | "[development]": { 40 | "strategy": "dummy" 41 | } 42 | } 43 | }, 44 | "hana": { 45 | "deploy-format": "hdbtable" 46 | }, 47 | "log": { 48 | "service": true 49 | }, 50 | "features": { 51 | "preserve_computed": true 52 | } 53 | }, 54 | "jest": { 55 | "testEnvironment": "node", 56 | "testTimeout": 20000 57 | }, 58 | "license": "SAP SAMPLE CODE LICENSE", 59 | "private": true 60 | } 61 | -------------------------------------------------------------------------------- /srv/travel-service.cds: -------------------------------------------------------------------------------- 1 | using { sap.fe.cap.travel as my } from '../db/schema'; 2 | 3 | service TravelService @(path:'/processor', requires: 'authenticated-user') { 4 | 5 | @odata.draft.enabled 6 | entity Travel as projection on my.Travel actions { 7 | action createTravelByTemplate() returns Travel; 8 | action rejectTravel(); 9 | action acceptTravel(); 10 | action deductDiscount( percent: Percentage not null ) returns Travel; 11 | }; 12 | 13 | // Ensure all masterdata entities are available to clients 14 | annotate my.MasterData with @cds.autoexpose @readonly; 15 | } 16 | 17 | type Percentage : Integer @assert.range: [1,100]; 18 | -------------------------------------------------------------------------------- /srv/workarounds.js: -------------------------------------------------------------------------------- 1 | // Temporary fix as monky-patch -> will soon go away with upcomming fix to OData library 2 | 3 | const cds = require ('@sap/cds/lib') 4 | 5 | const { init } = cds.ApplicationService.prototype 6 | cds.extend (cds.ApplicationService) .with (class { 7 | 8 | /** 9 | * This experimentally adds support to register standard ES6 class methods 10 | * of subclasses of cds.ApplicationService using "@on/before/after ..." 11 | * pragmas. 12 | */ 13 | init() { 14 | for (let o = this;;) { 15 | o = Reflect.getPrototypeOf(o); if (!o || o === cds.Service.prototype) break 16 | const pds = Object.getOwnPropertyDescriptors (o) 17 | for (let p in pds) { 18 | if (p === 'constructor' || p === 'init') continue 19 | const pragma = /^[^{]+{\s*"@(on|before|after) (\w+)(?: ([\w/]+)(?::(\w+))?)?"/.exec(pds[p].value); if (!pragma) continue 20 | const [, on, event, path, element] = pragma, handler = pds[p].value 21 | this[on] (event, path, 22 | !element ? handler 23 | : on === 'after' ? (_,req) => element in req.data && handler.call(this,_,req) 24 | : (req,next) => element in req.data && handler.call(this,req,next) 25 | ) 26 | // console.debug (`${this.name}.${on} (${event}, ${path}, this.${p})`) 27 | } 28 | } 29 | return init.call (this) 30 | } 31 | }) 32 | 33 | const { error } = cds.Request.prototype 34 | cds.extend (cds.Request) .with (class { 35 | 36 | /** 37 | * This is a temporary fix for req.error() ensuring target element 38 | * reference paths containing UUIDs are rendered correctly when UUIDs have 39 | * been mapped to `Edm.String` as we do in SFlight, due to ABAP-based data. 40 | */ 41 | error (e) { 42 | if (e.target) e.target = e.target.replace (/\((\w+)UUID=([^,)]+)/g, `($1UUID='$2'`) 43 | return error.call (this, ...arguments) 44 | } 45 | 46 | /** 47 | * This experimentally adds a req._target property which can be used as 48 | * arguments to SELECT.from or UPDATE to read the single instance of 49 | * req.target referred to by the incomming request. It also transparently 50 | * points to .drafts persistence, if in a draft scenario. 51 | */ 52 | get _target() { 53 | let {target} = this, [key] = this.params 54 | if (key && this.path.indexOf('/') < 0) { //> .../draftActivate 55 | // deviate to draft? 56 | const {IsActiveEntity} = key 57 | if (IsActiveEntity !== undefined) Object.defineProperty (key,'IsActiveEntity',{value:IsActiveEntity, enumerable:false}) //> skip as key in cqn 58 | if (cds.version < '6.0.0') { 59 | if (IsActiveEntity === 'false') target = target.drafts 60 | } else { 61 | if (IsActiveEntity === false) target = target.drafts 62 | } 63 | // prepare target query 64 | const q = SELECT.one.from(target,key) 65 | const {from:{ref},where} = q.SELECT 66 | if (cds.version < '5.6.0') 67 | ref[ref.length-1] = { id: ref[ref.length-1], where, cardinality:{max:1} } 68 | target = {ref} 69 | } 70 | return super._target = target 71 | } 72 | 73 | }) -------------------------------------------------------------------------------- /test/odata.test.js: -------------------------------------------------------------------------------- 1 | const cds = require('@sap/cds/lib') 2 | const { GET, POST, PATCH, axios, expect } = cds.test(__dirname+'/..') 3 | const EDIT = (url) => POST (url+'/TravelService.draftEdit',{}) 4 | const SAVE = (url) => POST (url+'/TravelService.draftActivate') 5 | axios.defaults.headers['content-type'] = 'application/json;IEEE754Compatible=true' // REVISIT: can be removed when @sap/cds 5.1.5 is released? 6 | 7 | 8 | describe ("Basic Querying", () => { 9 | 10 | it ("should read from row references", async()=>{ 11 | const TravelRef = {ref:[{ 12 | id:'TravelService.Travel', 13 | cardinality:{max:1}, 14 | where:[ {ref:['TravelUUID']},'=',{val:'e87f1e25331411ec959fd79bb4702f0b'} ] 15 | }]} 16 | const travel = await SELECT.from (TravelRef) 17 | expect (travel) .to.exist 18 | expect (travel.TravelID) .to.eql (102) 19 | }) 20 | 21 | }) 22 | 23 | 24 | 25 | describe('Basic OData', () => { 26 | 27 | it('serves $metadata documents in v4', async () => { 28 | const { headers, status, data } = await GET `/processor/$metadata` 29 | expect(status).to.equal(200) 30 | expect(headers).to.contain({ 31 | 'content-type': 'application/xml', 32 | 'odata-version': '4.0', 33 | }) 34 | expect(data).to.contain('') 35 | expect(data).to.contain('') 36 | }) 37 | 38 | it('GET /processor/Travel', async () => { 39 | const { data } = await GET(`/processor/Travel?$filter=TravelUUID eq 'e87f1df9331411ec959fd79bb4702f0b'`) 40 | expect(data.value).to.containSubset([{ 41 | "createdAt": '2021-10-07T10:10:40.000Z', 42 | "createdBy": 'Buchholm', 43 | "LastChangedAt": '2021-10-23T19:59:39.000Z', 44 | "LastChangedBy": 'Gueldenpfennig', 45 | "TravelUUID": 'e87f1df9331411ec959fd79bb4702f0b', 46 | "TravelID": 98, 47 | "BeginDate": '2022-05-30', 48 | "EndDate": '2022-05-30', 49 | "BookingFee": 30, 50 | "TotalPrice": 7310, 51 | "CurrencyCode_code": 'EUR', 52 | "Description": 'Business Trip to Germany', 53 | "TravelStatus_code": 'X', 54 | "GoGreen": false, 55 | "GreenFee": null, 56 | "TreesPlanted": null, 57 | "to_Agency_AgencyID": '070048', 58 | "to_Customer_CustomerID": '000471', 59 | "acceptEnabled": true, 60 | "rejectEnabled": false, 61 | "deductDiscountEnabled": false, 62 | "IsActiveEntity": true, 63 | "HasActiveEntity": false, 64 | "HasDraftEntity": false 65 | }]) 66 | }) 67 | 68 | it('supports $select', async () => { 69 | const { data } = await GET(`/processor/Travel`, { 70 | params: { $select: `TravelID,Description` } 71 | }) 72 | expect(data.value).to.containSubset([ 73 | { TravelID: 98, Description: 'Business Trip to Germany' } 74 | ]) 75 | }) 76 | 77 | it('supports $expand', async () => { 78 | const { data } = await GET(`/processor/Travel`, { 79 | params: { 80 | $select: `TravelID`, 81 | $expand: `to_Agency($select=Name,City)` 82 | } 83 | }) 84 | expect(data.value).to.containSubset([ 85 | { TravelID: 98, to_Agency: {Name: "Rocky Horror Tours", City:'Santa Monica'} }, 86 | ]) 87 | }) 88 | 89 | it('supports $value requests', async () => { 90 | const { data } = await GET `/processor/Travel(TravelUUID='e87f1e25331411ec959fd79bb4702f0b',IsActiveEntity=true)/to_Customer/LastName/$value` 91 | expect(data).to.equal('Delon') 92 | }) 93 | 94 | it('supports $top/$skip paging', async () => { 95 | const { data: p1 } = await GET `/processor/Travel?$select=TravelID,Description&$top=3&$orderby=TravelID` 96 | expect(p1.value).to.containSubset([ 97 | {"Description": "Vacation", "IsActiveEntity": true, "TravelID": 1}, 98 | {"Description": "Vacation to Mars", "IsActiveEntity": true, "TravelID": 2}, 99 | {"Description": "Business Trip to United States", "IsActiveEntity": true, "TravelID": 3}, 100 | ]) 101 | const { data: p2 } = await GET `/processor/Travel?$select=Description&$skip=3&$orderby=TravelID` 102 | expect(p2.value).not.to.containSubset([ 103 | {"Description": "Business Trip for Christine, Pierre", "TravelID": 1}, 104 | {"Description": "Vacation", "TravelID": 2}, 105 | {"Description": "Vacation", "TravelID": 3}, 106 | ]) 107 | }) 108 | 109 | it('new draft has initial key, key is auto incremented upon activation', async () => { 110 | const { data: newDraft } = await POST(`/processor/Travel`, {}) 111 | expect(newDraft).to.contain({ TravelID: 0 }) // initial value: 0 112 | 113 | // patch new draft in order to fill mandatory fields 114 | await PATCH (`/processor/Travel(TravelUUID='${newDraft.TravelUUID}',IsActiveEntity=false)`, { 115 | BeginDate: '2028-04-01', 116 | EndDate: '2028-04-02', 117 | BookingFee: '11', 118 | to_Customer_CustomerID: '000001', 119 | to_Agency_AgencyID: '070001', 120 | CurrencyCode_code: 'USD' 121 | }) 122 | 123 | const { data: newTravel } = await SAVE (`/processor/Travel(TravelUUID='${newDraft.TravelUUID}',IsActiveEntity=false)`) 124 | expect(newTravel).to.contain({ TravelID: 1423, TotalPrice: 11 }) 125 | }) 126 | 127 | it ('re-calculates totals after booking fee changed', async ()=>{ 128 | let Travel1422 = `/processor/Travel(TravelUUID='e89935b2331411ec959fd79bb4702f0b',IsActiveEntity=true)` 129 | let Draft = `/processor/Travel(TravelUUID='e89935b2331411ec959fd79bb4702f0b',IsActiveEntity=false)` 130 | let Booking = `/processor/Booking(BookingUUID='e89935b3331411ec959fd79bb4702f0b',IsActiveEntity=false)` 131 | let Supplement = `/processor/BookingSupplement(BookSupplUUID='e89935b4331411ec959fd79bb4702f0b',IsActiveEntity=false)` 132 | 133 | let { data:draft } = await EDIT (Travel1422) 134 | expect(draft).to.containSubset({ 135 | TotalPrice: 7344, 136 | TravelID: 1422, 137 | }) 138 | 139 | // Ensure it is not in accepted state as that would disallow changing 140 | await POST (Draft +`/TravelService.rejectTravel`) 141 | 142 | // Change the Travel's Booking Fee 143 | await PATCH (Draft, { BookingFee: '120' }) 144 | await expect_totals (7444) 145 | 146 | // Change a Booking's Flight Price 147 | await PATCH (Booking, { FlightPrice: '1657' }) 148 | await expect_totals (5481) 149 | 150 | // Change a Supplements's Price 151 | await PATCH (Supplement, { Price: '220' }) 152 | await expect_totals (5692) 153 | 154 | // Save Draft 155 | await SAVE (Draft) 156 | await expect_totals (5692, 'IsActiveEntity=true') 157 | 158 | async function expect_totals (expected, _active = 'IsActiveEntity=false') { 159 | let { data: { TotalPrice } } = await GET (`/processor/Travel(TravelUUID='e89935b2331411ec959fd79bb4702f0b',${_active})? 160 | $select=TotalPrice 161 | `) 162 | expect(TotalPrice).to.eql(expected) 163 | } 164 | }) 165 | 166 | it('deduct discount multiple times does not end up in error', async () => { 167 | const { data: res1 } = await GET `/processor/Travel(TravelUUID='e87f1e25331411ec959fd79bb4702f0b',IsActiveEntity=true)` 168 | expect(res1).to.contain({ TotalPrice: 8897.8, BookingFee: 50 }) 169 | 170 | const { data: res2 } = await POST( 171 | `/processor/Travel(TravelUUID='e87f1e25331411ec959fd79bb4702f0b',IsActiveEntity=true)/TravelService.deductDiscount`, 172 | { percent: 11 } 173 | ) 174 | expect(res2).to.contain({ TotalPrice: 8892.3, BookingFee: 44.5 }) 175 | 176 | const { data: res3 } = await POST( 177 | `/processor/Travel(TravelUUID='e87f1e25331411ec959fd79bb4702f0b',IsActiveEntity=true)/TravelService.deductDiscount`, 178 | { percent: 11 } 179 | ) 180 | expect(res3).to.contain({ TotalPrice: 8887.405, BookingFee: 39.605 }) 181 | 182 | const { data: res4 } = await POST( 183 | `/processor/Travel(TravelUUID='e87f1e25331411ec959fd79bb4702f0b',IsActiveEntity=true)/TravelService.deductDiscount`, 184 | { percent: 11 } 185 | ) 186 | // rounded to 3 decimals 187 | expect(res4).to.contain({ TotalPrice: 8883.048, BookingFee: 35.248 }) 188 | }) 189 | 190 | it('allows deducting discounts on drafts as well', async ()=>{ 191 | const Active = `/processor/Travel(TravelUUID='e87f1dd3331411ec959fd79bb4702f0b',IsActiveEntity=true)` 192 | const Draft = `/processor/Travel(TravelUUID='e87f1dd3331411ec959fd79bb4702f0b',IsActiveEntity=false)` 193 | 194 | const { data:res0 } = await GET (Active) 195 | expect(res0).to.contain({ TravelID:94, TotalPrice: 5627.8, BookingFee: 30 }) 196 | 197 | const { data:res1 } = await EDIT (Active) 198 | expect(res1).to.contain({ TotalPrice: 5627.8, BookingFee: 30 }) 199 | 200 | // Change the Travel's dates to avoid validation errors 201 | const today = new Date().toISOString().split('T')[0] 202 | await PATCH (Draft, { BeginDate: today }) 203 | const tomorrow = new Date(new Date().setDate(new Date().getDate() + 1)).toISOString().split('T')[0] 204 | await PATCH (Draft, { EndDate: tomorrow }) 205 | 206 | const { data:res2 } = await POST (`${Draft}/TravelService.deductDiscount`, { percent: 50 }) 207 | expect(res2).to.contain({ TotalPrice: 5612.8, BookingFee: 15 }) 208 | 209 | const { data:res3 } = await GET (Draft) 210 | expect(res3).to.contain({ TotalPrice: 5612.8, BookingFee: 15 }) 211 | 212 | await SAVE (Draft) 213 | 214 | const { data:res4 } = await GET (Active) 215 | expect(res4).to.contain({ TotalPrice: 5612.8, BookingFee: 15 }) 216 | }) 217 | 218 | }) 219 | --------------------------------------------------------------------------------