Compare commits
5 Commits
openSAP-we
...
openSAP-we
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b97da977e5 | ||
|
|
50085fe7be | ||
|
|
8c3733c9cd | ||
|
|
a412c41970 | ||
|
|
e49e9ae823 |
@@ -11,7 +11,7 @@ In SAP Business Application Studio, open a terminal.
|
|||||||
Then clone the repo with this specific branch:
|
Then clone the repo with this specific branch:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week3-unit3
|
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week3-unit1
|
||||||
cd projects/cloud-cap-samples
|
cd projects/cloud-cap-samples
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("admin.Component", {
|
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("admin.Component", {
|
||||||
metadata:{ manifest:'json' }
|
metadata:{ manifest:'json' }
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,7 @@
|
|||||||
"sap.ui5": {
|
"sap.ui5": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libs": {
|
"libs": {
|
||||||
"sap.fe.core": {},
|
"sap.fe": {}
|
||||||
"sap.fe.macros": {},
|
|
||||||
"sap.fe.templates": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("bookshop.Component", {
|
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("bookshop.Component", {
|
||||||
metadata:{ manifest:'json' }
|
metadata:{ manifest:'json' }
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,7 @@
|
|||||||
"sap.ui5": {
|
"sap.ui5": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libs": {
|
"libs": {
|
||||||
"sap.fe.core": {},
|
"sap.fe": {}
|
||||||
"sap.fe.macros": {},
|
|
||||||
"sap.fe.templates": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("orders.Component", {
|
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("orders.Component", {
|
||||||
metadata:{ manifest:'json' }
|
metadata:{ manifest:'json' }
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,7 @@
|
|||||||
"sap.ui5": {
|
"sap.ui5": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libs": {
|
"libs": {
|
||||||
"sap.fe.core": {},
|
"sap.fe": {}
|
||||||
"sap.fe.macros": {},
|
|
||||||
"sap.fe.templates": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
####### Generated mta.yaml based on template version 0.2.0
|
|
||||||
####### appName = capire-bookshop
|
|
||||||
####### language=nodejs; multiTenant=false
|
|
||||||
####### approuter=
|
|
||||||
|
|
||||||
_schema-version: '3.1'
|
|
||||||
ID: sap.capire-bookshop
|
|
||||||
version: 1.0.0
|
|
||||||
description: "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages."
|
|
||||||
|
|
||||||
build-parameters:
|
|
||||||
before-all:
|
|
||||||
- builder: custom
|
|
||||||
commands:
|
|
||||||
- npm install
|
|
||||||
- cds build/all
|
|
||||||
|
|
||||||
parameters:
|
|
||||||
enable-parallel-deployments: true
|
|
||||||
|
|
||||||
modules:
|
|
||||||
############## SERVER MODULE ##########################
|
|
||||||
- name: capire-bookshop-srv
|
|
||||||
type: nodejs
|
|
||||||
path: gen/srv
|
|
||||||
properties:
|
|
||||||
EXIT: 1 # required by deploy.js task to terminate
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############################################################
|
|
||||||
|
|
||||||
############## SIDECAR MODULE #########################
|
|
||||||
- name: db
|
|
||||||
|
|
||||||
type: hdb
|
|
||||||
path: gen/db
|
|
||||||
parameters:
|
|
||||||
app-name: capire-bookshop-db
|
|
||||||
requires:
|
|
||||||
#### Hana and xsuaa resources extracted from CAP configuration ####
|
|
||||||
############################################################
|
|
||||||
|
|
||||||
|
|
||||||
2027
packages/bookshop/package-lock.json
generated
2027
packages/bookshop/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,7 @@
|
|||||||
"license": "SAP SAMPLE CODE LICENSE",
|
"license": "SAP SAMPLE CODE LICENSE",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sap/cds": "^3",
|
"@sap/cds": "^3",
|
||||||
"express": "^4",
|
"express": "^4"
|
||||||
"sqlite3": "^5.0.0"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cds run --in-memory?",
|
"start": "cds run --in-memory?",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using { sap.capire.bookshop as my } from '../db/schema';
|
using { sap.capire.bookshop as my } from '../db/schema';
|
||||||
|
|
||||||
service AdminService @(_requires:'authenticated-user') {
|
service AdminService @(_requires:'authenticated-user',path:'/admin') {
|
||||||
entity Books as projection on my.Books;
|
entity Books as projection on my.Books;
|
||||||
entity Authors as projection on my.Authors;
|
entity Authors as projection on my.Authors;
|
||||||
entity Orders as select from my.Orders;
|
entity Orders as select from my.Orders;
|
||||||
|
|||||||
25
packages/bookshop/tests/authors.http
Normal file
25
packages/bookshop/tests/authors.http
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
### Service Document
|
||||||
|
GET http://localhost:4004/admin/Authors
|
||||||
|
|
||||||
|
### Create Author
|
||||||
|
POST http://localhost:4004/admin/Authors HTTP/1.1
|
||||||
|
content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"ID": 105,
|
||||||
|
"name": "J.K. Rowling",
|
||||||
|
"dateOfBirth": null,
|
||||||
|
"dateOfDeath": null,
|
||||||
|
"placeOfBirth": "",
|
||||||
|
"placeOfDeath": ""
|
||||||
|
}
|
||||||
|
### Update Author
|
||||||
|
PATCH http://localhost:4004/admin/Authors/105 HTTP/1.1
|
||||||
|
content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"placeOfBirth": "United Kingdom"
|
||||||
|
}
|
||||||
|
|
||||||
|
### Delete Author
|
||||||
|
DELETE http://localhost:4004/admin/Authors/105 HTTP/1.1
|
||||||
Reference in New Issue
Block a user