-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShell.capnb
More file actions
98 lines (98 loc) · 3.97 KB
/
Copy pathShell.capnb
File metadata and controls
98 lines (98 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
[
{
"kind": 1,
"language": "markdown",
"value": "## What is CAP\n#### The Cloud Application Programming Model (CAP) is a **framework of languages, libraries, and tools** for building enterprise-grade cloud applications. \n\nIt guides developers along a golden path of proven best practices, which are served out of the box by generic providers cloud-natively, thereby relieving application developers from tedious recurring tasks.\n\n### Fast Inner Loops\n\n\n*** ",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### Jumpstart & Grow as You Go...\nUse `cds init` to start and `cds add` to grow your project as you go:",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "cds init\n\ncds add data\ncds add hana\ncds add xsuaa\ncds add ias\ncds add multitenancy\ncds add mta\ncds add kyma\ncds add github-actions\n...",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "## Hands on",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### Initial setup\nCreate empty project structure\n",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "cds init",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### Set up Domain Model\ndb/schema.cds\n\n```cds\nusing { managed } from '@sap/cds/common';\nnamespace sap.capire.bookshop;\n\nentity Books : managed {\n key ID : Integer;\n title : localized String;\n descr : localized String;\n author : Association to Authors;\n stock : Integer;\n price : Decimal;\n}\n\nentity Authors : managed {\n key ID : Integer;\n name : String;\n books : Association to many Books on books.author = $self;\n}",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "touch db/schema.cds",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "npm install\ncds watch",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### ...add some test data",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "cds add data",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### Services\nNow create services to consume the data\n\n\n\nsrv/services.cds\n```cds\nusing { sap.capire.bookshop as my } from '../db/schema';\n\nservice AdminService @(odata:'/admin') {\n entity Authors as projection on my.Authors;\n entity Books as projection on my.Books;\n}\n\nservice CatalogService @(odata:'/browse') {\n @readonly entity Books as projection on my.Books {\n *, // all fields with the following denormalizations:\n author.name as author,\n } excluding { createdBy, modifiedBy };\n}",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "touch srv/services.cds",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### Test the service via HTTP requests",
"outputs": []
},
{
"kind": 2,
"language": "shell",
"value": "cds add http",
"outputs": []
},
{
"kind": 1,
"language": "markdown",
"value": "### Helpful resources\n- __[capire](https://cap.cloud.sap/)__\n- __[Docs and Samples](https://github.com/capire)__\n- __[Introduction to CAP Course](https://learning.sap.com/courses/introduction-to-sap-cloud-application-programming-model)__\n- __[SAP Fiori Development Portal](https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/topic/introduction)__\n- __[Fiori Elements Feature Showcase](https://github.com/SAP-samples/fiori-elements-feature-showcase)__\n",
"outputs": []
}
]