Skip to content

Commit 26bd60c

Browse files
committed
2 parents 30b8b61 + 327a744 commit 26bd60c

File tree

10 files changed

+178
-199
lines changed

10 files changed

+178
-199
lines changed

tutorials/add-authorization/add-authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ The authorization checks that you added to the CAP model apply not only when dep
136136
137137
```xml
138138
<dependency>
139-
<groupid>com.sap.cds</groupid>
140-
<artifactid>cds-starter-cloudfoundry</artifactid>
139+
<groupId>com.sap.cds</groupId>
140+
<artifactId>cds-starter-cloudfoundry</artifactId>
141141
</dependency>
142142
```
143143

tutorials/add-custom-logic/add-custom-logic.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,11 @@ In this tutorial, you add some custom code to the CAP application. Depending on
127127
@Component
128128
@ServiceName(ProcessorService_.CDS_NAME)
129129
public class ProcessorServiceHandler implements EventHandler {
130-
131130
private static final Logger logger = LoggerFactory.getLogger(ProcessorServiceHandler.class);
132-
133131
private final PersistenceService db;
134-
135132
public ProcessorServiceHandler(PersistenceService db) {
136133
this.db = db;
137134
}
138-
139135
/*
140136
* Change the urgency of an incident to "high" if the title contains the word "urgent"
141137
*/
@@ -147,10 +143,8 @@ In this tutorial, you add some custom code to the CAP application. Depending on
147143
incident.setUrgencyCode("H");
148144
logger.info("Adjusted Urgency for incident '{}' to 'HIGH'.", incident.getTitle());
149145
}
150-
151146
}
152147
}
153-
154148
/*
155149
* Handler to avoid updating a "closed" incident
156150
*/
@@ -160,9 +154,7 @@ In this tutorial, you add some custom code to the CAP application. Depending on
160154
if (in.getStatusCode().equals("C")) {
161155
throw new ServiceException(ErrorStatuses.CONFLICT, "Can't modify a closed incident");
162156
}
163-
164157
}
165-
166158
}
167159
```
168160
@@ -173,7 +165,7 @@ In this tutorial, you add some custom code to the CAP application. Depending on
173165
174166
<!-- border; size:540px --> ![Create new incident](./create-new-incident.png)
175167
176-
You'll see that the value in the **Urgency** field is automatically set to **high**.
168+
You'll see that the value in the **Urgency** field is automatically set to **High**.
177169
178170
<!-- border; size:540px --> ![Fiori Elements Work List](./incidentapp.png)
179171

tutorials/add-test-cases/add-test-cases.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ You have configured the access to your application. Follow the steps in the [Add
146146
)
147147
expect(status).to.equal(201)
148148
})
149-
150149
it(`Should Close the Incident-${draftId}`, async () => {
151150
const { status } = await PATCH(`/odata/v4/processor/Incidents(ID=${incidentId},IsActiveEntity=false)`, {
152151
status_code: 'C'
@@ -159,7 +158,6 @@ You have configured the access to your application. Follow the steps in the [Add
159158
)
160159
expect(response.status).to.eql(200)
161160
})
162-
163161
it('+ Test the incident status to be closed', async () => {
164162
const {
165163
status,
@@ -178,7 +176,6 @@ You have configured the access to your application. Follow the steps in the [Add
178176
)
179177
expect(status).to.equal(201)
180178
})
181-
182179
it(`Should re-open the Incident-${draftId} but fail`, async () => {
183180
const { status } = await PATCH(`/odata/v4/processor/Incidents(ID=${incidentId},IsActiveEntity=false)`, {
184181
status_code: 'N'
@@ -197,12 +194,10 @@ You have configured the access to your application. Follow the steps in the [Add
197194
})
198195
})
199196
})
200-
201197
it('- Delete the Draft', async () => {
202198
const response = await DELETE(`/odata/v4/processor/Incidents(ID=${draftId},IsActiveEntity=false)`)
203199
expect(response.status).to.eql(204)
204200
})
205-
206201
it('- Delete the Incident', async () => {
207202
const response = await DELETE(`/odata/v4/processor/Incidents(ID=${draftId},IsActiveEntity=true)`)
208203
expect(response.status).to.eql(204)
@@ -411,7 +406,7 @@ You have configured the access to your application. Follow the steps in the [Add
411406
412407
[OPTION BEGIN [Node.js]]
413408
414-
1. Open the **package.json** file and add the `"test": "jest tests/test.js"` line inside the `scripts` section. This adds a command to start the tests.
409+
1. Open the **package.json** file and add the `"test": "npx jest tests/test.js"` line inside the `scripts` section. This adds a command to start the tests.
415410
416411
```json
417412
{
@@ -428,7 +423,7 @@ You have configured the access to your application. Follow the steps in the [Add
428423
...
429424
},
430425
"scripts": {
431-
"test": "jest tests/test.js",
426+
"test": "npx jest tests/test.js",
432427
"start": "cds-serve",
433428
"watch-incidents": "cds watch --open incidents/webapp/index.html?sap-ui-xx-viewCache=false"
434429
},

tutorials/deploy-to-cf/deploy-to-cf.md

Lines changed: 1 addition & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,12 @@ You will use the [Cloud MTA Build Tool](https://sap.github.io/cloud-mta-build-to
6060
cds add mta
6161
```
6262

63-
### Add configuration for SAP Build Work Zone, standard edition
63+
### Check configuration for SAP Build Work Zone, standard edition
6464

6565
> You can create a CAP project in either Node.js or Java. You have to choose one way or the other and follow through. The tabs **Node.js** and **Java** provide detailed steps for each alternative way.
6666

6767
[OPTION BEGIN [Node.js]]
6868

69-
1. Run the following command in the terminal:
70-
71-
```bash
72-
cds add workzone-standard
73-
```
74-
75-
7669
2. Verify that the destinations module `incident-management-destinations` and resource `incident-management-destination` have been added to the **mta.yaml** file without errors:
7770

7871

@@ -147,119 +140,10 @@ You will use the [Cloud MTA Build Tool](https://sap.github.io/cloud-mta-build-to
147140
forwardAuthToken: true
148141
```
149142

150-
151-
152-
153-
3. Verify that the navigation target `incidents-display` and the SAP Cloud service `sap.cloud` have been correctly added to the application manifest file **app/incidents/webapp/manifest.json**:
154-
155-
156-
```json
157-
"sap.app": {
158-
"id": "ns.incidents",
159-
...
160-
"sourceTemplate": {
161-
...
162-
},
163-
"dataSources": {
164-
...
165-
},
166-
"crossNavigation": {
167-
"inbounds": {
168-
"incidents-display": {
169-
"semanticObject": "incidents",
170-
"action": "display",
171-
"title": "{{flpTitle}}",
172-
"subTitle": "{{flpSubtitle}}",
173-
"signature": {
174-
"parameters": {},
175-
"additionalParameters": "allowed"
176-
}
177-
}
178-
}
179-
}
180-
...
181-
"sap.cloud": {
182-
"public": true,
183-
"service": "incidents"
184-
}
185-
}
186-
```
187-
188-
189-
4. Open **app/incidents/webapp/manifest.json** and remove the leading `/` from the `uri` parameter.
190-
191-
```json
192-
{
193-
"_version": "1.49.0",
194-
"sap.app": {
195-
"id": "ns.incidents",
196-
"type": "application",
197-
"i18n": "i18n/i18n.properties",
198-
...
199-
"dataSources": {
200-
"mainService": {
201-
"uri": "odata/v4/processor/",
202-
"type": "OData",
203-
"settings": {
204-
"annotations": [],
205-
"localUri": "localService/metadata.xml",
206-
"odataVersion": "4.0"
207-
}
208-
}
209-
},
210-
...
211-
},
212-
...
213-
}
214-
```
215-
216-
This is needed as the dataSource URIs must be relative to the base URL, which means there is no need for a slash as the first character.
217-
218-
Check [Accessing Business Service UI](https://help.sap.com/docs/btp/sap-business-technology-platform/accessing-business-service-ui?locale=39723061bc4b4b679726b120cbefdf5a.html&q=base%20URL) for more information.
219-
220-
5. Make sure that the line `"welcomeFile": "/index.html"` in the following snippet is added to the **app/incidents/xs-app.json** file. Add if it is missing.
221-
222-
```json
223-
{
224-
"welcomeFile": "/index.html",
225-
"authenticationMethod": "route",
226-
"routes": [
227-
{
228-
"source": "^/?odata/(.*)$",
229-
"target": "/odata/$1",
230-
"destination": "incident-management-srv-api",
231-
"authenticationType": "xsuaa",
232-
"csrfProtection": true
233-
},
234-
{
235-
"source": "^(.*)$",
236-
"target": "$1",
237-
"service": "html5-apps-repo-rt",
238-
"authenticationType": "xsuaa"
239-
}
240-
]
241-
}
242-
```
243-
244143
[OPTION END]
245144

246145
[OPTION BEGIN [Java]]
247146

248-
1. Run the following command in the root folder of your project:
249-
250-
```bash
251-
cds add workzone
252-
```
253-
254-
You should see the following output in the terminal:
255-
256-
```bash
257-
Adding feature 'destination'...
258-
Adding feature 'html5-repo'...
259-
Adding feature 'workzone'...
260-
Adding feature 'workzone-standard'...
261-
```
262-
263147
2. Verify that all required modules (`incident-management-app-deployer`, `incidentmanagementincidents`, and `incident-management-destinations`) and resources (`incident-management-destination` and `incident-management-html5-repo-host`) have been added to the **mta.yaml** file without errors:
264148

265149
```yaml
@@ -365,50 +249,6 @@ You will use the [Cloud MTA Build Tool](https://sap.github.io/cloud-mta-build-to
365249
service-plan: app-host
366250
```
367251

368-
4. Open **app/incidents/webapp/manifest.json** and remove the leading `/` from the `uri` parameter.
369-
370-
```json
371-
{
372-
"_version": "1.49.0",
373-
"sap.app": {
374-
"id": "ns.incidents",
375-
"type": "application",
376-
"i18n": "i18n/i18n.properties",
377-
...
378-
"dataSources": {
379-
"mainService": {
380-
"uri": "odata/v4/processor/",
381-
"type": "OData",
382-
"settings": {
383-
"annotations": [],
384-
"localUri": "localService/metadata.xml",
385-
"odataVersion": "4.0"
386-
}
387-
}
388-
},
389-
...
390-
},
391-
...
392-
}
393-
```
394-
395-
This is needed as the dataSource URIs must be relative to the base URL, which means there is no need for a slash as the first character.
396-
397-
Check [Accessing Business Service UI](https://help.sap.com/docs/btp/sap-business-technology-platform/accessing-business-service-ui?locale=39723061bc4b4b679726b120cbefdf5a.html&q=base%20URL) for more information.
398-
399-
6. Navigate to the **db** folder in the terminal and run the following command:
400-
401-
```bash
402-
npm install
403-
```
404-
405-
7. Navigate to the **app/incidents** folder in the terminal and run the following command:
406-
407-
```bash
408-
npm install
409-
```
410-
411-
412252
[OPTION END]
413253

414254
### Make additional changes to the mta.yaml file

tutorials/deploy-to-kyma/deploy-to-kyma.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,13 @@ Kyma runs on containers. Hence, for this tutorial, you'll need an application th
539539
cds add xsuaa,hana --for production
540540
```
541541

542-
5. Build the CAP Java image:
542+
5. Install dependencies added by the `cds add` commands in the previous steps and build the `.jar` file to create the srv image:
543+
544+
```bash
545+
mvn clean install
546+
```
547+
548+
6. Build the CAP Java image:
543549

544550
```bash
545551
pack build <your-container-registry>/incident-management-srv:<image-version> \
@@ -562,7 +568,7 @@ Kyma runs on containers. Hence, for this tutorial, you'll need an application th
562568
563569
> The pack CLI builds the image that contains the build result in the **gen/srv** folder and the required npm packages by using the [Cloud Native Buildpack for Node.JS](https://github.com/paketo-buildpacks/nodejs) provided by Paketo.
564570
565-
6. Build the database image:
571+
7. Build the database image:
566572
567573
```bash
568574
pack build <your-container-registry>/incident-management-hana-deployer:<image-version> \
@@ -600,7 +606,7 @@ Kyma runs on containers. Hence, for this tutorial, you'll need an application th
600606
"authenticationMethod": "route",
601607
"routes": [
602608
{
603-
"source": "^/odata/v4/processor/(.*)$",
609+
"source": "^/odata/v4/ProcessorService/(.*)$",
604610
"destination": "srv-api",
605611
"authenticationType": "xsuaa"
606612
},

0 commit comments

Comments
 (0)