@sap/cds-dk 9.4.3 → 9.6.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 (168) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/bin/compile/index.js +1 -1
  3. package/bin/env.js +3 -3
  4. package/bin/export.js +1 -1
  5. package/bin/help.js +0 -1
  6. package/bin/import.js +8 -3
  7. package/bin/repl.js +7 -11
  8. package/bin/up.js +159 -23
  9. package/bin/util/containerize.js +79 -25
  10. package/bin/version.js +4 -4
  11. package/lib/bind/k8s.js +1 -1
  12. package/lib/build/plugins/helm/files/templates/_deployment_helpers.tpl +1 -1
  13. package/lib/build/plugins/helm/index.js +1 -1
  14. package/lib/build/provider/hana/2migration.js +16 -24
  15. package/lib/build/provider/hana/index.js +1 -1
  16. package/lib/build/provider/hana/template/.hdiconfig-all +7 -1
  17. package/lib/build/provider/hana/template/package.json +1 -1
  18. package/lib/build/provider/internalBuildPlugin.js +15 -1
  19. package/lib/build/provider/java/index.js +12 -1
  20. package/lib/build/provider/mtx-sidecar/index.js +2 -1
  21. package/lib/build/provider/nodejs/index.js +2 -1
  22. package/lib/build/util.js +36 -19
  23. package/lib/compile/to_openapi.js +1 -5
  24. package/lib/import/common.js +9 -2
  25. package/lib/import/odata/ParserContext.js +1 -0
  26. package/lib/import/odata/v4parser.js +57 -25
  27. package/lib/import/openapi/importOpenAPI.js +6 -1
  28. package/lib/init/constants.js +1 -1
  29. package/lib/init/index.js +20 -6
  30. package/lib/init/merge.js +16 -0
  31. package/lib/init/projectReader.js +34 -8
  32. package/lib/init/registries/mta.js +2 -2
  33. package/lib/init/template/ams/index.js +3 -3
  34. package/lib/init/template/app-frontend/files/app-package.json.hbs +1 -7
  35. package/lib/init/template/app-frontend/files/ui5.yaml.hbs +21 -1
  36. package/lib/init/template/app-frontend/index.js +2 -6
  37. package/lib/init/template/application-logging/index.js +11 -16
  38. package/lib/init/template/approuter/files/mta.yaml.hbs +0 -2
  39. package/lib/init/template/approuter/index.js +13 -10
  40. package/lib/init/template/attachments/index.js +4 -2
  41. package/lib/init/template/audit-logging/index.js +4 -2
  42. package/lib/init/template/cloud-logging/index.js +6 -5
  43. package/lib/init/template/connectivity/index.js +2 -2
  44. package/lib/init/template/console/files/package.json +5 -0
  45. package/lib/init/template/console/index.js +25 -0
  46. package/lib/init/template/containerize/index.js +4 -6
  47. package/lib/init/template/data/as-json.js +18 -20
  48. package/lib/init/template/destination/index.js +4 -2
  49. package/lib/init/template/dynatrace/files/package.json.hbs +2 -2
  50. package/lib/init/template/dynatrace/index.js +4 -4
  51. package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +3 -1
  52. package/lib/init/template/enterprise-messaging/index.js +4 -2
  53. package/lib/init/template/enterprise-messaging-shared/index.js +4 -2
  54. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +16 -1
  55. package/lib/init/template/github-actions/files/workflows/release.yaml.hbs +2 -2
  56. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +20 -0
  57. package/lib/init/template/github-actions/index.js +7 -10
  58. package/lib/init/template/hana/files/db/package.json +2 -2
  59. package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
  60. package/lib/init/template/hana/index.js +7 -9
  61. package/lib/init/template/helm/index.js +8 -10
  62. package/lib/init/template/helm-unified-runtime/index.js +1 -4
  63. package/lib/init/template/html5-repo/files/app-package.json.hbs +1 -7
  64. package/lib/init/template/html5-repo/files/ui5.yaml.hbs +21 -1
  65. package/lib/init/template/html5-repo/index.js +14 -18
  66. package/lib/init/template/ias/files/values.yaml.hbs +6 -6
  67. package/lib/init/template/ias/index.js +13 -21
  68. package/lib/init/template/java/index.js +14 -0
  69. package/lib/init/template/kafka/index.js +4 -2
  70. package/lib/init/template/{containerize → kyma}/files/containerize.yaml.hbs +17 -2
  71. package/lib/init/template/kyma/index.js +129 -5
  72. package/lib/init/template/malware-scanner/files/mta.yaml.hbs +3 -1
  73. package/lib/init/template/malware-scanner/files/values.yaml +3 -1
  74. package/lib/init/template/malware-scanner/index.js +4 -2
  75. package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -3
  76. package/lib/init/template/multitenancy/files/values.yaml.hbs +8 -0
  77. package/lib/init/template/multitenancy/index.js +15 -7
  78. package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -3
  79. package/lib/init/template/nodejs/files/package.json.hbs +1 -1
  80. package/lib/init/template/pipeline/files/app-package.json.hbs +1 -7
  81. package/lib/init/template/pipeline/files/ui5.yaml.hbs +21 -1
  82. package/lib/init/template/pipeline/index.js +1 -2
  83. package/lib/init/template/portal/files/mta.yaml.hbs +5 -3
  84. package/lib/init/template/portal/index.js +8 -8
  85. package/lib/init/template/postgres/index.js +2 -2
  86. package/lib/init/template/redis/index.js +2 -3
  87. package/lib/init/template/redis-messaging/index.js +2 -3
  88. package/lib/init/template/sample/files/_i18n/i18n_de.properties +21 -0
  89. package/lib/init/template/sample/files/_i18n/i18n_en.properties +21 -0
  90. package/lib/init/template/sample/files/_i18n/i18n_fr.properties +21 -0
  91. package/lib/init/template/sample/files/_i18n/messages_de.properties +34 -0
  92. package/lib/init/template/sample/files/_i18n/messages_en.properties +34 -0
  93. package/lib/init/template/sample/files/_i18n/messages_fr.properties +34 -0
  94. package/lib/init/template/sample/files/app/_i18n/i18n.properties +13 -25
  95. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +13 -25
  96. package/lib/init/template/sample/files/app/admin-authors/fiori-service.cds +52 -0
  97. package/lib/init/template/sample/files/app/admin-authors/webapp/Component.js.hbs +3 -0
  98. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +3 -0
  99. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n_de.properties +3 -0
  100. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n_en.properties +3 -0
  101. package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +130 -0
  102. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +81 -88
  103. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js.hbs +3 -0
  104. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +3 -3
  105. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +3 -3
  106. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +3 -3
  107. package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +24 -48
  108. package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +56 -5
  109. package/lib/init/template/sample/files/app/browse/fiori-service.cds +30 -30
  110. package/lib/init/template/sample/files/app/browse/webapp/Component.js.hbs +3 -0
  111. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +3 -4
  112. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +3 -3
  113. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +3 -4
  114. package/lib/init/template/sample/files/app/browse/webapp/manifest.json +19 -24
  115. package/lib/init/template/sample/files/app/common.cds +127 -158
  116. package/lib/init/template/sample/files/app/fiori-apps.html +50 -0
  117. package/lib/init/template/sample/files/app/genres/fiori-service.cds +33 -0
  118. package/lib/init/template/sample/files/app/genres/tree-view.cds +42 -0
  119. package/lib/init/template/sample/files/app/genres/value-help.cds +6 -0
  120. package/lib/init/template/sample/files/app/genres/webapp/Component.js.hbs +3 -0
  121. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +3 -0
  122. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +3 -0
  123. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_en.properties +3 -0
  124. package/lib/init/template/sample/files/app/genres/webapp/manifest.json +126 -0
  125. package/lib/init/template/sample/files/app/services.cds +6 -2
  126. package/lib/init/template/sample/files/db/currencies.cds +13 -0
  127. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +5 -5
  128. package/lib/init/template/sample/files/db/data/{sap.capire.bookshop-Books_texts.csv → sap.capire.bookshop-Books.texts.csv} +4 -4
  129. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +42 -15
  130. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.texts.csv +43 -0
  131. package/lib/init/template/sample/files/db/data/sap.common-Currencies.csv +12 -0
  132. package/lib/init/template/sample/files/db/data/sap.common-Currencies.texts.csv +15 -0
  133. package/lib/init/template/sample/files/db/hana/index.cds +10 -0
  134. package/lib/init/template/sample/files/db/schema.cds +35 -22
  135. package/lib/init/template/sample/files/db/sqlite/index.cds +10 -0
  136. package/lib/init/template/sample/files/package.json.hbs +14 -1
  137. package/lib/init/template/sample/files/srv/access-control.cds +3 -0
  138. package/lib/init/template/sample/files/srv/admin-service.cds +3 -2
  139. package/lib/init/template/sample/files/srv/cat-service.cds +7 -11
  140. package/lib/init/template/sample/index.js +40 -18
  141. package/lib/init/template/sqlite/files/package.json.hbs +13 -0
  142. package/lib/init/template/sqlite/index.js +1 -1
  143. package/lib/init/template/telemetry/index.js +1 -3
  144. package/lib/init/template/typescript/files/package.json +1 -1
  145. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +0 -5
  146. package/lib/init/template/workzone-standard/index.js +0 -1
  147. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -0
  148. package/lib/init/template/xsuaa/index.js +7 -6
  149. package/lib/lint/Linter.js +10 -4
  150. package/lib/lint/eslintHelp.json +1 -1
  151. package/lib/mtx/tenant_action.js +12 -4
  152. package/lib/util/checksum.js +41 -0
  153. package/lib/util/fs.js +8 -1
  154. package/lib/util/glob.js +26 -13
  155. package/lib/util/question.js +60 -7
  156. package/npm-shrinkwrap.json +141 -118
  157. package/package.json +2 -2
  158. package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +0 -25
  159. package/lib/init/template/github-actions/files/cf-setup/action.yaml +0 -53
  160. package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +0 -25
  161. package/lib/init/template/pipeline/files/ui5-deploy.yaml.hbs +0 -25
  162. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +0 -8
  163. package/lib/init/template/sample/files/app/browse/webapp/Component.js +0 -7
  164. package/lib/init/template/sample/files/app/index.html +0 -32
  165. package/lib/init/template/sqlite/files/package.json +0 -5
  166. /package/lib/init/template/{helm → kyma}/files/Chart.yaml.hbs +0 -0
  167. /package/lib/init/template/{helm → kyma}/files/values.schema.json +0 -0
  168. /package/lib/init/template/{helm → kyma}/files/values.yaml.hbs +0 -0
