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
1 change: 0 additions & 1 deletion docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ export default defineConfig({
{ text: "Bootstrapping", link: "/configuration/setup/ui5_bootstrapping" },
{ text: "Bootstrap Attributes", link: "/configuration/setup/bootstrap_attributes" },
{ text: "Style / CSS", link: "/configuration/setup/style_css" },
{ text: "Favicon", link: "/configuration/setup/favicon" },
{ text: "Logon Language", link: "/configuration/setup/logon_language" },
],
},
Expand Down
20 changes: 17 additions & 3 deletions docs/advanced/extensibility/user_exits.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ outline: [2, 4]
abap2UI5 offers predefined user exits for tweaking the standard behavior. The interface [`Z2UI5_IF_EXIT`](https://github.com/abap2UI5/abap2UI5/blob/main/src/02/z2ui5_if_exit.intf.abap) exposes the user exits. To use them on your system, build a class that implements the interface and its methods. The abap2UI5 class [`Z2UI5_CL_UI5_USER_EXIT`](https://github.com/abap2UI5/abap2UI5/blob/main/src/01/04/z2ui5_cl_ui5_user_exit.clas.abap) calls them dynamically. Put your class in a custom package — **not** in the abap2UI5 packages.

The interface exposes two exit methods:
- **`set_config_http_get`** — called on the initial HTTP GET request (page load). Use it to set frontend properties like the page title, UI5 theme, or UI5 version.
- **`set_config_http_get`** — called on the initial HTTP GET request (page load). Use it to set frontend properties like the UI5 theme, the UI5 version, or the inline CSS.
- **`set_config_http_post`** — called on every later HTTP POST request (each roundtrip). Use it to set backend behavior like the draft expiration time.

Both methods take a `cs_config` changing parameter whose fields you can set as needed. The example below changes the title, the theme, and how long the backend keeps drafts:
Both methods take a `cs_config` changing parameter whose fields you can set as needed. The example below changes the theme and how long the backend keeps drafts:

```abap
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC.
Expand All @@ -23,7 +23,6 @@ CLASS zcl_a2ui5_user_exit IMPLEMENTATION.

METHOD z2ui5_if_exit~set_config_http_get.

cs_config-title = `my title`.
cs_config-theme = `sap_belize`.

ENDMETHOD.
Expand All @@ -40,3 +39,18 @@ CLASS zcl_a2ui5_user_exit IMPLEMENTATION.

ENDCLASS.
```

::: tip The interface is being renamed
`z2ui5_if_exit` becomes `z2ui5_if_ui5_exit`, following the framework's naming.
Both work — abap2UI5 looks up both interfaces, so an existing exit keeps
running — and the examples here move to the new name once it is in a release.
See [Deprecations](/resources/deprecations).
:::

::: warning The tab title is not set here
`cs_config-title` is still on the structure — an exit that assigns it compiles
and runs — but nothing reads it any more. The generated page always carries
`<title>abap2UI5</title>`, and the title the user sees is set by the running
app with the `set_title` frontend event: see
[Title](/cookbook/browser_interaction/title).
:::
2 changes: 1 addition & 1 deletion docs/advanced/renaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ alone would let them collide; the segment is what keeps them apart.

| Segment | Meaning |
|---|---|
| *(none)* — `z2ui5_if_app`, `z2ui5_if_client`, `z2ui5_if_types`, `z2ui5_if_exit` | **The public API.** The four interfaces carry no segment on purpose: they are the contract, and a contract does not move between layers |
| *(none)* — `z2ui5_if_app`, `z2ui5_if_client`, `z2ui5_if_exit` | **The public API.** The three interfaces carry no segment on purpose: they are the contract, and a contract does not move between layers. `z2ui5_if_types` carries none either and is the exception that proves the rule: it is retired, ships unchanged so existing apps keep compiling, and every type it held now sits on the object that uses it — see [Deprecations](/resources/deprecations) |
| `ui5` | The framework itself — the engine and the shipped apps (`z2ui5_cl_ui5_handler`, `z2ui5_cl_ui5_srv_draft`, `z2ui5_cl_ui5_app_start`), plus the two public classes `z2ui5_cl_ui5_http_handler` and `z2ui5_cl_ui5_view_builder` |
| `ui5f` | The UI5 **f**rontend, embedded as ABAP string constants and **generated** — never edit one by hand, the next build overwrites it |
| `ajson`, `srt` | [ajson](/technical/tools/ajson) and [S-RTTI](/technical/tools/srtti), mirrored from their upstream projects under this namespace |
Expand Down
5 changes: 3 additions & 2 deletions docs/configuration/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outline: [2, 4]
---
# Setup

Every UI5 application has an `index.html` that bootstraps the framework, picks a theme, defines the page title and so on. With abap2UI5 you don't maintain that file by hand — the framework generates it on every page load. To change what ends up in it, implement the `z2ui5_if_exit` interface in your own ABAP class:
Every UI5 application has an `index.html` that bootstraps the framework, picks a theme, loads a UI5 version and so on. With abap2UI5 you don't maintain that file by hand — the framework generates it on every page load. To change what ends up in it, implement the `z2ui5_if_exit` interface in your own ABAP class:

```abap
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC.
Expand Down Expand Up @@ -32,11 +32,12 @@ ENDCLASS.
| [Bootstrapping](/configuration/setup/ui5_bootstrapping) | `src` | `src` of the bootstrap script (UI5 version + delivery channel) |
| [Bootstrap Attributes](/configuration/setup/bootstrap_attributes) | `t_add_config` | Additional `data-sap-ui-*` attributes |
| [Style / CSS](/configuration/setup/style_css) | `styles_css` | Inline `<style>` block in the page `<head>` |
| [Favicon](/configuration/setup/favicon) | `favicon` | `<link rel="icon">` in the page `<head>` — the tab icon |
| [Language](/configuration/setup/logon_language) | URL parameter `sap-language` | SAP session language + UI5 locale |

Security-relevant headers and the Content Security Policy meta tag are configured separately — see [Security](/configuration/security).

The tab title is **not** on this list. The generated page always carries `<title>abap2UI5</title>`, and the title the user sees is set by the running app with the `set_title` frontend event — see [Title](/cookbook/browser_interaction/title). The field `cs_config-title` still exists on `cs_config` so that existing exits compile, but nothing reads it.

## See Also

- Official SAP documentation on [UI5 bootstrapping](https://sapui5.hana.ondemand.com/#/topic/91f2cebe7c8e4d289fd80a4f0c0bd2ca) and [configuration options](https://sapui5.hana.ondemand.com/#/topic/91f2d03b6f4d1014b6dd926db0e91070).
Expand Down
58 changes: 0 additions & 58 deletions docs/configuration/setup/favicon.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/cookbook/browser_interaction/title.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ samples:

Set the text the browser shows in the tab and window title bar.

The running app is the only place this is decided. The page abap2UI5 generates
always carries `<title>abap2UI5</title>` — that is what the tab says while UI5
boots, before any app can speak — and from the first roundtrip on it says
whatever the app last set. The user exit's `cs_config-title` is not read any
more; see [Deprecations](/resources/deprecations).

### Standalone

To change the title after the app is running — for example, to reflect the current record — call the `set_title` frontend event from the backend:
Expand Down
91 changes: 91 additions & 0 deletions docs/resources/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ tell you what is coming if you do not.
| `z2ui5_cl_xml_view` | `z2ui5_cl_ui5_view_builder` | 1.143.0 |
| built-in popups | the [popups add-on](https://github.com/abap2UI5-addons/popups) | 1.142.0 |
| `z2ui5.Util` | `z2ui5.Formatter` | 1.142.0 |
| `cs_config-title` | `cs_event-set_title` | *next release* |
| `z2ui5_if_types=>…` | the same type on the object that uses it | *next release* |
| `z2ui5_if_exit` | `z2ui5_if_ui5_exit` | *next release* |

## Obsolete: still compiles

Expand Down Expand Up @@ -355,6 +358,94 @@ The controls still ship and views that use them keep rendering. See
[Follow-up Action](/cookbook/expert_more/follow_up_action) for the full argument
list of each event.

### `cs_config-title` → `cs_event-set_title`

The page title used to be set in the user exit and the tab title while the app
runs with the `set_title` frontend event — two mechanisms for one string, which
could disagree about what the tab says. The one that stays is the one the app
can reach at any point in its life:

```abap
" old - in your z2ui5_if_exit implementation
METHOD z2ui5_if_exit~set_config_http_get.

cs_config-title = `Invoice App`.

ENDMETHOD.

" new - in your app, whenever the title should change
client->follow_up_action( val = client->cs_event-set_title
t_arg = VALUE #( ( `Invoice App` ) ) ).
```

The field stays on `cs_config` and an exit that assigns it still compiles — it
simply has no effect. The generated page carries a constant
`<title>abap2UI5</title>`, which is what the tab shows while UI5 boots, before
any app can speak. Inside a Fiori Launchpad shell the title is
`cs_event-set_title_launchpad`, unchanged. See
[Title](/cookbook/browser_interaction/title).

### `z2ui5_if_exit` → `z2ui5_if_ui5_exit`

The user-exit interface follows the framework's naming: everything that is the
engine rather than the contract carries the `ui5` segment. The two methods, the
three types and the behaviour are unchanged.

```abap
" old
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_exit.
ENDCLASS.

" new
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_ui5_exit.
ENDCLASS.
```

**Nothing has to change today.** Both interfaces ship, and abap2UI5 looks up
both when it searches for your exit class — a class implementing the old one is
found and called exactly as before. A class implementing *both* is called once,
through the new interface. The types on `z2ui5_if_exit` are references to the
ones on `z2ui5_if_ui5_exit`, not copies, so a config structure that gains a
field gains it under either name.

`z2ui5_if_exit` is deleted after a transition period, so move your exit over
when you next touch it — after the release that brings the new name, which the
examples on this site still wait for.

### `z2ui5_if_types` → the object that uses the type

`z2ui5_if_types` was a shared interface holding the types the API passes
around. Each of them now sits on the object whose signature is the reason it
exists, so the type you need is declared where you already are:

| What you have | What to write |
|---|---|
| `z2ui5_if_types=>ty_s_get` | `z2ui5_if_client=>ty_s_get` — the return type of `get( )` |
| `z2ui5_if_types=>ty_s_event_control` | `z2ui5_if_client=>ty_s_event_control` — the `s_ctrl` of `_event( )` |
| `z2ui5_if_types=>ty_s_name_value` / `ty_t_name_value` | `z2ui5_if_client=>ty_s_name_value` / `ty_t_name_value` |
| `z2ui5_if_types=>cs_device` | `z2ui5_if_client=>cs_device` |
| `z2ui5_if_types=>ty_s_http_context` / `ty_s_http_config` / `ty_s_http_config_post` | the same names on `z2ui5_if_exit`, whose two methods take them |
| `z2ui5_if_types=>ty_s_draft` | `z2ui5_cl_ui5_srv_draft=>ty_s_draft` |
| `z2ui5_if_types=>ty_s_config` | written out inside `z2ui5_if_client=>ty_s_get-s_config` |

```abap
" old
DATA ls_get TYPE z2ui5_if_types=>ty_s_get.

" new
DATA ls_get TYPE z2ui5_if_client=>ty_s_get.
```

Nothing was deleted and nothing was reshaped. `z2ui5_if_types` still ships,
unchanged, from the framework's frozen package — an app that names it compiles
and runs exactly as before, and every moved type is identical field for field,
so a variable declared the old way still fits the new signatures. There is no
deadline; change it when you next touch the class.

### `z2ui5.Util` → `z2ui5.Formatter`

`z2ui5.Util` (module `z2ui5/Util`) is a backward-compatible alias that
Expand Down
6 changes: 3 additions & 3 deletions docs/resources/logo.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ edges the day the page turns grey.

## Favicon

The mark at tab size, as an `.ico`. The browser tab of this documentation, and
the tab of any abap2UI5 app that does not
[set its own](/configuration/setup/favicon).
The mark at tab size, as an `.ico`. The browser tab of this documentation. An
abap2UI5 app sets its own tab icon from the running app, with the `set_favicon`
frontend event — see [Title](/cookbook/browser_interaction/title).

![The abap2UI5 favicon](/favicon.ico){width=64}

Expand Down