@sap/cds-dk 9.4.2 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/bin/compile/index.js +1 -1
  3. package/bin/data-products/index.js +10 -2
  4. package/bin/data-products/prepare-csn.js +63 -26
  5. package/bin/export.js +1 -1
  6. package/bin/help.js +2 -3
  7. package/bin/import.js +13 -3
  8. package/bin/repl.js +7 -11
  9. package/bin/up.js +164 -13
  10. package/bin/util/containerize.js +183 -0
  11. package/bin/version.js +4 -4
  12. package/lib/bind/k8s.js +1 -1
  13. package/lib/build/buildTaskEngine.js +5 -2
  14. package/lib/build/plugin.js +1 -1
  15. package/lib/build/plugins/helm/files/templates/_deployment_helpers.tpl +1 -1
  16. package/lib/build/plugins/helm/index.js +7 -7
  17. package/lib/build/provider/hana/2migration.js +16 -24
  18. package/lib/build/provider/hana/index.js +11 -3
  19. package/lib/build/provider/hana/template/.hdiconfig-all +7 -1
  20. package/lib/build/provider/hana/template/package.json +1 -1
  21. package/lib/build/provider/internalBuildPlugin.js +15 -1
  22. package/lib/build/provider/java/index.js +12 -1
  23. package/lib/build/provider/mtx-sidecar/index.js +2 -1
  24. package/lib/build/provider/nodejs/index.js +2 -1
  25. package/lib/build/util.js +3 -3
  26. package/lib/compile/to_openapi.js +1 -5
  27. package/lib/import/common.js +5 -4
  28. package/lib/import/message.js +1 -1
  29. package/lib/import/odata/ParserContext.js +1 -0
  30. package/lib/import/odata/v4parser.js +48 -3
  31. package/lib/import/openapi/importOpenAPI.js +6 -1
  32. package/lib/init/constants.js +1 -1
  33. package/lib/init/index.js +15 -6
  34. package/lib/init/merge.js +16 -0
  35. package/lib/init/projectReader.js +54 -24
  36. package/lib/init/registries/mta.js +5 -2
  37. package/lib/init/registries/xs-app.js +7 -1
  38. package/lib/init/template/ams/index.js +1 -1
  39. package/lib/init/template/app-frontend/files/app-package.json.hbs +1 -7
  40. package/lib/init/template/app-frontend/files/ui5.yaml.hbs +20 -1
  41. package/lib/init/template/app-frontend/index.js +0 -4
  42. package/lib/init/template/application-logging/index.js +9 -14
  43. package/lib/init/template/approuter/files/mta.yaml.hbs +7 -2
  44. package/lib/init/template/approuter/index.js +21 -16
  45. package/lib/init/template/audit-logging/index.js +2 -2
  46. package/lib/init/template/cloud-logging/index.js +2 -3
  47. package/lib/init/template/containerize/files/containerize.yaml.hbs +17 -3
  48. package/lib/init/template/containerize/index.js +0 -4
  49. package/lib/init/template/data/as-json.js +18 -20
  50. package/lib/init/template/destination/index.js +0 -4
  51. package/lib/init/template/dynatrace/index.js +0 -2
  52. package/lib/init/template/github-actions/files/kyma-setup/action.yaml +0 -2
  53. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +16 -1
  54. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +20 -0
  55. package/lib/init/template/github-actions/index.js +5 -8
  56. package/lib/init/template/hana/files/db/package.json +2 -2
  57. package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
  58. package/lib/init/template/hana/index.js +5 -7
  59. package/lib/init/template/helm/index.js +16 -33
  60. package/lib/init/template/helm-unified-runtime/index.js +0 -4
  61. package/lib/init/template/html5-repo/files/app-package.json.hbs +1 -7
  62. package/lib/init/template/html5-repo/files/containerize.yaml.hbs +0 -9
  63. package/lib/init/template/html5-repo/files/mta.yaml.hbs +0 -7
  64. package/lib/init/template/html5-repo/files/ui5.yaml.hbs +20 -1
  65. package/lib/init/template/html5-repo/files/values.yaml.hbs +6 -0
  66. package/lib/init/template/html5-repo/files/xs-app.json.hbs +5 -3
  67. package/lib/init/template/html5-repo/index.js +8 -14
  68. package/lib/init/template/ias/files/values.yaml.hbs +6 -6
  69. package/lib/init/template/ias/index.js +14 -23
  70. package/lib/init/template/kyma/index.js +14 -1
  71. package/lib/init/template/malware-scanner/files/mta.yaml.hbs +3 -1
  72. package/lib/init/template/malware-scanner/files/values.yaml +3 -1
  73. package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -3
  74. package/lib/init/template/multitenancy/files/values.yaml.hbs +8 -0
  75. package/lib/init/template/multitenancy/index.js +10 -5
  76. package/lib/init/template/nodejs/files/package.json.hbs +1 -1
  77. package/lib/init/template/pipeline/files/app-package.json.hbs +1 -7
  78. package/lib/init/template/pipeline/files/ui5.yaml.hbs +20 -1
  79. package/lib/init/template/pipeline/index.js +6 -3
  80. package/lib/init/template/portal/files/mta.yaml.hbs +5 -3
  81. package/lib/init/template/portal/index.js +3 -6
  82. package/lib/init/template/sample/files/_i18n/i18n_de.properties +12 -0
  83. package/lib/init/template/sample/files/_i18n/i18n_en.properties +21 -0
  84. package/lib/init/template/sample/files/_i18n/i18n_fr.properties +20 -0
  85. package/lib/init/template/sample/files/_i18n/messages_de.properties +34 -0
  86. package/lib/init/template/sample/files/_i18n/messages_en.properties +34 -0
  87. package/lib/init/template/sample/files/_i18n/messages_fr.properties +34 -0
  88. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +0 -26
  89. package/lib/init/template/sample/files/app/_i18n/i18n_en.properties +8 -0
  90. package/lib/init/template/sample/files/app/admin-authors/fiori-service.cds +52 -0
  91. package/lib/init/template/sample/files/app/admin-authors/webapp/Component.js.hbs +3 -0
  92. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +11 -0
  93. package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +130 -0
  94. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +81 -88
  95. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js.hbs +3 -0
  96. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +10 -2
  97. package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +24 -48
  98. package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +54 -3
  99. package/lib/init/template/sample/files/app/browse/fiori-service.cds +30 -30
  100. package/lib/init/template/sample/files/app/browse/webapp/Component.js.hbs +3 -0
  101. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +10 -3
  102. package/lib/init/template/sample/files/app/browse/webapp/manifest.json +18 -23
  103. package/lib/init/template/sample/files/app/common.cds +126 -158
  104. package/lib/init/template/sample/files/app/fiori-apps.html +30 -0
  105. package/lib/init/template/sample/files/app/genres/fiori-service.cds +33 -0
  106. package/lib/init/template/sample/files/app/genres/tree-view.cds +42 -0
  107. package/lib/init/template/sample/files/app/genres/value-help.cds +6 -0
  108. package/lib/init/template/sample/files/app/genres/webapp/Component.js.hbs +3 -0
  109. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +4 -0
  110. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +2 -0
  111. package/lib/init/template/sample/files/app/genres/webapp/manifest.json +126 -0
  112. package/lib/init/template/sample/files/app/services.cds +6 -2
  113. package/lib/init/template/sample/files/db/currencies.cds +13 -0
  114. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +5 -5
  115. package/lib/init/template/sample/files/db/data/{sap.capire.bookshop-Books_texts.csv → sap.capire.bookshop-Books.texts.csv} +4 -4
  116. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +42 -15
  117. package/lib/init/template/sample/files/db/data/sap.common-Currencies.csv +12 -0
  118. package/lib/init/template/sample/files/db/data/sap.common-Currencies.texts.csv +15 -0
  119. package/lib/init/template/sample/files/db/hana/index.cds +10 -0
  120. package/lib/init/template/sample/files/db/schema.cds +35 -22
  121. package/lib/init/template/sample/files/db/sqlite/index.cds +10 -0
  122. package/lib/init/template/sample/files/package.json.hbs +14 -1
  123. package/lib/init/template/sample/files/srv/access-control.cds +3 -0
  124. package/lib/init/template/sample/files/srv/admin-service.cds +3 -2
  125. package/lib/init/template/sample/files/srv/cat-service.cds +7 -11
  126. package/lib/init/template/sample/index.js +26 -17
  127. package/lib/init/template/telemetry/index.js +1 -3
  128. package/lib/init/template/typescript/files/package.json +1 -1
  129. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +0 -5
  130. package/lib/init/template/workzone-standard/index.js +0 -1
  131. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -0
  132. package/lib/init/template/xsuaa/index.js +5 -7
  133. package/lib/lint/Linter.js +10 -4
  134. package/lib/lint/eslintHelp.json +1 -1
  135. package/lib/mtx/tenant_action.js +12 -4
  136. package/lib/util/checksum.js +32 -0
  137. package/lib/util/question.js +60 -7
  138. package/npm-shrinkwrap.json +61 -37
  139. package/package.json +2 -2
  140. package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +0 -25
  141. package/lib/init/template/github-actions/files/cf-setup/action.yaml +0 -53
  142. package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +0 -25
  143. package/lib/init/template/pipeline/files/ui5-deploy.yaml.hbs +0 -25
  144. package/lib/init/template/sample/files/app/_i18n/i18n.properties +0 -29
  145. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +0 -8
  146. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +0 -3
  147. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +0 -3
  148. package/lib/init/template/sample/files/app/browse/webapp/Component.js +0 -7
  149. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +0 -3
  150. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +0 -4
  151. package/lib/init/template/sample/files/app/index.html +0 -32
