You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 13, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: exercises/01/readme.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,31 +43,31 @@ user-agent = "npm/6.4.1 node/v10.15.3 linux x64"
43
43
;"npm config ls -l" to show all defaults.
44
44
```
45
45
46
-
:point_right: Next, explore the information about the `@sap/cds`package, including its dependencies, with:
46
+
:point_right: Next, explore the information about the `@sap/cds-dk` (the dk stands for development kit)package, including its dependencies, with:
47
47
48
48
```sh
49
49
user@host:~
50
-
=> npm info @sap/cds
50
+
=> npm info @sap/cds-dk
51
51
```
52
52
53
53
This will show you that it has dependencies on other `@sap` namespaced packages, and also that there is a 'binary' (in other words an executable) called `cds` that's delivered as part of the package.
54
54
55
-
:point_right: Now, install the `@sap/cds` package globally:
55
+
:point_right: Now, install the `@sap/cds-dk` package globally:
56
56
57
57
```sh
58
58
user@host:~
59
-
=> npm install --global @sap/cds
59
+
=> npm install --global @sap/cds-dk
60
60
```
61
61
62
62
This should eventually produce output similar to this:
Here you can see that the version of the `@sap/cds` package installed is 3.18.3. It may be that the version of `@sap/cds` that is installed when you do this exercise will be different (newer).
70
+
Here you can see that the version of the `@sap/cds-dk` package installed is 3.18.4. It may be that the version of `@sap/cds-dk` that is installed when you do this exercise will be different (newer).
If necessary, double check the [prerequisites](../../prerequisites.md) to install the missing tools. Please contact the instructor of this CodeJam if you need help.
113
+
If necessary, double check the [prerequisites](../../prerequisites.md)to install the missing tools. Please contact the instructor of this CodeJam if you need help.
114
114
115
115
116
116
## Summary
@@ -120,9 +120,13 @@ You've now installed the key tools for developing with CAP locally, and are all
120
120
## Questions
121
121
122
122
1. What are the benefits of using NPM here?
123
+
<!--- easy to user and de-facto standard --->
123
124
124
-
1. What are the `@sap` namespaced packages upon which `@sap/cds` depends?
125
+
2. What are the `@sap` namespaced packages upon which `@sap/cds-dk` depends?
Copy file name to clipboardExpand all lines: exercises/02/readme.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ user@host:~
98
98
=> code bookshop
99
99
```
100
100
101
-
If this approach is not available to you, simply start VS Code through your operating system's GUI and open the directory manually (with menu path "File → Open").
101
+
> If this approach is not available to you, simply start VS Code through your operating system's GUI and open the directory manually (with menu path "File → Open").
102
102
103
103
104
104
### 3. Explore the initialized project structure
@@ -115,7 +115,7 @@ Briefly, the directories and contents can be described thus:
115
115
| -------------- | -------- |
116
116
|`.vscode`| VS Code specific files for launch configurations (useful for debugging, which we will cover in [exercise 08](../08/)) |
117
117
|`db`| Where the data models (in CDS) are specified. |
118
-
|`node_modules`| This is the normal place where NPM packages (modules) are to be found in a Node.js based project |
118
+
|`node_modules`| This is the place where NPM packages (modules) are to be found in a Node.js based project |
119
119
|`srv`| Where the service definitions (in CDS) are specified. |
120
120
|`mta.yaml`| This is the central descriptor file for the project. It defines all modules (microservices) and backing services (like databases). This information will be used to build the .mtar archive during design time and to deploy & provision the apps and services during deploy time. |
121
121
@@ -168,6 +168,9 @@ This should open up the terminal at the bottom of VS Code like this:
168
168
169
169

170
170
171
+
> **Windows users:** Please make sure to select `cmd` as your default shell before you continue:
172
+

173
+
171
174
:point_right: In the integrated terminal, use the `cds` command line tool with the `serve` command to start serving. Specify `all`, like this, so that `cds` will look for appropriate configuration to serve:
172
175
173
176
```sh
@@ -215,10 +218,14 @@ With a single command, you've initialized a basic OData service project and with
215
218
216
219
## Questions
217
220
218
-
1. Why is there an focus on "TTM" (time to metadata) - what advantages does that bring?
221
+
1. Why is there an focus on "Contracts First" (As all you need to run a service is a service definition) - what advantages does that bring?
222
+
<!--- UI teams can start to work right away --->
219
223
220
-
1. What is the difference between the data model and the service definition? Why do we need both?
224
+
2. What is the difference between the data model and the service definition? Why do we need both?
225
+
<!--- db model for schema, service for access (control) --->
221
226
222
-
1. What is returned in response to a request for the Books entityset resource right now?
227
+
3. What is returned in response to a request for the Books entityset resource right now?
228
+
<!--- error --->
223
229
224
-
1. What happened to the `cds` process when you accessed the entityset? Can you think of reasons why this happened?
230
+
4. What happened to the `cds` process when you accessed the entityset? Can you think of reasons why this happened?
Copy file name to clipboardExpand all lines: exercises/05/readme.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,8 +155,6 @@ user@host:~/bookshop
155
155
[cds] - launched in: 722.087ms
156
156
```
157
157
158
-
> If you're running Windows, you can use a double-semicolon (;;) in place of the `&&`. It's not quite the same but will work just fine in most cases.
159
-
160
158
161
159
### 5. Examine what the Orders entity looks like now
162
160
@@ -262,8 +260,11 @@ At this point you have a meaningful OData service with data and against which yo
262
260
263
261
## Questions
264
262
265
-
1. We added a field `country` described by the type `Country`. What exactly is this type, and what does it bring about in the resulting service's metadata?
266
-
267
263
1. Did you notice an extra line in the output of `cds serve all` after the addition of the reference to `@sap/cds/common`?
264
+
<!--- node_modules/@sap/cds/common.cds --->
265
+
266
+
2. We added a field `country` described by the type `Country`. What exactly is this type, and what does it bring about in the resulting service's metadata?
267
+
<!--- string(3), code list --->
268
268
269
-
1. Are there any issues with the way we have set up the service definition right now?
269
+
3. Are there any issues with the way we have set up the service definition right now?
Copy file name to clipboardExpand all lines: exercises/06/readme.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ curl \
45
45
http://localhost:4004/catalog/Books
46
46
```
47
47
48
-
Check that the creation requests are successful, and that you can see the new author and book in an OData Query operation: [http://localhost:4004/catalog/Authors?$expand=books](http://localhost:4004/catalog/Authors?$expand=books).
48
+
Check that the creation requests are successful, and that you can see the new author and book in an OData Query operation: <http://localhost:4004/catalog/Authors?$expand=books>.
49
49
50
50
51
51
### 3. Restrict access to the Books and Authors entities
@@ -187,6 +187,11 @@ In this exercise you used shortcut annotations to restrict access to the entitie
187
187
188
188
## Questions
189
189
190
-
1. How might the annotations relating to the read-only restrictions be useful in a UI context?
190
+
1. Did you notice anything special about your request to <http://localhost:4004/catalog/Authors?$expand=books> in step 2?
191
+
<!--- expand call --->
191
192
192
-
1. What was the format of the OData Delete operation - did we need to supply a payload?
193
+
2. How might the annotations relating to the read-only restrictions be useful in a UI context?
194
+
<!--- FE autorenders (or hides) component depending on metadata --->
195
+
196
+
3. What was the format of the OData Delete operation - did we need to supply a payload?
0 commit comments