diff --git a/bookshop/db/data/sap.capire.bookshop-Genres.csv b/bookshop/db/data/sap.capire.bookshop-Genres.csv index 08435ca9..1ea3793b 100644 --- a/bookshop/db/data/sap.capire.bookshop-Genres.csv +++ b/bookshop/db/data/sap.capire.bookshop-Genres.csv @@ -11,6 +11,6 @@ ID;parent_ID;name 19;10;Fairy Tale 20;;Non-Fiction 21;20;Biography -22;20;Autobiography +22;21;Autobiography 23;20;Essay 24;20;Speech diff --git a/common/data/sap.common-Currencies.csv b/common/data/sap.common-Currencies.csv index 63372602..efe4538e 100644 --- a/common/data/sap.common-Currencies.csv +++ b/common/data/sap.common-Currencies.csv @@ -2,7 +2,7 @@ code;symbol;name;descr;numcode;minor;exponent EUR;€;Euro;European Euro;978;Cent;2 USD;$;US Dollar;United States Dollar;840;Cent;2 CAD;$;Canadian Dollar;Canadian Dollar;124;Cent;2 -AUD;$;Australian Dollar;Canadian Dollar;036;Cent;2 +AUD;$;Australian Dollar;Australian Dollar;036;Cent;2 GBP;£;British Pound;Great Britain Pound;826;Penny;2 ILS;₪;Shekel;Israeli New Shekel;376;Agorat;2 INR;₹;Rupee;Indian Rupee;356;Paise;2 diff --git a/fiori/app/_i18n/i18n.properties b/fiori/app/_i18n/i18n.properties index 5d6f03d6..c1d0293f 100644 --- a/fiori/app/_i18n/i18n.properties +++ b/fiori/app/_i18n/i18n.properties @@ -7,7 +7,19 @@ AuthorID = Author ID Stock = Stock Name = Name AuthorName = Author's Name +DateOfBirth = Date of Birth +DateOfDeath = Date of Death +PlaceOfBirth = Place of Birth +PlaceOfDeath = Place of Death Authors = Authors Order = Order Orders = Orders Price = Price + +Genre = Genre +Genres = Genres +SubGenres = Sub Genres + +NumCode = Numeric Code +MinorUnit = Minor Unit +Exponent = Exponent \ No newline at end of file diff --git a/fiori/app/common.cds b/fiori/app/common.cds index 2cbdd162..614f03b3 100644 --- a/fiori/app/common.cds +++ b/fiori/app/common.cds @@ -1,9 +1,9 @@ /* - Common Annotations shared by all apps + Common Annotations shared by all apps */ using { sap.capire.bookshop as my } from '@capire/bookshop'; - +using { sap.common } from '@capire/common'; //////////////////////////////////////////////////////////////////////////// // @@ -13,7 +13,7 @@ annotate my.Books with @( Common.SemanticKey: [title], UI: { Identification: [{Value:title}], - SelectionFields: [ ID, author_ID, price, currency_code ], + SelectionFields: [ ID, author_ID, price, currency_code ], LineItem: [ {Value: ID}, {Value: title}, @@ -28,25 +28,18 @@ annotate my.Books with @( author @ValueList.entity:'Authors'; }; -annotate my.Authors with @( - UI: { - Identification: [{Value:name}], - } -); - - //////////////////////////////////////////////////////////////////////////// // // Books Details // annotate my.Books with @( UI: { - HeaderInfo: { - TypeName: '{i18n>Book}', - TypeNamePlural: '{i18n>Books}', - Title: {Value: title}, - Description: {Value: author.name} - }, + HeaderInfo: { + TypeName: '{i18n>Book}', + TypeNamePlural: '{i18n>Books}', + Title: {Value: title}, + Description: {Value: author.name} + }, } ); @@ -66,15 +59,199 @@ annotate my.Books with { descr @UI.MultiLineText; } +//////////////////////////////////////////////////////////////////////////// +// +// Genres List +// +annotate my.Genres with @( + Common.SemanticKey: [name], + UI: { + SelectionFields: [ name ], + LineItem:[ + {Value: name}, + {Value: parent.name, Label: 'Main Genre'}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Genre Details +// +annotate my.Genres with @( + UI: { + Identification: [{Value:name}], + HeaderInfo: { + TypeName: '{i18n>Genre}', + TypeNamePlural: '{i18n>Genres}', + Title: {Value: name}, + Description: {Value: ID} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: '{i18n>SubGenres}', Target: 'children/@UI.LineItem'}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Genres Elements +// annotate my.Genres with { - name @title: '{i18n>Genre}'; + ID @title: '{i18n>ID}'; + name @title: '{i18n>Genre}'; } +//////////////////////////////////////////////////////////////////////////// +// +// Authors List +// +annotate my.Authors with @( + Common.SemanticKey: [name], + UI: { + Identification: [{Value:name}], + SelectionFields: [ name ], + LineItem:[ + {Value: ID}, + {Value: name}, + {Value: dateOfBirth}, + {Value: dateOfDeath}, + {Value: placeOfBirth}, + {Value: placeOfDeath}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Author Details +// +annotate my.Authors with @( + UI: { + HeaderInfo: { + TypeName: '{i18n>Author}', + TypeNamePlural: '{i18n>Authors}', + Title: {Value: name}, + Description: {Value: dateOfBirth} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Target: 'books/@UI.LineItem'}, + ], + } +); + + //////////////////////////////////////////////////////////////////////////// // // Authors Elements // annotate my.Authors with { ID @title:'{i18n>ID}' @UI.HiddenFilter; - name @title:'{i18n>AuthorName}'; + name @title:'{i18n>Name}'; + dateOfBirth @title:'{i18n>DateOfBirth}'; + dateOfDeath @title:'{i18n>DateOfDeath}'; + placeOfBirth @title:'{i18n>PlaceOfBirth}'; + placeOfDeath @title:'{i18n>PlaceOfDeath}'; +} + +//////////////////////////////////////////////////////////////////////////// +// +// Languages List +// +annotate common.Languages with @( + Common.SemanticKey: [code], + Identification: [{Value:code}], + UI: { + SelectionFields: [ name, descr ], + LineItem:[ + {Value: code}, + {Value: name}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Language Details +// +annotate common.Languages with @( + UI: { + HeaderInfo: { + TypeName: '{i18n>Language}', + TypeNamePlural: '{i18n>Languages}', + Title: {Value: name}, + Description: {Value: descr} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, + ], + FieldGroup#Details: { + Data: [ + {Value: code}, + {Value: name}, + {Value: descr} + ] + }, + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Currencies List +// +annotate common.Currencies with @( + Common.SemanticKey: [code], + Identification: [{Value:code}], + UI: { + SelectionFields: [ name, descr ], + LineItem:[ + {Value: descr}, + {Value: symbol}, + {Value: code}, + ], + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Currency Details +// +annotate common.Currencies with @( + UI: { + HeaderInfo: { + TypeName: '{i18n>Currency}', + TypeNamePlural: '{i18n>Currencies}', + Title: {Value: descr}, + Description: {Value: code} + }, + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, + {$Type: 'UI.ReferenceFacet', Label: '{i18n>Extended}', Target: '@UI.FieldGroup#Extended'}, + ], + FieldGroup#Details: { + Data: [ + {Value: name}, + {Value: symbol}, + {Value: code}, + {Value: descr} + ] + }, + FieldGroup#Extended: { + Data: [ + {Value: numcode}, + {Value: minor}, + {Value: exponent} + ] + }, + } +); + +//////////////////////////////////////////////////////////////////////////// +// +// Currencies Elements +// +annotate common.Currencies with { + numcode @title:'{i18n>NumCode}'; + minor @title:'{i18n>MinorUnit}'; + exponent @title:'{i18n>Exponent}'; }