-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is PR is about the possibility to apply a hierarchy (and later one aggregation ) on existing list definition (aka UI.LineItem). We start with three different proposals: adding a new property to UI.PresentationVariant, adding a new term that can be applied on UI.LineItem annotations, adding a new term that uses UI.LineItem as BaseTerm. --------- Co-authored-by: Ralf Handl <[email protected]>
- Loading branch information
Showing
5 changed files
with
375 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"$Version": "4.0", | ||
"$Reference": { | ||
"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.json": { | ||
"$Include": [{ "$Namespace": "Org.OData.Core.V1", "$Alias": "Core" }] | ||
}, | ||
"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.json": { | ||
"$Include": [{ "$Namespace": "Org.OData.Aggregation.V1", "$Alias": "Aggregation" }] | ||
}, | ||
"https://sap.github.io/odata-vocabularies/vocabularies/UI.json": { | ||
"$Include": [{ "$Namespace": "com.sap.vocabularies.UI.v1", "$Alias": "UI" }] | ||
} | ||
}, | ||
"Examples": { | ||
"container": { | ||
"$Kind": "EntityContainer", | ||
"HierarchySet": { "$Collection": true, "$Type": "Examples.Hierarchy_Type" } | ||
}, | ||
"Hierarchy_Type": { | ||
"$Kind": "EntityType", | ||
"$Key": ["ID"], | ||
"ID": { "$MaxLength": 10 }, | ||
"StatusText": { "$Nullable": true, "$MaxLength": 30 }, | ||
"Node": { "$Type": "Edm.Guid" }, | ||
"to_Parent": { "$Kind": "NavigationProperty", "$Type": "Hierarchy_Type", "$Nullable": true } | ||
}, | ||
"$Annotations": { | ||
"Examples.Hierarchy_Type": { | ||
"@Aggregation.RecursiveHierarchy#myHierarchyQualifier": { | ||
"Node": "Node", | ||
"ParentNavigationProperty": "to_Parent" | ||
}, | ||
"@UI.LineItem#useHierarchy": [ | ||
{ | ||
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/UI.xml#UI.DataField", | ||
"Value": { "$Path": "ID" } | ||
}, | ||
{ | ||
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/UI.xml#UI.DataField", | ||
"Value": { "$Path": "StatusText" } | ||
} | ||
], | ||
"@UI.PresentationVariant": { | ||
"Visualizations": ["UI.LineItem#useHierarchy"], | ||
"RecursiveHierarchyQualifier": "myHierarchyQualifier" | ||
} | ||
} | ||
} | ||
}, | ||
"$EntityContainer": "Examples.container" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?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://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml"> | ||
<edmx:Include Namespace="Org.OData.Core.V1" Alias="Core" /> | ||
</edmx:Reference> | ||
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml"> | ||
<edmx:Include Namespace="Org.OData.Aggregation.V1" Alias="Aggregation" /> | ||
</edmx:Reference> | ||
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/UI.xml"> | ||
<edmx:Include Namespace="com.sap.vocabularies.UI.v1" Alias="UI" /> | ||
</edmx:Reference> | ||
|
||
<edmx:DataServices> | ||
<Schema Namespace="Examples" xmlns="http://docs.oasis-open.org/odata/ns/edm"> | ||
|
||
<EntityContainer Name="container"> | ||
<EntitySet Name="HierarchySet" EntityType="Examples.Hierarchy_Type" /> | ||
</EntityContainer> | ||
|
||
<EntityType Name="Hierarchy_Type"> | ||
<Key> | ||
<PropertyRef Name="ID" /> | ||
</Key> | ||
<Property Name="ID" Type="Edm.String" Nullable="false" MaxLength="10" /> | ||
<Property Name="StatusText" Type="Edm.String" MaxLength="30" /> | ||
<Property Name="Node" Type="Edm.Guid" Nullable="false" /> | ||
<NavigationProperty Name="to_Parent" Type="Hierarchy_Type" /> | ||
<!-- ... and a lot more --> | ||
</EntityType> | ||
|
||
<Annotations Target="Examples.Hierarchy_Type"> | ||
|
||
<Annotation Term="Aggregation.RecursiveHierarchy" Qualifier="myHierarchyQualifier"> | ||
<Record> | ||
<PropertyValue Property="Node" PropertyPath="Node" /> | ||
<PropertyValue Property="ParentNavigationProperty" NavigationPropertyPath="to_Parent" /> | ||
</Record> | ||
</Annotation> | ||
|
||
<Annotation Term="UI.LineItem" Qualifier="useHierarchy"> | ||
<Collection> | ||
<Record Type="UI.DataField"> | ||
<PropertyValue Property="Value" Path="ID" /> | ||
</Record> | ||
<Record Type="UI.DataField"> | ||
<PropertyValue Property="Value" Path="StatusText" /> | ||
</Record> | ||
</Collection> | ||
</Annotation> | ||
<Annotation Term="UI.PresentationVariant"> | ||
<Record> | ||
<PropertyValue Property="Visualizations"> | ||
<Collection> | ||
<AnnotationPath>UI.LineItem#useHierarchy</AnnotationPath> | ||
</Collection> | ||
</PropertyValue> | ||
<PropertyValue Property="RecursiveHierarchyQualifier" String="myHierarchyQualifier" /> | ||
</Record> | ||
</Annotation> | ||
|
||
</Annotations> | ||
|
||
</Schema> | ||
</edmx:DataServices> | ||
</edmx:Edmx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.