Skip to main content

Custom Connector

It's very easy to add your own connector. In fact there are two services, two configuration classes and two form classes to define. To get started, you need register them first:

services:
## Post Builder
App\SocialData\Connector\MyConnectorType\Builder\SocialPostBuilder: ~

## Definition
App\SocialData\Connector\MyConnectorType\ConnectorDefinition:
tags:
- {
name: social_data.connector_definition,
identifier: my_connector_type,
socialPostBuilder: App\SocialData\Connector\MyConnectorType\Builder\SocialPostBuilder
}

Now you need to add them to the global register:

opendxp_social_data:
social_post_data_class: SocialPost
available_connectors:
- connector_name: my_connector_type

After that you're already able to add your connector in the configuration panel in backend.


Service Classes​

Connector Definition​

The Connector Definition presents all connector configuration. This class needs to implement the ConnectorDefinitionInterface.

MethodDescription
isOnlineTBD
beforeEnableTBD
beforeDisableTBD
isAutoConnectedTBD
isConnectedTBD
connectTBD
disconnectTBD
needsEngineConfigurationTBD
getEngineConfigurationClassTBD
getFeedConfigurationClassTBD
getEngineConfigurationTBD

Configuration Classes​

The Configuration Classes presents all connector configuration. You need two of them: The Engine configuration and Feed configuration class.

Engine Configuration​

The engine configuration class needs to implement the ConnectorEngineConfigurationInterface.

Required MethodsDescription
static function getFormClassReturns the configuration form type
Feed Configuration​

THe feed configuration class needs to implement the ConnectorFeedConfigurationInterface.

Required MethodsDescription
static function getFormClassReturns the configuration form type

Social Post Builder​

The social post builder class needs to implement the SocialPostBuilderInterface.

MethodDescription
configureFetchTBD
fetchTBD
configureFilterTBD
filterTBD
configureTransformTBD
transformTBD