From 8fa029869ebe0153befac859758d7ecf07cfd987 Mon Sep 17 00:00:00 2001 From: D070615 Date: Fri, 21 Mar 2025 10:16:33 +0100 Subject: [PATCH] rm tree table in catalogservice --- bookshop/srv/admin-service.cds | 9 +- bookshop/srv/cat-service.cds | 5 -- fiori/app/admin-books/fiori-service.cds | 20 ----- fiori/app/browse/fiori-service.cds | 13 --- fiori/app/genres/fiori-service.cds | 30 +++---- fiori/app/genres/webapp/manifest.json | 115 ++++++++++++------------ 6 files changed, 82 insertions(+), 110 deletions(-) diff --git a/bookshop/srv/admin-service.cds b/bookshop/srv/admin-service.cds index 10fc6801..fa904dc2 100644 --- a/bookshop/srv/admin-service.cds +++ b/bookshop/srv/admin-service.cds @@ -1,6 +1,11 @@ using { sap.capire.bookshop as my } from '../db/schema'; +using { my.common.Hierarchy as Hierarchy } from './hierarchy'; + +extend my.Genres with Hierarchy; + service AdminService @(requires:'admin', path:'/admin') { - entity Books as projection on my.Books; - entity Authors as projection on my.Authors; + entity Books as projection on my.Books; + entity Authors as projection on my.Authors; + @readonly entity GenreHierarchy as projection on my.Genres } diff --git a/bookshop/srv/cat-service.cds b/bookshop/srv/cat-service.cds index 53910d46..d3a75b84 100644 --- a/bookshop/srv/cat-service.cds +++ b/bookshop/srv/cat-service.cds @@ -1,7 +1,5 @@ using { sap.capire.bookshop as my } from '../db/schema'; -using {my.common.Hierarchy as Hierarchy} from './hierarchy'; -extend my.Genres with Hierarchy; service CatalogService @(path:'/browse') { /** For displaying lists of Books */ @@ -13,9 +11,6 @@ service CatalogService @(path:'/browse') { author.name as author } excluding { createdBy, modifiedBy }; - @readonly - entity GenreHierarchy as projection on my.Genres; - @requires: 'authenticated-user' action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer }; event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String }; diff --git a/fiori/app/admin-books/fiori-service.cds b/fiori/app/admin-books/fiori-service.cds index 866a45e9..48de172c 100644 --- a/fiori/app/admin-books/fiori-service.cds +++ b/fiori/app/admin-books/fiori-service.cds @@ -83,26 +83,6 @@ annotate AdminService.GenreHierarchy with { ID @UI.Hidden; }; -//////////////////////////////////////////////////////////////////////////// -// -// Tree Table -// -annotate AdminService.GenreHierarchy with @Aggregation.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Aggregation.RecursiveHierarchyType', - NodeProperty: ID, // identifies a node - ParentNavigationProperty: parent // navigates to a node's parent - }; - -annotate AdminService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Hierarchy.RecursiveHierarchyType', - LimitedDescendantCount: LimitedDescendantCount, - DistanceFromRoot: DistanceFromRoot, - DrillState: DrillState, - Matched: Matched, - MatchedDescendantCount: MatchedDescendantCount, - LimitedRank: LimitedRank -}; - //////////////////////////////////////////////////////////// // // Draft for Localized Data diff --git a/fiori/app/browse/fiori-service.cds b/fiori/app/browse/fiori-service.cds index eb294781..015e265b 100644 --- a/fiori/app/browse/fiori-service.cds +++ b/fiori/app/browse/fiori-service.cds @@ -55,16 +55,3 @@ annotate CatalogService.Books with @(UI : { {Value : currency.symbol}, ] }, ); - -annotate CatalogService.GenreHierarchy with @UI: { - PresentationVariant : { - $Type : 'UI.PresentationVariantType', - RequestAtLeast: [name], - Visualizations: ['@UI.LineItem'], - }, - LineItem : [{ - $Type: 'UI.DataField', - Value: name, - Label : 'Genre' - }], -}; \ No newline at end of file diff --git a/fiori/app/genres/fiori-service.cds b/fiori/app/genres/fiori-service.cds index 2a72e589..b4bb5429 100644 --- a/fiori/app/genres/fiori-service.cds +++ b/fiori/app/genres/fiori-service.cds @@ -1,20 +1,20 @@ /* UI annotations for the Browse GenreHierarchy App */ -using CatalogService from '@capire/bookstore'; +using AdminService from '@capire/bookshop'; -annotate CatalogService.GenreHierarchy with @Aggregation.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Aggregation.RecursiveHierarchyType', - NodeProperty: ID, // identifies a node - ParentNavigationProperty: parent // navigates to a node's parent - }; - -annotate CatalogService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Hierarchy.RecursiveHierarchyType', - LimitedDescendantCount: LimitedDescendantCount, - DistanceFromRoot: DistanceFromRoot, - DrillState: DrillState, - Matched: Matched, - MatchedDescendantCount: MatchedDescendantCount, - LimitedRank: LimitedRank +annotate AdminService.GenreHierarchy with @Aggregation.RecursiveHierarchy #GenreHierarchy: { + $Type : 'Aggregation.RecursiveHierarchyType', + NodeProperty : ID, // identifies a node + ParentNavigationProperty: parent // navigates to a node's parent +}; + +annotate AdminService.GenreHierarchy with @Hierarchy.RecursiveHierarchy #GenreHierarchy: { + $Type : 'Hierarchy.RecursiveHierarchyType', + LimitedDescendantCount: LimitedDescendantCount, + DistanceFromRoot : DistanceFromRoot, + DrillState : DrillState, + Matched : Matched, + MatchedDescendantCount: MatchedDescendantCount, + LimitedRank : LimitedRank }; diff --git a/fiori/app/genres/webapp/manifest.json b/fiori/app/genres/webapp/manifest.json index 8048179f..1287713b 100644 --- a/fiori/app/genres/webapp/manifest.json +++ b/fiori/app/genres/webapp/manifest.json @@ -10,8 +10,8 @@ "version": "1.0.0" }, "dataSources": { - "CatalogService": { - "uri": "browse/", + "AdminService": { + "uri": "admin/", "type": "OData", "settings": { "odataVersion": "4.0" @@ -25,9 +25,9 @@ "inbounds": { "Genres-display": { "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, + "parameters": {}, + "additionalParameters": "allowed" + }, "title": "{{appTitle}}", "semanticObject": "GenreHierarchy", "action": "display", @@ -63,7 +63,12 @@ "tablet": true, "phone": true }, - "supportedThemes": ["sap_hcb", "sap_belize", "sap_belize_deep", "sap_fiori_3"] + "supportedThemes": [ + "sap_hcb", + "sap_belize", + "sap_belize_deep", + "sap_fiori_3" + ] }, "sap.ui5": { "resources": { @@ -81,7 +86,7 @@ "uri": "i18n/i18n.properties" }, "": { - "dataSource": "CatalogService", + "dataSource": "AdminService", "settings": { "synchronizationMode": "None", "operationMode": "Server", @@ -96,56 +101,56 @@ } }, "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" : { - "contextPath" : "/GenreHierarchy", - "navigation" : { - "GenreHierarchy" : { - "detail" : { - "route" : "GenreHierarchyDetails" - } - } - }, - "controlConfiguration": { - "@com.sap.vocabularies.UI.v1.LineItem": { - "tableSettings": { - "hierarchyQualifier": "GenreHierarchy", - "type": "TreeTable" - } + "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": { + "contextPath": "/GenreHierarchy", + "navigation": { + "GenreHierarchy": { + "detail": { + "route": "GenreHierarchyDetails" } + } + }, + "controlConfiguration": { + "@com.sap.vocabularies.UI.v1.LineItem": { + "tableSettings": { + "hierarchyQualifier": "GenreHierarchy", + "type": "TreeTable" + } + } } - } - } - }, - "GenreHierarchyDetails": { - "type": "Component", - "id": "GenreHierarchyDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "contextPath" : "/GenreHierarchy" - } - } - } - } - }, + } + } + }, + "GenreHierarchyDetails": { + "type": "Component", + "id": "GenreHierarchyDetails", + "name": "sap.fe.templates.ObjectPage", + "options": { + "settings": { + "contextPath": "/GenreHierarchy" + } + } + } + } + }, "contentDensities": { "compact": true, "cozy": true