Skip to content

Commit 637f571

Browse files
committed
review fix
1 parent 21536b6 commit 637f571

File tree

10 files changed

+69
-74
lines changed

10 files changed

+69
-74
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ User Interface related Features:
9090
- [Model Localization](https://cap.cloud.sap/docs/guides/i18n) for [English](app/_i18n/i18n.properties) and [German](app/_i18n/i18n_de.properties) language for static texts
9191
- [Custom File Upload extension](app/admin/webapp/extension/Upload.js) which provides a button for uploading `CSV` files
9292
- A simple Swagger UI for the CatalogService API at <http://localhost:8080/swagger/index.html>
93-
- UI5 [Tree Table](app/genres/webapp/manifest.json) with CRUD requests and Value Help for [GenreHierarchy](app/admin/fiori-service.cds)
93+
- UI5 [Tree Table](app/genres/webapp/manifest.json) with CRUD requests and Value Help for [GenreHierarchy](app/admin/fiori-service.cds). Only on HANA. To check tree table `Contents` embedded into `Books`, please remove `@UI.Hidden` annotation from [Fiori Service](app/admin/fiori-service.cds)
9494
- [Custom event handlers](https://cap.cloud.sap/docs/java/provisioning-api) for Tree Table such as the [Custom business logic for GenreHierarchy](srv/src/main/java/my/bookshop/handlers/HierarchyHandler.java).
9595
Please note, that Tree Tables must be used with HANA. Custom event handler in this case provides a limited support ment for local testing.
96-
- [Custom actions](https://cap.cloud.sap/docs/cds/cdl#actions) such as `moveSiblingAction` in the [Admin Service](srv/admin-service.cds). This action demonstrates experimental UI feature [ChangeNextSiblingAction](https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/Hierarchy.md#template_changenextsiblingaction-experimental). The Action implementation is in the [Hierarchy Sibling Action Handler](srv/src/main/java/my/bookshop/handlers/HierarchySiblingActionHandler.java)
96+
- [Custom actions](https://cap.cloud.sap/docs/cds/cdl#actions) such as `moveSibling` in the [Admin Service](srv/admin-service.cds). This action demonstrates experimental UI feature [ChangeNextSiblingAction](https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/Hierarchy.md#template_changenextsiblingaction-experimental). The Action implementation is in the [Hierarchy Sibling Action Handler](srv/src/main/java/my/bookshop/handlers/HierarchySiblingActionHandler.java)
9797

9898
CDS Maven Plugin Features:
9999

app/_i18n/i18n.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Created = Created
55
Modified = Modified
66
ModifiedBy = Modified By
77
General = General
8+
Contents = Contents
89
Details = Details
910
Admin = Administrative
1011
Translations = Translations
@@ -63,7 +64,11 @@ Text = Text
6364
Image = Image
6465
Genres = Genres
6566
Genre = Genre
66-
67+
PageNumber = Page Number
68+
Informations = Informations
69+
Page = Page
70+
ContentsLevel = Contents Level
71+
ContentsLevels = Contents Levels
6772
AddReview = Add Review
6873
6974
Notes = Notes

app/_i18n/i18n_de.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Created = Angelegt
55
Modified = Bearbeitet
66
ModifiedBy = Bearbeitet von
77
General = Generelles
8+
Contents = Buchinhalt
89
Details = Details
910
Admin = Administratives
1011
Translations = Übersetzungen
@@ -63,6 +64,11 @@ Text = Text
6364
Image = Bild
6465
Genres = Genre
6566
Genre = Genre
67+
PageNumber = Seitenzahl
68+
Informations = Informationen
69+
Page = Seite
70+
ContentsLevel = Inhaltsebene
71+
ContentsLevels = Inhaltsebenen
6672

6773
AddReview = Rezension hinzufügen
6874

app/admin/fiori-service.cds

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ annotate AdminService.Books with @(UI : {
3737
Label : '{i18n>Admin}',
3838
Target : '@UI.FieldGroup#Admin'
3939
},
40-
{
40+
{
41+
// TODO: should work dynamically
42+
@UI.Hidden,
4143
$Type : 'UI.ReferenceFacet',
4244
Label : '{i18n>Contents}',
4345
Target : 'contents/@UI.PresentationVariant'
@@ -72,7 +74,7 @@ annotate AdminService.Books with @(UI : {
7274
//
7375
annotate AdminService.Books with {
7476
genre @(Common: {
75-
Label : 'Genre',
77+
Label : '{i18n>Genre}',
7678
ValueList: {
7779
CollectionPath : 'GenreHierarchy',
7880
Parameters : [
@@ -99,7 +101,7 @@ annotate AdminService.GenreHierarchy with {
99101
@Hierarchy.RecursiveHierarchyActions #GenreHierarchy: {
100102
$Type : 'Hierarchy.RecursiveHierarchyActionsType',
101103
// any name can be the action name with namespace/no bound action name
102-
ChangeNextSiblingAction: 'AdminService.moveSiblingAction',
104+
ChangeNextSiblingAction: 'AdminService.moveSibling',
103105
}
104106

105107
annotate AdminService.GenreHierarchy with @UI: {
@@ -111,28 +113,30 @@ annotate AdminService.GenreHierarchy with @UI: {
111113
LineItem : [{
112114
$Type: 'UI.DataField',
113115
Value: name,
114-
Label : 'Genre'
116+
Label : '{i18n>Genre}'
115117
}],
116118
};
117119

118120
annotate AdminService.ContentsHierarchy with @UI: {
119121
PresentationVariant : {
120122
$Type : 'UI.PresentationVariantType',
121123
RequestAtLeast: [name],
122-
Visualizations: ['@UI.LineItem', ],
124+
Visualizations: ['@UI.LineItem'],
123125
},
124126
LineItem : [{
125127
$Type: 'UI.DataField',
126128
Value: name,
129+
Label : '{i18n>Name}'
127130
},
128131
{
129-
$Type: 'UI.DataField',
130-
Value: page,
132+
$Type: 'UI.DataField',
133+
Value: page,
134+
Label : '{i18n>Page}'
131135
}],
132136
HeaderInfo : {
133137
$Type : 'UI.HeaderInfoType',
134-
TypeName : 'Contents Level',
135-
TypeNamePlural: 'Contents Levels',
138+
TypeName : '{i18n>ContentsLevel}',
139+
TypeNamePlural: '{i18n>ContentsLevels}',
136140
Title : {
137141
$Type: 'UI.DataField',
138142
Value: name,
@@ -143,13 +147,13 @@ annotate AdminService.ContentsHierarchy with @UI: {
143147
Data : [{
144148
$Type: 'UI.DataField',
145149
Value: page,
146-
Label : 'Page Number'
150+
Label : '{i18n>PageNumber}'
147151
}],
148152
},
149153
Facets : [{
150154
$Type : 'UI.ReferenceFacet',
151155
Target: '@UI.FieldGroup',
152-
Label : 'Informations',
156+
Label : '{i18n>Informations}',
153157
}],
154158
};
155159

app/admin/webapp/manifest.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@
115115
"settings" : {
116116
"contextPath" : "/Books",
117117
"navigation" : {
118-
"Authors" : {
119-
"detail" : {
120-
"route" : "AuthorsDetails"
121-
}
122-
},
123118
"contents": {
124119
"detail": {
125120
"route": "ContentsDetails"
@@ -146,16 +141,6 @@
146141
"contextPath": "/Books/contents"
147142
}
148143
}
149-
},
150-
"AuthorsDetails": {
151-
"type": "Component",
152-
"id": "AuthorsDetailsList",
153-
"name": "sap.fe.templates.ObjectPage",
154-
"options": {
155-
"settings" : {
156-
"contextPath" : "/Authors"
157-
}
158-
}
159144
}
160145
}
161146
},

app/browse-genres/webapp/manifest.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
}
1818
}
1919
},
20-
"-sourceTemplate": {
21-
"id": "ui5template.basicSAPUI5ApplicationProject",
22-
"-id": "ui5template.smartTemplate",
23-
"-version": "1.40.12"
24-
},
2520
"crossNavigation": {
2621
"inbounds": {
2722
"Genres-show": {
@@ -82,12 +77,12 @@
8277
"name": "sap.fe.templates.ListReport",
8378
"options": {
8479
"settings" : {
85-
"entitySet" : "GenreHierarchy",
80+
"contextPath" : "/GenreHierarchy",
8681
"navigation" : {
8782
"GenreHierarchy" : {
8883
"detail" : {
8984
"route" : "GenreHierarchyDetails"
90-
}
85+
}
9186
}
9287
},
9388
"controlConfiguration": {
@@ -107,7 +102,7 @@
107102
"name": "sap.fe.templates.ObjectPage",
108103
"options": {
109104
"settings" : {
110-
"entitySet": "GenreHierarchy"
105+
"contextPath" : "/GenreHierarchy"
111106
}
112107
}
113108
}

app/browse/fiori-service.cds

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ annotate CatalogService.GenreHierarchy with @UI: {
165165
PresentationVariant : {
166166
$Type : 'UI.PresentationVariantType',
167167
RequestAtLeast: [name],
168-
Visualizations: ['@UI.LineItem', ],
168+
Visualizations: ['@UI.LineItem'],
169169
},
170170
LineItem : [{
171171
$Type: 'UI.DataField',
172172
Value: name,
173-
Label : 'Genre'
173+
Label : '{i18n>Genre}'
174174
}],
175175
};
176176

db/books.cds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ entity Books : cuid, managed {
2222
reviews : Association to many Reviews
2323
on reviews.book = $self;
2424
isReviewable : TechnicalBooleanFlag not null default true;
25-
contents : Composition of many Contents on contents.book = $self;
25+
contents : Composition of many Contents on contents.book = $self @odata.contained:false;
2626
}
2727

2828
entity Authors : cuid, managed {

db/data/my.bookshop-Genres.csv

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
ID;parent_ID;name;siblingRank
2-
f846b0b9-01d4-4f6d-82a4-d79204f62369;;Fiction;1000
3-
f846b0b9-01d4-4f6d-82a4-d79204f62360;f846b0b9-01d4-4f6d-82a4-d79204f62369;Action;2000
4-
f846b0b9-01d4-4f6d-82a4-d79204f62359;f846b0b9-01d4-4f6d-82a4-d79204f62369;Adventure;3000
5-
f846b0b9-01d4-4f6d-82a4-d79204f62570;f846b0b9-01d4-4f6d-82a4-d79204f62369;Drama;4000
6-
f846b0b9-01d4-4f6d-82a4-d79204f62571;f846b0b9-01d4-4f6d-82a4-d79204f62369;Poetry;5000
7-
f846b0b9-01d4-4f6d-82a4-d79204f62572;f846b0b9-01d4-4f6d-82a4-d79204f62369;Fantasy;6000
8-
f846b0b9-01d4-4f6d-82a4-d79204f62592;f846b0b9-01d4-4f6d-82a4-d79204f62572;Epic fantasy;7000
9-
f846b0b9-01d4-4f6d-82a4-d79204f62593;f846b0b9-01d4-4f6d-82a4-d79204f62572;High fantasy;8000
10-
f846b0b9-01d4-4f6d-82a4-d79204f62573;f846b0b9-01d4-4f6d-82a4-d79204f62369;Science Fiction;9000
11-
f846b0b9-01d4-4f6d-82a4-d79204f62357;f846b0b9-01d4-4f6d-82a4-d79204f62573;Utopian and Dystopian;10000
12-
f846b0b9-01d4-4f6d-82a4-d79204f62355;f846b0b9-01d4-4f6d-82a4-d79204f62357;Dystopia;11000
13-
f846b0b9-01d4-4f6d-82a4-d79204f62353;f846b0b9-01d4-4f6d-82a4-d79204f62355;Cyberpunk;12000
14-
f846b0b9-01d4-4f6d-82a4-d79204f62351;f846b0b9-01d4-4f6d-82a4-d79204f62353;Steampunk;13000
15-
f846b0b9-01d4-4f6d-82a4-d79204f62574;f846b0b9-01d4-4f6d-82a4-d79204f62369;Romance;14000
16-
f846b0b9-01d4-4f6d-82a4-d79204f62575;f846b0b9-01d4-4f6d-82a4-d79204f62369;Mystery;15000
17-
f846b0b9-01d4-4f6d-82a4-d79204f62515;f846b0b9-01d4-4f6d-82a4-d79204f62369;Graphic Novel;16000
18-
f846b0b9-01d4-4f6d-82a4-d79204f62576;f846b0b9-01d4-4f6d-82a4-d79204f62369;Thriller;17000
19-
f846b0b9-01d4-4f6d-82a4-d79204f62520;f846b0b9-01d4-4f6d-82a4-d79204f62576;Suspense;18000
20-
f846b0b9-01d4-4f6d-82a4-d79204f62523;f846b0b9-01d4-4f6d-82a4-d79204f62576;Crime thriller;19000
21-
f846b0b9-01d4-4f6d-82a4-d79204f62525;f846b0b9-01d4-4f6d-82a4-d79204f62576;Spy thriller;20000
22-
f846b0b9-01d4-4f6d-82a4-d79204f62527;f846b0b9-01d4-4f6d-82a4-d79204f62576;Political thriller;21000
23-
f846b0b9-01d4-4f6d-82a4-d79204f62512;f846b0b9-01d4-4f6d-82a4-d79204f62369;Short Story;23000
24-
f846b0b9-01d4-4f6d-82a4-d79204f62578;f846b0b9-01d4-4f6d-82a4-d79204f62369;Fairy Tale;24000
25-
f846b0b9-01d4-4f6d-82a4-d79204f62529;f846b0b9-01d4-4f6d-82a4-d79204f62369;Horror;25000
26-
f846b0b9-01d4-4f6d-82a4-d79204f62531;f846b0b9-01d4-4f6d-82a4-d79204f62369;Historical Fiction;26000
27-
f846b0b9-01d4-4f6d-82a4-d79204f62533;f846b0b9-01d4-4f6d-82a4-d79204f62369;Contemporary Fiction;27000
28-
f846b0b9-01d4-4f6d-82a4-d79204f62535;f846b0b9-01d4-4f6d-82a4-d79204f62369;Magical Realism;28000
29-
f846b0b9-01d4-4f6d-82a4-d79204f62537;f846b0b9-01d4-4f6d-82a4-d79204f62369;Literary Fiction;29000
30-
d846b0b9-01d4-4f6d-82a4-d79204f62487;;Non-Fiction;30000
31-
d846b0b9-01d4-4f6d-82a4-d79204f62588;d846b0b9-01d4-4f6d-82a4-d79204f62487;Biography;31000
32-
d846b0b9-01d4-4f6d-82a4-d79204f62589;d846b0b9-01d4-4f6d-82a4-d79204f62588;Autobiography;32000
33-
d846b0b9-01d4-4f6d-82a4-d79204f62590;d846b0b9-01d4-4f6d-82a4-d79204f62487;Essay;33000
34-
d846b0b9-01d4-4f6d-82a4-d79204f62591;d846b0b9-01d4-4f6d-82a4-d79204f62487;Speech;34000
2+
8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;;Fiction;1000
3+
08467c69-4b69-4b30-bf51-998f9c4b8a12;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Action;1500
4+
c5247996-2516-40c5-b3ea-02492a1e1f4d;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Adventure;3000
5+
d74eb118-ff57-4776-96d3-0d649278bf6b;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Drama;4000
6+
b84a7e92-cc0c-4599-8b62-9e3ae39e343f;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Poetry;5000
7+
445a6c1e-071f-4e9d-b0bb-670ec73b0a49;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Fantasy;6000
8+
0d4f268f-c5c5-4a82-b54a-2120271cf54e;445a6c1e-071f-4e9d-b0bb-670ec73b0a49;Epic fantasy;7000
9+
5ccfe8e7-009f-4744-91fd-c1c1e9a0c9c6;445a6c1e-071f-4e9d-b0bb-670ec73b0a49;High fantasy;8000
10+
86e9f4d5-3e7c-4c06-8421-8b6d72fe9c93;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Science Fiction;9000
11+
9f8653a2-6d6d-4fd7-b02f-b90d15d6f67f;86e9f4d5-3e7c-4c06-8421-8b6d72fe9c93;Utopian and Dystopian;10000
12+
7c7b2c30-c24e-4627-bb84-0f9d09f9e91b;9f8653a2-6d6d-4fd7-b02f-b90d15d6f67f;Dystopia;11000
13+
34f6a939-2708-4cc0-9882-daf36a8ed5e6;7c7b2c30-c24e-4627-bb84-0f9d09f9e91b;Cyberpunk;12000
14+
4297bff9-c4b3-4097-b68f-5605f89c6e4c;34f6a939-2708-4cc0-9882-daf36a8ed5e6;Steampunk;13000
15+
f283b1b3-b763-42f9-95f0-38e1d78a1d7e;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Romance;14000
16+
5d2c5060-84cf-4a94-9118-8d9ad88f2a24;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Mystery;15000
17+
7d6cc413-cf8c-4cf9-b30a-bf8cf6f97b72;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Graphic Novel;16000
18+
f846b0b9-01d4-4f6d-82a4-d79204f62576;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Thriller;17000
19+
82f9a2d9-bd77-4cfd-9c76-d03b8f6827a3;f846b0b9-01d4-4f6d-82a4-d79204f62576;Suspense;18000
20+
a7b5b4d7-bff3-430d-9d7e-25fd67b66022;f846b0b9-01d4-4f6d-82a4-d79204f62576;Crime thriller;19000
21+
5f93c395-6f8a-43de-84c1-bf22cfba8f56;f846b0b9-01d4-4f6d-82a4-d79204f62576;Spy thriller;20000
22+
3ff51d9c-5ff5-421f-8d0d-d75b08e32a25;f846b0b9-01d4-4f6d-82a4-d79204f62576;Political thriller;21000
23+
a530cd31-b0cf-4a32-9f28-72ee7b9f29fc;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Short Story;23000
24+
5b091c64-8b4f-401a-a06d-61b19857635b;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Fairy Tale;24000
25+
7125da65-b3ae-4a0b-a735-1db410a3e079;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Horror;25000
26+
a02b5c9b-b79f-43ef-b2ab-28e4b431cc18;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Historical Fiction;26000
27+
d6c3448e-d771-47f0-b6c7-8d2159b29d2a;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Contemporary Fiction;27000
28+
7ed5cfab-8c4d-46a3-b89b-c5b8fa74f049;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Magical Realism;28000
29+
23e86990-66d3-4488-8272-98ed056710b5;8bbf14c6-b378-4e35-9b4f-5a9c8b8762da;Literary Fiction;29000
30+
85b5a640-7e9a-468e-80e2-e9268486031b;;Non-Fiction;30000
31+
10d19b1a-832b-4d60-bf9b-88dcd089db85;85b5a640-7e9a-468e-80e2-e9268486031b;Biography;31000
32+
1f1c8b5b-451e-48f6-bdbb-759be4ea1a8f;10d19b1a-832b-4d60-bf9b-88dcd089db85;Autobiography;32000
33+
4bc5ad4d-b7a3-47a7-9938-325c6fdf8041;85b5a640-7e9a-468e-80e2-e9268486031b;Essay;33000
34+
e0d350c2-1f42-45b5-b768-67cccd997b56;85b5a640-7e9a-468e-80e2-e9268486031b;Speech;34000

srv/admin-service.cds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ service AdminService @(requires: 'admin') {
2828
actions {
2929
// Experimental UI feature, see:
3030
// https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/Hierarchy.md#template_changenextsiblingaction-experimental
31-
action moveSiblingAction(NextSibling : NextSibling);
31+
action moveSibling(NextSibling : NextSibling);
3232
};
3333

3434
extend my.Contents with Hierarchy;

0 commit comments

Comments
 (0)