@@ -1,4 +1,11 @@
1
+ # This is the resource bundle of itelo
2
+ # __ldi.translation.uuid=c3431418-9caf-11e8-98d0-529269fb1459
3
+
4
+ # JCI app descriptor contains lower case TITLE
1
5
  appTitle=Browse Books
2
- appSubTitle=All books in one place
3
- appDescription=This application lets you find the next books you want to read.
4
- appInfo=Find your favorite books
6
+
7
+ # JCI app descriptor contains lower case DESCRIPTION
8
+ appSubTitle=CAP Sample Application
9
+
10
+ # JCI app descriptor contains lower case DESCRIPTION
11
+ appDescription=CDS Sample Service
@@ -1,14 +1,14 @@
1
1
  {
2
- "_version": "1.49.0",
2
+ "_version": "1.28.0",
3
3
  "sap.app": {
4
- "id": "browse-books",
5
- "applicationVersion": {
6
- "version": "1.0.0"
7
- },
4
+ "id": "browse",
8
5
  "type": "application",
9
6
  "title": "{{appTitle}}",
10
7
  "description": "{{appDescription}}",
11
8
  "i18n": "i18n/i18n.properties",
9
+ "applicationVersion": {
10
+ "version": "1.0.0"
11
+ },
12
12
  "dataSources": {
13
13
  "CatalogService": {
14
14
  "uri": "odata/v4/catalog/",
@@ -30,7 +30,7 @@
30
30
  "renameTo": "ID"
31
31
  }
32
32
  },
33
- "additionalParameters": "allowed"
33
+ "additionalParameters": "ignored"
34
34
  },
35
35
  "semanticObject": "Books",
36
36
  "action": "display",
@@ -47,18 +47,9 @@
47
47
  }
