Plugins |
[This is preliminary documentation and is subject to change.]
The Plug-in system in TOPICA is used to encapsulate specialized application logic that migth only be used a single or few configurations. This allows each configuration to extend or override certain aspects of the standard functionality of the TOPICA framework.
Plug-ins are useful in situations where the application logic is to large or complex to include in a single webform page. In situations such as this it could be a good solution to create a framework plug-in.
Plug-ins could also be used to contain application logic that should not be subject to random change in individual configurations.
Plug-ins usually contain application logic that might be used in multiple configurations. This could be integration with external systems, that are used by a wide range of applications.
Plug-ins have been used extensively to implement Integration between TOPICA applications and external systems, including Import and Export funtionality.
The plug-ins are developed as dll's in the .Net framework. The framework plug-in must adhere to predefined interface specifications that allow for seamless integration wih the TOPICA framework. If the plug-in implements the specified interface any application logic can be included in the plug-in.
FormCommandHandler plug-ins are used to invoke functionality in a dll from a button that is integrated into a dynamic form. These plug-ins must implement the following interface in order to be recognized by the TOPICA framework:
public interface IFormCommandHandler: IPlugin { /// <summary xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"> /// Triggered to execute some command /// </summary> void Execute(Record record, FormContext formContext, ContextWrapper contextWrapper, string command); /// <summary xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"> /// This method is called after the Execute finishes, the return value is reported to the end user /// </summary> string PostExecuteReport(); }
Data import plug-ins are used to import data into the TOPICA application.
NB: Import plug-ins are more or less a deprecated feature. Consider using SSIS packages instead!
Import plug-ins must implement the following interface in order to be compatible the TOPICA framework:
public interface IImport : IPlugin { /// <summary> /// Defines a contract that importers should implement /// </summary> /// <param name="stream">Stream to the data that should be imported</param> /// <param name="systemInfoWrapper">Holds information about the system the Import is triggered from</param> /// <param name="importProgress">Delegate used for progress callback (can be used to stop the import)</param> /// <param name="customparams">Custom parameters for the Import</param> /// <returns>The outcome of the import</returns> ImportStatus Import(Stream stream, BaseContextWrapper systemInfoWrapper, ImportProgress importProgress, string customparams); /// <summary> /// Defines a contract that updaters should implement /// </summary> /// <param name="stream">Stream to the data that should be imported</param> /// <param name="systemInfoWrapper">Holds information about the system the Import is triggered from</param> /// <param name="importProgress">Delegate used for progress callback (can be used to stop the import)</param> /// <returns>The outcome of the import</returns> ImportStatus Update(Stream stream, BaseContextWrapper systemInfoWrapper, ImportProgress importProgress); /// <summary> /// Defines a contract that deleters should implement /// </summary> /// <param name="stream">Stream to the data that should be imported</param> /// <param name="systemInfoWrapper">Holds information about the system the Import is triggered from</param> /// <param name="importProgress">Delegate used for progress callback (can be used to stop the import)</param> /// <returns>The outcome of the import</returns> ImportStatus Delete(Stream stream, BaseContextWrapper systemInfoWrapper, ImportProgress importProgress); }