Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CAP-based projects benefit from a **[primary focus on domain](#domain-modeling)*

The CAP framework features a mix of proven and broadly adopted open-source and SAP technologies, as highlighted in the figure below.

<img src="../assets/overview.drawio.svg" style="width:480px; margin: auto" alt="The graphic is explained in the accompanying text.">
![The graphic is explained in the accompanying text.](../assets/overview.drawio.svg){style="width:480px; margin: auto"}

<div id="logos" style="text-align:center;">
<img src="../assets/logos/nodejs.svg" style="height:40px" alt="Node.js logo" />
Expand Down Expand Up @@ -310,7 +310,7 @@ All behavioral aspects in CAP are based on ubiquitous notions of [Services](#ser
Services in CAP are **stateless** and with a **minimal footprint**, which allows you to modularize solutions into single-purposed (nano) services or functions-as-a-service.

<figure>
<img src="../assets/agnostic-services.drawio.svg" width="333px">
<img src="../assets/agnostic-services.drawio.svg" width="333px">
<figcaption><a href="#hexagonal-architecture">Hexagonal Architecture à la CAP</a></figcaption>
</figure>

Expand Down
2 changes: 1 addition & 1 deletion cds/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Language Reference Documentation

CDL is the backbone of the SAP Cloud Application Programming Model (CAP). It provides the means to declaratively capture service definitions and data models, queries, and expressions in plain (JavaScript) object notations. CDL features to parse from a variety of source languages and to compile them into various target languages. Though the language used within `.cds` files is CDL, we usually use the terms _CDS_ or _CDS Models_ as synonyms to keep it simple where we don't need to care about technical details too much.

<img src="./assets/csn.drawio.svg" alt="The graphic is explained in the accompanying text."/>
!["The graphic is explained in the accompanying text."](./assets/csn.drawio.svg)

CDS models are plain JavaScript objects complying to the _[Core Schema Notation (CSN)](./csn)_, an open specification derived from [JSON Schema](https://json-schema.org/). You can easily create or interpret these models, which foster extensions by 3rd-party contributions. Models are processed dynamically at runtime and can also be created dynamically.

Expand Down
2 changes: 1 addition & 1 deletion get-started/in-a-nutshell.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ Open _<http://localhost:4004>_ / _<http://localhost:8080>_ in your browser and s

<div class="impl java">

<img src="./assets/in-a-nutshell/welcome_java.png" alt="Generic welcome page generated by CAP that list all endpoints. Eases jumpstarting development and is not meant for productive use." />
![Generic welcome page generated by CAP that list all endpoints. Eases jumpstarting development and is not meant for productive use.](./assets/in-a-nutshell/welcome_java.png)

> Note: User `authenticated` is a [prepared mock user](../java/security#mock-users) which will be authenticated by default. Use it to access the _/admin_ service. You don't need to enter a password.

Expand Down
2 changes: 1 addition & 1 deletion get-started/jumpstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Follow the steps below to set up a local development environment. If you are a d

Choose the **LTS** version, via the left-hand side button:

<img src="./assets/jumpstart/image-20230310202845639.png" alt="Screenshot showing exemplary buttons from the nodejs.org download page. The term LTS is magnified on the left-hand button." style="zoom: 33%;" />
![Screenshot showing exemplary buttons from the nodejs.org download page. The term LTS is magnified on the left-hand button.](./assets/jumpstart/image-20230310202845639.png){style="zoom: 33%;" }



Expand Down
14 changes: 7 additions & 7 deletions get-started/samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ It is available in both Node.js and Java. The Node.js variant contains additiona

Available for:

[<img src="../assets/logos/nodejs.svg" title="Link to the cloud-cap-samples repository." style="height:2.5em; display:inline; margin:0 0.2em;" alt="Node.js logo"/>](https://github.com/sap-samples/cloud-cap-samples)
[<img src="../assets/logos/java.svg" title="link to the cloud-cap-samples-java repository." style="height:3em; display:inline; margin:0 0.2em;" alt="Java logo" />](https://github.com/sap-samples/cloud-cap-samples-java)
[![Node.js logo](../assets/logos/nodejs.svg 'Link to the cloud-cap-samples repository.'){style="height:2.5em; display:inline; margin:0 0.2em;"}](https://github.com/sap-samples/cloud-cap-samples)
[![Java logo](../assets/logos/java.svg 'link to the cloud-cap-samples-java repository.'){style="height:3em; display:inline; margin:0 0.2em;"}](https://github.com/sap-samples/cloud-cap-samples-java)



Expand All @@ -64,7 +64,7 @@ A reference sample application for CAP and the SAP BTP Developer Guide.

Available for:

[<img src="../assets/logos/nodejs.svg" title="Link to the incident-app repository." style="height:2.5em; display:inline; margin:0 0.2em;" alt="Node.js logo"/>](https://github.com/cap-js/incidents-app)
[![Node.js logo](../assets/logos/nodejs.svg 'Link to the incident-app repository.'){style="height:2.5em; display:inline; margin:0 0.2em;"}](https://github.com/cap-js/incidents-app)



Expand All @@ -74,8 +74,8 @@ This sample is a CAP adaptation of the popular [SFLIGHT](https://blog.sap-press.

Available for:

[<img src="../assets/logos/nodejs.svg" title="Link to the cap-sflight repository." style="height:2.5em; display:inline; margin:0 0.2em;" alt="Node.js logo"/>](https://github.com/sap-samples/cap-sflight)
[<img src="../assets/logos/java.svg" title="Link to the cap-sflight repository." style="height:3em; display:inline; margin:0 0.2em;" alt="Java logo"/>](https://github.com/sap-samples/cap-sflight)
[![Node.js logo](../assets/logos/nodejs.svg 'Link to the cap-sflight repository.'){style="height:2.5em; display:inline; margin:0 0.2em;"}](https://github.com/sap-samples/cap-sflight)
[![Java logo](../assets/logos/java.svg 'Link to the cap-sflight repository.'){style="height:3em; display:inline; margin:0 0.2em;"}](https://github.com/sap-samples/cap-sflight)



Expand All @@ -87,7 +87,7 @@ The projects described above have fallen out of maintenance but still offered th

Available for:

[<img src="../assets/logos/nodejs.svg" title="Link to the Star Wars app repository." style="height:2.5em; display:inline; margin:0 0.2em;" alt="Node.js logo"/>](https://github.com/SAP-samples/cloud-cap-hana-swapi)
[![Node.js logo](../assets/logos/nodejs.svg 'Link to the Star Wars app repository.'){style="height:2.5em; display:inline; margin:0 0.2em;"}](https://github.com/SAP-samples/cloud-cap-hana-swapi)



Expand All @@ -97,4 +97,4 @@ The Sustainable SaaS (SusaaS) sample application has been built in a partner col

Available for:

[<img src="../assets/logos/nodejs.svg" title="Link to the Sustainable SaaS (SusaaS) repository." style="height:2.5em; display:inline; margin:0 0.2em;" alt="Node.js logo"/>](https://github.com/SAP-samples/btp-cap-multitenant-saas)
[![Node.js logo](../assets/logos/nodejs.svg 'Link to the Sustainable SaaS (SusaaS) repository.'){style="height:2.5em; display:inline; margin:0 0.2em;"}](https://github.com/SAP-samples/btp-cap-multitenant-saas)
4 changes: 2 additions & 2 deletions guides/data-privacy/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In order to automate audit logging, personal data management, and data retention

In the remainder of this guide, we use the [Incidents Management reference sample app](https://github.com/cap-js/incidents-app) as the base to add data privacy and audit logging to.

<img src="./assets/Incidents-App.drawio.svg" style="zoom:111%;" alt="Shows the connections between the entities in the sample app." />
![Shows the connections between the entities in the sample app.](./assets/Incidents-App.drawio.svg){style="zoom:111%;"}

So, let's annotate the data model to identify personal data.
In essence, in all our entities we search for elements which carry personal data, such as person names, birth dates, etc., and tag them accordingly.
Expand Down Expand Up @@ -82,7 +82,7 @@ Learn more about these annotations in the [@PersonalData OData vocabulary](https

The entity-level annotation `@PersonalData.EntitySemantics` signifies relevant entities as *Data Subject*, *Data Subject Details*, or *Other* in data privacy terms, as depicted in the following graphic.

<img src="./assets/Data-Subjects.drawio.svg" alt="Shows the connections between the entities in the sample app. In addition via color coding it makes clear how entities are annotated: customers are data subject, addresses are data subject details and incidents are other." style="zoom:111%;" />
![Shows the connections between the entities in the sample app. In addition via color coding it makes clear how entities are annotated: customers are data subject, addresses are data subject details and incidents are other.](./assets/Data-Subjects.drawio.svg){style="zoom:111%;"}

The following table provides some further details.

Expand Down
2 changes: 1 addition & 1 deletion guides/data-privacy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Data protection is associated with numerous legal requirements and privacy conce

CAP supports applications in their obligations to comply to data privacy regulations, by automating tedious tasks as much as possible based on annotated models. That is, CAP provides easy ways to designate personal data, as well as out-of-the-box integration with SAP BTP services, which enable you to fulfill specific data privacy requirements in your application. This relieves application developers of these tedious tasks and related efforts.

<img src="./assets/Data-Privacy.drawio.svg" alt="Shows with which solutions CAP annotations can be used out of the box, as described in the following table." style="zoom:111%;" />
![Shows with which solutions CAP annotations can be used out of the box, as described in the following table.](./assets/Data-Privacy.drawio.svg){style="zoom:111%;"}



Expand Down
2 changes: 1 addition & 1 deletion guides/messaging/s4.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ As documented in the [Service Consumption guide](../using-services#external-serv
1. Find / open [Business Partner (A2X) API](https://api.sap.com/api/API_BUSINESS_PARTNER).
2. Choose button *"API Specification"*.
3. Download the EDMX spec from this list:
<img src="./assets/api-specification.png" alt="Showing all available specifications on the SAP Business Accelerator Hub." style="zoom: 33%;" />
![Showing all available specifications on the SAP Business Accelerator Hub.](./assets/api-specification.png){style="zoom: 33%;" }
1. Import it as a CDS model:

```sh
Expand Down
2 changes: 1 addition & 1 deletion guides/security/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ CAP requires a dedicated [platform environment](#platform-environment) to integr
The following diagram provides a high-level overview about the security-relevant aspects of a deployed CAP application in a cloud environment:

<!-- TODO: Redraw as .drawio.svg -->
<img src="./assets/cap-security-architecture-overview.png" width="600px" alt="This TAM graphic is explained in the accompanying text.">
![This TAM graphic is explained in the accompanying text.](./assets/cap-security-architecture-overview.png){width="600px"}

To serve a business request, different runtime components are involved: a request, issued by a UI or technical client ([public zone](#public-zone)), is forwarded by a gateway or ingress router to the CAP application. In case of an UI request, an [Application Router](https://help.sap.com/docs/btp/sap-business-technology-platform/application-router) instance acts as a proxy. The CAP application might make use of a CAP sidecar. All application components ([application zone](#application-zone)) might make use of platform services such as database or identity service ([platform zone](#platform-zone)).

Expand Down
2 changes: 1 addition & 1 deletion java/cqn-services/remote-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Destinations in the Cloud SDK are the means to express and define connectivity t

On top of that CAP integrates nicely with Cloud SDK, for example, ensuring automatic propagation of tenant and user information from the _Request Context_ to the Cloud SDK.

<img src="../assets/remote%20services.drawio.svg" width="700px" class="mute-dark" alt="This graphic depicts the integration of SAP Cloud SDK into SAP CAP Java.">
![This graphic depicts the integration of SAP Cloud SDK into SAP CAP Java.](../assets/remote%20services.drawio.svg){width="700px" class="mute-dark"}

CAP's clear recommendation is to use _Remote Services_ over directly using the SAP Cloud SDK. However, if you can't leverage CQN-based _Remote Services_, refer to [native consumption with Cloud SDK](#native-consumption) for details.

Expand Down
2 changes: 1 addition & 1 deletion java/developing-applications/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ A common example for this is to run the application locally on H2 instead of SAP

The following diagram illustrates the modular stack architecture and highlights the generic components:

<img alt="This screenshot is explained in the accompanying text." src="./assets/modularized-architecture.png" width="600px">
![This screenshot is explained in the accompanying text.](./assets/modularized-architecture.png){width="600px"}

You can recognize five different areas of the stack, which comprise components according to different tasks:

Expand Down
8 changes: 4 additions & 4 deletions java/event-handlers/request-contexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ The CAP Java SDK allows you to create new Request Contexts and define their scop

There are a few typical use cases in a CAP-based, multitenant application on SAP BTP in which creation of new Request Contexts is necessary. These scenarios are identified by a combination of the user (technical or named) and the tenant (provider or subscribed).

<img src="./assets/requestcontext.drawio.svg" alt="A named user can switch to a technical user in the same/subscriber tenant using the systemUser() method. Also, a named user can switch to a technical user in the provider tenant using the systemUserProvider() method. In addition technical users provider/subscriber tenants can switch to technical users on provider/subscriber tenants using the methods systemUserProvider() or systemUser(tenant). ">
![A named user can switch to a technical user in the same/subscriber tenant using the systemUser() method. Also, a named user can switch to a technical user in the provider tenant using the systemUserProvider() method. In addition technical users provider/subscriber tenants can switch to technical users on provider/subscriber tenants using the methods systemUserProvider() or systemUser(tenant).](./assets/requestcontext.drawio.svg)

When calling CAP Services, it's important to call them in an appropriate Request Context. Services might, for example, trigger HTTP requests to external services by deriving the target tenant from the current Request Context.

Expand All @@ -144,7 +144,7 @@ In the following a few concrete examples are given:

### Switching to Technical User

<img src="./assets/nameduser.drawio.svg" alt="The graphic is explained in the accompanying text.">
![The graphic is explained in the accompanying text.](./assets/nameduser.drawio.svg)

The incoming JWT token triggers the creation of an initial RequestContext with a named user. Accesses to the database in the OData Adapter as well as the custom `On` handler are executed within <i>tenant1</i> and authorization checks are performed for user <i>JohnDoe</i>. An additionally defined `After` handler wants to call out to an external service using a technical user without propagating the named user <i>JohnDoe</i>.
Therefore, the `After` handler needs to create a new Request Context. To achieve this, it's required to call `requestContext()` on the current `CdsRuntime` and use the `systemUser()` method to remove the named user from the new Request Context:
Expand All @@ -160,7 +160,7 @@ public void afterHandler(EventContext context){
```
### Switching to Technical Provider Tenant {#switching-to-provider-tenant}

<img src="./assets/switchprovidertenant.drawio.svg" alt="The graphic is explained in the accompanying text.">
![The graphic is explained in the accompanying text.](./assets/switchprovidertenant.drawio.svg)

The application offers an action for one of its CDS entities. Within the action, a communication happens with a remote CAP service using an internal technical user from the provider account. The corresponding `on` handler of the action needs to create a new Request Context by calling `requestContext()`. Using the `systemUserProvider()` method, the existing user information is removed and the tenant is automatically set to the provider tenant. This allows the application to perform an HTTP call to the remote CAP service, which is secured using the pseudo-role `internal-user`.

Expand All @@ -175,7 +175,7 @@ public void onAction(AddToOrderContext context){
```
### Switching to a Specific Technical Tenant

<img src="./assets/switchtenant.drawio.svg" alt="The graphic is explained in the accompanying text.">
![The graphic is explained in the accompanying text.](./assets/switchtenant.drawio.svg)

The application is using a job scheduler that needs to regularly perform tasks on behalf of a certain tenant. By default, background executions (for example in a dedicated thread pool) aren't associated to any subscriber tenant and user. In this case, it's necessary to explicitly define a new Request Context based on the subscribed tenant by calling `systemUser(tenantId)`. This ensures that the Persistence Service performs the query for the specified tenant.

Expand Down
2 changes: 1 addition & 1 deletion java/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ In the following, we provide a basic introduction to publish-subscribe-based mes

In a publish-subscribe-based messaging scenario (pub-sub messaging), senders send a message tagged with a topic to a message broker. Receivers can create queues at the message broker and subscribe these queues to the topics they're interested in. The message broker will then copy incoming messages matching the subscribed topics to the corresponding queues. Receivers can now consume these messages from their queues. If the receiver is offline, no messages will be lost as the message broker safely stores messages in the queue until a receiver consumes the messages. After the receiver acknowledges the successful processing of a message, the message broker will delete the acknowledged message from the queue.

<img src="./assets/messaging_foundation.png" width="700px" alt="The graphic is explained in the accompanying text.">
![The graphic is explained in the accompanying text.](./assets/messaging_foundation.png){width="700px"}

CAP makes sending and receiving messages easy by providing an API agnostic from specific message brokers, and taking care of broker-specific mechanics like connection handling, protocols to use, creating queues, subscriptions, etc. The API seamlessly blends into the common event API of CAP services, so that event messages can be sent using `emit` and handlers to execute when receiving event messages can be declared with the `@On` annotation.

Expand Down
4 changes: 2 additions & 2 deletions java/operating-applications/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Various logging frameworks for Java have evolved and are widely used in Open Sou

CAP Java SDK seamlessly integrates with Simple Logging Façade for Java ([SLF4J](https://www.slf4j.org)), which provides an abstraction layer for logging APIs. Applications compiled against SLF4J are free to choose a logging framework implementation at deployment time. Most famous libraries have a native integration to SLF4J, but it also can bridge legacy logging API calls:

<img src="./assets/slf4j.png" width="500px">
![](./assets/slf4j.png){width="500px"}

### Logger API { #logging-api}

Expand Down Expand Up @@ -252,7 +252,7 @@ Spans and traces that are produced out of the box, include HTTP requests as well

In addition, it's possible to add manual instrumentations using the [Open Telemetry Java API](https://opentelemetry.io/docs/instrumentation/java/manual/), for example, in a custom event handler.

<img src="./assets/screenshot_otel_trace.png" width="500px" class="mute-dark" alt="This graphic shows several spans, which conclude a trace of a single HTTP request, including the time they're opened and closed.">
![This graphic shows several spans, which conclude a trace of a single HTTP request, including the time they're opened and closed.](./assets/screenshot_otel_trace.png){width="500px" class="mute-dark"}

#### Configure Java Agent and Extension Library { #agent-extension }

Expand Down
Loading