Skip to content

Commit

Permalink
wip: genres hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
OlenaTi committed Oct 30, 2024
1 parent 0d6c8a3 commit dab98a1
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 98 deletions.
21 changes: 21 additions & 0 deletions app/appconfig/fioriSandboxConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
"title": "Browse Books",
"description": "Find your favorite book"
}
}, {
"id": "browse-genres",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"targetURL": "#Genres-display",
"title": "Browse Genres",
"description": "Find your favorite genre"
}
}
]
},
Expand Down Expand Up @@ -112,6 +120,19 @@
"url": "/browse/webapp"
}
},
"browse-genres": {
"semanticObject": "Genres",
"action": "display",
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"resolutionResult": {
"applicationType": "SAPUI5",
"additionalInformation": "SAPUI5.Component=genres",
"url": "/genres/webapp"
}
},
"manage-books": {
"semanticObject": "Books",
"action": "manage",
Expand Down
2 changes: 1 addition & 1 deletion app/common.cds
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ annotate my.Genres with
Facets : [{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>SubGenres}',
Target : 'children/@UI.LineItem'
Target : 'parent/@UI.LineItem'
}, ],
});

Expand Down
22 changes: 22 additions & 0 deletions app/genres/fiori-service.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Annotations for the Browse GenreHierarchy App
*/

using AdminService from '../../srv/admin-service';


annotate AdminService.GenreHierarchy with @Aggregation.RecursiveHierarchy#AdminHierarchy: {
$Type: 'Aggregation.RecursiveHierarchyType',
NodeProperty: node_id, // identifies a node
ParentNavigationProperty: parent // navigates to a node's parent
};

annotate AdminService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#AdminHierarchy: {
$Type: 'Hierarchy.RecursiveHierarchyType',
// ExternalKey : null,
LimitedDescendantCount: LimitedDescendantCount,
DistanceFromRoot: DistanceFromRoot,
DrillState: DrillState,
Matched: Matched,
MatchedDescendantCount: MatchedDescendantCount
};
12 changes: 12 additions & 0 deletions app/genres/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "genres",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
3 changes: 3 additions & 0 deletions app/genres/webapp/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("genres.Component", {
metadata:{ manifest:'json' }
}))
2 changes: 2 additions & 0 deletions app/genres/webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appTitle=Browse Genres
appDescription=Browse Genres - Sample Application
2 changes: 2 additions & 0 deletions app/genres/webapp/i18n/i18n_de.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appTitle=Zeige Genre
appDescription=Zeige Genre - Beispielanwendung
35 changes: 35 additions & 0 deletions app/genres/webapp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Browse Books</title>
<style>
html, body, body > div, #container, #container-uiarea {
height: 100%;
}
</style>
<script
id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-resourceroots='{
"genres": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted"
></script>
</head>
<body class="sapUiBody sapUiSizeCompact" id="content">
<div
data-sap-ui-component
data-name="genres"
data-id="container"
data-settings='{"id" : "genres"}'
data-handle-validation="true"
></div>
</body>
</html>
129 changes: 129 additions & 0 deletions app/genres/webapp/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"_version": "1.8.0",
"sap.app": {
"id": "genres",
"type": "application",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
},
"dataSources": {
"AdminService": {
"uri": "/api/admin/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
}
}
},
"-sourceTemplate": {
"id": "ui5template.basicSAPUI5ApplicationProject",
"-id": "ui5template.smartTemplate",
"-version": "1.40.12"
},
"crossNavigation": {
"inbounds": {
"Genres-show": {
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"semanticObject": "GenreHierarchy",
"action": "show"
}
}
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.122.0",
"libs": {
"sap.fe.templates": {}
}
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"": {
"dataSource": "AdminService",
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect" : true,
"earlyRequests": true,
"groupProperties": {
"default": {
"submit": "Auto"
}
}
}
}
},
"routing": {
"routes": [
{
"pattern": ":?query:",
"name": "GenreHierarchyList",
"target": "GenreHierarchyList"
},
{
"pattern": "GenreHierarchy({key}):?query:",
"name": "GenreHierarchyDetails",
"target": "GenreHierarchyDetails"
}
],
"targets": {
"GenreHierarchyList": {
"type": "Component",
"id": "GenreHierarchyList",
"name": "sap.fe.templates.ListReport",
"options": {
"settings" : {
"entitySet" : "GenreHierarchy",
"navigation" : {
"GenreHierarchy" : {
"detail" : {
"route" : "GenreHierarchyDetails"
}
}
},
"controlConfiguration": {
"@com.sap.vocabularies.UI.v1.LineItem": {
"tableSettings": {
"hierarchyQualifier": "AdminHierarchy",
"type": "TreeTable"
}
}
}
}
}
},
"GenreHierarchyDetails": {
"type": "Component",
"id": "GenreHierarchyDetails",
"name": "sap.fe.templates.ObjectPage",
"options": {
"settings" : {
"entitySet": "GenreHierarchy"
}
}
}
}
},
"contentDensities": {
"compact": true,
"cozy": true
}
},
"sap.ui": {
"technology": "UI5",
"fullWidth": false
},
"sap.fiori": {
"registrationIds": [],
"archeType": "transactional"
}
}
1 change: 1 addition & 0 deletions app/index.cds
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ using from './orders/fiori-service';
using from './reviews/fiori-service';
using from './notes/fiori-service';
using from './addresses/fiori-service';
using from './genres/fiori-service';
using from './common';
Loading

0 comments on commit dab98a1

Please sign in to comment.