Skip to content

Commit 0e73ef8

Browse files
committed
Initial commit
1 parent d7c099a commit 0e73ef8

File tree

87 files changed

+14130
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+14130
-11
lines changed

.cdsprettier.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.cdsrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CAP feature-showcase
2+
_out
3+
*.db
4+
connection.properties
5+
default-*.json
6+
gen/
7+
node_modules/
8+
target/
9+
10+
# Web IDE, App Studio
11+
.che/
12+
.gen/
13+
14+
# MTA
15+
*_mta_build_tmp
16+
*.mtar
17+
mta_archives/
18+
19+
# Other
20+
.DS_Store
21+
*.orig
22+
*.log
23+
24+
*.iml
25+
*.flattened-pom.xml
26+
27+
# IDEs
28+
.vscode
29+
.idea

README.md

+3,500-11
Large diffs are not rendered by default.

app/featureShowcase/capabilities.cds

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
using service1 from '../../srv/service';
2+
3+
annotate service1.RootEntities with @odata.draft.enabled; //Search-Term: #Draft
4+
5+
annotate service1.RootEntities with @(
6+
//Disables the delete option dependent of the fields value
7+
Capabilities.DeleteRestrictions : {
8+
Deletable : deletePossible, //Search-Term: #DynamicCRUD
9+
},
10+
/* Capabilities.UpdateRestrictions : {
11+
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
12+
}, */
13+
UI.UpdateHidden : updateHidden,//Search-Term: #DynamicCRUD
14+
15+
/* Capabilities.FilterRestrictions : {
16+
RequiredProperties : [
17+
stringProperty //Search-Term: #RequiredFilter
18+
],
19+
}, */
20+
);
21+
22+
annotate service1.ChartDataEntities with @(
23+
//Search-Term: #ChartSection
24+
Aggregation.ApplySupported : {
25+
Transformations : [
26+
'aggregate',
27+
'topcount',
28+
'bottomcount',
29+
'identity',
30+
'concat',
31+
'groupby',
32+
'filter',
33+
'expand',
34+
'top',
35+
'skip',
36+
'orderby',
37+
'search'
38+
],
39+
Rollup : #None,
40+
PropertyRestrictions : true,
41+
GroupableProperties : [
42+
dimensions,
43+
criticality_code
44+
],
45+
AggregatableProperties : [
46+
{Property : integerValue},
47+
],
48+
}
49+
);
50+
51+
annotate service1.ChartDataEntities with {
52+
//Search-Term: #ChartSection
53+
criticality @(
54+
UI.ValueCriticality : [
55+
{
56+
Value : 0,
57+
Criticality : #Neutral
58+
},
59+
{
60+
Value : 1,
61+
Criticality : #Negative
62+
},
63+
{
64+
Value : 2,
65+
Criticality : #Critical
66+
},
67+
{
68+
Value : 3,
69+
Criticality : #Positive
70+
}
71+
]
72+
);
73+
74+
integerValue @(
75+
Measures.ISOCurrency : uom_code,
76+
Core.Immutable : true,
77+
);
78+
};

app/featureShowcase/field-control.cds

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using service1 from '../../srv/service';
2+
3+
//
4+
// annotations that control the behavior of fields and actions
5+
//
6+
7+
annotate service1.RootEntities {
8+
ID @UI.Hidden @readonly @mandatory @UI.ExcludeFromNavigationContext;
9+
stringProperty @Core.Immutable @mandatory @UI.ExcludeFromNavigationContext; //Search-Term: #CreationDialog
10+
uom @UI.Hidden;
11+
12+
childEntity2 @(
13+
//Search-Term: #Navigation
14+
//Semantic Object annotation in order to show the links to the semantic object apps in the quick view facet
15+
Common.SemanticObject : 'FeatureShowcaseChildEntity2',
16+
Common.SemanticObjectMapping : [
17+
{
18+
// Semantic object mapping is done, to set filter values when navigation to the semantic object map
19+
// No logical sensen behind the connection - just to demonstrate
20+
$Type : 'Common.SemanticObjectMappingType',
21+
LocalProperty : integerValue,
22+
SemanticObjectProperty : 'field3',
23+
},
24+
],
25+
);
26+
27+
areaChartDeviationLowerBoundValue @UI.HiddenFilter; //Search-Term: #HideFilter
28+
areaChartDeviationUpperBoundValue @UI.HiddenFilter;
29+
areaChartToleranceLowerBoundValue @UI.HiddenFilter;
30+
areaChartToleranceUpperBoundValue @UI.HiddenFilter;
31+
fieldWithURLtext @UI.HiddenFilter;
32+
33+
/** Search-Term: #FilterDefault
34+
For a default filter value in the list report. Does not support complex values */
35+
//stringProperty @Common.FilterDefaultValue : 'Root entity 4';
36+
37+
region_country_code @UI.HiddenFilter; //Filter not available in the list report
38+
deletePossible @UI.Hidden;
39+
updateHidden @UI.Hidden;
40+
fieldWithURL @UI.Hidden;
41+
42+
email @mandatory;
43+
};
44+
45+
46+
annotate service1.ChildEntities1 {
47+
ID @UI.Hidden @readonly @mandatory;
48+
parent @UI.Hidden;
49+
field @Core.Immutable @mandatory;
50+
};
51+
52+
annotate service1.criticalAction with @(
53+
Common.IsActionCritical : true //Search-Term: #CriticalAction
54+
);
55+
56+
annotate service1.GrandChildEntities {
57+
ID @UI.Hidden @readonly @mandatory;
58+
parent @UI.Hidden;
59+
};
60+
61+
annotate service1.ChildEntities2 {
62+
ID @UI.Hidden @readonly @mandatory;
63+
};
64+
65+
annotate service1.ChartDataEntities {
66+
ID @UI.Hidden @readonly @mandatory;
67+
parent @UI.Hidden @Core.Immutable;
68+
}

