Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical line items #325

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions examples/UI.ApplyRecursiveHierarchy-sample.json
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"
}
65 changes: 65 additions & 0 deletions examples/UI.ApplyRecursiveHierarchy-sample.xml
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>
6 changes: 6 additions & 0 deletions vocabularies/UI.json
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,12 @@
"@Core.Description": "Lists available visualization types. Currently supported types are `UI.LineItem`, `UI.Chart`, and `UI.DataPoint`.\n For each type, no more than a single annotation is meaningful. Multiple instances of the same visualization type\n shall be modeled with different presentation variants.\n A reference to `UI.Lineitem` should always be part of the collection (least common denominator for renderers).\n The first entry of the collection is the default visualization.\n ",
"@Validation.AllowedTerms": ["UI.Chart", "UI.DataPoint", "UI.LineItem"]
},
"RecursiveHierarchyQualifier": {
"$Type": "Aggregation.HierarchyQualifier",
"$Nullable": true,
"@Common.Experimental": true,
"@Core.Description": "Qualifier of the recursive hierarchy that should be applied to the Visualization"
},
"RequestAtLeast": {
"$Collection": true,
"$Type": "Edm.PropertyPath",
Expand Down
Loading