Skip to content

Commit 29f8e03

Browse files
fix: fiori docs to reflect cds10 reality (#2628)
Co-authored-by: Daniel Hutzel <daniel.hutzel@sap.com>
1 parent dcd24ec commit 29f8e03

3 files changed

Lines changed: 22 additions & 18 deletions

File tree

.github/CODEOWNERS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# We start with defining ownership globally and later on can get more granular.
33

44
# General content
5-
* @renejeglinsky
5+
* @renejeglinsky @danjoa
66

7-
node.js/ @smahati @renejeglinsky
8-
java/ @smahati @renejeglinsky
7+
node.js/ @smahati @renejeglinsky @danjoa
8+
java/ @smahati @renejeglinsky @danjoa
99

1010
# Infra
1111
.github/ @chgeo @swaldmann
12-
.vitepress/ @chgeo @swaldmann
13-
public/ @chgeo @swaldmann
12+
.vitepress/ @chgeo @swaldmann @danjoa
13+
public/ @chgeo @swaldmann @danjoa
1414

1515
# allow dependencies updates through renovate w/o code owners
1616
package.json

guides/uis/fiori.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,27 +307,24 @@ Draft locks are not applied when creating drafts for new entities, as there is n
307307
Fiori clients send the following HTTP requests for draft operations:
308308

309309
```php:line-numbers [Requests to <i>draft</i> data]
310-
POST /Foo/draftNew //> NEW
310+
POST /Foo //> NEW
311311
POST /Foo(ID,IsActiveEntity=true)/draftEdit //> EDIT
312312
GET /Foo(ID,IsActiveEntity=false) //> READ
313313
PATCH /Foo(ID,IsActiveEntity=false) {...} //> PATCH
314314
POST /Foo(ID,IsActiveEntity=false)/draftActivate //> SAVE
315315
DELETE /Foo(ID,IsActiveEntity=false) //> DISCARD
316316
```
317317

318-
The key parameter `IsActiveEntity=false` addresses draft data, with the exception of `draftNew`, which is an _unbound_ action, and `draftEdit` for semantic reasons.
319-
320-
::: details `draftNew` actions are used <Since package="@sap/cds" version="v10" /> and <Since package="CAP Java" version="v5" />
321-
Previously, regular `POST /Foo` requests without an `IsActiveEntity` parameter created new drafts, which caused ambiguities with requests to active data.
322-
Can be disabled with <Config>cds.fiori.draft_new_action: false</Config>.
323-
:::
318+
The key parameter `IsActiveEntity=false` addresses draft data, with the exception of the empty POST and `draftEdit` for semantic reasons.
324319

325320
::: details Full HTTP requests ...
326321
The requests above are abbreviated for clarity. The actual HTTP requests include the service path, content-type headers, and JSON bodies as shown below.
327322

328323
```http
329-
POST /odata/v4/TravelService/Travels/draftNew
324+
POST /odata/v4/TravelService/Travels
330325
Content-Type: application/json
326+
327+
{}
331328
```
332329
```http
333330
POST /odata/v4/TravelService/Travels(ID=a11fb6f1-36ab-46ec-b00c-d379031e817a,IsActiveEntity=true)/draftEdit
@@ -364,15 +361,21 @@ While this was always possible in CAP Java before, it's available for CAP Node.j
364361
365362
#### Draft-agnostic Requests
366363

367-
Taking this further, `IsActiveEntity=true` is assumed by default, so clients that are unaware of drafts or don't need to handle them can ignore all draft-specific requests and parameters:
364+
Taking this further, through <Config>cds.fiori.draft_new_action: true</Config> `IsActiveEntity=true` is assumed by default, so clients that are unaware of drafts or don't need to handle them can ignore all draft-specific requests and parameters:
368365

369366
```php:line-numbers [Draft-agnostic requests to <i>active</i> data]
367+
// creation of active instances
370368
POST /Foo //> CREATE
371369
GET /Foo(ID) //> READ
372370
PATCH /Foo(ID) {...} //> UPDATE
373371
DELETE /Foo(ID) //> DELETE
372+
// creation of draft instances
373+
POST /Foo/draftNew //> CREATE new draft [!code ++]
374+
...
374375
```
375376

377+
The previously used `POST /Foo` requests without an `IsActiveEntity` parameter to create new drafts is now replaced by the collection bound action `draftNew` to resolve the ambiguities with requests to active data.
378+
376379
::: details Available for CAP Node.js <Since package="@sap/cds" version="v10" /> – not yet for CAP Java
377380
Draft-agnostic requests as above assume `IsActiveEntity=true` by default for all requests that don't explicitly specify it.
378381
This was possible in CAP Node.js, but not in CAP Java, which is still bound by the [*Olingo*](https://olingo.apache.org) library. For CAP Java, explicitly add `IsActiveEntity=true` as a key parameter to address active data

node.js/core-services.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,19 @@ var srv.options : { //> from cds.requires config
396396

397397

398398

399-
### . entities {.property alt="The following documentation on actions also applies to entities. "}
400-
### . events {.property alt="The following documentation on actions also applies to events. "}
401399
### . actions {.property}
400+
### . events {.property}
401+
### . types {.property}
402+
### . entities {.property}
402403
###### srv-entities
403404

404405
```tsx
405-
var srv.entities/events/actions : Iterable <{
406+
var srv.entities/events/actions/types : Iterable <{
406407
name : CSN definition
407408
}>
408409
```
409410

410-
These properties provide convenient access to the CSN definitions of the *entities*, *events* and *actions* (incl. *functions*) exposed by this service. They return instances of [`LinkedDefinitions`](cds-reflect#iterable) which you can use in all of these ways:
411+
These properties provide convenient access to the CSN definitions of the *entities*, *types*, *events*, and *actions* (incl. *functions*) exposed by this service. They return instances of [`LinkedDefinitions`](cds-reflect#iterable) which you can use in all of these ways:
411412

412413
```js
413414
// Assumed `this` is an instance of cds.Service

0 commit comments

Comments
 (0)