Skip to content

Commit dab98a1

Browse files
committed
wip: genres hierarchy
1 parent 0d6c8a3 commit dab98a1

File tree

16 files changed

+374
-98
lines changed

16 files changed

+374
-98
lines changed

app/appconfig/fioriSandboxConfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
"title": "Browse Books",
2121
"description": "Find your favorite book"
2222
}
23+
}, {
24+
"id": "browse-genres",
25+
"tileType": "sap.ushell.ui.tile.StaticTile",
26+
"properties": {
27+
"targetURL": "#Genres-display",
28+
"title": "Browse Genres",
29+
"description": "Find your favorite genre"
30+
}
2331
}
2432
]
2533
},
@@ -112,6 +120,19 @@
112120
"url": "/browse/webapp"
113121
}
114122
},
123+
"browse-genres": {
124+
"semanticObject": "Genres",
125+
"action": "display",
126+
"signature": {
127+
"parameters": {},
128+
"additionalParameters": "allowed"
129+
},
130+
"resolutionResult": {
131+
"applicationType": "SAPUI5",
132+
"additionalInformation": "SAPUI5.Component=genres",
133+
"url": "/genres/webapp"
134+
}
135+
},
115136
"manage-books": {
116137
"semanticObject": "Books",
117138
"action": "manage",

app/common.cds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ annotate my.Genres with
203203
Facets : [{
204204
$Type : 'UI.ReferenceFacet',
205205
Label : '{i18n>SubGenres}',
206-
Target : 'children/@UI.LineItem'
206+
Target : 'parent/@UI.LineItem'
207207
}, ],
208208
});
209209

app/genres/fiori-service.cds

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
Annotations for the Browse GenreHierarchy App
3+
*/
4+
5+
using AdminService from '../../srv/admin-service';
6+
7+
8+
annotate AdminService.GenreHierarchy with @Aggregation.RecursiveHierarchy#AdminHierarchy: {
9+
$Type: 'Aggregation.RecursiveHierarchyType',
10+
NodeProperty: node_id, // identifies a node
11+
ParentNavigationProperty: parent // navigates to a node's parent
12+
};
13+
14+
annotate AdminService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#AdminHierarchy: {
15+
$Type: 'Hierarchy.RecursiveHierarchyType',
16+
// ExternalKey : null,
17+
LimitedDescendantCount: LimitedDescendantCount,
18+
DistanceFromRoot: DistanceFromRoot,
19+
DrillState: DrillState,
20+
Matched: Matched,
21+
MatchedDescendantCount: MatchedDescendantCount
22+
};

app/genres/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "genres",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC"
12+
}

app/genres/webapp/Component.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("genres.Component", {
2+
metadata:{ manifest:'json' }
3+
}))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
appTitle=Browse Genres
2+
appDescription=Browse Genres - Sample Application
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
appTitle=Zeige Genre
2+
appDescription=Zeige Genre - Beispielanwendung

app/genres/webapp/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<title>Browse Books</title>
8+
<style>
9+
html, body, body > div, #container, #container-uiarea {
10+
height: 100%;
11+
}
12+
</style>
13+
<script
14+
id="sap-ui-bootstrap"
15+
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
16+
data-sap-ui-theme="sap_fiori_3"
17+
data-sap-ui-resourceroots='{
18+
"genres": "./"
19+
}'
20+
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
21+
data-sap-ui-compatVersion="edge"
22+
data-sap-ui-async="true"
23+
data-sap-ui-frameOptions="trusted"
24+
></script>
25+
</head>
26+
<body class="sapUiBody sapUiSizeCompact" id="content">
27+
<div
28+
data-sap-ui-component
29+
data-name="genres"
30+
data-id="container"
31+
data-settings='{"id" : "genres"}'
32+
data-handle-validation="true"
33+
></div>
34+
</body>
35+
</html>

