Skip to content

Commit

Permalink
Added example
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Jul 18, 2024
1 parent 0c9c602 commit 9f79ab6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/Common.SortOrder-sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Common.v1", "$Alias": "Common" }]
}
},
"sortorder.sample": {
"WorkerTimeSheet": {
"$Kind": "EntityType",
"ClockInDateTime": { "$Type": "Edm.DateTimeOffset", "$Nullable": true, "$Precision": 0 },
"ClockOutDateTime": { "$Type": "Edm.DateTimeOffset", "$Nullable": true, "$Precision": 0 }
},
"$Annotations": {
"timezone.sample.WorkerTimeSheet": {
"@Common.SortOrder#HeroesOfLabor": [
{
"Expression": { "$Sub": [{ "$Path": "ClockOutDateTime" }, { "$Path": "ClockInDateTime" }] },
"Descending": true
}
]
}
}
}
}
29 changes: 29 additions & 0 deletions examples/Common.SortOrder-sample.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Common.xml">
<edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common" />
</edmx:Reference>
<edmx:DataServices>
<Schema Namespace="sortorder.sample" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EntityType Name="WorkerTimeSheet">
<Property Name="ClockInDateTime" Type="Edm.DateTimeOffset" />
<Property Name="ClockOutDateTime" Type="Edm.DateTimeOffset" />
</EntityType>
<Annotations Target="timezone.sample.WorkerTimeSheet">
<Annotation Term="Common.SortOrder" Qualifier="HeroesOfLabor">
<Collection>
<Record>
<PropertyValue Property="Expression">
<Sub>
<Path>ClockOutDateTime</Path>
<Path>ClockInDateTime</Path>
</Sub>
</PropertyValue>
<PropertyValue Property="Descending" Bool="true"/>
</Record>
</Collection>
</Annotation>
</Annotations>
</Schema>
</edmx:DataServices>
</edmx:Edmx>

0 comments on commit 9f79ab6

Please sign in to comment.