Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 0d5b65d

Browse files
authored
Merge pull request #291 from gregorwolf/navigation
Demo for Semantic Navigation using the local Fiori Launchpad
2 parents fb41dd1 + dcf5ec6 commit 0d5b65d

14 files changed

Lines changed: 679 additions & 266 deletions

File tree

bookshop/srv/cat-service.cds

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,42 @@
1-
using { sap.capire.bookshop as my } from '../db/schema';
2-
service CatalogService @(path:'/browse') {
1+
using {sap.capire.bookshop as my} from '../db/schema';
32

4-
/** For displaying lists of Books */
5-
@readonly entity ListOfBooks as projection on Books
6-
excluding { descr };
3+
service CatalogService @(path : '/browse') {
74

8-
/** For display in details pages */
9-
@readonly entity Books as projection on my.Books { *,
10-
author.name as author
11-
} excluding { createdBy, modifiedBy };
5+
/**
6+
* For displaying lists of Books
7+
*/
8+
@readonly
9+
entity ListOfBooks as projection on Books excluding {
10+
descr
11+
};
1212

13-
@requires: 'authenticated-user'
14-
action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer };
15-
event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String };
13+
/**
14+
* For display in details pages
15+
*/
16+
@readonly
17+
entity Books as projection on my.Books {
18+
* , author.name as authorName
19+
} excluding {
20+
createdBy,
21+
modifiedBy
22+
};
23+
24+
@readonly
25+
entity Authors as projection on my.Authors {
26+
* , books : redirected to Books
27+
} excluding {
28+
createdBy,
29+
modifiedBy
30+
};
31+
32+
@requires : 'authenticated-user'
33+
action submitOrder(book : Books:ID, quantity : Integer) returns {
34+
stock : Integer
35+
};
36+
37+
event OrderedBook : {
38+
book : Books:ID;
39+
quantity : Integer;
40+
buyer : String
41+
};
1642
}

