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

Grid2 #345

Open
wants to merge 10 commits into
base: grid
Choose a base branch
from
Open

Grid2 #345

Show file tree
Hide file tree
Changes from all 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
75 changes: 75 additions & 0 deletions examples/Analytics.DataGrid-sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Common.v1", "$Alias": "Common" }]
},
"https://sap.github.io/odata-vocabularies/vocabularies/Analytics.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Analytics.v1", "$Alias": "Analytics" }]
},
"/sap/opu/odata/sap/C_CNSLDTNBALANCESHEETQ_CDS/$metadata": {
"$Include": [{ "$Namespace": "C_CNSLDTNBALANCESHEETQ_CDS" }]
}
},
"Analytics.examples": {
"$Annotations": {
"C_CNSLDTNBALANCESHEETQ_CDS.C_CNSLDTNBALANCESHEETQResult": {
"@Analytics.StructureElement#ClsgFiscalYearAmount": {
"@Common.Label": {
"$Function": "odata.concat",
"$Apply": ["Current Year ", { "$Path": "Parameters/P_FiscalYear" }]
},
"Filter": {
"$And": [
{ "$Eq": [{ "$Path": "FiscalYear" }, { "$Path": "Parameters/P_FiscalYear" }] },
{ "$Eq": [{ "$Path": "ConsolidationVersion" }, { "$Path": "Parameters/P_ConsolidationVersion" }] }
]
}
},
"@Analytics.StructureElement#PrevFiscalYearAmount": {
"@Common.Label": {
"$Function": "odata.concat",
"$Apply": ["Previous Year ", { "$Path": "Parameters/P_PreviousFiscalYear" }]
},
"Filter": {
"$And": [
{ "$Eq": [{ "$Path": "FiscalYear" }, { "$Path": "Parameters/P_PreviousFiscalYear" }] },
{ "$Eq": [{ "$Path": "ConsolidationVersion" }, { "$Path": "Parameters/P_ConsolidationVersion" }] }
]
}
},
"@Analytics.Structure#YearComp": [
"@Analytics.StructureElement#ClsgFiscalYearAmount",
"@Analytics.StructureElement#PrevFiscalYearAmount"
],
"@Analytics.DataGrid": {
"Rows": [
{
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml#Analytics.GridElementDimension",
"Value": "FinancialStatementItem"
}
],
"Columns": [
{
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml#Analytics.GridElementDimension",
"Value": "ConsolidationGroup"
},
{
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml#Analytics.GridElementMeasures",
"Values": ["AmountInGroupCurrency", "CnsldtnAdjustmentsAmount"]
},
{
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml#Analytics.GridElementDimension",
"Value": "ConsolidationUnit"
},
{
"@odata.type": "https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml#Analytics.GridElementReference",
"Label": "Year Comparison",
"Target": "@Analytics.Structure#YearComp"
}
]
}
}
}
}
}
104 changes: 104 additions & 0 deletions examples/Analytics.DataGrid-sample.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?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:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml">
<edmx:Include Namespace="com.sap.vocabularies.Analytics.v1" Alias="Analytics" />
</edmx:Reference>
<edmx:Reference Uri="/sap/opu/odata/sap/C_CNSLDTNBALANCESHEETQ_CDS/$metadata">
<edmx:Include Namespace="C_CNSLDTNBALANCESHEETQ_CDS" />
</edmx:Reference>

<edmx:DataServices>
<Schema Namespace="Analytics.examples" xmlns="http://docs.oasis-open.org/odata/ns/edm">

<Annotations Target="C_CNSLDTNBALANCESHEETQ_CDS.C_CNSLDTNBALANCESHEETQResult">
<Annotation Term="Analytics.StructureElement" Qualifier="ClsgFiscalYearAmount">
<Record>
<Annotation Term="Common.Label">
<Apply Function="odata.concat">
<String>Current Year </String>
<Path>Parameters/P_FiscalYear</Path>
</Apply>
</Annotation>
<PropertyValue Property="Filter">
<And>
<Eq>
<Path>FiscalYear</Path>
<Path>Parameters/P_FiscalYear</Path>
</Eq>
<Eq>
<Path>ConsolidationVersion</Path>
<Path>Parameters/P_ConsolidationVersion</Path>
</Eq>
</And>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Analytics.StructureElement" Qualifier="PrevFiscalYearAmount">
<Record>
<Annotation Term="Common.Label">
<Apply Function="odata.concat">
<String>Previous Year </String>
<Path>Parameters/P_PreviousFiscalYear</Path>
</Apply>
</Annotation>
<PropertyValue Property="Filter">
<And>
<Eq>
<Path>FiscalYear</Path>
<Path>Parameters/P_PreviousFiscalYear</Path>
</Eq>
<Eq>
<Path>ConsolidationVersion</Path>
<Path>Parameters/P_ConsolidationVersion</Path>
</Eq>
</And>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Analytics.Structure" Qualifier="YearComp">
<Collection>
<AnnotationPath>@Analytics.StructureElement#ClsgFiscalYearAmount</AnnotationPath>
<AnnotationPath>@Analytics.StructureElement#PrevFiscalYearAmount</AnnotationPath>
</Collection>
</Annotation>
<Annotation Term="Analytics.DataGrid">
<Record>
<PropertyValue Property="Rows">
<Collection>
<Record Type="Analytics.GridElementDimension">
<PropertyValue Property="Value" PropertyPath="FinancialStatementItem" />
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Columns">
<Collection>
<Record Type="Analytics.GridElementDimension">
<PropertyValue Property="Value" PropertyPath="ConsolidationGroup" />
</Record>
<Record Type="Analytics.GridElementMeasures">
<PropertyValue Property="Values">
<Collection>
<PropertyPath>AmountInGroupCurrency</PropertyPath>
<PropertyPath>CnsldtnAdjustmentsAmount</PropertyPath>
</Collection>
</PropertyValue>
</Record>
<Record Type="Analytics.GridElementDimension">
<PropertyValue Property="Value" PropertyPath="ConsolidationUnit" />
</Record>
<Record Type="Analytics.GridElementReference">
<PropertyValue Property="Label" String="Year Comparison" />
<PropertyValue Property="Target" AnnotationPath="@Analytics.Structure#YearComp" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>