app/genres/webapp/manifest.json

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"_version": "1.8.0",
3+
"sap.app": {
4+
"id": "genres",
5+
"type": "application",
6+
"title": "{{appTitle}}",
7+
"description": "{{appDescription}}",
8+
"applicationVersion": {
9+
"version": "1.0.0"
10+
},
11+
"dataSources": {
12+
"AdminService": {
13+
"uri": "/api/admin/",
14+
"type": "OData",
15+
"settings": {
16+
"odataVersion": "4.0"
17+
}
18+
}
19+
},
20+
"-sourceTemplate": {
21+
"id": "ui5template.basicSAPUI5ApplicationProject",
22+
"-id": "ui5template.smartTemplate",
23+
"-version": "1.40.12"
24+
},
25+
"crossNavigation": {
26+
"inbounds": {
27+
"Genres-show": {
28+
"signature": {
29+
"parameters": {},
30+
"additionalParameters": "allowed"
31+
},
32+
"semanticObject": "GenreHierarchy",
33+
"action": "show"
34+
}
35+
}
36+
}
37+
},
38+
"sap.ui5": {
39+
"dependencies": {
40+
"minUI5Version": "1.122.0",
41+
"libs": {
42+
"sap.fe.templates": {}
43+
}
44+
},
45+
"models": {
46+
"i18n": {
47+
"type": "sap.ui.model.resource.ResourceModel",
48+
"uri": "i18n/i18n.properties"
49+
},
50+
"": {
51+
"dataSource": "AdminService",
52+
"settings": {
53+
"synchronizationMode": "None",
54+
"operationMode": "Server",
55+
"autoExpandSelect" : true,
56+
"earlyRequests": true,
57+
"groupProperties": {
58+
"default": {
59+
"submit": "Auto"
60+
}
61+
}
62+
}
63+
}
64+
},
65+
"routing": {
66+
"routes": [
67+
{
68+
"pattern": ":?query:",
69+
"name": "GenreHierarchyList",
70+
"target": "GenreHierarchyList"
71+
},
72+
{
73+
"pattern": "GenreHierarchy({key}):?query:",
74+
"name": "GenreHierarchyDetails",
75+
"target": "GenreHierarchyDetails"
76+
}
77+
],
78+
"targets": {
79+
"GenreHierarchyList": {
80+
"type": "Component",
81+
"id": "GenreHierarchyList",
82+
"name": "sap.fe.templates.ListReport",
83+
"options": {
84+
"settings" : {
85+
"entitySet" : "GenreHierarchy",
86+
"navigation" : {
87+
"GenreHierarchy" : {
88+
"detail" : {
89+
"route" : "GenreHierarchyDetails"
90+
}
91+
}
92+
},
93+
"controlConfiguration": {
94+
"@com.sap.vocabularies.UI.v1.LineItem": {
95+
"tableSettings": {
96+
"hierarchyQualifier": "AdminHierarchy",
97+
"type": "TreeTable"
98+
}
99+
}
100+
}
101+
}
102+
}
103+
},
104+
"GenreHierarchyDetails": {
105+
"type": "Component",
106+
"id": "GenreHierarchyDetails",
107+
"name": "sap.fe.templates.ObjectPage",
108+
"options": {
109+
"settings" : {
110+
"entitySet": "GenreHierarchy"
111+
}
112+
}
113+
}
114+
}
115+
},
116+
"contentDensities": {
117+
"compact": true,
118+
"cozy": true
119+
}
120+
},
121+
"sap.ui": {
122+
"technology": "UI5",
123+
"fullWidth": false
124+
},
125+
"sap.fiori": {
126+
"registrationIds": [],
127+
"archeType": "transactional"
128+
}
129+
}

app/index.cds

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ using from './orders/fiori-service';
88
using from './reviews/fiori-service';
99
using from './notes/fiori-service';
1010
using from './addresses/fiori-service';
11+
using from './genres/fiori-service';
1112
using from './common';

0 commit comments

Comments
 (0)