Custom Data Providers
Make Custom Data Interfaces Available in Composite C1
Composite C1 has built-in data types (data interfaces). You can also create your own data types manually via the GUI in the Administrative console global data types or programmatically as described in "Data Types Using C#".
What if you want your custom data interfaces to be available in C1 and even behave as C1's own ?
This might be the case if you have already created your data interfaces and simply want to expose them to Composite C1 or you want to integrate an external solution with its own data type system within Composite C1.
The solution is to create a custom data provider for your data interface and hook it up into C1.
The following are the articles about creating and using custom data providers.
To expose a data interface to C1, you should:
- Implement the IDataProvider interface for a read-only data provider or IWritableDataProvider for a read/write data provider.
- Register the custom data provider in Composite.config
At this point you can use your exposed data types programmatically (via C1 Data API).
If you want them accessed via the GUI, you may need to take additional steps: to present them in the Admin console (via Tree Definitions) and have them edited in a user-friendly way (via dynamic forms).
The above general steps imply that you have your data types ready. Whether you create brand new data interfaces or adapt existing ones from external data sources, you need to inherit them from the IData interface (see "Data Types Using C#") and implement them in corresponding classes. This also requires implementation of the IDataId interface, too, to meet ID requirements by the exposed data system.
If your data provider requires some additional configuration settings when instantiated, you may consider to add custom attributes to the data provider configuration (Composite.config) and handle them in code.