Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ams-cap-nodejs-bookshop/.cdsrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
},
"[production]": {
"kind": "ias",
"config": {
"validation": {
"x5t": { "enabled": false },
"proofToken": { "enabled": false }
}
},
"ams": {
"cache": {
"TTL": 15000
Expand Down
30 changes: 30 additions & 0 deletions ams-cap-nodejs-bookshop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,36 @@ To deploy with *sqlite*, you must copy the [db.sqlite](db.sqlite) file to `gen/s

Please note that `cds add mta` creates a `mta.yaml` that contains a `before-all` command that runs `cds build --production`. This deletes and re-creates the `gen` folder after you manually copied the file. In that case, you should add another command behind it such as `cp db.sqlite gen/srv/db.sqlite` instead of manually copying.

### (Optional) Configure Value Help in mta.yaml
To add value help to your application, replace the section for ams-cap-nodejs-bookshop-auth with this:
```yaml
resources:
- name: ams-cap-nodejs-bookshop-auth
type: org.cloudfoundry.managed-service
parameters:
service: identity
service-name: ams-cap-nodejs-bookshop-auth
service-plan: application
config:
display-name: ams-cap-nodejs-bookshop-marie
provided-apis:
- name: AMS_ValueHelp
description: Value Help Callback from AMS
type: public
authorization:
enabled: true
value-help-url: ~{srv-api/srv-cert-url}/odata/v4/ams-value-help/
value-help-api-name: AMS_ValueHelp
oauth2-configuration:
redirect-uris:
- ~{app-api/app-protocol}://~{app-api/app-uri}/login/callback
post-logout-redirect-uris:
- ~{app-api/app-protocol}://~{app-api/app-uri}/*/logout.html
requires:
- name: srv-api
- name: app-api
```

### Deployment

:warning: Please make sure to use `@sap/cds-dk` version `>= 8.7.3` to get correct deployment configurations for *ams*/*ias*. Remember to update your global npm installation of `@sap/cds-dk` if you have one as it has priority over the version specified in *node_modules*. Use `cds version -i` to check.
Expand Down
5 changes: 5 additions & 0 deletions ams-cap-nodejs-bookshop/ams/dcl/schema.dcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

SCHEMA {
description: String,
@valueHelp: {
path: 'Genres',
valueField: 'name',
labelField: 'name'
}
genre: String,
just: {
for: {
Expand Down
Binary file modified ams-cap-nodejs-bookshop/db.sqlite
Binary file not shown.
6 changes: 6 additions & 0 deletions ams-cap-nodejs-bookshop/srv/vh-service.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using { sap.capire.bookshop as my } from '../db/schema';

service AmsValueHelpService @(requires: 'Reader') {
@cds.localized: false
entity Genres as projection on my.Genres;
}