add object page and manage genres

This commit is contained in:
D070615
2025-07-03 11:20:18 +02:00
parent 9c1d5280af
commit 3ca79efcfb
7 changed files with 62 additions and 15 deletions

View File

@@ -115,3 +115,5 @@ extend service AdminService {
// Workaround for Fiori popup for asking user to enter a new UUID on Create // Workaround for Fiori popup for asking user to enter a new UUID on Create
annotate AdminService.Books with { ID @Core.Computed; } annotate AdminService.Books with { ID @Core.Computed; }
using from './tree-view';

View File

@@ -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,
};

View File

@@ -18,14 +18,6 @@
"title": "Browse Books", "title": "Browse Books",
"targetURL": "#Books-display" "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", "title": "Manage Books",
"targetURL": "#Books-manage" "targetURL": "#Books-manage"
} }
},
{
"id": "ManageGenres",
"tileType": "sap.ushell.ui.tile.StaticTile",
"properties": {
"title": "Manage Genres",
"targetURL": "#Genres-manage"
}
}, },
{ {
"id": "ManageAuthors", "id": "ManageAuthors",
@@ -114,10 +114,10 @@
"url": "/admin-authors/webapp" "url": "/admin-authors/webapp"
} }
}, },
"BrowseGenres": { "ManageGenres": {
"semanticObject": "Genres", "semanticObject": "Genres",
"action": "display", "action": "manage",
"title": "Browse Genres", "title": "Manage Genres",
"signature": { "signature": {
"parameters": { "parameters": {
"Genre.ID": { "Genre.ID": {

View File

@@ -68,6 +68,10 @@ annotate my.Books with {
image @title: '{i18n>Image}'; image @title: '{i18n>Image}';
} }
annotate my.Contents with @(
cds.search: {name}
);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// Contents List // Contents List

View File

@@ -1,7 +1,6 @@
using { sap.capire.bookshop.Genres } from '@capire/bookstore'; using { sap.capire.bookshop.Genres } from '@capire/bookstore';
annotate Genres with @cds.search: {name}; annotate Genres with @cds.search: {name};
annotate Genres with @readonly;
annotate Genres with { annotate Genres with {
name @title: '{i18n>Genre}'; name @title: '{i18n>Genre}';
} }

View File

@@ -1,4 +1,4 @@
#XTIT #XTIT
appTitle=Browse Genres appTitle=Manage Genres
#XTXT #XTXT
appDescription=Genres as Tree View appDescription=Genres as Tree View

View File

@@ -19,13 +19,13 @@
}, },
"crossNavigation": { "crossNavigation": {
"inbounds": { "inbounds": {
"Genres-display": { "Genres-manage": {
"signature": { "signature": {
"parameters": {}, "parameters": {},
"additionalParameters": "allowed" "additionalParameters": "allowed"
}, },
"semanticObject": "Genres", "semanticObject": "Genres",
"action": "display" "action": "manage"
} }
} }
} }