416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
This is the support page for the legacy Dundas Dashboard application. For assistance with the current Dundas BI application please click here.
Dashboard v5.0

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Creating a Simple Data Provider Plug-in

Hide navigation
RSS
Modified on Mon, 20 Jan 2014 01:39 PM Categorized as Data Connectors, Open APIs, Samples

Introduction

&dw; provides many popular data sources but there may be some that we don’t support out of the box. This article will focus on providing a step by step tutorial on how to create a custom simple data provider. For this particular article, we will be building a data provider that reads from an Xml file.

See the Download tab to download the Simple Data Provider Sample solution which includes both the template and Xml data provider sample projects.

Simple data provider workflow

Simple data provider workflow


Requirements


Building a sample data provider to read from an Xml file

As a friendly reminder, we are going to build a simple data provider that reads in from an Xml file.

See the Download tab to download the Simple Data Provider Sample solution which includes both the template and Xml data provider sample projects.

Each plug-in will contain two projects; a server-side project (based on .NET 3.5 Windows Class Library) and a client-side project (based on .NET 3.5 Silverlight Class Library for Silverlight 4).

The server-side project contains the core plug-in responsible for data and structure discovery, while the client-side project will provide a user interface for the provider's connection.

The two projects are identified and related by the Guid identified in [QualificationData("ProviderId", "GUID")] on the server-side and [ConnectionBuilderInfo("GUID")] on the client-side data provider.

Sample and Template project structures

Sample and Template project structures


Filling in the class attributes

In order for both the server-side and client-side data providers to work together, in both the SimpleServerSideTemplate.cs in the SimpleServerSideTemplate project and the TemplateView.xaml.cs in the SimpleClientSideTemplate project need to have the following header information filled in.

Be sure to set all these attributes accordingly based on the comments before moving on.

Basics of a simple data provider class

The main class implements the SimpleDataProvider class from the Server API library.

Below are the list of overridable methods and properties that can be implemented as part of the class.

Methods


Properties


Packaging and Installing &dw; Plug-ins

The SimpleServerSideTemplate project's output (SimpleServerSideTemplate.dll) must be packaged as a DataProviderServer plug-in and the SimpleClientSideTemplate project's output (SimpleClientSideTemplate.dll) must be packaged as a DataProviderClient plug-in.

The XmlServerSideDataProvider project's output (XmlServerSideDataProvider.dll) must be packaged as a DataProviderServer plug-in and the XmlClientSideDataProvider project's output (XmlClientSideDataProvider.dll) must be packaged as a DataProviderClient plug-in.

To package and install these plug-ins, refer to the References section for information on how to package and install plug-ins.

Upon successful packaging and installation of the plug-ins, they will appear in the Data Connector screen and the database structure successfully discovered and previewed:

Xml Sample defining the data structures

Xml Sample defining the data structures

Xml Sample testing connection

Xml Sample testing connection

Xml Sample previewing a discovered table

Xml Sample previewing a discovered table


References


Code

SimpleServerSideTemplate.cs:
namespace SimpleServerSideTemplate
{
    /// 
    /// The custom data provider class based on the SimpleDataProvider.  This is typically used for flat files, web services, or any data source that
    /// really only provides a single set of data to return.
    ///
    /// TODO: The ProviderId GUID is a unique GUID for the data provider.
    /// To generate a GUID, use an online GUID generator or use the GUID Generator provided with
    /// Microsoft Visual SDK Tools (eg. C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\guidgen.exe)
    [QualificationData("ProviderId", "B0000000-0000-0000-0000-000000000000")]
    /// TODO: The ProviderName is the name of your assembly.
    [QualificationData("ProviderName", "SimpleServerSideTemplate")]
    /// TODO: The ProviderType is the type of plug-in.  For this template, we need to use SimpleRelational.
    [QualificationData("ProviderType", "SimpleRelational")]
    /// TODO: The ProviderDescription is the description that will appear in the user-interface of Dashboard (in the data source drop down list to be precise).
    [QualificationData("ProviderDescription", "Simple Data Provider (Template)")]
    ///
    public class SimpleServerSideTemplate : SimpleDataProvider
    {
     ...
    }
}

TemplateView.xaml.cs:
namespace SimpleClientSideTemplate
{
    /// 
    /// This XAML partial class inherits from the Dundas View class so there is consistency in the
    /// look and feel of the data provider user interface within Dundas Dashboard.  In addition,
    /// it implements the IConnectionBuilder interface so it is easy to manage the data connector
    /// information between the server and the client.
    /// 
    /// The GUID is the same GUID used that is used in QualificationData("ProviderId") field
    /// in the server-side plug-in project.
    /// 
    /// 
    [ConnectionBuilderInfo("B0000000-0000-0000-0000-000000000000")]
    public partial class TemplateView : View, IConnectionBuilder
    {
    ...
    }
}

Downloads

SimpleDataProviderSample30.zip - Simple Data Provider Sample Solution for Visual Studio 2010

Note: The sample projects are built using &dw; 2.0.3. If you are using a different version, make sure to change the references to the &dw; assemblies in the projects.

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2014 Dundas Data Visualization, Inc.