Creating New Base Model
Based on the type of Connector you select, create a class that will inherit the model definitions from the following classes that the SDK provides.
- ConnectorBase.BaseReadOnlyExchangeModel for Read-only Connector.
- ConnectorBase.BaseWriteOnlyExchangeModel for Write-only Connector.
- ConnectorBase.BaseReadWriteExchangeModel for Read-Write Connector.
The ConnectorBase.BaseReadOnlyExchangeModel, ConnectorBase.BaseWriteOnlyExchangeModel, and ConnectorBase.BaseReadWriteExchangeModel are abstract classes that provide default implementation to bind the Connector UI with the Data Exchange SDK, ForgeAuth and the ACCHostingProvider. These default implementations can be overridden to customize the Connector behaviors.
All the base models require you to override the following abstract methods:
- GetExchangesAsync: Retrieve a collection of exchanges based on the specified exchange search filter. The search can be performed by exchange, folder, and project criteria.
- SelectElementsAsync: Passes a list of Exchange Id’s as a parameter, where it should highlight the Exchange elements on the platform application.
Following are the methods that you can override:
For BaseWriteOnlyExchangeModel and BaseReadWriteExchangeModel:
UpdateExchangeAsync
: This method is called when an Exchange is created or updated and is the place where the Client data -> FDX translation should be implemented.
For BaseReadOnlyExchangeModel and BaseReadWriteExchangeModel:
OnGetLatestExchangeDataAction
: This method is called when an Exchange is added to the client and is the place where the FDX -> Client data translation should be implemented.
UnloadExchangesAsync
: This method is called when an added Exchange is being unloaded. This can be used to implement code to clear the corresponding data from the client document.
ReadOnly Model
A ReadOnly Model inherits from BaseReadOnlyExchangeModel.
An implementation of the ReadOnly model requires you to implement GetExchangesAsync, SelectElements and UnloadExchangesAsync abstract methods.
For a ReadOnly Model, the Application class launches the user interface as shown in the following image. The Read Connector enables you to read or load the Data Exchanges.
WriteOnly Model
A WriteOnly Model inherits from BaseWriteOnlyExchangeModel.
An implementation of the WriteOnly model requires the implementation of GetExchangesAsync, SelectElements and UpdateExchangeAsync abstract methods.
For a Write Model, the Application class launches the user interface as shown in the following image. The Write Connector enables you to create a Data Exchange.
Read-Write Model
A Read-Write Model inherits from BaseReadWriteExchangeModel.
An implementation of the Read-Write model requires the implementation of GetExchangesAsync, SelectElements, UpdateExchangeAsync and UnloadExchangesAsync abstract methods.
For a Read-Write Model, the Application class launches the user interface as shown in the following image. The Read-Write Connector combines the features of both Read and Write Connectors in the same interface.