-
Notifications
You must be signed in to change notification settings - Fork 75
/
capabilities.cds
97 lines (88 loc) · 2.83 KB
/
capabilities.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using service1 from '../../srv/service';
annotate service1.RootEntities with @odata.draft.enabled; //Search-Term: #Draft
annotate service1.RootEntityVariants with @odata.draft.enabled; //Annotation has to exists, without no entites would be visible on view with other entity set of List Report
annotate service1.RootEntities with @(
//Disables the delete option dependent of the fields value
Capabilities.DeleteRestrictions : {
Deletable : deletePossible, //Search-Term: #DynamicCRUD
},
/* Capabilities.UpdateRestrictions : {
Updatable : updatePossible, //UpdateRestrictions are ignored in determining if the edit button is visible or not, but it still affects wheather the fields are editable or not
}, */
UI.UpdateHidden : updateHidden,//Search-Term: #DynamicCRUD
UI.CreateHidden: { $edmJson: { $Path: '/service1.EntityContainer/Singleton/createHidden' } }, //Search-Term: #DynamicCRUD
Capabilities.FilterRestrictions : {
FilterExpressionRestrictions : [
{
//Search-Term: #SemanticDateFilter
Property : 'validFrom',
AllowedExpressions : 'SingleRange' //Other option: SingleValue
},
],
// RequiredProperties : [
// stringProperty //Search-Term: #RequiredFilter
// ]
},
) {
validTo @UI.DateTimeStyle : 'short'
};
annotate service1 with @(
Capabilities.FilterFunctions : [
'tolower' //Search-Term: #CaseInsensitiveFiltering
],
);
annotate service1.ChartDataEntities with @(
//Search-Term: #ChartSection
Aggregation.ApplySupported : {
Transformations : [
'aggregate',
'topcount',
'bottomcount',
'identity',
'concat',
'groupby',
'filter',
'expand',
'top',
'skip',
'orderby',
'search'
],
Rollup : #None,
PropertyRestrictions : true,
GroupableProperties : [
dimensions,
criticality_code
],
AggregatableProperties : [
{Property : integerValue},
],
}
);
annotate service1.ChartDataEntities with {
//Search-Term: #ChartSection
criticality @(
UI.ValueCriticality : [
{
Value : 0,
Criticality : #Neutral
},
{
Value : 1,
Criticality : #Negative
},
{
Value : 2,
Criticality : #Critical
},
{
Value : 3,
Criticality : #Positive
}
]
);
integerValue @(
Measures.ISOCurrency : uom_code,
Core.Immutable : true,
);
};