app/featureShowcase/labels.cds

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using { sap.fe.featureShowcase as schema } from '../../db/schema';
2+
3+
//
4+
// annotations that control rendering of fields and labels
5+
//
6+
7+
annotate schema.RootEntities with{
8+
childEntities1 @title : '{i18n>childEntities1}';
9+
stringProperty @title : '{i18n>semanticKeyField}';
10+
integerValue @title : '{i18n>integerValue}';
11+
forecastValue @title : '{i18n>forecastValue}';
12+
targetValue @title : '{i18n>targetValue}';
13+
dimensions @title : '{i18n>dimensions}';
14+
sumIntegerValue @title : '{i18n>sumIntegerValue}';
15+
sumTargetValue @title : '{i18n>sumTargetValue}';
16+
starsValue @title : '{i18n>stars}';
17+
isoCurrency @title : '{i18n>currencyForFieldWithPrice}';
18+
fieldWithCriticality @title : '{i18n>fieldWithCriticality}';
19+
contact @title : '{i18n>contact}';
20+
validFrom @title : '{i18n>date}';
21+
validTo @title : '{i18n>dateTo}';
22+
time @title : '{i18n>time}';
23+
timeStamp @title : '{i18n>timeStamp}';
24+
25+
fieldWithPrice @title : '{i18n>fieldWithPrice}' @(Measures.ISOCurrency: isoCurrency_code ); //Search-Term: #Units
26+
fieldWithUoM @title : '{i18n>fieldWithUoM}' @(Measures.Unit : uom_code); //Search-Term: #Units
27+
imageUrl @title : '{i18n>image}' @UI.IsImageURL; //Displaying the image instead of the link //Search-Term: #Image
28+
29+
childEntity2 @title : '{i18n>ChildEntity2}' @Common.Text : childEntity2.stringProperty @Common.TextArrangement : #TextOnly;
30+
criticality_code @title : '{i18n>criticality}' @Common.Text : criticality.name @Common.TextArrangement : #TextFirst; //Search-Term: #DisplayTextAndID
31+
country @title : '{i18n>country}' @Common.Text : country.name @Common.TextArrangement : #TextFirst;
32+
33+
description @title : '{i18n>description}' @UI.MultiLineText; //Search-Term: #MultiLineText
34+
description_customGrowing @title : '{i18n>description2}' @UI.MultiLineText @UI.Placeholder : '[email protected]';
35+
region @title : '{i18n>region}' @UI.Placeholder : 'Select a region'; //Search-Term: #Placeholder
36+
email @title : '{i18n>email}' @Communication.IsEmailAddress; //Search-Term: #CommunicationFields
37+
telephone @title : '{i18n>telephone}' @Communication.IsPhoneNumber; //Search-Term: #CommunicationFields
38+
};
39+
40+
annotate schema.ChildEntities1 with @title : '{i18n>childEntities1}' {
41+
field @title : '{i18n>field}';
42+
booleanProperty @title : '{i18n>booleanProperty}';
43+
fieldWithPerCent @title : '{i18n>fieldWithPerCent}' @(Measures.Unit : '%'); //Search-Term: #Units
44+
};
45+
46+
annotate schema.GrandChildEntities with @title : '{i18n>grandChildren}' {
47+
field @title : '{i18n>field}'
48+
};
49+
50+
annotate schema.ChildEntities2 with @title : '{i18n>ChildEntity2}' {
51+
integerProperty @title : '{i18n>integerProperty}';
52+
decimalProperty @title : '{i18n>decimalProperty}';
53+
stringProperty @title : '{i18n>stringProperty}' @UI.MultiLineText; //MultiLineText for Descriptions (line break)
54+
};
55+
56+
annotate schema.ChildEntities3 with @title : '{i18n>childEntities3}' {
57+
field @title : '{i18n>stringProperty}'
58+
};
59+
60+
annotate schema.ChartDataEntities with {
61+
integerValue @title : '{i18n>integerValue}';
62+
forecastValue @title : '{i18n>forecastValue}';
63+
targetValue @title : '{i18n>targetValue}';
64+
dimensions @title : '{i18n>dimensions}';
65+
integerValueWithUoM @Measures.Unit : uom_code;
66+
};
67+
68+
annotate schema.UnitOfMeasureCodeList with {
69+
code @title : '{i18n>unitCode}' @Common.Text : name @Common.TextArrangement : #TextOnly
70+
};
71+
72+
annotate schema.Contacts with {
73+
ID @title : '{i18n>name}' @Common.Text : name @Common.TextArrangement : #TextOnly
74+
};
75+

0 commit comments

Comments
 (0)