Files
cloud-cap-samples/fiori/app/browse/fiori-service.cds
Christian Georgi 2b03529a4c PDF export PoC
2023-03-14 15:28:26 +01:00

68 lines
1.6 KiB
Plaintext

using CatalogService from '@capire/bookstore';
using from '@sap/cds-pdf-export';
annotate CatalogService with @(
Capabilities: { SupportedFormats : [ 'application/pdf' ] },
PDF.Features: {
DocumentDescriptionReference : '/-pdf/',
DocumentDescriptionCollection : 'createDocumentDescription'
}
);
////////////////////////////////////////////////////////////////////////////
//
// Books Object Page
//
annotate CatalogService.Books with @(UI : {
HeaderInfo : {
TypeName : 'Book',
TypeNamePlural : 'Books',
Description : {Value : author}
},
HeaderFacets : [{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>Description}',
Target : '@UI.FieldGroup#Descr'
}, ],
Facets : [{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>Details}',
Target : '@UI.FieldGroup#Price'
}, ],
FieldGroup #Descr : {Data : [{Value : descr}, ]},
FieldGroup #Price : {Data : [
{Value : price},
{
Value : currency.symbol,
Label : '{i18n>Currency}'
},
]},
});
////////////////////////////////////////////////////////////////////////////
//
// Books List Page
//
annotate CatalogService.Books with @(UI : {
SelectionFields : [
ID,
price,
currency_code
],
LineItem : [
{
Value : ID,
Label : '{i18n>Title}'
},
{
Value : author,
Label : '{i18n>Author}'
},
{Value : genre.name},
{Value : price},
{Value : currency.symbol},
]
}, );