48
48
  }
49
49
  },
50
- "sap.ui": {
51
- "technology": "UI5",
52
- "fullWidth": false,
53
- "deviceTypes": {
54
- "desktop": true,
55
- "tablet": true,
56
- "phone": true
57
- }
58
- },
59
50
  "sap.ui5": {
60
51
  "dependencies": {
61
- "minUI5Version": "1.115.1",
52
+ "minUI5Version": "1.136.0",
62
53
  "libs": {
63
54
  "sap.fe.templates": {}
64
55
  }
@@ -71,14 +62,10 @@
71
62
  "": {
72
63
  "dataSource": "CatalogService",
73
64
  "settings": {
65
+ "synchronizationMode": "None",
74
66
  "operationMode": "Server",
75
67
  "autoExpandSelect": true,
76
- "earlyRequests": true,
77
- "groupProperties": {
78
- "default": {
79
- "submit": "Auto"
80
- }
81
- }
68
+ "earlyRequests": true
82
69
  }
83
70
  }
84
71
  },
@@ -103,7 +90,7 @@
103
90
  "options": {
104
91
  "settings": {
105
92
  "entitySet": "Books",
106
- "initialLoad": true,
93
+ "liveMode": true,
107
94
  "navigation": {
108
95
  "Books": {
109
96
  "detail": {
@@ -131,6 +118,14 @@
131
118
  "cozy": true
132
119
  }
133
120
  },
121
+ "sap.ui": {
122
+ "technology": "UI5",
123
+ "deviceTypes": {
124
+ "desktop": true,
125
+ "tablet": true,
126
+ "phone": true
127
+ }
128
+ },
134
129
  "sap.fiori": {
135
130
  "registrationIds": [],
136
131
  "archeType": "transactional"
@@ -2,123 +2,69 @@
2
2
  Common Annotations shared by all apps
3
3
  */
4
4
 
5
- using {sap.capire.bookshop as my} from '../db/schema';
6
- using {
7
- sap.common,
8
- sap.common.Currencies
9
- } from '@sap/cds/common';
5
+ using { sap.capire.bookshop as my } from '../db/schema';
6
+ using { sap.common } from '@sap/cds/common';
10
7
 
11
8
  ////////////////////////////////////////////////////////////////////////////
12
9
  //
13
10
  // Books Lists
14
11
  //
15
12
  annotate my.Books with @(
16
- Common.SemanticKey: [ID],
17
- UI : {
18
- Identification : [{Value: title}],
19
- SelectionFields: [
13
+ Common.SemanticKey : [ID],
14
+ UI : {
15
+ Identification : [{ Value: title }],
16
+ SelectionFields : [
20
17
  ID,
21
18
  author_ID,
22
19
  price,
23
20
  currency_code
24
21
  ],
25
- LineItem : [
26
- {
27
- Value: ID,
28
- Label: '{i18n>Title}'
29
- },
30
- {
31
- Value: author.ID,
32
- Label: '{i18n>Author}'
33
- },
34
- {Value: genre.name},
35
- {Value: stock},
36
- {Value: price},
37
- {Value: currency.symbol},
22
+ LineItem : [
23
+ { Value: ID, Label: '{i18n>Title}' },
24
+ { Value: author.ID, Label: '{i18n>Author}' },
25
+ { Value: genre.name },
26
+ { Value: stock },
27
+ { Value: price },
28
+ { Value: currency.symbol },
38
29
  ]
39
30
  }
40
31
  ) {
41
- ID @Common : {
32
+ ID @Common: {
42
33
  SemanticObject : 'Books',
43
- Text : title,
44
- TextArrangement: #TextOnly
34
+ Text: title,
35
+ TextArrangement : #TextOnly
45
36
  };
46
- author @ValueList.entity: 'Authors';
37
+ author @ValueList.entity : 'Authors';
47
38
  };
48
39
 
49
- annotate Currencies with {
50
- symbol @Common.Label: '{i18n>Currency}';
51
- }
52
-
53
-
54
- ////////////////////////////////////////////////////////////////////////////
55
- //
56
- // Books Elements
57
- //
58
- annotate my.Books with {
59
- ID @title: '{i18n>ID}';
60
- title @title: '{i18n>Title}';
61
- genre @title: '{i18n>Genre}' @Common : {
62
- Text : genre.name,
63
- TextArrangement: #TextOnly
64
- };
65
- author @title: '{i18n>Author}' @Common : {
66
- Text : author.name,
67
- TextArrangement: #TextOnly
68
- };
69
- price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
70
- stock @title: '{i18n>Stock}';
71
- descr @title: '{i18n>Description}' @UI.MultiLineText;
40
+ annotate common.Currencies with {
41
+ symbol @Common.Label : '{i18n>Currency}';
72
42
  }
73
43
 
74
44
  ////////////////////////////////////////////////////////////////////////////
75
45
  //
76
- // Genres List
46
+ // Books Details
77
47
  //
78
- annotate my.Genres with @(
79
- Common.SemanticKey: [name],
80
- UI : {
81
- SelectionFields: [name],
82
- LineItem : [
83
- {Value: name},
84
- {
85
- Value: parent.name,
86
- Label: '{i18n>MainGenre}'
87
- },
88
- ],
89
- }
90
- );
48
+ annotate my.Books with @(UI : {HeaderInfo : {
49
+ TypeName : '{i18n>Book}',
50
+ TypeNamePlural : '{i18n>Books}',
51
+ Title : { Value: title },
52
+ Description : { Value: author.name }
53
+ }, });
91
54
 
92
- annotate my.Genres with {
93
- ID @Common.Text: name @Common.TextArrangement: #TextOnly;
94
- }
95
55
 
96
56
  ////////////////////////////////////////////////////////////////////////////
97
57
  //
98
- // Genre Details
99
- //
100
- annotate my.Genres with @(UI: {
101
- Identification: [{Value: name}],
102
- HeaderInfo : {
103
- TypeName : '{i18n>Genre}',
104
- TypeNamePlural: '{i18n>Genres}',
105
- Title : {Value: name},
106
- Description : {Value: ID}
107
- },
108
- Facets : [{
109
- $Type : 'UI.ReferenceFacet',
110
- Label : '{i18n>SubGenres}',
111
- Target: 'children/@UI.LineItem'
112
- }, ],
113
- });
114
-
115
- ////////////////////////////////////////////////////////////////////////////
116
- //
117
- // Genres Elements
58
+ // Books Elements
118
59
  //
119
- annotate my.Genres with {
120
- ID @title: '{i18n>ID}';
121
- name @title: '{i18n>Genre}';
60
+ annotate my.Books with {
61
+ ID @title: '{i18n>ID}';
62
+ title @title: '{i18n>Title}';
63
+ genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
64
+ author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
65
+ price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code;
66
+ stock @title: '{i18n>Stock}';
67
+ descr @title: '{i18n>Description}' @UI.MultiLineText;
122
68
  }
123
69
 
124
70
  ////////////////////////////////////////////////////////////////////////////
@@ -126,23 +72,23 @@ annotate my.Genres with {
126
72
  // Authors List
127
73
  //
128
74
  annotate my.Authors with @(
129
- Common.SemanticKey: [ID],
130
- UI : {
131
- Identification : [{Value: name}],
132
- SelectionFields: [name],
133
- LineItem : [
134
- {Value: ID},
135
- {Value: dateOfBirth},
136
- {Value: dateOfDeath},
137
- {Value: placeOfBirth},
138
- {Value: placeOfDeath},
75
+ Common.SemanticKey : [ID],
76
+ UI : {
77
+ Identification : [{ Value: name}],
78
+ SelectionFields : [name],
79
+ LineItem : [
80
+ { Value: ID },
81
+ { Value: dateOfBirth },
82
+ { Value: dateOfDeath },
83
+ { Value: placeOfBirth },
84
+ { Value: placeOfDeath },
139
85
  ],
140
86
  }
141
87
  ) {
142
- ID @Common: {
88
+ ID @Common: {
143
89
  SemanticObject : 'Authors',
144
- Text : name,
145
- TextArrangement: #TextOnly,
90
+ Text: name,
91
+ TextArrangement : #TextOnly,
146
92
  };
147
93
  };
148
94
 
@@ -150,17 +96,17 @@ annotate my.Authors with @(
150
96
  //
151
97
  // Author Details
152
98
  //
153
- annotate my.Authors with @(UI: {
154
- HeaderInfo: {
155
- TypeName : '{i18n>Author}',
156
- TypeNamePlural: '{i18n>Authors}',
157
- Title : {Value: name},
158
- Description : {Value: dateOfBirth}
99
+ annotate my.Authors with @(UI : {
100
+ HeaderInfo : {
101
+ TypeName : '{i18n>Author}',
102
+ TypeNamePlural : '{i18n>Authors}',
103
+ Title : { Value: name },
104
+ Description : { Value: dateOfBirth }
159
105
  },
160
- Facets : [{
161
- $Type : 'UI.ReferenceFacet',
162
- Target: 'books/@UI.LineItem'
163
- }],
106
+ Facets : [{
107
+ $Type : 'UI.ReferenceFacet',
108
+ Target : 'books/@UI.LineItem'
109
+ }, ],
164
110
  });
165
111
 
166
112
 
@@ -182,16 +128,16 @@ annotate my.Authors with {
182
128
  // Languages List
183
129
  //
184
130
  annotate common.Languages with @(
185
- Common.SemanticKey: [code],
186
- Identification : [{Value: code}],
187
- UI : {
188
- SelectionFields: [
131
+ Common.SemanticKey : [code],
132
+ Identification : [{ Value: code}],
133
+ UI : {
134
+ SelectionFields : [
189
135
  name,
190
136
  descr
191
137
  ],
192
- LineItem : [
193
- {Value: code},
194
- {Value: name},
138
+ LineItem : [
139
+ { Value: code },
140
+ { Value: name },
195
141
  ],
196
142
  }
197
143
  );
@@ -200,22 +146,22 @@ annotate common.Languages with @(
200
146
  //
201
147
  // Language Details
202
148
  //
203
- annotate common.Languages with @(UI: {
204
- HeaderInfo : {
205
- TypeName : '{i18n>Language}',
206
- TypeNamePlural: '{i18n>Languages}',
207
- Title : {Value: name},
208
- Description : {Value: descr}
149
+ annotate common.Languages with @(UI : {
150
+ HeaderInfo : {
151
+ TypeName : '{i18n>Language}',
152
+ TypeNamePlural : '{i18n>Languages}',
153
+ Title : { Value: name },
154
+ Description : { Value: descr }
209
155
  },
210
- Facets : [{
211
- $Type : 'UI.ReferenceFacet',
212
- Label : '{i18n>Details}',
213
- Target: '@UI.FieldGroup#Details'
156
+ Facets : [{
157
+ $Type : 'UI.ReferenceFacet',
158
+ Label : '{i18n>Details}',
159
+ Target : '@UI.FieldGroup#Details'
214
160
  }, ],
215
- FieldGroup #Details: {Data: [
216
- {Value: code},
217
- {Value: name},
218
- {Value: descr}
161
+ FieldGroup #Details : {Data : [
162
+ { Value: code },
163
+ { Value: name },
164
+ { Value: descr }
219
165
  ]},
220
166
  });
221
167
 
@@ -224,17 +170,17 @@ annotate common.Languages with @(UI: {
224
170
  // Currencies List
225
171
  //
226
172
  annotate common.Currencies with @(
227
- Common.SemanticKey: [code],
228
- Identification : [{Value: code}],
229
- UI : {
230
- SelectionFields: [
173
+ Common.SemanticKey : [code],
174
+ Identification : [{ Value: code}],
175
+ UI : {
176
+ SelectionFields : [
231
177
  name,
232
178
  descr
233
179
  ],
234
- LineItem : [
235
- {Value: descr},
236
- {Value: symbol},
237
- {Value: code},
180
+ LineItem : [
181
+ { Value: descr },
182
+ { Value: symbol },
183
+ { Value: code },
238
184
  ],
239
185
  }
240
186
  );
@@ -243,22 +189,44 @@ annotate common.Currencies with @(
243
189
  //
244
190
  // Currency Details
245
191
  //
246
- annotate common.Currencies with @(UI: {
247
- HeaderInfo : {
248
- TypeName : '{i18n>Currency}',
249
- TypeNamePlural: '{i18n>Currencies}',
250
- Title : {Value: descr},
251
- Description : {Value: code}
192
+ annotate common.Currencies with @(UI : {
193
+ HeaderInfo : {
194
+ TypeName : '{i18n>Currency}',
195
+ TypeNamePlural : '{i18n>Currencies}',
196
+ Title : { Value: descr },
197
+ Description : { Value: code }
252
198
  },
253
- Facets : [{
254
- $Type : 'UI.ReferenceFacet',
255
- Label : '{i18n>Details}',
256
- Target: '@UI.FieldGroup#Details'
257
- }],
258
- FieldGroup #Details: {Data: [
259
- {Value: name},
260
- {Value: symbol},
261
- {Value: code},
262
- {Value: descr}
263
- ]}
199
+ Facets : [
200
+ {
201
+ $Type : 'UI.ReferenceFacet',
202
+ Label : '{i18n>Details}',
203
+ Target : '@UI.FieldGroup#Details'
204
+ },
205
+ {
206
+ $Type : 'UI.ReferenceFacet',
207
+ Label : '{i18n>Extended}',
208
+ Target : '@UI.FieldGroup#Extended'
209
+ },
210
+ ],
211
+ FieldGroup #Details : {Data : [
212
+ { Value: name },
213
+ { Value: symbol },
214
+ { Value: code },
215
+ { Value: descr }
216
+ ]},
217
+ FieldGroup #Extended : {Data : [
218
+ { Value: numcode },
219
+ { Value: minor },
220
+ { Value: exponent }
221
+ ]},
264
222
  });
223
+
224
+ ////////////////////////////////////////////////////////////////////////////
225
+ //
226
+ // Currencies Elements
227
+ //
228
+ annotate common.Currencies with {
229
+ numcode @title: '{i18n>NumCode}';
230
+ minor @title: '{i18n>MinorUnit}';
231
+ exponent @title: '{i18n>Exponent}';
232
+ }
@@ -0,0 +1,30 @@
1
+ <!doctype html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Bookshop</title>
9
+
10
+ <script>
11
+ window["sap-ushell-config"] = {
12
+ defaultRenderer: "fiori2",
13
+ applications: {},
14
+ };
15
+ </script>
16
+
17
+ <script id="sap-ushell-bootstrap" src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
18
+ <script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
19
+ data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout" data-sap-ui-compatVersion="edge"
20
+ data-sap-ui-theme="sap_horizon"></script>
21
+ <script>
22
+ sap.ui.getCore().attachInit(() =>
23
+ sap.ushell.Container.createRenderer().placeAt("content")
24
+ );
25
+ </script>
26
+ </head>
27
+
28
+ <body class="sapUiBody" id="content"></body>
29
+
30
+ </html>
@@ -0,0 +1,33 @@
1
+ using { sap.capire.bookshop.Genres } from '../../db/schema';
2
+
3
+ annotate Genres with @cds.search: {name};
4
+ annotate Genres with @readonly;
5
+ annotate Genres with {
6
+ name @title: '{i18n>Genre}';
7
+ }
8
+
9
+ // Lists
10
+ annotate Genres with @(
11
+ Common.SemanticKey : [name],
12
+ UI.SelectionFields : [name],
13
+ UI.LineItem : [
14
+ { Value: name, Label: '{i18n>Name}' },
15
+ ],
16
+ );
17
+
18
+ // Details
19
+ annotate Genres with @(UI : {
20
+ Identification : [{ Value: name }],
21
+ HeaderInfo : {
22
+ TypeName : '{i18n>Genre}',
23
+ TypeNamePlural : '{i18n>Genres}',
24
+ Title : { Value: name },
25
+ Description : { Value: ID }
26
+ }
27
+ });
28
+
29
+
30
+ // Tree Views
31
+ // annotate AdminService.Genres with @hierarchy; // upcomming simplification
32
+ using from './tree-view';
33
+ using from './value-help';
@@ -0,0 +1,42 @@
1
+ using { AdminService } from '../../srv/admin-service';
2
+
3
+ ////////////////////////////////////////////////////////////////////////////
4
+ //
5
+ // Genres Tree View
6
+ //
7
+
8
+ // Tell Fiori about the structure of the hierarchy
9
+ annotate AdminService.Genres with @Aggregation.RecursiveHierarchy #GenresHierarchy : {
10
+ ParentNavigationProperty : parent, // navigates to a node's parent
11
+ NodeProperty : ID, // identifies a node, usually the key
12
+ };
13
+
14
+ // Fiori expects the following to be defined explicitly, even though they're always the same
15
+ extend AdminService.Genres with @(
16
+ // The columns expected by Fiori to be present in hierarchy entities
17
+ Hierarchy.RecursiveHierarchy #GenresHierarchy : {
18
+ LimitedDescendantCount : LimitedDescendantCount,
19
+ DistanceFromRoot : DistanceFromRoot,
20
+ DrillState : DrillState,
21
+ LimitedRank : LimitedRank
22
+ },
23
+ // Disallow filtering on these properties from Fiori UIs
24
+ Capabilities.FilterRestrictions.NonFilterableProperties: [
25
+ 'LimitedDescendantCount',
26
+ 'DistanceFromRoot',
27
+ 'DrillState',
28
+ 'LimitedRank'
29
+ ],
30
+ // Disallow sorting on these properties from Fiori UIs
31
+ Capabilities.SortRestrictions.NonSortableProperties : [
32
+ 'LimitedDescendantCount',
33
+ 'DistanceFromRoot',
34
+ 'DrillState',
35
+ 'LimitedRank'
36
+ ],
37
+ ) columns { // Ensure we can query these fields from database
38
+ null as LimitedDescendantCount : Int16,
39
+ null as DistanceFromRoot : Int16,
40
+ null as DrillState : String,
41
+ null as LimitedRank : Int16,
42
+ };
@@ -0,0 +1,6 @@
1
+ // Value help with Tree View
2
+ using from '../admin-books/fiori-service';
3
+ annotate AdminService.Books:genre with @Common.ValueList.PresentationVariantQualifier: 'VH';
4
+ annotate AdminService.Genres with @UI.PresentationVariant #VH: {
5
+ RecursiveHierarchyQualifier : 'GenresHierarchy',
6
+ };
@@ -0,0 +1,3 @@
1
+ sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("{{appName}}.{{app}}.Component", {
2
+ metadata:{ manifest:'json' }
3
+ }))
@@ -0,0 +1,4 @@
1
+ #XTIT
2
+ appTitle=Browse Genres
3
+ #XTXT
4
+ appDescription=Genres as Tree View
@@ -0,0 +1,2 @@
1
+ appTitle=Zeige Genres
2
+ appDescription=Genres als Baumansicht