format
This commit is contained in:
@@ -1,48 +1,54 @@
|
|||||||
/*
|
/*
|
||||||
Common Annotations shared by all apps
|
Common Annotations shared by all apps
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using { sap.capire.bookshop as my } from '@capire/bookshop';
|
using {sap.capire.bookshop as my} from '@capire/bookshop';
|
||||||
using { sap.common } from '@capire/common';
|
using {sap.common} from '@capire/common';
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Books Lists
|
// Books Lists
|
||||||
//
|
//
|
||||||
annotate my.Books with @(
|
annotate my.Books with @(
|
||||||
Common.SemanticKey: [title],
|
Common.SemanticKey : [title],
|
||||||
UI: {
|
UI : {
|
||||||
Identification: [{Value:title}],
|
Identification : [{Value : title}],
|
||||||
SelectionFields: [ ID, author_ID, price, currency_code ],
|
SelectionFields : [
|
||||||
LineItem: [
|
ID,
|
||||||
{Value: ID},
|
author_ID,
|
||||||
{Value: title},
|
price,
|
||||||
{Value: author.name, Label:'{i18n>Author}'},
|
currency_code
|
||||||
{Value: genre.name},
|
],
|
||||||
{Value: stock},
|
LineItem : [
|
||||||
{Value: price},
|
{Value : ID},
|
||||||
{Value: currency.symbol, Label:' '},
|
{Value : title},
|
||||||
]
|
{
|
||||||
}
|
Value : author.name,
|
||||||
|
Label : '{i18n>Author}'
|
||||||
|
},
|
||||||
|
{Value : genre.name},
|
||||||
|
{Value : stock},
|
||||||
|
{Value : price},
|
||||||
|
{
|
||||||
|
Value : currency.symbol,
|
||||||
|
Label : ' '
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
author @ValueList.entity:'Authors';
|
author @ValueList.entity : 'Authors';
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Books Details
|
// Books Details
|
||||||
//
|
//
|
||||||
annotate my.Books with @(
|
annotate my.Books with @(UI : {HeaderInfo : {
|
||||||
UI: {
|
TypeName : '{i18n>Book}',
|
||||||
HeaderInfo: {
|
TypeNamePlural : '{i18n>Books}',
|
||||||
TypeName: '{i18n>Book}',
|
Title : {Value : title},
|
||||||
TypeNamePlural: '{i18n>Books}',
|
Description : {Value : author.name}
|
||||||
Title: {Value: title},
|
}, });
|
||||||
Description: {Value: author.name}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -50,13 +56,19 @@ annotate my.Books with @(
|
|||||||
// Books Elements
|
// Books Elements
|
||||||
//
|
//
|
||||||
annotate my.Books with {
|
annotate my.Books with {
|
||||||
ID @title:'{i18n>ID}' @UI.HiddenFilter;
|
ID @title : '{i18n>ID}' @UI.HiddenFilter;
|
||||||
title @title:'{i18n>Title}';
|
title @title : '{i18n>Title}';
|
||||||
genre @title:'{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
|
genre @title : '{i18n>Genre}' @Common : {
|
||||||
author @title:'{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
|
Text : genre.name,
|
||||||
price @title:'{i18n>Price}' @Measures.ISOCurrency: currency_code;
|
TextArrangement : #TextOnly
|
||||||
stock @title:'{i18n>Stock}';
|
};
|
||||||
descr @UI.MultiLineText;
|
author @title : '{i18n>Author}' @Common : {
|
||||||
|
Text : author.name,
|
||||||
|
TextArrangement : #TextOnly
|
||||||
|
};
|
||||||
|
price @title : '{i18n>Price}' @Measures.ISOCurrency : currency_code;
|
||||||
|
stock @title : '{i18n>Stock}';
|
||||||
|
descr @UI.MultiLineText;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -64,42 +76,45 @@ annotate my.Books with {
|
|||||||
// Genres List
|
// Genres List
|
||||||
//
|
//
|
||||||
annotate my.Genres with @(
|
annotate my.Genres with @(
|
||||||
Common.SemanticKey: [name],
|
Common.SemanticKey : [name],
|
||||||
UI: {
|
UI : {
|
||||||
SelectionFields: [ name ],
|
SelectionFields : [name],
|
||||||
LineItem:[
|
LineItem : [
|
||||||
{Value: name},
|
{Value : name},
|
||||||
{Value: parent.name, Label: 'Main Genre'},
|
{
|
||||||
],
|
Value : parent.name,
|
||||||
}
|
Label : 'Main Genre'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Genre Details
|
// Genre Details
|
||||||
//
|
//
|
||||||
annotate my.Genres with @(
|
annotate my.Genres with @(UI : {
|
||||||
UI: {
|
Identification : [{Value : name}],
|
||||||
Identification: [{Value:name}],
|
HeaderInfo : {
|
||||||
HeaderInfo: {
|
TypeName : '{i18n>Genre}',
|
||||||
TypeName: '{i18n>Genre}',
|
TypeNamePlural : '{i18n>Genres}',
|
||||||
TypeNamePlural: '{i18n>Genres}',
|
Title : {Value : name},
|
||||||
Title: {Value: name},
|
Description : {Value : ID}
|
||||||
Description: {Value: ID}
|
},
|
||||||
},
|
Facets : [{
|
||||||
Facets: [
|
$Type : 'UI.ReferenceFacet',
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>SubGenres}', Target: 'children/@UI.LineItem'},
|
Label : '{i18n>SubGenres}',
|
||||||
],
|
Target : 'children/@UI.LineItem'
|
||||||
}
|
}, ],
|
||||||
);
|
});
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Genres Elements
|
// Genres Elements
|
||||||
//
|
//
|
||||||
annotate my.Genres with {
|
annotate my.Genres with {
|
||||||
ID @title: '{i18n>ID}';
|
ID @title : '{i18n>ID}';
|
||||||
name @title: '{i18n>Genre}';
|
name @title : '{i18n>Genre}';
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -107,38 +122,37 @@ annotate my.Genres with {
|
|||||||
// Authors List
|
// Authors List
|
||||||
//
|
//
|
||||||
annotate my.Authors with @(
|
annotate my.Authors with @(
|
||||||
Common.SemanticKey: [name],
|
Common.SemanticKey : [name],
|
||||||
UI: {
|
UI : {
|
||||||
Identification: [{Value:name}],
|
Identification : [{Value : name}],
|
||||||
SelectionFields: [ name ],
|
SelectionFields : [name],
|
||||||
LineItem:[
|
LineItem : [
|
||||||
{Value: ID},
|
{Value : ID},
|
||||||
{Value: name},
|
{Value : name},
|
||||||
{Value: dateOfBirth},
|
{Value : dateOfBirth},
|
||||||
{Value: dateOfDeath},
|
{Value : dateOfDeath},
|
||||||
{Value: placeOfBirth},
|
{Value : placeOfBirth},
|
||||||
{Value: placeOfDeath},
|
{Value : placeOfDeath},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Author Details
|
// Author Details
|
||||||
//
|
//
|
||||||
annotate my.Authors with @(
|
annotate my.Authors with @(UI : {
|
||||||
UI: {
|
HeaderInfo : {
|
||||||
HeaderInfo: {
|
TypeName : '{i18n>Author}',
|
||||||
TypeName: '{i18n>Author}',
|
TypeNamePlural : '{i18n>Authors}',
|
||||||
TypeNamePlural: '{i18n>Authors}',
|
Title : {Value : name},
|
||||||
Title: {Value: name},
|
Description : {Value : dateOfBirth}
|
||||||
Description: {Value: dateOfBirth}
|
},
|
||||||
},
|
Facets : [{
|
||||||
Facets: [
|
$Type : 'UI.ReferenceFacet',
|
||||||
{$Type: 'UI.ReferenceFacet', Target: 'books/@UI.LineItem'},
|
Target : 'books/@UI.LineItem'
|
||||||
],
|
}, ],
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -146,12 +160,12 @@ annotate my.Authors with @(
|
|||||||
// Authors Elements
|
// Authors Elements
|
||||||
//
|
//
|
||||||
annotate my.Authors with {
|
annotate my.Authors with {
|
||||||
ID @title:'{i18n>ID}' @UI.HiddenFilter;
|
ID @title : '{i18n>ID}' @UI.HiddenFilter;
|
||||||
name @title:'{i18n>Name}';
|
name @title : '{i18n>Name}';
|
||||||
dateOfBirth @title:'{i18n>DateOfBirth}';
|
dateOfBirth @title : '{i18n>DateOfBirth}';
|
||||||
dateOfDeath @title:'{i18n>DateOfDeath}';
|
dateOfDeath @title : '{i18n>DateOfDeath}';
|
||||||
placeOfBirth @title:'{i18n>PlaceOfBirth}';
|
placeOfBirth @title : '{i18n>PlaceOfBirth}';
|
||||||
placeOfDeath @title:'{i18n>PlaceOfDeath}';
|
placeOfDeath @title : '{i18n>PlaceOfDeath}';
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -159,99 +173,105 @@ annotate my.Authors with {
|
|||||||
// Languages List
|
// Languages List
|
||||||
//
|
//
|
||||||
annotate common.Languages with @(
|
annotate common.Languages with @(
|
||||||
Common.SemanticKey: [code],
|
Common.SemanticKey : [code],
|
||||||
Identification: [{Value:code}],
|
Identification : [{Value : code}],
|
||||||
UI: {
|
UI : {
|
||||||
SelectionFields: [ name, descr ],
|
SelectionFields : [
|
||||||
LineItem:[
|
name,
|
||||||
{Value: code},
|
descr
|
||||||
{Value: name},
|
],
|
||||||
],
|
LineItem : [
|
||||||
}
|
{Value : code},
|
||||||
|
{Value : name},
|
||||||
|
],
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Language Details
|
// Language Details
|
||||||
//
|
//
|
||||||
annotate common.Languages with @(
|
annotate common.Languages with @(UI : {
|
||||||
UI: {
|
HeaderInfo : {
|
||||||
HeaderInfo: {
|
TypeName : '{i18n>Language}',
|
||||||
TypeName: '{i18n>Language}',
|
TypeNamePlural : '{i18n>Languages}',
|
||||||
TypeNamePlural: '{i18n>Languages}',
|
Title : {Value : name},
|
||||||
Title: {Value: name},
|
Description : {Value : descr}
|
||||||
Description: {Value: descr}
|
},
|
||||||
},
|
Facets : [{
|
||||||
Facets: [
|
$Type : 'UI.ReferenceFacet',
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
Label : '{i18n>Details}',
|
||||||
],
|
Target : '@UI.FieldGroup#Details'
|
||||||
FieldGroup#Details: {
|
}, ],
|
||||||
Data: [
|
FieldGroup #Details : {Data : [
|
||||||
{Value: code},
|
{Value : code},
|
||||||
{Value: name},
|
{Value : name},
|
||||||
{Value: descr}
|
{Value : descr}
|
||||||
]
|
]},
|
||||||
},
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Currencies List
|
// Currencies List
|
||||||
//
|
//
|
||||||
annotate common.Currencies with @(
|
annotate common.Currencies with @(
|
||||||
Common.SemanticKey: [code],
|
Common.SemanticKey : [code],
|
||||||
Identification: [{Value:code}],
|
Identification : [{Value : code}],
|
||||||
UI: {
|
UI : {
|
||||||
SelectionFields: [ name, descr ],
|
SelectionFields : [
|
||||||
LineItem:[
|
name,
|
||||||
{Value: descr},
|
descr
|
||||||
{Value: symbol},
|
],
|
||||||
{Value: code},
|
LineItem : [
|
||||||
],
|
{Value : descr},
|
||||||
}
|
{Value : symbol},
|
||||||
|
{Value : code},
|
||||||
|
],
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Currency Details
|
// Currency Details
|
||||||
//
|
//
|
||||||
annotate common.Currencies with @(
|
annotate common.Currencies with @(UI : {
|
||||||
UI: {
|
HeaderInfo : {
|
||||||
HeaderInfo: {
|
TypeName : '{i18n>Currency}',
|
||||||
TypeName: '{i18n>Currency}',
|
TypeNamePlural : '{i18n>Currencies}',
|
||||||
TypeNamePlural: '{i18n>Currencies}',
|
Title : {Value : descr},
|
||||||
Title: {Value: descr},
|
Description : {Value : code}
|
||||||
Description: {Value: code}
|
},
|
||||||
},
|
Facets : [
|
||||||
Facets: [
|
{
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
$Type : 'UI.ReferenceFacet',
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Extended}', Target: '@UI.FieldGroup#Extended'},
|
Label : '{i18n>Details}',
|
||||||
],
|
Target : '@UI.FieldGroup#Details'
|
||||||
FieldGroup#Details: {
|
},
|
||||||
Data: [
|
{
|
||||||
{Value: name},
|
$Type : 'UI.ReferenceFacet',
|
||||||
{Value: symbol},
|
Label : '{i18n>Extended}',
|
||||||
{Value: code},
|
Target : '@UI.FieldGroup#Extended'
|
||||||
{Value: descr}
|
},
|
||||||
]
|
],
|
||||||
},
|
FieldGroup #Details : {Data : [
|
||||||
FieldGroup#Extended: {
|
{Value : name},
|
||||||
Data: [
|
{Value : symbol},
|
||||||
{Value: numcode},
|
{Value : code},
|
||||||
{Value: minor},
|
{Value : descr}
|
||||||
{Value: exponent}
|
]},
|
||||||
]
|
FieldGroup #Extended : {Data : [
|
||||||
},
|
{Value : numcode},
|
||||||
}
|
{Value : minor},
|
||||||
);
|
{Value : exponent}
|
||||||
|
]},
|
||||||
|
});
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Currencies Elements
|
// Currencies Elements
|
||||||
//
|
//
|
||||||
annotate common.Currencies with {
|
annotate common.Currencies with {
|
||||||
numcode @title:'{i18n>NumCode}';
|
numcode @title : '{i18n>NumCode}';
|
||||||
minor @title:'{i18n>MinorUnit}';
|
minor @title : '{i18n>MinorUnit}';
|
||||||
exponent @title:'{i18n>Exponent}';
|
exponent @title : '{i18n>Exponent}';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user