@@ -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,12 +30,12 @@
30
30
  "renameTo": "ID"
31
31
  }
32
32
  },
33
- "additionalParameters": "allowed"
33
+ "additionalParameters": "ignored"
34
34
  },
35
35
  "semanticObject": "Books",
36
36
  "action": "display",
37
37
  "title": "{{appTitle}}",
38
- "info": "{{appInfo}}",
38
+ "info": "{{appDescription}}",
39
39
  "subTitle": "{{appSubTitle}}",
40
40
  "icon": "sap-icon://course-book",
41
41
  "indicatorDataSource": {
@@ -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,70 @@
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';
7
+ using { sap.common.Currencies } from '../db/currencies';
10
8
 
11
9
  ////////////////////////////////////////////////////////////////////////////
12
10
  //
13
11
  // Books Lists
14
12
  //
15
13
  annotate my.Books with @(
16
- Common.SemanticKey: [ID],
17
- UI : {
18
- Identification : [{Value: title}],
19
- SelectionFields: [
14
+ Common.SemanticKey : [ID],
15
+ UI : {
16
+ Identification : [{ Value: title }],
17
+ SelectionFields : [
20
18
  ID,
21
19
  author_ID,
22
20
  price,
23
21
  currency_code
24
22
  ],
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},
23
+ LineItem : [
24
+ { Value: ID, Label: '{i18n>Title}' },
25
+ { Value: author.ID, Label: '{i18n>Author}' },
26
+ { Value: genre.name },
27
+ { Value: stock },
28
+ { Value: price },
29
+ { Value: currency.symbol },
38
30
  ]
39
31
  }
40
32
  ) {
41
- ID @Common : {
33
+ ID @Common: {
42
34
  SemanticObject : 'Books',
43
- Text : title,
44
- TextArrangement: #TextOnly
35
+ Text: title,
36
+ TextArrangement : #TextOnly
45
37
  };
46
- author @ValueList.entity: 'Authors';
38
+ author @ValueList.entity : 'Authors';
47
39
  };
48
40
 
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;
41
+ annotate common.Currencies with {
42
+ symbol @Common.Label : '{i18n>Currency}';
72
43
  }
73
44
 
74
45
  ////////////////////////////////////////////////////////////////////////////
75
46
  //
76
- // Genres List
47
+ // Books Details
77
48
  //
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
- );
49
+ annotate my.Books with @(UI : {HeaderInfo : {
50
+ TypeName : '{i18n>Book}',
51
+ TypeNamePlural : '{i18n>Books}',
52
+ Title : { Value: title },
53
+ Description : { Value: author.name }
54
+ }, });
91
55
 
92
- annotate my.Genres with {
93
- ID @Common.Text: name @Common.TextArrangement: #TextOnly;
94
- }
95
56
 
96
57
  ////////////////////////////////////////////////////////////////////////////
97
58
  //
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
59
+ // Books Elements
118
60
  //
119
- annotate my.Genres with {
120
- ID @title: '{i18n>ID}';
121
- name @title: '{i18n>Genre}';
61
+ annotate my.Books with {
62
+ ID @title: '{i18n>ID}';
63
+ title @title: '{i18n>Title}';
64
+ genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
65
+ author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
66
+ price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code;
67
+ stock @title: '{i18n>Stock}';
68
+ descr @title: '{i18n>Description}' @UI.MultiLineText;
122
69
  }
123
70
 
124
71
  ////////////////////////////////////////////////////////////////////////////
@@ -126,23 +73,23 @@ annotate my.Genres with {
126
73
  // Authors List
127
74
  //
128
75
  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},
76
+ Common.SemanticKey : [ID],
77
+ UI : {
78
+ Identification : [{ Value: name}],
79
+ SelectionFields : [name],
80
+ LineItem : [
81
+ { Value: ID },
82
+ { Value: dateOfBirth },
83
+ { Value: dateOfDeath },
84
+ { Value: placeOfBirth },
85
+ { Value: placeOfDeath },
139
86
  ],
140
87
  }
141
88
  ) {
142
- ID @Common: {
89
+ ID @Common: {
143
90
  SemanticObject : 'Authors',
144
- Text : name,
145
- TextArrangement: #TextOnly,
91
+ Text: name,
92
+ TextArrangement : #TextOnly,
146
93
  };
147
94
  };
148
95
 
@@ -150,17 +97,17 @@ annotate my.Authors with @(
150
97
  //
151
98
  // Author Details
152
99
  //
153
- annotate my.Authors with @(UI: {
154
- HeaderInfo: {
155
- TypeName : '{i18n>Author}',
156
- TypeNamePlural: '{i18n>Authors}',
157
- Title : {Value: name},
158
- Description : {Value: dateOfBirth}
100
+ annotate my.Authors with @(UI : {
101
+ HeaderInfo : {
102
+ TypeName : '{i18n>Author}',
103
+ TypeNamePlural : '{i18n>Authors}',
104
+ Title : { Value: name },
105
+ Description : { Value: dateOfBirth }
159
106
  },
160
- Facets : [{
161
- $Type : 'UI.ReferenceFacet',
162
- Target: 'books/@UI.LineItem'
163
- }],
107
+ Facets : [{
108
+ $Type : 'UI.ReferenceFacet',
109
+ Target : 'books/@UI.LineItem'
110
+ }, ],
164
111
  });
165
112
 
166
113
 
@@ -182,16 +129,16 @@ annotate my.Authors with {
182
129
  // Languages List
183
130
  //
184
131
  annotate common.Languages with @(
185
- Common.SemanticKey: [code],
186
- Identification : [{Value: code}],
187
- UI : {
188
- SelectionFields: [
132
+ Common.SemanticKey : [code],
133
+ Identification : [{ Value: code}],
134
+ UI : {
135
+ SelectionFields : [
189
136
  name,
190
137
  descr
191
138
  ],
192
- LineItem : [
193
- {Value: code},
194
- {Value: name},
139
+ LineItem : [
140
+ { Value: code },
141
+ { Value: name },
195
142
  ],
196
143
  }
197
144
  );
@@ -200,22 +147,22 @@ annotate common.Languages with @(
200
147
  //
201
148
  // Language Details
202
149
  //
203
- annotate common.Languages with @(UI: {
204
- HeaderInfo : {
205
- TypeName : '{i18n>Language}',
206
- TypeNamePlural: '{i18n>Languages}',
207
- Title : {Value: name},
208
- Description : {Value: descr}
150
+ annotate common.Languages with @(UI : {
151
+ HeaderInfo : {
152
+ TypeName : '{i18n>Language}',
153
+ TypeNamePlural : '{i18n>Languages}',
154
+ Title : { Value: name },
155
+ Description : { Value: descr }
209
156
  },
210
- Facets : [{
211
- $Type : 'UI.ReferenceFacet',
212
- Label : '{i18n>Details}',
213
- Target: '@UI.FieldGroup#Details'
157
+ Facets : [{
158
+ $Type : 'UI.ReferenceFacet',
159
+ Label : '{i18n>Details}',
160
+ Target : '@UI.FieldGroup#Details'
214
161
  }, ],
215
- FieldGroup #Details: {Data: [
216
- {Value: code},
217
- {Value: name},
218
- {Value: descr}
162
+ FieldGroup #Details : {Data : [
163
+ { Value: code },
164
+ { Value: name },
165
+ { Value: descr }
219
166
  ]},
220
167
  });
221
168
 
@@ -224,17 +171,17 @@ annotate common.Languages with @(UI: {
224
171
  // Currencies List
225
172
  //
226
173
  annotate common.Currencies with @(
227
- Common.SemanticKey: [code],
228
- Identification : [{Value: code}],
229
- UI : {
230
- SelectionFields: [
174
+ Common.SemanticKey : [code],
175
+ Identification : [{ Value: code}],
176
+ UI : {
177
+ SelectionFields : [
231
178
  name,
232
179
  descr
233
180
  ],
234
- LineItem : [
235
- {Value: descr},
236
- {Value: symbol},
237
- {Value: code},
181
+ LineItem : [
182
+ { Value: descr },
183
+ { Value: symbol },
184
+ { Value: code },
238
185
  ],
239
186
  }
240
187
  );
@@ -243,22 +190,44 @@ annotate common.Currencies with @(
243
190
  //
244
191
  // Currency Details
245
192
  //
246
- annotate common.Currencies with @(UI: {
247
- HeaderInfo : {
248
- TypeName : '{i18n>Currency}',
249
- TypeNamePlural: '{i18n>Currencies}',
250
- Title : {Value: descr},
251
- Description : {Value: code}
193
+ annotate common.Currencies with @(UI : {
194
+ HeaderInfo : {
195
+ TypeName : '{i18n>Currency}',
196
+ TypeNamePlural : '{i18n>Currencies}',
197
+ Title : { Value: descr },
198
+ Description : { Value: code }
252
199
  },
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
- ]}
200
+ Facets : [
201
+ {
202
+ $Type : 'UI.ReferenceFacet',
203
+ Label : '{i18n>Details}',
204
+ Target : '@UI.FieldGroup#Details'
205
+ },
206
+ {
207
+ $Type : 'UI.ReferenceFacet',
208
+ Label : '{i18n>Extended}',
209
+ Target : '@UI.FieldGroup#Extended'
210
+ },
211
+ ],
212
+ FieldGroup #Details : {Data : [
213
+ { Value: name },
214
+ { Value: symbol },
215
+ { Value: code },
216
+ { Value: descr }
217
+ ]},
218
+ FieldGroup #Extended : {Data : [
219
+ { Value: numcode },
220
+ { Value: minor },
221
+ { Value: exponent }
222
+ ]},
264
223
  });
224
+
225
+ ////////////////////////////////////////////////////////////////////////////
226
+ //
227
+ // Currencies Elements
228
+ //
229
+ annotate common.Currencies with {
230
+ numcode @title: '{i18n>NumCode}';
231
+ minor @title: '{i18n>MinorUnit}';
232
+ exponent @title: '{i18n>Exponent}';
233
+ }
@@ -0,0 +1,50 @@
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
+ renderers: {
14
+ fiori2: {
15
+ componentData: {
16
+ config: {
17
+ enableSearch: false // suppress browser errors
18
+ }
19
+ }
20
+ }
21
+ },
22
+ applications: {}
23
+ }
24
+ </script>
25
+
26
+ <script
27
+ id="sap-ushell-bootstrap"
28
+ src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js">
29
+ </script>
30
+
31
+ <script
32
+ id="sap-ui-bootstrap"
33
+ src="https://ui5.sap.com/resources/sap-ui-core.js"
34
+ data-sap-ui-libs="sap.m,sap.ushell,sap.collaboration,sap.ui.layout"
35
+ data-sap-ui-compatVersion="edge"
36
+ data-sap-ui-theme="sap_horizon">
37
+ </script>
38
+
39
+ <script>
40
+ sap.ui.getCore().attachInit(() => {
41
+ sap.ushell.Container
42
+ .createRenderer('fiori2', true)
43
+ .then(renderer => renderer.placeAt('content'))
44
+ })
45
+ </script>
46
+ </head>
47
+
48
+ <body class="sapUiBody" id="content"></body>
49
+
50
+ </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; // upcoming 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,3 @@
1
+ appTitle = Browse Genres
2
+ appSubTitle = CAP Sample Application
3
+ appDescription = Genres as Tree View
@@ -0,0 +1,3 @@
1
+ appTitle = Zeige Genres
2
+ appSubTitle = CAP Beispielanwendung
3
+ appDescription = Genres als Baumansicht
@@ -0,0 +1,3 @@
1
+ appTitle = Browse Genres
2
+ appSubTitle = CAP Sample Application
3
+ appDescription = Genres as Tree View