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
3 changes: 2 additions & 1 deletion SAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# The sample catalogue

Every app in this repository — 45 of them — with what it shows and a
Every app in this repository — 46 of them — with what it shows and a
link to its source. This is the [overview app](src/z2ui5_cl_smps_app_000.clas.abap)
as a page you can read here, before installing anything.

Expand Down Expand Up @@ -104,6 +104,7 @@ type who does not know it exists. `Ctrl+F` on this page uses them.
| Sample | Class |
|---|---|
| Build the URL of a Launchpad App<br>Builds the URL of a launchpad app from semantic object, action and parameters - through cl_lsapi_manager where the system has it, as an intent URL of its own where it does not<br><sub>launchpad fiori flp url intent semantic object action link cl_lsapi_manager open_new_tab</sub> | [`Z2UI5_CL_SMPS_APP_025`](src/09/z2ui5_cl_smps_app_025.clas.abap) |
| Smart Link Popover with getLinks<br>a list of products whose ids are smart links - a press asks the launchpad which apps the user may open for the product and lists them in a popover<br><sub>launchpad fiori flp smart link popover getlinks intent semantic object cross_app_nav_get_links</sub> | [`Z2UI5_CL_SMPS_APP_026`](src/09/z2ui5_cl_smps_app_026.clas.abap) |
| Read Startup Parameters<br>what the tile passed in - client->get( )-t_comp_params<br><sub>launchpad fiori flp startup parameters intent</sub> | [`Z2UI5_CL_SMPS_APP_481`](src/09/z2ui5_cl_smps_app_481.clas.abap) |
| Set Shell Title<br>follow_up_action( cs_event-set_title_launchpad )<br><sub>launchpad fiori flp shell title follow_up_action</sub> | [`Z2UI5_CL_SMPS_APP_482`](src/09/z2ui5_cl_smps_app_482.clas.abap) |
| Cross-App Navigation Sender<br>hands two values over to another tile<br><sub>launchpad fiori flp cross app navigation sender intent</sub> | [`Z2UI5_CL_SMPS_APP_483`](src/09/z2ui5_cl_smps_app_483.clas.abap) |
Expand Down
22 changes: 12 additions & 10 deletions catalogue-derived.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"sap.m.QuickViewPage",
"sap.m.ToggleButton",
"z2ui5.cc.Websocket",
"sap.m.StandardListItem",
"sap.m.CheckBox",
"sap.m.Select",
"sap.ui.core.Item",
Expand All @@ -70,8 +71,8 @@
"sap.m.TextArea"
],
"counts": {
"samples": 45,
"controls": 60,
"samples": 46,
"controls": 61,
"noChain": 0
},
"samples": [
Expand All @@ -88,19 +89,20 @@
{"class":"Z2UI5_CL_SMPS_APP_010","minUi5":"1.71","needs":[],"controls":[1,2,3,39,40,22,37,6,7,10,11,12,13,18,41,15,17,38],"controlCount":55},
{"class":"Z2UI5_CL_SMPS_APP_011","minUi5":"1.71","needs":[],"controls":[1,2,3,22,37,5,7,10,11,12,13,18,41,17,38],"controlCount":33},
{"class":"Z2UI5_CL_SMPS_APP_012","minUi5":"1.71","needs":[],"controls":[1,2,3,7,10,11,12,13,18,41,17],"controlCount":18},
{"class":"Z2UI5_CL_SMPS_APP_013","minUi5":"1.71","needs":[],"controls":[1,50,22,37,5,23,7,51,10,41,52,17,38],"controlCount":28},
{"class":"Z2UI5_CL_SMPS_APP_013","minUi5":"1.71","needs":[],"controls":[1,51,22,37,5,23,7,52,10,41,53,17,38],"controlCount":28},
{"class":"Z2UI5_CL_SMPS_APP_014","minUi5":"1.71","needs":[],"controls":[1,43,44,22,45,5,7,10,14,17],"controlCount":11},
{"class":"Z2UI5_CL_SMPS_APP_015","minUi5":"1.71","needs":[],"controls":[1,2,3,22,37,5,53,7,8,10,11,12,14,17],"controlCount":38},
{"class":"Z2UI5_CL_SMPS_APP_016","minUi5":"1.71","needs":[],"controls":[1,2,3,31,22,37,5,7,10,11,12,13,18,41,17,38,54],"controlCount":35},
{"class":"Z2UI5_CL_SMPS_APP_017","minUi5":"1.71","needs":[],"controls":[1,2,3,31,37,5,6,7,10,55,11,12,13,18,41,17],"controlCount":31},
{"class":"Z2UI5_CL_SMPS_APP_018","minUi5":"1.71","needs":[],"controls":[1,2,3,40,31,22,37,5,7,56,57,10,58,11,12,59,13,18,41,15,17,38],"controlCount":50},
{"class":"Z2UI5_CL_SMPS_APP_015","minUi5":"1.71","needs":[],"controls":[1,2,3,22,37,5,54,7,8,10,11,12,14,17],"controlCount":38},
{"class":"Z2UI5_CL_SMPS_APP_016","minUi5":"1.71","needs":[],"controls":[1,2,3,31,22,37,5,7,10,11,12,13,18,41,17,38,55],"controlCount":35},
{"class":"Z2UI5_CL_SMPS_APP_017","minUi5":"1.71","needs":[],"controls":[1,2,3,31,37,5,6,7,10,56,11,12,13,18,41,17],"controlCount":31},
{"class":"Z2UI5_CL_SMPS_APP_018","minUi5":"1.71","needs":[],"controls":[1,2,3,40,31,22,37,5,7,57,58,10,59,11,12,60,13,18,41,15,17,38],"controlCount":50},
{"class":"Z2UI5_CL_SMPS_APP_019","minUi5":"1.71","needs":[],"controls":[1,22,37,5,23,7,10,12,41,17,38],"controlCount":15},
{"class":"Z2UI5_CL_SMPS_APP_020","minUi5":"1.71","needs":[],"controls":[1,2,3,31,5,7,10,11,12,13,18,41,17],"controlCount":25},
{"class":"Z2UI5_CL_SMPS_APP_021","minUi5":"1.71","needs":[],"controls":[1,2,3,31,5,7,10,11,12,17,54],"controlCount":27},
{"class":"Z2UI5_CL_SMPS_APP_021","minUi5":"1.71","needs":[],"controls":[1,2,3,31,5,7,10,11,12,17,55],"controlCount":27},
{"class":"Z2UI5_CL_SMPS_APP_022","minUi5":"1.71","needs":[],"controls":[1,2,3,22,5,7,10,11,12,13,18,41,17],"controlCount":22},
{"class":"Z2UI5_CL_SMPS_APP_023","minUi5":"1.71","needs":[],"controls":[1,22,37,5,23,7,10,12,59,41,17,38],"controlCount":18},
{"class":"Z2UI5_CL_SMPS_APP_024","minUi5":"1.71","needs":[],"controls":[1,2,3,37,5,6,23,7,10,11,12,59,41,17,38],"controlCount":22},
{"class":"Z2UI5_CL_SMPS_APP_023","minUi5":"1.71","needs":[],"controls":[1,22,37,5,23,7,10,12,60,41,17,38],"controlCount":18},
{"class":"Z2UI5_CL_SMPS_APP_024","minUi5":"1.71","needs":[],"controls":[1,2,3,37,5,6,23,7,10,11,12,60,41,17,38],"controlCount":22},
{"class":"Z2UI5_CL_SMPS_APP_025","minUi5":"1.71","needs":[],"controls":[1,2,3,22,37,5,23,7,10,11,12,13,18,41,17,38],"controlCount":31},
{"class":"Z2UI5_CL_SMPS_APP_026","minUi5":"1.71","needs":[],"controls":[2,3,22,37,4,45,5,7,9,10,50,11,12,13,18,15,17,38],"controlCount":24},
{"class":"Z2UI5_CL_SMPS_APP_313","minUi5":"1.71","needs":[],"controls":[7,10,19,20,21,17],"controlCount":6},
{"class":"Z2UI5_CL_SMPS_APP_314","minUi5":"1.71","needs":[],"controls":[2,3,22,7,10,11,12,13,18,17],"controlCount":31},
{"class":"Z2UI5_CL_SMPS_APP_315","minUi5":"1.71","needs":[],"controls":[2,3,7,10,11,12,13,18,17],"controlCount":35},
Expand Down
26 changes: 26 additions & 0 deletions catalogue.json
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,32 @@
"branch": "09-launchpad",
"setup": "src/09/README.md"
},
{
"class": "Z2UI5_CL_SMPS_APP_026",
"path": "src/09/z2ui5_cl_smps_app_026.clas.abap",
"package": "src/09",
"technology": "Launchpad",
"title": "Smart Link Popover with getLinks",
"summary": "a list of products whose ids are smart links - a press asks the launchpad which apps the user may open for the product and lists them in a popover",
"keywords": [
"launchpad",
"fiori",
"flp",
"smart",
"link",
"popover",
"getlinks",
"intent",
"semantic",
"object",
"cross_app_nav_get_links"
],
"runsOn": "Cloud + Standard ≥ 7.40 SP08",
"cloud": true,
"needs": "a Fiori Launchpad with a tile pointing at abap2UI5",
"branch": "09-launchpad",
"setup": "src/09/README.md"
},
{
"class": "Z2UI5_CL_SMPS_APP_481",
"path": "src/09/z2ui5_cl_smps_app_481.clas.abap",
Expand Down
32 changes: 30 additions & 2 deletions src/09/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ reaches the other tiles of the launchpad — your own and SAP's alike.
Nothing about the app changes for that. It stays the same class with the same
`main( )`; the framework recognises the launchpad on its own and tells the app
through `client->get( )-check_launchpad_active`. So one app runs in both worlds, and
the four samples here show what the launchpad adds when it is the one you are in.
the samples here show what the launchpad adds when it is the one you are in.

## What you need

Expand All @@ -31,7 +31,7 @@ The target mapping's URL is the abap2UI5 ICF node plus the app to start:

The framework detects the launchpad from that context (`scenario=LAUNCHPAD` in the
query, or `/ui2/flp` / `test/flpSandbox` in the path) and sets
`check_launchpad_active`. `481` to `483` check the flag and tell you with a message
`check_launchpad_active`. `481` to `483` and `026` check the flag and tell you with a message
box when they were started standalone — where they then have no shell to talk to;
`484`, the receiver, shows the flag in its form and hides its two navigation
buttons instead.
Expand All @@ -45,6 +45,7 @@ buttons instead.
| [`483`](z2ui5_cl_smps_app_483.clas.abap) | cross-app navigation, **sender** — hands two values over to another tile |
| [`484`](z2ui5_cl_smps_app_484.clas.abap) | cross-app navigation, **receiver** — reads them back out of its startup parameters |
| [`025`](z2ui5_cl_smps_app_025.clas.abap) | build the URL of a launchpad app from semantic object, action and parameters — `cl_lsapi_manager` where the system has it, an intent URL of its own where it does not. Runs standalone too |
| [`026`](z2ui5_cl_smps_app_026.clas.abap) | a **smart link popover** — asks the launchpad which apps the user may open for a product and lists them next to the pressed link — `follow_up_action( cs_event-cross_app_nav_get_links )` |

Start any of them with `?app_start=z2ui5_cl_smps_app_<no>` — from a tile, that is
what the target mapping's URL carries. The overview app
Expand Down Expand Up @@ -83,6 +84,33 @@ Both literals sit in the classes, so use these two names or change them there. T
*back to the previous app* button in either sample needs no configuration at all —
`cs_event-cross_app_nav_to_prev_app` goes back through the shell's own history.

## Asking the launchpad which apps there are

`483` names its target. A Fiori elements list does not: its smart links ask the
launchpad which apps the user may open for the object — the answer depends on the
user's roles and catalogs, so only the frontend has it. `026` asks the same
question with the frontend action `cs_event-cross_app_nav_get_links` (target,
intent parameters, the event that receives the answer):

```abap
client->follow_up_action(
val = client->cs_event-cross_app_nav_get_links
t_arg = VALUE #( ( `{"semanticObject":"Z2UI5_CL_LP_SAMPLE_04"}` )
( `{"PRODUCT":"102343333","QUANTITY":"500"}` )
( `LINKS_READ` ) ) ).
```

`LINKS_READ` then arrives with a JSON array, one object per intent — `intent`
(the hash), `text`, `subTitle` — which the sample lists in a popover next to the
pressed link. A press on an entry navigates there with `cross_app_nav_to_ext` and
`{"shellHash":"<intent>"}` as target.

It needs no configuration of its own: its default semantic object is the one of
the receiver `484`, so with the target mapping of the pair above the popover lists
the receiver, and the receiver shows the product and quantity of the pressed row.
Type another semantic object to see what the launchpad offers for it; one without
target mapping gives an empty list. Needs abap2UI5 newer than 1.148.0.

## Where to go next

- [`01` OData](../01/README.md) — back to the beginning: the app talking to a
Expand Down
Loading
Loading