Class OpenBiApiClientDataProviderExtensions
- Namespace
- BiExcellence.OpenBi.Api.DataProviders
- Assembly
- BiExcellence.OpenBi.Api.Client.dll
Extension methods for the /dataproviders and /chartdefinitions REST APIs - the reporting
engine.
public static class OpenBiApiClientDataProviderExtensions
- Inheritance
-
objectOpenBiApiClientDataProviderExtensions
Remarks
A dataprovider is session state, not a stored row: its id is the name it has inside the caller's own
session, and it comes into existence by validating a connection template
(OpenBiApiClientConnectionTemplateExtensions.ValidateConnectionTemplateAsync). The usual flow is
validate, OpenDataProviderAsync(IOpenBiApiClient, string, OpenDataProviderRequest, CancellationToken), GetDataProviderViewAsync(IOpenBiApiClient, string, CancellationToken), change the
definition, execute, read the grid - and DeleteDataProviderAsync when done, which
DataProviderView does on dispose.
Plan values are buffered server-side: SetDataProviderPlanValueAsync(IOpenBiApiClient, string, SetDataProviderPlanValueRequest, CancellationToken) writes into the buffer, SaveDataProviderPlanValuesAsync(IOpenBiApiClient, string, CancellationToken) writes the buffer to the source and ResetDataProviderPlanBufferAsync(IOpenBiApiClient, string, CancellationToken) throws it away.
Methods
CreateDataProviderCommentAsync(IOpenBiApiClient, string, CreateDataProviderCommentRequest, CancellationToken)
Writes a comment against a cell of the grid. The comments come back from GetDataProviderTextsAsync(IOpenBiApiClient, string, CancellationToken) along with whatever else the source attaches to the context.
public static Task<DataProviderComment> CreateDataProviderCommentAsync(this IOpenBiApiClient client, string dataProviderName, CreateDataProviderCommentRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringrequestCreateDataProviderCommentRequestcancellationTokenCancellationToken
Returns
- Task<DataProviderComment>
CreateDataProviderDefinitionAsync(IOpenBiApiClient, string, CreateDataProviderDefinitionRequest, CancellationToken)
Builds a dataprovider from a definition rather than from a source object, and stores it as a view.
public static Task<SavedDataProviderView> CreateDataProviderDefinitionAsync(this IOpenBiApiClient client, string dataProviderName, CreateDataProviderDefinitionRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringrequestCreateDataProviderDefinitionRequestcancellationTokenCancellationToken
Returns
- Task<SavedDataProviderView>
DeleteDataProviderAsync(IOpenBiApiClient, string, CancellationToken)
Closes the dataprovider and frees the source system connection behind it.
public static Task DeleteDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringcancellationTokenCancellationToken
Returns
- Task
DeleteDataProviderCommentAsync(IOpenBiApiClient, string, string, CancellationToken)
Removes a data comment. Only its author can, unless the caller is an administrator.
public static Task DeleteDataProviderCommentAsync(this IOpenBiApiClient client, string dataProviderName, string commentId, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringcommentIdstringcancellationTokenCancellationToken
Returns
- Task
DeleteDataProviderElementsAsync(IOpenBiApiClient, string, DataProviderElementType, IEnumerable<string>, CancellationToken)
Removes dimensions, key figures or variables from the dataprovider.
public static Task DeleteDataProviderElementsAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderElementType type, IEnumerable<string> elementIds, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
typeDataProviderElementTypeThe kind of element to remove.
elementIdsIEnumerable<string>The ids to remove.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task
ExecuteDataProviderAsync(IOpenBiApiClient, string, DataProviderDefinition, IEnumerable<AffectedDataProvider>?, CancellationToken)
Applies a definition and reads the data.
public static Task<DataProviderExecuteResult> ExecuteDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderDefinition definition, IEnumerable<AffectedDataProvider>? affectedDataProviders = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringdefinitionDataProviderDefinitionaffectedDataProvidersIEnumerable<AffectedDataProvider>cancellationTokenCancellationToken
Returns
ExecuteDataProviderAsync(IOpenBiApiClient, string, ExecuteDataProviderRequest, CancellationToken)
Applies a definition and reads the data. The definition is applied whole - what is left out of it is removed from the dataprovider.
public static Task<DataProviderExecuteResult> ExecuteDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, ExecuteDataProviderRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
requestExecuteDataProviderRequestThe definition, and what else to re-execute with it.
cancellationTokenCancellationTokenA cancellation token.
Returns
ExportDataProviderDocumentAsync(IOpenBiApiClient, string, DataProviderExportFormat?, string?, CancellationToken)
Renders the executed grid as a document. The caller owns the returned file and has to dispose it.
public static Task<OpenBiApiFile> ExportDataProviderDocumentAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderExportFormat? format = null, string? gridStyleGroupId = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
formatDataProviderExportFormat?The document format. Defaults to Xlsx.
gridStyleGroupIdstringThe grid style group to render with. Defaults to the default group.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<OpenBiApiFile>
GenerateChartDefinitionAsync(IOpenBiApiClient, GenerateChartDefinitionRequest, CancellationToken)
Stores a chart definition and returns its id, to be passed to the chart data routes as
definitionId. The one dataprovider route that is not bound to a session dataprovider.
public static Task<ChartDefinition> GenerateChartDefinitionAsync(this IOpenBiApiClient client, GenerateChartDefinitionRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientrequestGenerateChartDefinitionRequestcancellationTokenCancellationToken
Returns
- Task<ChartDefinition>
GetDataProviderChartDataAsync(IOpenBiApiClient, string, DataProviderChartDataOptions?, string?, string?, CancellationToken)
Reads the executed grid reshaped for charting: points, categories and series instead of cells. With a
definitionId the values are rendered into that stored chart definition instead.
public static Task<DataProviderChartData> GetDataProviderChartDataAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderChartDataOptions? options = null, string? definitionId = null, string? description = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
optionsDataProviderChartDataOptionsHow the grid is reshaped.
definitionIdstringA stored chart definition to render the values into.
descriptionstringThe title to render into that definition.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<DataProviderChartData>
GetDataProviderChartDataAsync(IOpenBiApiClient, string, DataProviderChartDataRequest, CancellationToken)
Renders the executed grid into a chart definition sent in the body - for a definition that is being edited and has not been stored yet.
public static Task<DataProviderChartData> GetDataProviderChartDataAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderChartDataRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringrequestDataProviderChartDataRequestcancellationTokenCancellationToken
Returns
- Task<DataProviderChartData>
GetDataProviderDatabaseMetaAsync(IOpenBiApiClient, string, bool?, CancellationToken)
Reads the tables and views a database-backed dataprovider can read - the metadata needed to write the SQL for CreateDataProviderDefinitionAsync(IOpenBiApiClient, string, CreateDataProviderDefinitionRequest, CancellationToken).
public static Task<DataProviderDatabaseSchema> GetDataProviderDatabaseMetaAsync(this IOpenBiApiClient client, string dataProviderName, bool? refreshMetadata = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
refreshMetadatabool?Reads the database again instead of answering from the server-side cache.
cancellationTokenCancellationTokenA cancellation token.
Returns
GetDataProviderDefinitionAsync(IOpenBiApiClient, string, bool?, CancellationToken)
Reads what the dataprovider currently is: its dimensions, key figures, variables and state.
public static Task<DataProviderDefinition> GetDataProviderDefinitionAsync(this IOpenBiApiClient client, string dataProviderName, bool? withoutHierarchies = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
withoutHierarchiesbool?Leaves the hierarchies a dimension offers out. They are read from the source per dimension, which is the expensive part of this call and is wasted where a caller only wants the layout.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<DataProviderDefinition>
GetDataProviderF4ValuesAsync(IOpenBiApiClient, string, DataProviderF4ValuesRequest, CancellationToken)
Reads the value help under a filter context sent in the body - the variable answers to narrow the values by, where they are not the ones the dataprovider was executed with.
public static Task<DataProviderF4Values> GetDataProviderF4ValuesAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderF4ValuesRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringrequestDataProviderF4ValuesRequestcancellationTokenCancellationToken
Returns
- Task<DataProviderF4Values>
GetDataProviderF4ValuesAsync(IOpenBiApiClient, string, string?, string?, string?, string?, bool?, bool?, CancellationToken)
Reads the values a dimension or a variable can be filtered on, under everything that is filtered
already. Exactly one of dimensionId and variableId is given.
public static Task<DataProviderF4Values> GetDataProviderF4ValuesAsync(this IOpenBiApiClient client, string dataProviderName, string? dimensionId = null, string? variableId = null, string? variableLow = null, string? hierarchyName = null, bool? withAttributes = null, bool? withMaps = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
dimensionIdstringThe dimension to read the values of.
variableIdstringThe variable to read the values of.
variableLowstringThe value to read the text of, for a variable that has no value help.
hierarchyNamestringThe hierarchy to read the values as a tree from.
withAttributesbool?Include the dimension's attributes with every value.
withMapsbool?Include the coordinates of every value.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<DataProviderF4Values>
GetDataProviderGridDataAsync(IOpenBiApiClient, string, int?, int?, int?, int?, int?, int?, bool?, bool?, bool?, CancellationToken)
Reads a window of the executed grid, headers included. The whole grid is returned where no window is given.
public static Task<DataProviderGridData> GetDataProviderGridDataAsync(this IOpenBiApiClient client, string dataProviderName, int? fromRow = null, int? fromCol = null, int? noRows = null, int? noCols = null, int? fromDataRow = null, int? fromDataCol = null, bool? withMaps = null, bool? withTuples = null, bool? suppressRepeatedText = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider.
fromRowint?The first row of the window, 1-based and counting the header rows.
fromColint?The first column of the window, 1-based and counting the header columns.
noRowsint?The number of rows to return.
noColsint?The number of columns to return.
fromDataRowint?The first row of the window, 1-based and counting data rows only - the headers come with it.
fromDataColint?The first column of the window, 1-based and counting data columns only - the headers come with it.
withMapsbool?Include the coordinates of every dimension value.
withTuplesbool?Include the row and column tuple every cell sits at.
suppressRepeatedTextbool?Leave a header text out where it repeats the cell above it.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<DataProviderGridData>
GetDataProviderNodesAsync(IOpenBiApiClient, string, bool?, bool?, bool?, bool?, CancellationToken)
Lists what the connected source offers: its cubes, queries and the views stored on them.
public static Task<OpenBiListResult<DataProviderNode>> GetDataProviderNodesAsync(this IOpenBiApiClient client, string dataProviderName, bool? withDashboards = null, bool? withScorecards = null, bool? withKpis = null, bool? withCombined = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider name a validate returned.
withDashboardsbool?Include the stored dashboards.
withScorecardsbool?Include the stored scorecards.
withKpisbool?Include the stored key performance indicators.
withCombinedbool?Include the combined dataproviders.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<OpenBiListResult<DataProviderNode>>
GetDataProviderTextsAsync(IOpenBiApiClient, string, CancellationToken)
Lists the documents the source system attaches to the dataprovider's context - query documentation, key figure notes and the like. Independent of execute.
public static Task<OpenBiListResult<DataProviderDocument>> GetDataProviderTextsAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringcancellationTokenCancellationToken
Returns
GetDataProviderViewAsync(IOpenBiApiClient, string, CancellationToken)
Reads the dataprovider's definition and wraps it in a DataProviderView - a handle that carries the definition as mutable client-side state and closes the dataprovider when it is disposed.
public static Task<DataProviderView> GetDataProviderViewAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringcancellationTokenCancellationToken
Returns
- Task<DataProviderView>
OpenDataProviderAsync(IOpenBiApiClient, string, DataProviderNode, CancellationToken)
Opens a catalog node on an already validated connection.
public static Task<OpenDataProviderResult> OpenDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderNode node, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider name a validate returned.
nodeDataProviderNodeThe node to open, from GetDataProviderNodesAsync(IOpenBiApiClient, string, bool?, bool?, bool?, bool?, CancellationToken).
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<OpenDataProviderResult>
Remarks
Only a query the source itself offers goes in Query. A node that came out of stored content - a saved view, a dashboard, a scorecard, a KPI - is opened by the element id its CubeName carries whatever its Type says, because a saved view is typed as a query too. The server tells the two apart the same way, by whether what it is given parses as a GUID.
OpenDataProviderAsync(IOpenBiApiClient, string, OpenDataProviderRequest, CancellationToken)
Opens a cube, query or stored view on an already validated connection. Returns the connections the dataprovider is built on - each one still has to be validated before data can be read.
public static Task<OpenDataProviderResult> OpenDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, OpenDataProviderRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
dataProviderNamestringThe dataprovider name a validate returned.
requestOpenDataProviderRequestWhat to open.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<OpenDataProviderResult>
ResetDataProviderPlanBufferAsync(IOpenBiApiClient, string, CancellationToken)
Throws the buffered plan values away, so the grid shows what the source holds again.
public static Task ResetDataProviderPlanBufferAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringcancellationTokenCancellationToken
Returns
- Task
SaveDataProviderPlanValuesAsync(IOpenBiApiClient, string, CancellationToken)
Writes the buffered plan values to the source system.
public static Task SaveDataProviderPlanValuesAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringcancellationTokenCancellationToken
Returns
- Task
SaveDataProviderViewAsync(IOpenBiApiClient, string, SaveDataProviderViewRequest, CancellationToken)
Stores the dataprovider's current state as a view that can be opened again.
public static Task<SavedDataProviderView> SaveDataProviderViewAsync(this IOpenBiApiClient client, string dataProviderName, SaveDataProviderViewRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringrequestSaveDataProviderViewRequestcancellationTokenCancellationToken
Returns
- Task<SavedDataProviderView>
SaveDataProviderViewAsync(IOpenBiApiClient, string, string?, string?, CancellationToken)
Stores the dataprovider's current state as a view that can be opened again.
public static Task<SavedDataProviderView> SaveDataProviderViewAsync(this IOpenBiApiClient client, string dataProviderName, string? id = null, string? description = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringidstringdescriptionstringcancellationTokenCancellationToken
Returns
- Task<SavedDataProviderView>
SetDataProviderPlanValueAsync(IOpenBiApiClient, string, SetDataProviderPlanValueRequest, CancellationToken)
Writes one planned value into the server-side buffer. Nothing reaches the source until SaveDataProviderPlanValuesAsync(IOpenBiApiClient, string, CancellationToken).
public static Task SetDataProviderPlanValueAsync(this IOpenBiApiClient client, string dataProviderName, SetDataProviderPlanValueRequest request, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientdataProviderNamestringrequestSetDataProviderPlanValueRequestcancellationTokenCancellationToken
Returns
- Task