Supporting an additional provider
To support an additonal provider you need to go through the steps outlined
below. In the discussion the new provider is assumed to have a prefix Exa
for its objects. I.e. the command object is called ExaCommand and the
connection object is called ExaConnection and so on. You should
substitute the prefix used by your provider instead of Exa.
-
Make sure you have a source distribution of the Mimer Provider Manager and that
you can build the solution. You should use Microsoft Visual Studio .NET 2003.
-
Choose New Project and select
Add new project\Other projects\Extensibility projects.
Select the Mimer Provider Manager Plugin Wizard.
-
A wizard starts where you have to fill in basic facts about your provider.
-
A new project is generated when you press the finish button. The project
contains the default implementation for a plugin.
-
In the project references you have to add a reference to your provider's
assembly.
-
If MpmData and MpmData.Internal was not a
project within the solution, you should add references to Mimer.Mpm.Data
and Mimer.Mpm.Data.Internal
respectively.
-
You should now be able to build your provider!
-
With the help of the Mimer Provider Administrator you add your new plugin and
let a data source reference it.
-
You should now be able to test your provider!
-
You should take a look at the following places to customize the code for your
provider: The method setNativeType in MpmTemplateParameter.cs and also the
class for handling the connection string grid which can be found in
MpmTemplateConnectionStringEdit.cs.
All plugins except the generic plugin is generated from the
MpmData.TemplatePlugin. If a change is needed to all plugins it is only done in
two places (the TemplatePlugin and GenericPlugin) and the code regenerated. The
template plugin uses a rudimentary preprocessing mechanism. Look at the code
and you will see how it is done. The code that generates the plugins are in the
MpmPluginWizard project. It would be fairly easy to allow nested if-then-else
constructs in the future.