</Schema>
</edmx:DataServices>
</edmx:Edmx>
87 changes: 87 additions & 0 deletions vocabularies/Analytics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
},
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Common.v1", "$Alias": "Common" }]
},
"https://sap.github.io/odata-vocabularies/vocabularies/UI.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.UI.v1", "$Alias": "UI" }]
}
},
"com.sap.vocabularies.Analytics.v1": {
Expand Down Expand Up @@ -156,6 +159,90 @@
"@Core.Description": "The measure has non-negative and additive values; it can be used in whole-part charts, e.g. the Donut"
}
},
"DataGrid": {
"$Kind": "Term",
"$Type": "Analytics.DataGridType",
"$AppliesTo": ["EntityType"],
"@Common.Experimental": true,
"@UI.ThingPerspective": true,
"@Core.Description": "Visualization of a data grid"
},
"DataGridType": {
"$Kind": "ComplexType",
"@Common.Experimental": true,
"@Core.LongDescription": "- Exactly one [GridElementMeasures](#GridElementMeasures) must be contained in `Columns` and `Rows` together.\n- At most one [GridElementReference](#GridElementReference) targeting a [Structure](#Structure) may be contained in `Columns` and `Rows` together.",
"Title": { "$Nullable": true, "@Core.Description": "Title of the grid", "@Core.IsLanguageDependent": true },
"Description": { "$Nullable": true, "@Core.Description": "Short description", "@Core.IsLanguageDependent": true },
"Columns": { "$Collection": true, "$Type": "Analytics.GridElement", "@Core.Description": "Columns of the grid" },
"Rows": { "$Collection": true, "$Type": "Analytics.GridElement", "@Core.Description": "Rows of the grid" },
"Actions": {
"$Collection": true,
"$Type": "UI.DataFieldForActionAbstract",
"@Core.Description": "Available actions"
}
},
"GridElementAbstract": {
"$Kind": "ComplexType",
"$Abstract": true,
"@Common.Experimental": true,
"Label": {
"$Nullable": true,
"@Core.Description": "A short, human-readable text suitable for labels and captions in UIs",
"@Core.IsLanguageDependent": true
}
},
"GridElementDimension": {
"$Kind": "ComplexType",
"$BaseType": "Analytics.GridElementAbstract",
"Value": {
"$Type": "Edm.PropertyPath",
"@Core.Description": "The property must occur in [`AnalyticalContext/Dimensions`](#AnalyticalContextType)"
}
},
"GridElementMeasures": {
"$Kind": "ComplexType",
"$BaseType": "Analytics.GridElementAbstract",
"@Common.Experimental": true,
"Values": {
"$Collection": true,
"$Type": "Edm.PropertyPath",
"@Core.Description": "The properties must occur in [`AnalyticalContext/Measures`](#AnalyticalContextType)"
}
},
"GridElementReference": {
"$Kind": "ComplexType",
"$BaseType": "Analytics.GridElementAbstract",
"@Common.Experimental": true,
"Target": { "$Type": "Edm.AnnotationPath", "@Validation.AllowedTerms": ["Analytics.Structure"] }
},
"Structure": {
"$Kind": "Term",
"$Collection": true,
"$Type": "Edm.AnnotationPath",
"$AppliesTo": ["EntityType"],
"@Common.Experimental": true,
"@Core.Description": "In analytical reports based on the InA protocol, a collection of entities may be structured into several subsets, each described by one StructureElement",
"@Core.LongDescription": "An analytical report with such a structure evaluates its measures once for each subset.\n For example, financial posting items can be structured into \"current period\", \"previous period\", \"current period last year\".\n See also [this example](../examples/Analytics.DataGrid-sample.xml).",
"@Validation.AllowedTerms": ["Analytics.StructureElement"]
},
"StructureElement": {
"$Kind": "Term",
"$Type": "Analytics.StructureElementType",
"$AppliesTo": ["EntityType"],
"@Common.Experimental": true,
"@Core.Description": "A subset of entities that is part of one or more [Structures](#Structure)"
},
"StructureElementType": {
"$Kind": "ComplexType",
"@Common.Experimental": true,
"@Validation.ApplicableTerms": ["Common.Label"],
"Filter": {
"$Type": "Edm.Boolean",
"$Nullable": true,
"@Core.Description": "Whether an entity belongs to the subset",
"@Core.LongDescription": "The value is given as a dynamic expression that is evaluated relative to the entity."
}
},
"$Annotations": {
"Aggregation.CustomAggregate": {
"@[email protected]": "Adding a list of other terms that can be annotated to it.",
Expand Down
Loading