Fine-tuned ext - using x_ prefix

This commit is contained in:
Daniel
2022-10-03 11:42:29 +02:00
parent 4bdad98165
commit f50afdbd69
4 changed files with 23 additions and 23 deletions

View File

@@ -2,13 +2,12 @@
It contains these folders and files, following our recommended project layout: It contains these folders and files, following our recommended project layout:
File or Folder | Purpose | File or Folder | Purpose |
---------|---------- |----------------|------------------------------------|
`app/` | content for UI frontends goes here | `app/` | content for UI frontends goes here |
`db/` | your domain models and data go here | `test/` | contet for local tests |
`srv/` | your service models and code go here | `package.json` | project metadata and configuration |
`package.json` | project metadata and configuration | `readme.md` | this getting started guide |
`readme.md` | this getting started guide
## Next Steps ## Next Steps

View File

@@ -1,24 +1,25 @@
using { sap.capire.orders, OrdersService, sap.common } from '@capire/fiori'; using { OrdersService, sap, sap.capire.orders.Orders } from '@capire/fiori';
namespace x_bookshop.extension;
namespace Z_bookshop.extension; // Adding 2 new fields for Orders
extend Orders with {
extend orders.Orders with { x_priority : String @assert.range enum {high; medium; low} default 'medium' ;
Z_priority : String @assert.range enum {high; medium; low} default 'medium' ; x_salesRegion : Association to SalesRegion;
Z_SalesRegion : Association to Z_SalesRegion;
} }
entity Z_SalesRegion: common.CodeList { /** Value Help for x_salesRegion */
key regionCode : String(11); entity SalesRegion : sap.common.CodeList {
key code : String(11);
} }
// --- UI --- // --- UI ---
annotate orders.Orders : Z_priority with @title : 'Priority'; annotate Orders:x_priority with @title : 'Priority';
annotate Z_SalesRegion : name with @title : 'Sales Region'; annotate SalesRegion:name with @title : 'Sales Region';
annotate OrdersService.Orders with @UI.LineItem : [ annotate OrdersService.Orders with @UI.LineItem : [
... up to { Value: OrderNo }, ... up to { Value: OrderNo },
{ Value : Z_priority }, { Value : x_priority },
{ Value : Z_SalesRegion.name }, { Value : x_salesRegion.name },
... ...
]; ];

View File

@@ -1,4 +1,4 @@
regionCode;name;descr code;name;descr
AMER;Americas;North, Central and South America AMER;Americas;North, Central and South America
EMEA;Europe, the Middle East and Africa;Europe, the Middle East and Africa EMEA;Europe, the Middle East and Africa;Europe, the Middle East and Africa
APJ;Asia Pacific and Japan;Asia Pacific and Japan APJ;Asia Pacific and Japan;Asia Pacific and Japan
1 regionCode code name descr
2 AMER AMER Americas North, Central and South America
3 EMEA EMEA Europe, the Middle East and Africa Europe, the Middle East and Africa
4 APJ APJ Asia Pacific and Japan Asia Pacific and Japan

View File

@@ -57,14 +57,14 @@
"toggles": true, "toggles": true,
"extensibility": true, "extensibility": true,
"cds.xt.ExtensibilityService": { "cds.xt.ExtensibilityService": {
"element-prefix": ["Z_"], "element-prefix": ["x_"],
"extension-allowlist": [ "extension-allowlist": [
{ {
"for": [ "for": [
"sap.capire.orders.Orders" "sap.capire.orders"
], ],
"kind": "entity", "kind": "entity",
"new-fields": 2 "new-fields": 3
}, },
{ {
"for": [ "for": [