@sap/cds-dk 7.0.0 → 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 +13 -8
- package/bin/compile/index.js +3 -3
- package/bin/env.js +4 -1
- package/bin/help.js +2 -3
- package/lib/bind/bindingManager.js +1 -1
- package/lib/bind/bindingResolver.js +1 -1
- package/lib/bind/bindingUtil.js +1 -1
- package/lib/build/buildTaskEngine.js +1 -1
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +2 -1
- package/lib/build/provider/buildTaskHandlerInternal.js +1 -1
- package/lib/build/provider/java/index.js +2 -2
- package/lib/build/provider/mtx-sidecar/index.js +3 -4
- package/lib/build/provider/nodejs/index.js +6 -5
- package/lib/build/util.js +8 -0
- package/lib/cds.js +2 -2
- package/lib/import/asyncapi/parserContext.js +2 -2
- package/lib/index.js +6 -0
- package/lib/init/constants.js +4 -4
- package/lib/init/index.js +37 -38
- package/lib/init/template/_merging/registry-mta.js +2 -2
- package/lib/init/template/approuter/index.js +12 -8
- package/lib/init/template/auditlog/index.js +7 -7
- package/lib/init/template/cf-manifest/index.js +5 -5
- package/lib/init/template/connectivity/index.js +7 -7
- package/lib/init/template/data/index.js +1 -1
- package/lib/init/template/destination/index.js +6 -6
- package/lib/init/template/enterprise-messaging/index.js +10 -10
- package/lib/init/template/enterprise-messaging-shared/index.js +8 -8
- package/lib/init/template/extensibility/index.js +6 -6
- package/lib/init/template/file-based-messaging/index.js +4 -4
- package/lib/init/template/hana/index.js +11 -11
- package/lib/init/template/helm/index.js +5 -5
- package/lib/init/template/html5-repo/index.js +2 -2
- package/lib/init/template/java/index.js +20 -37
- 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/files/package.sidecar.json.hbs +1 -1
- package/lib/init/template/multitenancy/index.js +18 -12
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/nodejs/index.js +12 -19
- package/lib/init/template/pipeline/index.js +1 -1
- package/lib/init/template/redis-messaging/index.js +7 -7
- 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/samples/index.js +3 -3
- package/lib/init/template/sqlite/files/package.json.hbs +1 -21
- package/lib/init/template/sqlite/index.js +4 -4
- package/lib/init/template/templateBase.js +1 -1
- package/lib/init/template/{sample-tiny → tiny-sample}/files/nodejs/db/data-model.cds +1 -1
- package/lib/init/template/{sample-tiny → tiny-sample}/files/nodejs/srv/cat-service.cds.hbs +1 -1
- package/lib/init/template/{sample-tiny → tiny-sample}/index.js +2 -2
- package/lib/init/template/toggles/index.js +3 -3
- package/lib/init/template/typer/index.js +6 -5
- package/lib/init/template/xsuaa/index.js +9 -9
- package/lib/init/util/md5.js +2 -2
- package/lib/init/util/merge.js +9 -9
- package/lib/init/util/mvn.js +1 -1
- package/lib/init/util/projectReader.js +4 -4
- package/lib/util/fs.js +10 -10
- package/lib/util/term.js +2 -0
- package/npm-shrinkwrap.json +281 -334
- 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
- /package/lib/init/template/{sample-tiny → tiny-sample}/files/nodejs/db/data/my.bookshop-Books.csv +0 -0
|
@@ -1,63 +1,46 @@
|
|
|
1
|
-
const
|
|
2
|
-
const os = require('os');
|
|
3
|
-
const { join, relative } = require('path');
|
|
4
|
-
|
|
5
|
-
const commandUtil = require('../../../util/command');
|
|
6
|
-
const mvnArchetypeUtil = require('../../util/mvn');
|
|
7
|
-
const term = require('../../../util/term');
|
|
1
|
+
const os = require('os')
|
|
8
2
|
const cds = require('../../../cds')
|
|
9
|
-
const { exists, copy, rimraf } = cds.utils
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
3
|
+
const { exists, copy, rimraf, fs, path } = cds.utils, { join } = path
|
|
4
|
+
const cmd = require('../../../util/command')
|
|
5
|
+
const mvn = require('../../util/mvn')
|
|
6
|
+
const term = require('../../../util/term')
|
|
7
|
+
const { URLS, OPTIONS: { NODEJS, JAVA }, COMMAND_ADD } = require('../../constants')
|
|
13
8
|
|
|
14
9
|
module.exports = class JavaTemplate extends require('../templateBase') {
|
|
15
10
|
|
|
16
11
|
static hasFacet() {
|
|
17
|
-
return exists('pom.xml')
|
|
12
|
+
return exists('pom.xml') || cds.cli.options?.add?.has(JAVA)
|
|
18
13
|
}
|
|
19
14
|
|
|
20
15
|
async canRun() {
|
|
21
|
-
if (
|
|
22
|
-
throw
|
|
16
|
+
if (cds.cli.command === COMMAND_ADD) {
|
|
17
|
+
throw `You can't change the runtime of an existing project.`
|
|
23
18
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
throw new Error(`Only one runtime per project is supported. Specify either ${JAVA} or ${NODEJS}.`);
|
|
19
|
+
if (cds.cli.options.add?.has(NODEJS)) {
|
|
20
|
+
throw `Only one runtime per project is supported. Specify either ${term.bold(JAVA)} or ${term.bold(NODEJS)}.`
|
|
27
21
|
}
|
|
28
|
-
|
|
29
|
-
return true;
|
|
22
|
+
return true
|
|
30
23
|
}
|
|
31
24
|
|
|
32
25
|
async run() {
|
|
33
|
-
const
|
|
34
|
-
|
|
26
|
+
const { cmdLine, artifactId, archetypeVersion } = await mvn.getGenerateCmdArgs(this.projectName, this.options)
|
|
27
|
+
console.log(`Using Maven archetype version ${archetypeVersion}`)
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const tempFolder = await fs.mkdtemp(join(os.tmpdir(), `${this.projectName}_`));
|
|
29
|
+
const temp = await fs.promises.mkdtemp(join(os.tmpdir(), `${this.projectName}_`))
|
|
39
30
|
try {
|
|
40
|
-
await
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
await copy(join(tempFolder, artifactId), this.projectPath);
|
|
31
|
+
await cmd.spawnCommand('mvn', cmdLine, { cwd: temp })
|
|
32
|
+
await copy(join(temp, artifactId), this.projectPath);
|
|
45
33
|
} catch (err) {
|
|
46
34
|
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
47
|
-
throw
|
|
35
|
+
throw `Maven executable 'mvn' not found, follow ${term.info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`
|
|
48
36
|
}
|
|
49
37
|
throw err;
|
|
50
38
|
} finally {
|
|
51
|
-
await rimraf(
|
|
39
|
+
await rimraf(temp);
|
|
52
40
|
}
|
|
53
41
|
}
|
|
54
42
|
|
|
55
43
|
async finalize() {
|
|
56
|
-
|
|
57
|
-
if (relativeProjectPath && relativeProjectPath !== '.') {
|
|
58
|
-
LOG.info(`Continue with 'cd ${relativeProjectPath}'`);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
LOG.info(`Learn about next steps at ${URLS.CAPIRE}`);
|
|
44
|
+
console.log(`Learn about next steps at ${term.link(URLS.CAPIRE)}`)
|
|
62
45
|
}
|
|
63
46
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
modules:
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
|
+
requires:
|
|
7
|
+
- name: {{appName}}-logging
|
|
8
|
+
|
|
9
|
+
{{#isMultitenant}}
|
|
10
|
+
- name: {{appName}}-mtx
|
|
11
|
+
type: nodejs
|
|
12
|
+
path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
|
|
13
|
+
requires:
|
|
14
|
+
- name: {{appName}}-logging
|
|
15
|
+
{{/isMultitenant}}
|
|
16
|
+
|
|
17
|
+
{{#hasApprouter}}
|
|
18
|
+
- name: {{appName}}
|
|
19
|
+
type: approuter.nodejs
|
|
20
|
+
requires:
|
|
21
|
+
- name: {{appName}}-logging
|
|
22
|
+
{{/hasApprouter}}
|
|
23
|
+
|
|
24
|
+
resources:
|
|
25
|
+
- name: {{appName}}-logging
|
|
26
|
+
type: org.cloudfoundry.managed-service
|
|
27
|
+
parameters:
|
|
28
|
+
service: application-logs
|
|
29
|
+
service-plan: lite
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const { join } = require('path')
|
|
2
|
+
const { readProject } = require('../../util/projectReader')
|
|
3
|
+
const { mergeJSON, mergeYAML } = require('../../util/merge')
|
|
4
|
+
const { srvNode4, srvJava4, mtxSidecar4, kibana, approuter } = require('../_merging/registry-mta')
|
|
5
|
+
|
|
6
|
+
module.exports = class KibanaTemplate extends require('../templateBase') {
|
|
7
|
+
|
|
8
|
+
static hasFacet(env) {
|
|
9
|
+
return env.features.kibana_formatter
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async canRun() {
|
|
13
|
+
const { hasMta, hasHelm, isJava } = await readProject(this.options)
|
|
14
|
+
if (hasHelm && !hasMta) throw `'cds add kibana' is not available for Kyma yet`
|
|
15
|
+
if (isJava) throw `'cds add kibana' is not available for Java yet`
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async run() {
|
|
20
|
+
const project = await readProject(this.options)
|
|
21
|
+
const { configFile } = project
|
|
22
|
+
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), project)
|
|
23
|
+
await this.runDependentMerging()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async runDependentMerging() {
|
|
27
|
+
const project = await readProject(this.options)
|
|
28
|
+
const { hasMta, hasApprouter, isJava, isMultitenant, srvPath } = project
|
|
29
|
+
|
|
30
|
+
if (hasMta) {
|
|
31
|
+
const srv = (isJava ? srvJava4 : srvNode4)(srvPath)
|
|
32
|
+
const additions = [srv, kibana]
|
|
33
|
+
const relationships = [{
|
|
34
|
+
insert: [kibana, 'name'],
|
|
35
|
+
into: [srv, 'requires', 'name']
|
|
36
|
+
}]
|
|
37
|
+
if (isMultitenant) {
|
|
38
|
+
const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
|
|
39
|
+
additions.push(mtxSidecar)
|
|
40
|
+
relationships.push({
|
|
41
|
+
insert: [kibana, 'name'],
|
|
42
|
+
into: [mtxSidecar, 'requires', 'name']
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
if (hasApprouter) {
|
|
46
|
+
additions.push(approuter)
|
|
47
|
+
relationships.push({
|
|
48
|
+
insert: [kibana, 'name'],
|
|
49
|
+
into: [approuter, 'requires', 'name']
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
await mergeYAML('mta.yaml', join(__dirname, 'files', 'mta.yaml.hbs'), project, { additions, relationships })
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -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,21 +23,26 @@ 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
|
-
const
|
|
30
|
-
const { isNodejs, configFile } =
|
|
31
|
-
await mergeJSON(configFile, join(__dirname, 'files', `package.json.hbs`),
|
|
30
|
+
const project = await readProject(this.options)
|
|
31
|
+
const { isNodejs, isJava, configFile } = project
|
|
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
|
-
await copyRenderedJSON(join(__dirname, 'files', 'package.sidecar.json.hbs'), join('mtx', 'sidecar', 'package.json'),
|
|
39
|
+
await copyRenderedJSON(join(__dirname, 'files', 'package.sidecar.json.hbs'), join('mtx', 'sidecar', 'package.json'), project)
|
|
34
40
|
await this.runDependentMerging()
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
async runDependentMerging(context = {}) {
|
|
38
|
-
const
|
|
39
|
-
const { isNodejs, isJava, hasMta, hasHelm, hasXsuaa, hasHana, srvPath } =
|
|
44
|
+
const project = await readProject(this.options)
|
|
45
|
+
const { isNodejs, isJava, hasMta, hasHelm, hasXsuaa, hasHana, srvPath } = project
|
|
40
46
|
|
|
41
47
|
if (hasMta) {
|
|
42
48
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
@@ -75,7 +81,7 @@ module.exports = class MultitenancyTemplate extends require('../templateBase') {
|
|
|
75
81
|
|
|
76
82
|
const templateMtaPath = join(__dirname, 'files', 'mta.yaml.hbs')
|
|
77
83
|
const mergingRules = { additions, overwrites, relationships }
|
|
78
|
-
await mergeYAML('mta.yaml', templateMtaPath,
|
|
84
|
+
await mergeYAML('mta.yaml', templateMtaPath, project, mergingRules)
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
// REVISIT: Why not just pass a Boolean from run() to indicate the merging isn't run transitively?
|
|
@@ -90,7 +96,7 @@ module.exports = class MultitenancyTemplate extends require('../templateBase') {
|
|
|
90
96
|
await mergeYAML(
|
|
91
97
|
join('chart', 'values.yaml'),
|
|
92
98
|
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
93
|
-
|
|
99
|
+
project
|
|
94
100
|
)
|
|
95
101
|
|
|
96
102
|
const envFromObject = {
|
|
@@ -119,7 +125,7 @@ module.exports = class MultitenancyTemplate extends require('../templateBase') {
|
|
|
119
125
|
]
|
|
120
126
|
}
|
|
121
127
|
},
|
|
122
|
-
|
|
128
|
+
project
|
|
123
129
|
)
|
|
124
130
|
|
|
125
131
|
// REVISIT: Don't reference other templates except for the safe `runDependentMerging` -> low coupling, high cohesion
|
|
@@ -156,7 +162,7 @@ module.exports = class MultitenancyTemplate extends require('../templateBase') {
|
|
|
156
162
|
await mergeJSON(
|
|
157
163
|
'xs-security.json',
|
|
158
164
|
join(__dirname, 'files', 'xs-security.json.hbs'),
|
|
159
|
-
|
|
165
|
+
project,
|
|
160
166
|
{
|
|
161
167
|
additions: [{
|
|
162
168
|
in: 'scopes',
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
const { join
|
|
1
|
+
const { join } = require('path')
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
|
-
const { mkdirp } = cds.utils
|
|
4
|
-
const {
|
|
3
|
+
const { exists, mkdirp } = cds.utils
|
|
4
|
+
const { URLS, OPTIONS: { NODEJS, JAVA }, COMMAND_ADD } = require('../../constants')
|
|
5
|
+
const term = require('../../../util/term')
|
|
5
6
|
const { copyFiles } = require('../../util/template')
|
|
6
7
|
const LOG = console
|
|
7
8
|
|
|
8
9
|
module.exports = class NodejsTemplate extends require('../templateBase') {
|
|
9
10
|
|
|
10
11
|
static hasFacet() {
|
|
11
|
-
|
|
12
|
-
//return this.language === P_LANGUAGE_NODEJS
|
|
12
|
+
return !exists('pom.xml') || cds.cli.options?.add?.has(NODEJS)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async canRun() {
|
|
16
|
-
if (
|
|
17
|
-
throw
|
|
16
|
+
if (cds.cli.command === COMMAND_ADD) {
|
|
17
|
+
throw `You can't change the runtime of an existing project.`
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new Error(`Only one runtime per project is supported. Specify either ${JAVA} or ${NODEJS}.`);
|
|
19
|
+
if (cds.cli.options.add?.has(JAVA)) {
|
|
20
|
+
throw `Only one runtime per project is supported. Specify either ${term.bold(JAVA)} or ${term.bold(NODEJS)}.`
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
return true;
|
|
22
|
+
return true
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
async run() {
|
|
@@ -32,12 +30,7 @@ module.exports = class NodejsTemplate extends require('../templateBase') {
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
async finalize() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
LOG.info(`Continue with 'cd ${relativeProjectPath}'`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
LOG.info(`Find samples on ${URLS.SAMPLES}`);
|
|
41
|
-
LOG.info(`Learn about next steps at ${URLS.CAPIRE}`);
|
|
33
|
+
LOG.info(`Find samples on ${term.link(URLS.SAMPLES)}`)
|
|
34
|
+
LOG.info(`Learn about next steps at ${term.link(URLS.CAPIRE)}`)
|
|
42
35
|
}
|
|
43
36
|
}
|
|
@@ -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;
|
|
@@ -19,23 +19,23 @@ module.exports = class RedisMessagingTemplate extends require('../templateBase')
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
async run() {
|
|
22
|
-
const
|
|
23
|
-
const { configFile } =
|
|
24
|
-
|
|
25
|
-
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'),
|
|
22
|
+
const project = await readProject(this.options)
|
|
23
|
+
const { configFile } = project
|
|
24
|
+
project.shortcut = !(await read(configFile)).cds?.requires?.messaging?.kind
|
|
25
|
+
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), project)
|
|
26
26
|
await this.runDependentMerging()
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async runDependentMerging() {
|
|
30
|
-
const
|
|
31
|
-
const { hasMta, isNodejs, srvPath } =
|
|
30
|
+
const project = await readProject(this.options)
|
|
31
|
+
const { hasMta, isNodejs, srvPath } = project
|
|
32
32
|
|
|
33
33
|
if (hasMta) {
|
|
34
34
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
35
35
|
await mergeYAML(
|
|
36
36
|
'mta.yaml',
|
|
37
37
|
join(__dirname, 'files', 'mta.yaml.hbs'),
|
|
38
|
-
|
|
38
|
+
project,
|
|
39
39
|
{
|
|
40
40
|
additions: [srv, redis],
|
|
41
41
|
relationships: [{
|
|
@@ -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.
|