fiori/app/admin/webapp/manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"options": {
7474
"settings" : {
7575
"entitySet" : "Books",
76+
"initialLoad": true,
7677
"navigation" : {
7778
"Books" : {
7879
"detail" : {
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"services": {
3+
"LaunchPage": {
4+
"adapter": {
5+
"config": {
6+
"catalogs": [],
7+
"groups": [
8+
{
9+
"id": "Bookshop",
10+
"title": "Bookshop",
11+
"isPreset": true,
12+
"isVisible": true,
13+
"isGroupLocked": false,
14+
"tiles": [
15+
{
16+
"id": "BrowseBooks",
17+
"tileType": "sap.ushell.ui.tile.StaticTile",
18+
"properties": {
19+
"title": "Browse Books",
20+
"targetURL": "#Books-display"
21+
}
22+
},
23+
{
24+
"id": "BrowseAuthors",
25+
"tileType": "sap.ushell.ui.tile.StaticTile",
26+
"properties": {
27+
"title": "Browse Authors",
28+
"targetURL": "#Authors-display"
29+
}
30+
}
31+
]
32+
},
33+
{
34+
"id": "Administration",
35+
"title": "Administration",
36+
"isPreset": true,
37+
"isVisible": true,
38+
"isGroupLocked": false,
39+
"tiles": [
40+
{
41+
"id": "ManageBooks",
42+
"tileType": "sap.ushell.ui.tile.StaticTile",
43+
"properties": {
44+
"title": "Manage Books",
45+
"targetURL": "#Books-manage"
46+
}
47+
},
48+
{
49+
"id": "ManageOrders",
50+
"tileType": "sap.ushell.ui.tile.StaticTile",
51+
"properties": {
52+
"title": "Manage Orders",
53+
"targetURL": "#Orders-manage"
54+
}
55+
}
56+
]
57+
}
58+
]
59+
}
60+
}
61+
},
62+
"NavTargetResolution": {
63+
"config": {
64+
"enableClientSideTargetResolution": true
65+
}
66+
},
67+
"ClientSideTargetResolution": {
68+
"adapter": {
69+
"config": {
70+
"inbounds": {
71+
"BrowseBooks": {
72+
"semanticObject": "Books",
73+
"action": "display",
74+
"title": "Browse Books",
75+
"signature": {
76+
"parameters": {
77+
"Books.ID": {
78+
"renameTo": "ID"
79+
},
80+
"Authors.books.ID": {
81+
"renameTo": "ID"
82+
}
83+
},
84+
"additionalParameters": "ignored"
85+
},
86+
"resolutionResult": {
87+
"applicationType": "SAPUI5",
88+
"additionalInformation": "SAPUI5.Component=bookshop",
89+
"url": "/browse/webapp"
90+
}
91+
},
92+
"BrowseAuthors": {
93+
"semanticObject": "Authors",
94+
"action": "display",
95+
"title": "Browse Authors",
96+
"signature": {
97+
"parameters": {
98+
"Books.author.ID":{
99+
"renameTo": "ID"
100+
}
101+
},
102+
"additionalParameters": "ignored"
103+
},
104+
"resolutionResult": {
105+
"applicationType": "SAPUI5",
106+
"additionalInformation": "SAPUI5.Component=authors",
107+
"url": "/authors/webapp"
108+
}
109+
},
110+
"ManageBooks": {
111+
"semanticObject": "Books",
112+
"action": "manage",
113+
"title": "Manage Books",
114+
"signature": {
115+
"parameters": {},
116+
"additionalParameters": "allowed"
117+
},
118+
"resolutionResult": {
119+
"applicationType": "SAPUI5",
120+
"additionalInformation": "SAPUI5.Component=admin",
121+
"url": "/admin/webapp"
122+
}
123+
},
124+
"ManageOrders": {
125+
"semanticObject": "Orders",
126+
"action": "manage",
127+
"signature": {
128+
"parameters": {},
129+
"additionalParameters": "allowed"
130+
},
131+
"resolutionResult": {
132+
"applicationType": "SAPUI5",
133+
"additionalInformation": "SAPUI5.Component=orders",
134+
"url": "/orders/webapp"
135+
}
136+
}
137+
}
138+
}
139+
}
140+
}
141+
}
142+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using CatalogService from '@capire/bookshop';
2+
3+
////////////////////////////////////////////////////////////////////////////
4+
//
5+
// Authors Object Page
6+
//
7+
annotate CatalogService.Authors with @(UI : {
8+
HeaderInfo : {
9+
TypeName : 'Author',
10+
TypeNamePlural : 'Authors',
11+
Description : {Value : name}
12+
},
13+
HeaderFacets : [{
14+
$Type : 'UI.ReferenceFacet',
15+
Label : '{i18n>Description}',
16+
Target : '@UI.FieldGroup#Descr'
17+
}, ],
18+
Facets : [{
19+
$Type : 'UI.ReferenceFacet',
20+
Label : '{i18n>Details}',
21+
Target : 'books/@UI.LineItem'
22+
}, ],
23+
FieldGroup #Descr : {Data : [
24+
{Value : name},
25+
{Value : dateOfBirth},
26+
{Value : dateOfDeath},
27+
{Value : placeOfBirth},
28+
{Value : placeOfDeath},
29+
]},
30+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sap.ui.define(["sap/fe/core/AppComponent"], function (AppComponent) {
2+
"use strict";
3+
return AppComponent.extend("authors.Component", {
4+
metadata: { manifest: "json" },
5+
});
6+
});
7+
/* eslint no-undef:0 */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is the resource bundle of itelo
2+
# __ldi.translation.uuid=c3431418-9caf-11e8-98d0-529269fb1459
3+
4+
# JCI app descriptor contains lower case TITLE
5+
appTitle=Bookshop Authors
6+
7+
# JCI app descriptor contains lower case DESCRIPTION
8+
appSubTitle=Bookshop Authors
9+
10+
# JCI app descriptor contains lower case DESCRIPTION
11+
appDescription=Bookshop Authors
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"_version": "1.28.0",
3+
"sap.app": {
4+
"id": "authors",
5+
"type": "application",
6+
"title": "Browse Authors",
7+
"description": "Sample Application",
8+
"i18n": "i18n/i18n.properties",
9+
"applicationVersion": {
10+
"version": "1.0.0"
11+
},
12+
"dataSources": {
13+
"CatalogService": {
14+
"uri": "/browse/",
15+
"type": "OData",
16+
"settings": {
17+
"odataVersion": "4.0"
18+
}
19+
}
20+
},
21+
"sourceTemplate": {
22+
"id": "ui5template.basicSAPUI5ApplicationProject",
23+
"-id": "ui5template.smartTemplate",
24+
"version": "1.40.12"
25+
},
26+
"crossNavigation": {
27+
"inbounds": {
28+
"intent1": {
29+
"signature": {
30+
"parameters": {
31+
"Books.author.ID":{
32+
"renameTo": "ID"
33+
}
34+
},
35+
"additionalParameters": "ignored"
36+
},
37+
"semanticObject": "Authors",
38+
"action": "display",
39+
"title": "{{appTitle}}",
40+
"info": "{{appInfo}}",
41+
"subTitle": "{{appSubTitle}}",
42+
"icon": "sap-icon://SAP-icons-TNT/user",
43+
"indicatorDataSource": {
44+
"dataSource": "CatalogService",
45+
"path": "Authors/$count",
46+
"refresh": 1800
47+
}
48+
}
49+
}
50+
}
51+
},
52+
"sap.ui5": {
53+
"dependencies": {
54+
"minUI5Version": "1.81.0",
55+
"libs": {
56+
"sap.fe.templates": {}
57+
}
58+
},
59+
"models": {
60+
"i18n": {
61+
"type": "sap.ui.model.resource.ResourceModel",
62+
"uri": "i18n/i18n.properties"
63+
},
64+
"": {
65+
"dataSource": "CatalogService",
66+
"settings": {
67+
"synchronizationMode": "None",
68+
"operationMode": "Server",
69+
"autoExpandSelect": true,
70+
"earlyRequests": true,
71+
"groupProperties": {
72+
"default": {
73+
"submit": "Auto"
74+
}
75+
}
76+
}
77+
}
78+
},
79+
"routing": {
80+
"routes": [
81+
{
82+
"pattern": ":?query:",
83+
"name": "AuthorsList",
84+
"target": "AuthorsList"
85+
},
86+
{
87+
"pattern": "Authors({key}):?query:",
88+
"name": "AuthorsDetails",
89+
"target": "AuthorsDetails"
90+
}
91+
],
92+
"targets": {
93+
"AuthorsList": {
94+
"type": "Component",
95+
"id": "AuthorsList",
96+
"name": "sap.fe.templates.ListReport",
97+
"options": {
98+
"settings": {
99+
"entitySet": "Authors",
100+
"initialLoad": true,
101+
"navigation": {
102+
"Authors": {
103+
"detail": {
104+
"route": "AuthorsDetails"
105+
}
106+
}
107+
}
108+
}
109+
}
110+
},
111+
"AuthorsDetails": {
112+
"type": "Component",
113+
"id": "AuthorsDetailsList",
114+
"name": "sap.fe.templates.ObjectPage",
115+
"options": {
116+
"settings": {
117+
"entitySet": "Authors"
118+
}
119+
}
120+
}
121+
}
122+
},
123+
"contentDensities": {
124+
"compact": true,
125+
"cozy": true
126+
}
127+
},
128+
"sap.ui": {
129+
"technology": "UI5",
130+
"fullWidth": false,
131+
"deviceTypes":{
132+
"desktop": true,
133+
"tablet": true,
134+
"phone": true
135+
}
136+
},
137+
"sap.fiori": {
138+
"registrationIds": [],
139+
"archeType": "transactional"
140+
}
141+
}

0 commit comments

Comments
 (0)