@sap/cds-dk 6.8.3 → 7.0.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.
- package/bin/activate.js +15 -7
- package/bin/add.js +29 -15
- package/bin/bind.js +49 -116
- package/bin/build.js +114 -0
- package/bin/cds.js +67 -24
- package/bin/compile/index.js +2 -2
- package/bin/deploy/index.js +46 -39
- package/bin/deploy/to-hana.js +11 -8
- package/bin/deploy/to-postgres.js +8 -2
- package/bin/deploy/to-sqlite.js +0 -1
- package/bin/env.js +75 -41
- package/bin/eval.js +3 -3
- package/bin/extend.js +17 -10
- package/bin/help.js +22 -21
- package/bin/import.js +10 -7
- package/bin/init.js +38 -17
- package/bin/login.js +69 -55
- package/bin/logout.js +12 -9
- package/bin/migrate.js +10 -4
- package/bin/pull.js +12 -5
- package/bin/push.js +24 -13
- package/bin/repl.js +1 -0
- package/bin/run.js +25 -0
- package/bin/subscribe.js +13 -8
- package/bin/unsubscribe.js +15 -8
- package/bin/upgrade.js +15 -9
- package/bin/util/log.js +24 -0
- package/bin/version.js +124 -0
- package/bin/watch.js +1 -35
- package/bin/watched.js +39 -0
- package/lib/bind/KubernetesApiAccessor.js +2 -2
- package/lib/bind/bindingManager.js +1 -1
- package/lib/bind/bindingUtil.js +0 -9
- package/lib/bind/cfKeyProvider.js +10 -72
- package/lib/bind/index.js +114 -0
- package/lib/bind/kubernetesCredentialsProvider.js +2 -2
- package/lib/bind/userCdsrcJsonStorageProvider.js +7 -44
- package/lib/build/buildTaskEngine.js +355 -0
- package/lib/build/buildTaskFactory.js +284 -0
- package/lib/build/buildTaskHandler.js +240 -0
- package/lib/build/buildTaskProvider.js +22 -0
- package/lib/build/buildTaskProviderFactory.js +182 -0
- package/lib/build/constants.js +56 -0
- package/lib/build/index.js +21 -0
- package/lib/build/provider/buildTaskHandlerEdmx.js +83 -0
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +132 -0
- package/lib/build/provider/buildTaskHandlerInternal.js +228 -0
- package/lib/build/provider/buildTaskProviderInternal.js +370 -0
- package/lib/build/provider/fiori/index.js +167 -0
- package/lib/build/provider/hana/2migration.js +179 -0
- package/lib/build/provider/hana/index.js +522 -0
- package/lib/build/provider/hana/migrationtable.js +472 -0
- package/lib/build/provider/hana/template/.hdiconfig-all +163 -0
- package/lib/build/provider/hana/template/.hdiconfig-cloud +137 -0
- package/lib/build/provider/hana/template/.hdinamespace +4 -0
- package/lib/build/provider/hana/template/package.json +12 -0
- package/lib/build/provider/hana/template/undeploy.json +5 -0
- package/lib/build/provider/java/index.js +93 -0
- package/lib/build/provider/java-cf/index.js +1 -0
- package/lib/build/provider/mtx/index.js +37 -0
- package/lib/build/provider/mtx/resourcesTarBuilder.js +94 -0
- package/lib/build/provider/mtx-extension/index.js +131 -0
- package/lib/build/provider/mtx-sidecar/index.js +138 -0
- package/lib/build/provider/node-cf/index.js +1 -0
- package/lib/build/provider/nodejs/index.js +178 -0
- package/lib/build/util.js +263 -0
- package/lib/cds.js +9 -21
- package/lib/client/auth_manager.js +39 -16
- package/lib/client/helper/dependency_helper.js +7 -6
- package/lib/client/push.js +2 -1
- package/lib/client/settings_manager.js +10 -39
- package/lib/deploy/to-hana/hana.js +273 -0
- package/lib/deploy/to-hana/hdiDeployUtil.js +68 -0
- package/lib/deploy/to-hana/mtaUtil.js +171 -0
- package/lib/import/asyncapi/importAsyncAPI.js +3 -2
- package/lib/import/asyncapi/index.js +5 -2
- package/lib/import/asyncapi/parserContext.js +67 -26
- package/lib/import/asyncapi/utils.js +34 -3
- package/lib/import/common.js +40 -30
- package/lib/import/importapi.js +36 -35
- package/lib/index.js +12 -17
- package/lib/init/constants.js +36 -71
- package/lib/init/index.js +18 -52
- package/lib/init/template/_merging/registry-mta.js +21 -3
- package/lib/init/template/approuter/files/mta.yaml.hbs +29 -29
- package/lib/init/template/approuter/files/values.yaml.hbs +5 -5
- package/lib/init/template/approuter/files/xs-app.json.hbs +8 -2
- package/lib/init/template/approuter/index.js +7 -8
- package/lib/init/template/auditlog/files/mta.yaml.hbs +5 -5
- package/lib/init/template/auditlog/files/package.json.hbs +13 -13
- package/lib/init/template/auditlog/index.js +3 -3
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +22 -22
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +3 -3
- package/lib/init/template/connectivity/files/mta.yaml.hbs +14 -0
- package/lib/init/template/connectivity/files/package.json.hbs +17 -0
- package/lib/init/template/connectivity/index.js +21 -4
- package/lib/init/template/data/index.js +5 -1
- package/lib/init/template/destination/files/mta.yaml.hbs +14 -0
- package/lib/init/template/destination/files/package.json.hbs +17 -0
- package/lib/init/template/{destinations → destination}/index.js +19 -13
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging/files/xs-security.json.hbs +19 -0
- package/lib/init/template/enterprise-messaging/index.js +27 -6
- package/lib/init/template/enterprise-messaging-shared/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging-shared/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -5
- package/lib/init/template/extensibility/files/package.json.hbs +10 -10
- package/lib/init/template/extensibility/index.js +8 -9
- package/lib/init/template/file-based-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/file-based-messaging/index.js +3 -4
- package/lib/init/template/hana/files/db/package.json +1 -1
- package/lib/init/template/hana/files/mta.yaml.hbs +21 -21
- package/lib/init/template/hana/files/package.json.hbs +16 -22
- package/lib/init/template/hana/files/values.yaml.hbs +1 -1
- package/lib/init/template/hana/index.js +5 -15
- package/lib/init/template/helm/files/Chart.yaml.hbs +4 -4
- package/lib/init/template/helm/files/values.yaml.hbs +6 -6
- package/lib/init/template/helm/index.js +5 -10
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +37 -31
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +13 -14
- package/lib/init/template/helm/subcharts/content-deployment/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.md +116 -116
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/_helpers.tpl +9 -9
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +2 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +15 -15
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/web-application/templates/NOTES.txt +15 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +23 -23
- package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +4 -4
- package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +17 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +24 -3
- package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/values.md +141 -123
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +7 -0
- package/lib/init/template/helm/subcharts/web-application/values.yaml +1 -0
- package/lib/init/template/html5-repo/index.js +4 -5
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/kibana-logging/files/package.json.hbs +9 -9
- package/lib/init/template/kibana-logging/index.js +3 -4
- package/lib/init/template/lint/index.js +3 -3
- package/lib/init/template/mta/files/mta.yaml.hbs +14 -14
- package/lib/init/template/mta/files/package.json +5 -0
- package/lib/init/template/mta/index.js +12 -13
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +29 -27
- package/lib/init/template/multitenancy/files/package.json.hbs +17 -14
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -7
- package/lib/init/template/multitenancy/files/values.yaml.hbs +19 -19
- package/lib/init/template/multitenancy/index.js +14 -16
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/nodejs/index.js +5 -8
- package/lib/init/template/redis-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/redis-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/redis-messaging/index.js +4 -5
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +43 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +14 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +114 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +8 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +129 -0
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +57 -0
- package/lib/init/template/sample/files/app/common.cds +263 -0
- package/lib/init/template/sample/files/app/index.html +30 -0
- package/lib/init/template/sample/files/app/services.cds +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -0
- package/lib/init/template/sample/files/db/schema.cds +31 -0
- package/lib/init/template/sample/files/nodejs/admin-service.js +12 -0
- package/lib/init/template/sample/files/nodejs/cat-service.js +26 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +5 -0
- package/lib/init/template/sample/files/srv/cat-service.cds +16 -0
- package/lib/init/template/sample/index.js +24 -0
- package/lib/init/template/sample-tiny/index.js +39 -0
- package/lib/init/template/samples/index.js +5 -56
- package/lib/init/template/sqlite/files/package.json.hbs +13 -13
- package/lib/init/template/sqlite/index.js +2 -2
- package/lib/init/template/templateBase.js +24 -1
- package/lib/init/template/toggles/files/package.json.hbs +10 -10
- package/lib/init/template/toggles/index.js +3 -3
- package/lib/init/template/typer/files/gitignore +1 -0
- package/lib/init/template/typer/files/package.json +8 -0
- package/lib/init/template/typer/files/xsconfig.json +9 -0
- package/lib/init/template/typer/index.js +36 -0
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +12 -12
- package/lib/init/template/xsuaa/files/package.json.hbs +13 -13
- package/lib/init/template/xsuaa/files/values.yaml.hbs +8 -8
- package/lib/init/template/xsuaa/index.js +8 -19
- package/lib/init/util/merge.js +73 -59
- package/lib/init/util/mvn.js +21 -17
- package/lib/init/util/projectReader.js +49 -87
- package/lib/init/util/xml.js +14 -23
- package/lib/util/cfUtil.js +366 -0
- package/lib/util/command.js +3 -3
- package/lib/util/gitUtil.js +55 -0
- package/lib/util/version.js +27 -0
- package/npm-shrinkwrap.json +337 -275
- package/package.json +6 -6
- package/CHANGELOG.md +0 -1460
- package/bin/build/all.js +0 -88
- package/bin/build/index.js +0 -82
- package/lib/compile/index.js +0 -14
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data/my.bookshop-Books.csv +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data-model.cds +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/srv/cat-service.cds.hbs +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { join, relative } = require('path');
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
3
|
const { mkdirp } = cds.utils
|
|
4
|
-
const { COMMAND_ADD,
|
|
4
|
+
const { COMMAND_ADD, OPTIONS: { JAVA, NODEJS }, URLS } = require('../../constants')
|
|
5
5
|
const { copyFiles } = require('../../util/template')
|
|
6
6
|
const LOG = console
|
|
7
7
|
|
|
@@ -17,21 +17,18 @@ module.exports = class NodejsTemplate extends require('../templateBase') {
|
|
|
17
17
|
throw new Error(`You can't change the type of an existing project.`);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
if (this.options.add.has(
|
|
21
|
-
throw new Error(`Only one runtime per project is supported. Specify either ${
|
|
20
|
+
if (this.options.add.has(JAVA)) {
|
|
21
|
+
throw new Error(`Only one runtime per project is supported. Specify either ${JAVA} or ${NODEJS}.`);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
async run() {
|
|
28
|
-
const
|
|
28
|
+
const { db, srv, app } = (await this.getEnv()).folders
|
|
29
29
|
const { projectPath, projectName } = this
|
|
30
30
|
await copyFiles(join(__dirname, 'files'), projectPath, { projectName }, this.options.force)
|
|
31
|
-
|
|
32
|
-
await mkdirp(env.folders.db);
|
|
33
|
-
await mkdirp(env.folders.srv);
|
|
34
|
-
await mkdirp(env.folders.app);
|
|
31
|
+
await Promise.all([db, srv, app].map(p => mkdirp(p)))
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
async finalize() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
modules:
|
|
3
|
-
- name: {{
|
|
4
|
-
type: {{
|
|
5
|
-
path: {{&
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
6
|
requires:
|
|
7
|
-
- name: {{
|
|
7
|
+
- name: {{appName}}-redis
|
|
8
8
|
|
|
9
9
|
resources:
|
|
10
|
-
- name: {{
|
|
10
|
+
- name: {{appName}}-redis
|
|
11
11
|
type: org.cloudfoundry.managed-service
|
|
12
12
|
parameters:
|
|
13
13
|
service: redis-cache
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"redis": "^4"
|
|
5
5
|
},
|
|
6
6
|
"cds": {
|
|
7
|
-
{{/
|
|
7
|
+
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#
|
|
10
|
-
"[{{
|
|
11
|
-
{{/
|
|
9
|
+
{{#profile}}
|
|
10
|
+
"[{{profile}}]": {
|
|
11
|
+
{{/profile}}
|
|
12
12
|
"messaging": {
|
|
13
13
|
"kind": "redis-messaging"
|
|
14
14
|
}
|
|
15
|
-
{{#
|
|
15
|
+
{{#profile}}
|
|
16
16
|
}
|
|
17
|
-
{{/
|
|
17
|
+
{{/profile}}
|
|
18
18
|
}
|
|
19
|
-
{{#
|
|
19
|
+
{{#isNodejs}}
|
|
20
20
|
}
|
|
21
|
-
{{/
|
|
21
|
+
{{/isNodejs}}
|
|
22
22
|
}
|
|
@@ -8,8 +8,7 @@ const { srvNode4, srvJava4, redis } = require('../_merging/registry-mta')
|
|
|
8
8
|
module.exports = class RedisMessagingTemplate extends require('../templateBase') {
|
|
9
9
|
|
|
10
10
|
async canRun() {
|
|
11
|
-
const
|
|
12
|
-
const { hasMta, hasHelm, isJava } = projectDescriptor.cap
|
|
11
|
+
const { hasMta, hasHelm, isJava } = await readProject(this.options)
|
|
13
12
|
if (isJava) throw `'cds add redis-messaging' is not available for Java yet`
|
|
14
13
|
if (hasHelm && !hasMta) throw `'cds add redis-messaging' is not available for Kyma yet`
|
|
15
14
|
return true
|
|
@@ -21,15 +20,15 @@ module.exports = class RedisMessagingTemplate extends require('../templateBase')
|
|
|
21
20
|
|
|
22
21
|
async run() {
|
|
23
22
|
const projectDescriptor = await readProject(this.options)
|
|
24
|
-
const { configFile } = projectDescriptor
|
|
25
|
-
projectDescriptor.
|
|
23
|
+
const { configFile } = projectDescriptor
|
|
24
|
+
projectDescriptor.shortcut = !(await read(configFile)).cds?.requires?.messaging?.kind
|
|
26
25
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
27
26
|
await this.runDependentMerging()
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
async runDependentMerging() {
|
|
31
30
|
const projectDescriptor = await readProject(this.options)
|
|
32
|
-
const { hasMta, isNodejs, srvPath } = projectDescriptor
|
|
31
|
+
const { hasMta, isNodejs, srvPath } = projectDescriptor
|
|
33
32
|
|
|
34
33
|
if (hasMta) {
|
|
35
34
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Books = Books
|
|
2
|
+
Book = Book
|
|
3
|
+
ID = ID
|
|
4
|
+
Title = Title
|
|
5
|
+
Author = Author
|
|
6
|
+
AuthorID = Author ID
|
|
7
|
+
Stock = Stock
|
|
8
|
+
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
|
+
Age = Age
|
|
17
|
+
Lifetime = Lifetime
|
|
18
|
+
Authors = Authors
|
|
19
|
+
|
|
20
|
+
Order = Order
|
|
21
|
+
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
|
+
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
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Books = Bücher
|
|
2
|
+
Book = Buch
|
|
3
|
+
ID = ID
|
|
4
|
+
Title = Titel
|
|
5
|
+
Authors = Autoren
|
|
6
|
+
Author = Autor
|
|
7
|
+
AuthorID = ID des Autors
|
|
8
|
+
AuthorName = Name des Autors
|
|
9
|
+
Age = Alter
|
|
10
|
+
Name = Name
|
|
11
|
+
Stock = Bestand
|
|
12
|
+
Order = Bestellung
|
|
13
|
+
Orders = Bestellungen
|
|
14
|
+
Price = Preis
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
using { AdminService } from '../../srv/admin-service.cds';
|
|
2
|
+
using { sap.capire.bookshop } from '../../db/schema';
|
|
3
|
+
|
|
4
|
+
////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
//
|
|
6
|
+
// Books Object Page
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
annotate AdminService.Books with @(UI: {
|
|
10
|
+
Facets : [
|
|
11
|
+
{
|
|
12
|
+
$Type : 'UI.ReferenceFacet',
|
|
13
|
+
Label : '{i18n>General}',
|
|
14
|
+
Target: '@UI.FieldGroup#General'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
$Type : 'UI.ReferenceFacet',
|
|
18
|
+
Label : '{i18n>Translations}',
|
|
19
|
+
Target: 'texts/@UI.LineItem'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
$Type : 'UI.ReferenceFacet',
|
|
23
|
+
Label : '{i18n>Details}',
|
|
24
|
+
Target: '@UI.FieldGroup#Details'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
$Type : 'UI.ReferenceFacet',
|
|
28
|
+
Label : '{i18n>Admin}',
|
|
29
|
+
Target: '@UI.FieldGroup#Admin'
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
FieldGroup #General: {Data: [
|
|
33
|
+
{Value: title},
|
|
34
|
+
{Value: author_ID},
|
|
35
|
+
{Value: genre_ID},
|
|
36
|
+
{Value: descr},
|
|
37
|
+
]},
|
|
38
|
+
FieldGroup #Details: {Data: [
|
|
39
|
+
{Value: stock},
|
|
40
|
+
{Value: price},
|
|
41
|
+
{
|
|
42
|
+
Value: currency_code,
|
|
43
|
+
Label: '{i18n>Currency}'
|
|
44
|
+
},
|
|
45
|
+
]},
|
|
46
|
+
FieldGroup #Admin : {Data: [
|
|
47
|
+
{Value: createdBy},
|
|
48
|
+
{Value: createdAt},
|
|
49
|
+
{Value: modifiedBy},
|
|
50
|
+
{Value: modifiedAt}
|
|
51
|
+
]}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
////////////////////////////////////////////////////////////
|
|
56
|
+
//
|
|
57
|
+
// Draft for Localized Data
|
|
58
|
+
//
|
|
59
|
+
|
|
60
|
+
annotate sap.capire.bookshop.Books with @fiori.draft.enabled;
|
|
61
|
+
annotate AdminService.Books with @odata.draft.enabled;
|
|
62
|
+
|
|
63
|
+
annotate AdminService.Books.texts with @(UI: {
|
|
64
|
+
Identification : [{Value: title}],
|
|
65
|
+
SelectionFields: [
|
|
66
|
+
locale,
|
|
67
|
+
title
|
|
68
|
+
],
|
|
69
|
+
LineItem : [
|
|
70
|
+
{
|
|
71
|
+
Value: locale,
|
|
72
|
+
Label: 'Locale'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
Value: title,
|
|
76
|
+
Label: 'Title'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
Value: descr,
|
|
80
|
+
Label: 'Description'
|
|
81
|
+
},
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
annotate AdminService.Books.texts with {
|
|
86
|
+
ID @UI.Hidden;
|
|
87
|
+
ID_texts @UI.Hidden;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Add Value Help for Locales
|
|
91
|
+
annotate AdminService.Books.texts {
|
|
92
|
+
locale @(
|
|
93
|
+
ValueList.entity: 'Languages',
|
|
94
|
+
Common.ValueListWithFixedValues, //show as drop down, not a dialog
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// In addition we need to expose Languages through AdminService as a target for ValueList
|
|
99
|
+
using {sap} from '@sap/cds/common';
|
|
100
|
+
|
|
101
|
+
extend service AdminService {
|
|
102
|
+
@readonly
|
|
103
|
+
entity Languages as projection on sap.common.Languages;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Workaround for Fiori popup for asking user to enter a new UUID on Create
|
|
107
|
+
annotate AdminService.Books with {
|
|
108
|
+
ID @Core.Computed;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Show Genre as drop down, not a dialog
|
|
112
|
+
annotate AdminService.Books with {
|
|
113
|
+
genre @Common.ValueListWithFixedValues;
|
|
114
|
+
}
|
|
@@ -0,0 +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
|
|
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
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_version": "1.8.0",
|
|
3
|
+
"sap.app": {
|
|
4
|
+
"id": "books",
|
|
5
|
+
"type": "application",
|
|
6
|
+
"title": "Manage Books",
|
|
7
|
+
"description": "Sample Application",
|
|
8
|
+
"i18n": "i18n/i18n.properties",
|
|
9
|
+
"dataSources": {
|
|
10
|
+
"AdminService": {
|
|
11
|
+
"uri": "/admin/",
|
|
12
|
+
"type": "OData",
|
|
13
|
+
"settings": {
|
|
14
|
+
"odataVersion": "4.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"-sourceTemplate": {
|
|
19
|
+
"id": "ui5template.basicSAPUI5ApplicationProject",
|
|
20
|
+
"-id": "ui5template.smartTemplate",
|
|
21
|
+
"-version": "1.40.12"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"sap.ui5": {
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"libs": {
|
|
27
|
+
"sap.fe.templates": {}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"models": {
|
|
31
|
+
"i18n": {
|
|
32
|
+
"type": "sap.ui.model.resource.ResourceModel",
|
|
33
|
+
"uri": "i18n/i18n.properties"
|
|
34
|
+
},
|
|
35
|
+
"": {
|
|
36
|
+
"dataSource": "AdminService",
|
|
37
|
+
"settings": {
|
|
38
|
+
"synchronizationMode": "None",
|
|
39
|
+
"operationMode": "Server",
|
|
40
|
+
"autoExpandSelect" : true,
|
|
41
|
+
"earlyRequests": true,
|
|
42
|
+
"groupProperties": {
|
|
43
|
+
"default": {
|
|
44
|
+
"submit": "Auto"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"routing": {
|
|
51
|
+
"routes": [
|
|
52
|
+
{
|
|
53
|
+
"pattern": ":?query:",
|
|
54
|
+
"name": "BooksList",
|
|
55
|
+
"target": "BooksList"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"pattern": "Books({key}):?query:",
|
|
59
|
+
"name": "BooksDetails",
|
|
60
|
+
"target": "BooksDetails"
|
|
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
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"contentDensities": {
|
|
117
|
+
"compact": true,
|
|
118
|
+
"cozy": true
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"sap.ui": {
|
|
122
|
+
"technology": "UI5",
|
|
123
|
+
"fullWidth": false
|
|
124
|
+
},
|
|
125
|
+
"sap.fiori": {
|
|
126
|
+
"registrationIds": [],
|
|
127
|
+
"archeType": "transactional"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"services": {
|
|
3
|
+
"LaunchPage": {
|
|
4
|
+
"adapter": {
|
|
5
|
+
"config": {
|
|
6
|
+
"catalogs": [],
|
|
7
|
+
"groups": [
|
|
8
|
+
{
|
|
9
|
+
"id": "Administration",
|
|
10
|
+
"title": "Administration",
|
|
11
|
+
"isPreset": true,
|
|
12
|
+
"isVisible": true,
|
|
13
|
+
"isGroupLocked": false,
|
|
14
|
+
"tiles": [
|
|
15
|
+
{
|
|
16
|
+
"id": "ManageBooks",
|
|
17
|
+
"tileType": "sap.ushell.ui.tile.StaticTile",
|
|
18
|
+
"properties": {
|
|
19
|
+
"title": "Manage Books",
|
|
20
|
+
"targetURL": "#Books-manage"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"NavTargetResolution": {
|
|
30
|
+
"config": {
|
|
31
|
+
"enableClientSideTargetResolution": true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"ClientSideTargetResolution": {
|
|
35
|
+
"adapter": {
|
|
36
|
+
"config": {
|
|
37
|
+
"inbounds": {
|
|
38
|
+
"ManageBooks": {
|
|
39
|
+
"semanticObject": "Books",
|
|
40
|
+
"action": "manage",
|
|
41
|
+
"title": "Manage Books",
|
|
42
|
+
"signature": {
|
|
43
|
+
"parameters": {},
|
|
44
|
+
"additionalParameters": "allowed"
|
|
45
|
+
},
|
|
46
|
+
"resolutionResult": {
|
|
47
|
+
"applicationType": "SAPUI5",
|
|
48
|
+
"additionalInformation": "SAPUI5.Component=books",
|
|
49
|
+
"url": "admin-books/webapp"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|