System Administration
Create a Plugin
- Add a reference to the plugin API
- Define the Plugin
- Configure the Stewardship Tier for Data Binding
- Add the Data Binding Helper Property
- Add the PluginInstaller Attribute
Add a Reference to the Plugin API
Before the plugin can be utilized by Stewardship Tier, reference the CranBerry.Framework DLL in the Visual Studio solution.
C# Example
The following are the recommended C# references to include in the project:
Visual Basic .Net Example
The following are the recommended Visual Basic .Net references to include in the project:
Define the Plugin
A plugin is a public class that inherits from the Cranberry.Framework.Plugins class. This plugin class must override the OnExecute method of the CranBerry.Framework.plugins class. The OnExecute method runs when a Stewardship Tier page executes a plugin.
C# Example
Use the following C# code to define the plugin.
Visual Basic. Net Example
Use the following Visual Basic .Net code to define the plugin.
Configure Stewardship Tier Page for Data Binding
In order to read data from a Stewardship Tier page, the plugin must have a subclass that inherits from the Cranberry.Framework.Plugins.DataRowContract class.
NOTE: It is strongly recommended that the public properties of this subclass match the column names on the page exactly for the columns where data is passed to the plugin. This process sets up the ability to retrieve data from the Stewardship Tier page.
Verify the page which the plugin is linked to has columns that match the public properties.
C# Example
In this example, the MyDataRowContract subclass inherits the DataRowContract class. This subclass has a public property called RequestID that matches a column name on a page in Stewardship Tier.
Use the following C# example to configure Stewardship Tier page(s) for data binding.
Visual Basic .Net Example
In this example, the MyDataRowContract subclass inherits the DataRowContract class. This subclass has a public property called RequestID that matches a column name on a page in Stewardship Tier.
Use the following Visual Basic .Net example to configure Stewardship Tier page(s) for data-binding.
Add the Data Binding Helper Property
While it is possible to cast the contract everywhere it is used, in practice, it is easier to define a helper property that performs that cast.
In order to read the data from a page, a plugin uses the public properties of the created subclass. The following examples use the return of the DataRowContract object populated with information from the Stewardship Tier.
C# Example
Use the following C# example to add the data binding helper property. Note that the call to get the RequestID value from the DataRowContract subclass uses the function.
Visual Basic .Net Example
Use the following Visual Basic .Net example to add the data binding helper property. Note that the call to get the RequestID value from the DataRowContract subclass uses the function.
Add the PluginInstaller Attribute
The attributes described in this topic are only used during the installation of a plugin assembly.
When installing a plugin assembly, Stewardship Tier expects well-formed plugins to provide a PluginInstaller attribute that includes various metadata about how Stewardship Tier is expected to run the plugin.
C# Example
Add the following attributes directly before the class definition of the plugin class.
Visual Basic .Net Example
Add the following attributes directly before the class definition of the plugin class.