|
4 | 4 |
|
5 | 5 | using { sap.capire.bookshop as my } from '@capire/bookstore'; |
6 | 6 | using { sap.common } from '@capire/common'; |
7 | | -using { sap.common.Currencies } from '@sap/cds/common'; |
8 | 7 |
|
9 | 8 | //////////////////////////////////////////////////////////////////////////// |
10 | 9 | // |
@@ -38,7 +37,7 @@ annotate my.Books with @( |
38 | 37 | author @ValueList.entity : 'Authors'; |
39 | 38 | }; |
40 | 39 |
|
41 | | -annotate Currencies with { |
| 40 | +annotate common.Currencies with { |
42 | 41 | symbol @Common.Label : '{i18n>Currency}'; |
43 | 42 | } |
44 | 43 |
|
@@ -69,95 +68,6 @@ annotate my.Books with { |
69 | 68 | image @title: '{i18n>Image}'; |
70 | 69 | } |
71 | 70 |
|
72 | | -//////////////////////////////////////////////////////////////////////////// |
73 | | -// |
74 | | -// Computed Fields for Tree Tables |
75 | | -// |
76 | | -// DISCLAIMER: The below are an alpha version implementation and will change in final release !!! |
77 | | -// |
78 | | -aspect Hierarchy { |
79 | | - LimitedDescendantCount : Integer64 = null; |
80 | | - DistanceFromRoot : Integer64 = null; |
81 | | - DrillState : String = null; |
82 | | - LimitedRank : Integer64 = null; |
83 | | -} |
84 | | - |
85 | | -annotate Hierarchy with @Capabilities.FilterRestrictions.NonFilterableProperties: [ |
86 | | - 'LimitedDescendantCount', |
87 | | - 'DistanceFromRoot', |
88 | | - 'DrillState', |
89 | | - 'LimitedRank' |
90 | | -]; |
91 | | - |
92 | | -annotate Hierarchy with @Capabilities.SortRestrictions.NonSortableProperties: [ |
93 | | - 'LimitedDescendantCount', |
94 | | - 'DistanceFromRoot', |
95 | | - 'DrillState', |
96 | | - 'LimitedRank' |
97 | | -]; |
98 | | - |
99 | | -extend my.Genres with Hierarchy; |
100 | | - |
101 | | -//////////////////////////////////////////////////////////////////////////// |
102 | | -// |
103 | | -// Genres Tree Table Annotations |
104 | | -// |
105 | | -// DISCLAIMER: The below are an alpha version implementation and will change in final release !!! |
106 | | -// |
107 | | -annotate my.Genres with @Aggregation.RecursiveHierarchy #GenreHierarchy: { |
108 | | - $Type : 'Aggregation.RecursiveHierarchyType', |
109 | | - NodeProperty : ID, // identifies a node |
110 | | - ParentNavigationProperty: parent // navigates to a node's parent |
111 | | -}; |
112 | | - |
113 | | -annotate my.Genres with @Hierarchy.RecursiveHierarchy #GenreHierarchy: { |
114 | | - $Type : 'Hierarchy.RecursiveHierarchyType', |
115 | | - LimitedDescendantCount: LimitedDescendantCount, |
116 | | - DistanceFromRoot : DistanceFromRoot, |
117 | | - DrillState : DrillState, |
118 | | - LimitedRank : LimitedRank |
119 | | -}; |
120 | | - |
121 | | -annotate my.Genres with @( |
122 | | - readonly, |
123 | | - cds.search: {name} |
124 | | -); |
125 | | -//////////////////////////////////////////////////////////////////////////// |
126 | | -// |
127 | | -// Genres List |
128 | | -// |
129 | | -annotate my.Genres with @( |
130 | | - Common.SemanticKey : [name], |
131 | | - UI : { |
132 | | - SelectionFields : [name], |
133 | | - LineItem : [ |
134 | | - { Value : name, Label : '{i18n>Name}' }, |
135 | | - ], |
136 | | - } |
137 | | -); |
138 | | - |
139 | | -//////////////////////////////////////////////////////////////////////////// |
140 | | -// |
141 | | -// Genre Details |
142 | | -// |
143 | | -annotate my.Genres with @(UI : { |
144 | | - Identification : [{ Value: name}], |
145 | | - HeaderInfo : { |
146 | | - TypeName : '{i18n>Genre}', |
147 | | - TypeNamePlural : '{i18n>Genres}', |
148 | | - Title : { Value: name }, |
149 | | - Description : { Value: ID } |
150 | | - } |
151 | | -}); |
152 | | - |
153 | | -//////////////////////////////////////////////////////////////////////////// |
154 | | -// |
155 | | -// Genres Elements |
156 | | -// |
157 | | -annotate my.Genres with { |
158 | | - name @title: '{i18n>Genre}'; |
159 | | -} |
160 | | - |
161 | 71 | //////////////////////////////////////////////////////////////////////////// |
162 | 72 | // |
163 | 73 | // Authors List |
|
0 commit comments