diff --git a/fiori/app/admin-books/fiori-service.cds b/fiori/app/admin-books/fiori-service.cds index 9e860189..83b3a41c 100644 --- a/fiori/app/admin-books/fiori-service.cds +++ b/fiori/app/admin-books/fiori-service.cds @@ -115,3 +115,5 @@ extend service AdminService { // Workaround for Fiori popup for asking user to enter a new UUID on Create annotate AdminService.Books with { ID @Core.Computed; } + +using from './tree-view'; diff --git a/fiori/app/admin-books/tree-view.cds b/fiori/app/admin-books/tree-view.cds new file mode 100644 index 00000000..06575483 --- /dev/null +++ b/fiori/app/admin-books/tree-view.cds @@ -0,0 +1,42 @@ +using { AdminService } from '@capire/bookstore'; + +//////////////////////////////////////////////////////////////////////////// +// +// Contents Tree Table Annotations +// + +// Tell Fiori about the structure of the hierarchy +annotate AdminService.Contents with @Aggregation.RecursiveHierarchy #ContentsHierarchy : { + ParentNavigationProperty : parent, // navigates to a node's parent + NodeProperty : ID, // identifies a node, usually the key +}; + +// Fiori expects the following to be defined explicitly, even though they're always the same +extend AdminService.Contents with @( + // The columns expected by Fiori to be present in hierarchy entities + Hierarchy.RecursiveHierarchy #ContentsHierarchy : { + LimitedDescendantCount : LimitedDescendantCount, + DistanceFromRoot : DistanceFromRoot, + DrillState : DrillState, + LimitedRank : LimitedRank + }, + // Disallow filtering on these properties from Fiori UIs + Capabilities.FilterRestrictions.NonFilterableProperties: [ + 'LimitedDescendantCount', + 'DistanceFromRoot', + 'DrillState', + 'LimitedRank' + ], + // Disallow sorting on these properties from Fiori UIs + Capabilities.SortRestrictions.NonSortableProperties : [ + 'LimitedDescendantCount', + 'DistanceFromRoot', + 'DrillState', + 'LimitedRank' + ], +) columns { // Ensure we can query these fields from database + null as LimitedDescendantCount : Int16, + null as DistanceFromRoot : Int16, + null as DrillState : String, + null as LimitedRank : Int16, +}; \ No newline at end of file diff --git a/fiori/app/appconfig/fioriSandboxConfig.json b/fiori/app/appconfig/fioriSandboxConfig.json index aae8e77a..baf40316 100644 --- a/fiori/app/appconfig/fioriSandboxConfig.json +++ b/fiori/app/appconfig/fioriSandboxConfig.json @@ -18,14 +18,6 @@ "title": "Browse Books", "targetURL": "#Books-display" } - }, - { - "id": "BrowseGenres", - "tileType": "sap.ushell.ui.tile.StaticTile", - "properties": { - "title": "Browse Genres", - "targetURL": "#Genres-display" - } } ] }, @@ -43,6 +35,14 @@ "title": "Manage Books", "targetURL": "#Books-manage" } + }, + { + "id": "ManageGenres", + "tileType": "sap.ushell.ui.tile.StaticTile", + "properties": { + "title": "Manage Genres", + "targetURL": "#Genres-manage" + } }, { "id": "ManageAuthors", @@ -114,10 +114,10 @@ "url": "/admin-authors/webapp" } }, - "BrowseGenres": { + "ManageGenres": { "semanticObject": "Genres", - "action": "display", - "title": "Browse Genres", + "action": "manage", + "title": "Manage Genres", "signature": { "parameters": { "Genre.ID": { diff --git a/fiori/app/common.cds b/fiori/app/common.cds index f370c494..ddc9e27d 100644 --- a/fiori/app/common.cds +++ b/fiori/app/common.cds @@ -68,6 +68,10 @@ annotate my.Books with { image @title: '{i18n>Image}'; } +annotate my.Contents with @( + cds.search: {name} +); + //////////////////////////////////////////////////////////////////////////// // // Contents List diff --git a/fiori/app/genres/fiori-service.cds b/fiori/app/genres/fiori-service.cds index 834f2b57..8fe53eb5 100644 --- a/fiori/app/genres/fiori-service.cds +++ b/fiori/app/genres/fiori-service.cds @@ -1,7 +1,6 @@ using { sap.capire.bookshop.Genres } from '@capire/bookstore'; annotate Genres with @cds.search: {name}; -annotate Genres with @readonly; annotate Genres with { name @title: '{i18n>Genre}'; } diff --git a/fiori/app/genres/webapp/i18n/i18n.properties b/fiori/app/genres/webapp/i18n/i18n.properties index 42da0671..ebbb4671 100644 --- a/fiori/app/genres/webapp/i18n/i18n.properties +++ b/fiori/app/genres/webapp/i18n/i18n.properties @@ -1,4 +1,4 @@ #XTIT -appTitle=Browse Genres +appTitle=Manage Genres #XTXT appDescription=Genres as Tree View diff --git a/fiori/app/genres/webapp/manifest.json b/fiori/app/genres/webapp/manifest.json index 857a4203..77f6920d 100644 --- a/fiori/app/genres/webapp/manifest.json +++ b/fiori/app/genres/webapp/manifest.json @@ -19,13 +19,13 @@ }, "crossNavigation": { "inbounds": { - "Genres-display": { + "Genres-manage": { "signature": { "parameters": {}, "additionalParameters": "allowed" }, "semanticObject": "Genres", - "action": "display" + "action": "manage" } } }