Interface IDashAgent
Interface for the Dash Agent Agent that lets you configure dashboard tiles and retrieve dashboard data
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Dash Agent", "Interface for the Dash Agent. Agent that lets you configure dashboard tiles and retrieve dashboard data")]
public interface IDashAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DashAgent agent = new DashAgent())
{
// call methods on agent here...
}
}
Methods
AddNewTileToDashboardAsync(int, DashTileDefinition, CancellationToken)
Add a new tile to a dashboard with next rank
Declaration
Task<DashTile> AddNewTileToDashboardAsync(int dashboardId, DashTileDefinition dashTileDefinition, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardId | The id of the dashboard to add the tile to |
DashTileDefinition | dashTileDefinition | The tile definition data to add to the dashboard |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | The newly added tile |
AddTileToDashboardAsync(int, int, CancellationToken)
Add a tile to a dashboard with next rank
Declaration
Task<DashTile> AddTileToDashboardAsync(int dashboardId, int dashTileDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardId | The id of the dashboard to add the tile to |
int | dashTileDefinitionId | The id of the dashboard tile definition |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | The newly added tile |
CopyTileSelectionAsync(int, CancellationToken)
Copy Tile Selection for the dashboard
Declaration
Task<int> CopyTileSelectionAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to copy from |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Selection Id |
CreateDashTileSelectionFromEntityAsync(string, CancellationToken)
Returns the id to a dashboard tile selection
Declaration
Task<int> CreateDashTileSelectionFromEntityAsync(string entityName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | entityName | The name of the entity to create a default selection for |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Selection Id |
CreateDefaultDashAsync(CancellationToken)
Loading default values into a new Dash. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<Dash> CreateDefaultDashAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dash> | New Dash with default values |
CreateDefaultDashCollectionAsync(CancellationToken)
Loading default values into a new DashCollection. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<DashCollection> CreateDefaultDashCollectionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashCollection> | New DashCollection with default values |
CreateDefaultDashThemeAsync(CancellationToken)
Loading default values into a new DashTheme. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<DashTheme> CreateDefaultDashThemeAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTheme> | New DashTheme with default values |
CreateDefaultDashTileAsync(CancellationToken)
Loading default values into a new DashTile. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<DashTile> CreateDefaultDashTileAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | New DashTile with default values |
CreateDefaultDashTileDefinitionAsync(CancellationToken)
Loading default values into a new DashTileDefinition. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<DashTileDefinition> CreateDefaultDashTileDefinitionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileDefinition> | New DashTileDefinition with default values |
CreateDefaultPreviewDashAsync(CancellationToken)
Loading default values into a new PreviewDash. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<PreviewDash> CreateDefaultPreviewDashAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<PreviewDash> | New PreviewDash with default values |
CreateDefaultPreviewDashTileAsync(CancellationToken)
Loading default values into a new PreviewDashTile. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<PreviewDashTile> CreateDefaultPreviewDashTileAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<PreviewDashTile> | New PreviewDashTile with default values |
CreateDefaultTileDefinitionForEntityAsync(string, CancellationToken)
Set Measure to CountAll and MeasureField to primary key field
Declaration
Task<DashTileDefinition> CreateDefaultTileDefinitionForEntityAsync(string entityName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | entityName | Name of entity to use for primary key |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileDefinition> | Default |
CreateDefaultTileForEntityAsync(string, CancellationToken)
Set Measure to CountAll and MeasureField to primary key field
Declaration
Task<DashTile> CreateDefaultTileForEntityAsync(string entityName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | entityName | Name of entity to use for primary key |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | Default |
DeleteDashAsync(int, CancellationToken)
Deletes the Dash
Declaration
Task DeleteDashAsync(int dashId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashId | The identity of the Dash |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteDashThemeAsync(int, CancellationToken)
Deletes the DashTheme
Declaration
Task DeleteDashThemeAsync(int dashThemeId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashThemeId | The identity of the DashTheme |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteDashTileAsync(int, CancellationToken)
Deletes the DashTile
Declaration
Task DeleteDashTileAsync(int dashTileId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashTileId | The identity of the DashTile |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteDashTileDefinitionAsync(int, CancellationToken)
Deletes the DashTileDefinition
Declaration
Task DeleteDashTileDefinitionAsync(int dashTileDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashTileDefinitionId | The identity of the DashTileDefinition |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DuplicateDashboardAsync(int, string, CancellationToken)
Duplicate for the dashboard and all the sub elements
Declaration
Task<Dash> DuplicateDashboardAsync(int dashboardId, string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardId | The id of the dashboard to add the tile to |
string | name | The name of the new dashboard |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dash> | New dashboard |
DuplicateTileAsync(int, string, CancellationToken)
Duplicate for the tile and all the sub elements
Declaration
Task<DashTile> DuplicateTileAsync(int dashTileId, string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashTileId | The id of the tile to copy |
string | name | The name of the new tile |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | New tile |
GetDashAsync(int, CancellationToken)
Gets a Dash object.
Declaration
Task<Dash> GetDashAsync(int dashId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashId | The identifier of the Dash object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dash> | Dash |
GetDashCollectionAsync(CancellationToken)
Gets a collection of dashboards for the current associate
Declaration
Task<DashCollection> GetDashCollectionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashCollection> | Dashboard collection |
GetDashListAsync(int[], CancellationToken)
Gets the ordered list of dashboards
Declaration
Task<Dash[]> GetDashListAsync(int[] dashboards, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | dashboards | List of dashboardIds |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dash[]> | List of dashboards |
GetDashThemeAsync(int, CancellationToken)
Gets a DashTheme object.
Declaration
Task<DashTheme> GetDashThemeAsync(int dashThemeId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashThemeId | The identifier of the DashTheme object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTheme> | DashTheme |
GetDashTileAsync(int, CancellationToken)
Gets a DashTile object.
Declaration
Task<DashTile> GetDashTileAsync(int dashTileId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashTileId | The identifier of the DashTile object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | DashTile |
GetDashTileDefinitionAsync(int, CancellationToken)
Gets a DashTileDefinition object.
Declaration
Task<DashTileDefinition> GetDashTileDefinitionAsync(int dashTileDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashTileDefinitionId | The identifier of the DashTileDefinition object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileDefinition> | DashTileDefinition |
GetDashTileHtmlAsync(int, string, CancellationToken)
Get HTML for a dashboard tile definition with TileType = HTML
Declaration
Task<DashTileHtml> GetDashTileHtmlAsync(int dashboardTileDefinitionId, string languageCode, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardTileDefinitionId | The id of the dashboard tile definition |
string | languageCode | Preferred language code. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileHtml> | HTML data |
GetDashTileHtmlListAsync(int, CancellationToken)
Get HTML for a dashboard tile definition with TileType = HTML. Retrieve a list with all registered languages.
Declaration
Task<DashTileHtml[]> GetDashTileHtmlListAsync(int dashboardTileDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardTileDefinitionId | The id of the dashboard tile definition |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileHtml[]> |
GetDashTilesAsync(int, CancellationToken)
Gets the ordered list of tiles for a dashboard
Declaration
Task<DashTile[]> GetDashTilesAsync(int dashboardId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardId | The id of the dashboard |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile[]> | Ordered list of dashboard tiles |
GetPreviewDashAsync(int, CancellationToken)
Get a dashboard from its id
Declaration
Task<PreviewDash> GetPreviewDashAsync(int dashboardId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardId | Dashboard ID |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<PreviewDash> | Dashboard suitable for preview |
GetSecondaryTempTileSelectionAsync(int, CancellationToken)
Copy selection to secondary temporary personal tile selection
Declaration
Task<int> GetSecondaryTempTileSelectionAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to copy from |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Selection Id |
GetTempTileSelectionAsync(int, CancellationToken)
Copy selection to temporary personal tile selection
Declaration
Task<int> GetTempTileSelectionAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to copy from |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Selection Id |
SaveDashAsync(Dash, CancellationToken)
Updates the existing Dash or creates a new Dash if the id parameter is empty
Declaration
Task<Dash> SaveDashAsync(Dash dash, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Dash | dash | The Dash that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dash> | New or updated Dash |
SaveDashThemeAsync(DashTheme, CancellationToken)
Updates the existing DashTheme or creates a new DashTheme if the id parameter is empty
Declaration
Task<DashTheme> SaveDashThemeAsync(DashTheme dashTheme, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DashTheme | dashTheme | The DashTheme that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTheme> | New or updated DashTheme |
SaveDashTileAsync(DashTile, CancellationToken)
Updates the existing DashTile or creates a new DashTile if the id parameter is empty
Declaration
Task<DashTile> SaveDashTileAsync(DashTile dashTile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DashTile | dashTile | The DashTile that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTile> | New or updated DashTile |
SaveDashTileDefinitionAsync(DashTileDefinition, CancellationToken)
Updates the existing DashTileDefinition or creates a new DashTileDefinition if the id parameter is empty
Declaration
Task<DashTileDefinition> SaveDashTileDefinitionAsync(DashTileDefinition dashTileDefinition, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DashTileDefinition | dashTileDefinition | The DashTileDefinition that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileDefinition> | New or updated DashTileDefinition |
SaveDashTileHtmlListAsync(int, DashTileHtml[], CancellationToken)
Set the HTML data for a tile with TileType = HTML.
Declaration
Task<DashTileHtml[]> SaveDashTileHtmlListAsync(int dashboardTileDefinitionId, DashTileHtml[] languages, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardTileDefinitionId | The id of the dashboard tile definition |
DashTileHtml[] | languages | List of HTML content per language |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DashTileHtml[]> |
SaveDashTilesAsync(int, DashTile[], CancellationToken)
Saves the ordered list of tiles for a dashboard
Declaration
Task SaveDashTilesAsync(int dashboardId, DashTile[] dashTiles, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | dashboardId | The id of the dashboard |
DashTile[] | dashTiles | The tiles in order |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |