@sap/cds-dk 7.0.1 → 7.0.2
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.
- package/bin/add.js +34 -38
- package/bin/build.js +4 -0
- package/bin/cds.js +8 -4
- package/bin/compile/index.js +3 -3
- package/bin/help.js +2 -3
- package/lib/build/buildTaskEngine.js +1 -1
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +2 -1
- package/lib/build/provider/java/index.js +2 -2
- package/lib/build/provider/mtx-sidecar/index.js +2 -3
- package/lib/build/util.js +8 -0
- package/lib/cds.js +2 -2
- package/lib/init/constants.js +4 -4
- package/lib/init/index.js +15 -15
- package/lib/init/template/_merging/registry-mta.js +2 -2
- package/lib/init/template/approuter/index.js +7 -3
- package/lib/init/template/cf-manifest/index.js +4 -4
- package/lib/init/template/data/index.js +1 -1
- package/lib/init/template/hana/index.js +1 -1
- package/lib/init/template/java/index.js +3 -3
- package/lib/init/template/kibana/files/mta.yaml.hbs +29 -0
- package/lib/init/template/kibana/index.js +55 -0
- package/lib/init/template/multitenancy/files/package.json.hbs +0 -3
- package/lib/init/template/multitenancy/index.js +9 -3
- package/lib/init/template/nodejs/index.js +2 -2
- package/lib/init/template/pipeline/index.js +1 -1
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +3 -32
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +2 -2
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +6 -7
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +3 -3
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +3 -11
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +117 -113
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +38 -0
- package/lib/init/template/sample/files/app/browse/fiori-service.cds +56 -0
- package/lib/init/template/sample/files/app/browse/webapp/Component.js +7 -0
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +4 -0
- package/lib/init/template/sample/files/app/browse/webapp/manifest.json +139 -0
- package/lib/init/template/sample/files/app/common.cds +78 -81
- package/lib/init/template/sample/files/app/services.cds +1 -0
- package/lib/init/template/templateBase.js +1 -1
- package/lib/init/template/tiny-sample/index.js +1 -1
- package/lib/init/util/mvn.js +1 -1
- package/lib/init/util/projectReader.js +2 -2
- package/npm-shrinkwrap.json +14 -25
- package/package.json +1 -1
- package/lib/init/template/kibana-logging/files/cds.package.json +0 -7
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +0 -14
- package/lib/init/template/kibana-logging/index.js +0 -45
- /package/lib/init/template/{kibana-logging → kibana}/files/package.json.hbs +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
|
-
const { exists } = cds.utils
|
|
3
|
+
const { exists, read, write } = cds.utils
|
|
4
|
+
const { APPROUTER, HANA, KIBANA } = require('../../constants').OPTIONS
|
|
4
5
|
const { readProject } = require('../../util/projectReader')
|
|
5
6
|
const { mergeJSON, mergeYAML, sort } = require('../../util/merge')
|
|
6
7
|
const { copyAndTrack, parseMd5File, writeMd5File } = require('../../util/md5')
|
|
@@ -22,13 +23,18 @@ module.exports = class MultitenancyTemplate extends require('../templateBase') {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
getRelatedFacets() {
|
|
25
|
-
return [
|
|
26
|
+
return [APPROUTER, HANA, KIBANA]
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
async run() {
|
|
29
30
|
const project = await readProject(this.options)
|
|
30
|
-
const { isNodejs, configFile } = project
|
|
31
|
+
const { isNodejs, isJava, configFile } = project
|
|
31
32
|
await mergeJSON(configFile, join(__dirname, 'files', `package.json.hbs`), project)
|
|
33
|
+
if (isJava) {
|
|
34
|
+
const packageJson = await read('package.json')
|
|
35
|
+
packageJson.workspaces = ['mtx/sidecar']
|
|
36
|
+
await write('package.json', packageJson, { spaces: 2 })
|
|
37
|
+
}
|
|
32
38
|
if (isNodejs) await sort('package.json', 'dependencies')
|
|
33
39
|
await copyRenderedJSON(join(__dirname, 'files', 'package.sidecar.json.hbs'), join('mtx', 'sidecar', 'package.json'), project)
|
|
34
40
|
await this.runDependentMerging()
|
|
@@ -14,10 +14,10 @@ module.exports = class NodejsTemplate extends require('../templateBase') {
|
|
|
14
14
|
|
|
15
15
|
async canRun() {
|
|
16
16
|
if (cds.cli.command === COMMAND_ADD) {
|
|
17
|
-
throw
|
|
17
|
+
throw `You can't change the runtime of an existing project.`
|
|
18
18
|
}
|
|
19
19
|
if (cds.cli.options.add?.has(JAVA)) {
|
|
20
|
-
throw
|
|
20
|
+
throw `Only one runtime per project is supported. Specify either ${term.bold(JAVA)} or ${term.bold(NODEJS)}.`
|
|
21
21
|
}
|
|
22
22
|
return true
|
|
23
23
|
}
|
|
@@ -14,7 +14,7 @@ module.exports = class PipelineTemplate extends require('../templateBase') {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
if (exists('Jenkinsfile') || exists(join('.pipeline', 'config.yml'))) {
|
|
17
|
-
throw
|
|
17
|
+
throw `Pipeline support file exists. Use --force to overwrite.`
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
return true;
|
|
@@ -3,41 +3,12 @@ Book = Book
|
|
|
3
3
|
ID = ID
|
|
4
4
|
Title = Title
|
|
5
5
|
Author = Author
|
|
6
|
+
Authors = Authors
|
|
6
7
|
AuthorID = Author ID
|
|
7
|
-
|
|
8
|
+
AuthorName = Author Name
|
|
8
9
|
Name = Name
|
|
9
|
-
Description = Description
|
|
10
|
-
Image = Image
|
|
11
|
-
AuthorName = Author's Name
|
|
12
|
-
DateOfBirth = Date of Birth
|
|
13
|
-
DateOfDeath = Date of Death
|
|
14
|
-
PlaceOfBirth = Place of Birth
|
|
15
|
-
PlaceOfDeath = Place of Death
|
|
16
10
|
Age = Age
|
|
17
|
-
|
|
18
|
-
Authors = Authors
|
|
19
|
-
|
|
11
|
+
Stock = Stock
|
|
20
12
|
Order = Order
|
|
21
13
|
Orders = Orders
|
|
22
|
-
OrderNo = Order Number
|
|
23
|
-
OrderItems = Order Items
|
|
24
|
-
Customer = Customer
|
|
25
|
-
Product = Product
|
|
26
|
-
ProductID = Product ID
|
|
27
|
-
ProductTitle = Product Title
|
|
28
|
-
UnitPrice = Unit Price
|
|
29
|
-
Quantity = Quantity
|
|
30
|
-
|
|
31
14
|
Price = Price
|
|
32
|
-
Currency = Currency
|
|
33
|
-
Date = Date
|
|
34
|
-
Rating = Rating
|
|
35
|
-
NumberOfReviews = Number of Reviews
|
|
36
|
-
|
|
37
|
-
Genre = Genre
|
|
38
|
-
Genres = Genres
|
|
39
|
-
SubGenres = Sub Genres
|
|
40
|
-
|
|
41
|
-
NumCode = Numeric Code
|
|
42
|
-
MinorUnit = Minor Unit
|
|
43
|
-
Exponent = Exponent
|
|
@@ -2,12 +2,12 @@ Books = Bücher
|
|
|
2
2
|
Book = Buch
|
|
3
3
|
ID = ID
|
|
4
4
|
Title = Titel
|
|
5
|
-
Authors = Autoren
|
|
6
5
|
Author = Autor
|
|
6
|
+
Authors = Autoren
|
|
7
7
|
AuthorID = ID des Autors
|
|
8
8
|
AuthorName = Name des Autors
|
|
9
|
-
Age = Alter
|
|
10
9
|
Name = Name
|
|
10
|
+
Age = Alter
|
|
11
11
|
Stock = Bestand
|
|
12
12
|
Order = Bestellung
|
|
13
13
|
Orders = Bestellungen
|
|
@@ -7,7 +7,7 @@ using { sap.capire.bookshop } from '../../db/schema';
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
annotate AdminService.Books with @(UI: {
|
|
10
|
-
Facets
|
|
10
|
+
Facets: [
|
|
11
11
|
{
|
|
12
12
|
$Type : 'UI.ReferenceFacet',
|
|
13
13
|
Label : '{i18n>General}',
|
|
@@ -43,7 +43,7 @@ annotate AdminService.Books with @(UI: {
|
|
|
43
43
|
Label: '{i18n>Currency}'
|
|
44
44
|
},
|
|
45
45
|
]},
|
|
46
|
-
FieldGroup #Admin
|
|
46
|
+
FieldGroup #Admin: {Data: [
|
|
47
47
|
{Value: createdBy},
|
|
48
48
|
{Value: createdAt},
|
|
49
49
|
{Value: modifiedBy},
|
|
@@ -61,12 +61,12 @@ annotate sap.capire.bookshop.Books with @fiori.draft.enabled;
|
|
|
61
61
|
annotate AdminService.Books with @odata.draft.enabled;
|
|
62
62
|
|
|
63
63
|
annotate AdminService.Books.texts with @(UI: {
|
|
64
|
-
Identification
|
|
64
|
+
Identification: [{Value: title}],
|
|
65
65
|
SelectionFields: [
|
|
66
66
|
locale,
|
|
67
67
|
title
|
|
68
68
|
],
|
|
69
|
-
LineItem
|
|
69
|
+
LineItem: [
|
|
70
70
|
{
|
|
71
71
|
Value: locale,
|
|
72
72
|
Label: 'Locale'
|
|
@@ -93,14 +93,13 @@ annotate AdminService.Books.texts {
|
|
|
93
93
|
ValueList.entity: 'Languages',
|
|
94
94
|
Common.ValueListWithFixedValues, //show as drop down, not a dialog
|
|
95
95
|
)
|
|
96
|
-
}
|
|
96
|
+
};
|
|
97
97
|
|
|
98
98
|
// In addition we need to expose Languages through AdminService as a target for ValueList
|
|
99
99
|
using {sap} from '@sap/cds/common';
|
|
100
100
|
|
|
101
101
|
extend service AdminService {
|
|
102
|
-
@readonly
|
|
103
|
-
entity Languages as projection on sap.common.Languages;
|
|
102
|
+
@readonly entity Languages as projection on sap.common.Languages;
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
// Workaround for Fiori popup for asking user to enter a new UUID on Create
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# JCI app descriptor contains lower case TITLE
|
|
5
|
-
appTitle=Bookshop Sample
|
|
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
|
+
appTitle=Manage Books
|
|
2
|
+
appSubTitle=Manage bookshop inventory
|
|
3
|
+
appDescription=Manage your bookshop inventory with ease.
|
|
@@ -1,129 +1,133 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_version": "1.
|
|
2
|
+
"_version": "1.49.0",
|
|
3
3
|
"sap.app": {
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"id": "ui5template.basicSAPUI5ApplicationProject",
|
|
20
|
-
"-id": "ui5template.smartTemplate",
|
|
21
|
-
"-version": "1.40.12"
|
|
4
|
+
"applicationVersion": {
|
|
5
|
+
"version": "1.0.0"
|
|
6
|
+
},
|
|
7
|
+
"id": "books",
|
|
8
|
+
"type": "application",
|
|
9
|
+
"title": "{{appTitle}}",
|
|
10
|
+
"description": "{{appDescription}}",
|
|
11
|
+
"i18n": "i18n/i18n.properties",
|
|
12
|
+
"dataSources": {
|
|
13
|
+
"AdminService": {
|
|
14
|
+
"uri": "/admin/",
|
|
15
|
+
"type": "OData",
|
|
16
|
+
"settings": {
|
|
17
|
+
"odataVersion": "4.0"
|
|
18
|
+
}
|
|
22
19
|
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"sap.ui": {
|
|
23
|
+
"technology": "UI5",
|
|
24
|
+
"fullWidth": false,
|
|
25
|
+
"deviceTypes": {
|
|
26
|
+
"desktop": true,
|
|
27
|
+
"tablet": true,
|
|
28
|
+
"phone": true
|
|
29
|
+
}
|
|
23
30
|
},
|
|
24
31
|
"sap.ui5": {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"minUI5Version": "1.115.1",
|
|
34
|
+
"libs": {
|
|
35
|
+
"sap.fe.templates": {}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"models": {
|
|
39
|
+
"i18n": {
|
|
40
|
+
"type": "sap.ui.model.resource.ResourceModel",
|
|
41
|
+
"uri": "i18n/i18n.properties"
|
|
29
42
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
"": {
|
|
44
|
+
"dataSource": "AdminService",
|
|
45
|
+
"settings": {
|
|
46
|
+
"synchronizationMode": "None",
|
|
47
|
+
"operationMode": "Server",
|
|
48
|
+
"autoExpandSelect": true,
|
|
49
|
+
"earlyRequests": true,
|
|
50
|
+
"groupProperties": {
|
|
51
|
+
"default": {
|
|
52
|
+
"submit": "Auto"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"routing": {
|
|
59
|
+
"routes": [
|
|
60
|
+
{
|
|
61
|
+
"pattern": ":?query:",
|
|
62
|
+
"name": "BooksList",
|
|
63
|
+
"target": "BooksList"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"pattern": "Books({key}):?query:",
|
|
67
|
+
"name": "BooksDetails",
|
|
68
|
+
"target": "BooksDetails"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"pattern": "Books({key}/author({key2}):?query:",
|
|
72
|
+
"name": "AuthorsDetails",
|
|
73
|
+
"target": "AuthorsDetails"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"targets": {
|
|
77
|
+
"BooksList": {
|
|
78
|
+
"type": "Component",
|
|
79
|
+
"id": "BooksList",
|
|
80
|
+
"name": "sap.fe.templates.ListReport",
|
|
81
|
+
"options": {
|
|
82
|
+
"settings": {
|
|
83
|
+
"entitySet": "Books",
|
|
84
|
+
"initialLoad": true,
|
|
85
|
+
"navigation": {
|
|
86
|
+
"Books": {
|
|
87
|
+
"detail": {
|
|
88
|
+
"route": "BooksDetails"
|
|
46
89
|
}
|
|
90
|
+
}
|
|
47
91
|
}
|
|
92
|
+
}
|
|
48
93
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"pattern": "Books({key}/author({key2}):?query:",
|
|
64
|
-
"name": "AuthorsDetails",
|
|
65
|
-
"target": "AuthorsDetails"
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"targets": {
|
|
69
|
-
"BooksList": {
|
|
70
|
-
"type": "Component",
|
|
71
|
-
"id": "BooksList",
|
|
72
|
-
"name": "sap.fe.templates.ListReport",
|
|
73
|
-
"options": {
|
|
74
|
-
"settings" : {
|
|
75
|
-
"entitySet" : "Books",
|
|
76
|
-
"initialLoad": true,
|
|
77
|
-
"navigation" : {
|
|
78
|
-
"Books" : {
|
|
79
|
-
"detail" : {
|
|
80
|
-
"route" : "BooksDetails"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"BooksDetails": {
|
|
88
|
-
"type": "Component",
|
|
89
|
-
"id": "BooksDetailsList",
|
|
90
|
-
"name": "sap.fe.templates.ObjectPage",
|
|
91
|
-
"options": {
|
|
92
|
-
"settings" : {
|
|
93
|
-
"entitySet" : "Books",
|
|
94
|
-
"navigation" : {
|
|
95
|
-
"Authors" : {
|
|
96
|
-
"detail" : {
|
|
97
|
-
"route" : "AuthorsDetails"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
"AuthorsDetails": {
|
|
105
|
-
"type": "Component",
|
|
106
|
-
"id": "AuthorsDetailsList",
|
|
107
|
-
"name": "sap.fe.templates.ObjectPage",
|
|
108
|
-
"options": {
|
|
109
|
-
"settings" : {
|
|
110
|
-
"entitySet" : "Authors"
|
|
111
|
-
}
|
|
94
|
+
},
|
|
95
|
+
"BooksDetails": {
|
|
96
|
+
"type": "Component",
|
|
97
|
+
"id": "BooksDetailsList",
|
|
98
|
+
"name": "sap.fe.templates.ObjectPage",
|
|
99
|
+
"options": {
|
|
100
|
+
"settings": {
|
|
101
|
+
"entitySet": "Books",
|
|
102
|
+
"navigation": {
|
|
103
|
+
"Authors": {
|
|
104
|
+
"detail": {
|
|
105
|
+
"route": "AuthorsDetails"
|
|
112
106
|
}
|
|
107
|
+
}
|
|
113
108
|
}
|
|
109
|
+
}
|
|
114
110
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
"
|
|
111
|
+
},
|
|
112
|
+
"AuthorsDetails": {
|
|
113
|
+
"type": "Component",
|
|
114
|
+
"id": "AuthorsDetailsList",
|
|
115
|
+
"name": "sap.fe.templates.ObjectPage",
|
|
116
|
+
"options": {
|
|
117
|
+
"settings": {
|
|
118
|
+
"entitySet": "Authors"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
119
122
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
"
|
|
123
|
+
},
|
|
124
|
+
"contentDensities": {
|
|
125
|
+
"compact": true,
|
|
126
|
+
"cozy": true
|
|
127
|
+
}
|
|
124
128
|
},
|
|
125
129
|
"sap.fiori": {
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
"registrationIds": [],
|
|
131
|
+
"archeType": "transactional"
|
|
128
132
|
}
|
|
129
|
-
}
|
|
133
|
+
}
|
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
"config": {
|
|
6
6
|
"catalogs": [],
|
|
7
7
|
"groups": [
|
|
8
|
+
{
|
|
9
|
+
"id": "Bookshop",
|
|
10
|
+
"title": "Bookshop",
|
|
11
|
+
"isPreset": true,
|
|
12
|
+
"isVisible": true,
|
|
13
|
+
"isGroupLocked": false,
|
|
14
|
+
"tiles": [
|
|
15
|
+
{
|
|
16
|
+
"id": "BrowseBooks",
|
|
17
|
+
"tileType": "sap.ushell.ui.tile.StaticTile",
|
|
18
|
+
"properties": {
|
|
19
|
+
"title": "Browse Books",
|
|
20
|
+
"targetURL": "#Books-display"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
8
25
|
{
|
|
9
26
|
"id": "Administration",
|
|
10
27
|
"title": "Administration",
|
|
@@ -35,6 +52,27 @@
|
|
|
35
52
|
"adapter": {
|
|
36
53
|
"config": {
|
|
37
54
|
"inbounds": {
|
|
55
|
+
"BrowseBooks": {
|
|
56
|
+
"semanticObject": "Books",
|
|
57
|
+
"action": "display",
|
|
58
|
+
"title": "Browse Books",
|
|
59
|
+
"signature": {
|
|
60
|
+
"parameters": {
|
|
61
|
+
"Books.ID": {
|
|
62
|
+
"renameTo": "ID"
|
|
63
|
+
},
|
|
64
|
+
"Authors.books.ID": {
|
|
65
|
+
"renameTo": "ID"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"additionalParameters": "ignored"
|
|
69
|
+
},
|
|
70
|
+
"resolutionResult": {
|
|
71
|
+
"applicationType": "SAPUI5",
|
|
72
|
+
"additionalInformation": "SAPUI5.Component=bookshop",
|
|
73
|
+
"url": "browse/webapp"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
38
76
|
"ManageBooks": {
|
|
39
77
|
"semanticObject": "Books",
|
|
40
78
|
"action": "manage",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
using { CatalogService } from '../../srv/cat-service.cds';
|
|
2
|
+
|
|
3
|
+
////////////////////////////////////////////////////////////////////////////
|
|
4
|
+
//
|
|
5
|
+
// Books Object Page
|
|
6
|
+
//
|
|
7
|
+
annotate CatalogService.Books with @(UI : {
|
|
8
|
+
HeaderInfo: {
|
|
9
|
+
TypeName : 'Book',
|
|
10
|
+
TypeNamePlural: 'Books',
|
|
11
|
+
Description : {Value : author}
|
|
12
|
+
},
|
|
13
|
+
HeaderFacets: [{
|
|
14
|
+
$Type : 'UI.ReferenceFacet',
|
|
15
|
+
Label : '{i18n>Description}',
|
|
16
|
+
Target: '@UI.FieldGroup#Descr'
|
|
17
|
+
}, ],
|
|
18
|
+
Facets: [{
|
|
19
|
+
$Type : 'UI.ReferenceFacet',
|
|
20
|
+
Label : '{i18n>Details}',
|
|
21
|
+
Target: '@UI.FieldGroup#Price'
|
|
22
|
+
}, ],
|
|
23
|
+
FieldGroup #Descr: {Data : [{Value : descr}, ]},
|
|
24
|
+
FieldGroup #Price: {Data : [
|
|
25
|
+
{Value: price},
|
|
26
|
+
{
|
|
27
|
+
Value: currency.symbol,
|
|
28
|
+
Label: '{i18n>Currency}'
|
|
29
|
+
},
|
|
30
|
+
]},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
////////////////////////////////////////////////////////////////////////////
|
|
34
|
+
//
|
|
35
|
+
// Books List Page
|
|
36
|
+
//
|
|
37
|
+
annotate CatalogService.Books with @(UI : {
|
|
38
|
+
SelectionFields: [
|
|
39
|
+
ID,
|
|
40
|
+
price,
|
|
41
|
+
currency_code
|
|
42
|
+
],
|
|
43
|
+
LineItem: [
|
|
44
|
+
{
|
|
45
|
+
Value: ID,
|
|
46
|
+
Label: '{i18n>Title}'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
Value: author,
|
|
50
|
+
Label: '{i18n>Author}'
|
|
51
|
+
},
|
|
52
|
+
{Value: genre.name},
|
|
53
|
+
{Value: price},
|
|
54
|
+
{Value: currency.symbol},
|
|
55
|
+
]
|
|
56
|
+
});
|