Developers can add custom connectors to Theia by implementing custom Java code.
In the extracted installation archive, the connector-api directory includes:
- Javadocs for the connector API, in the following directory:
- Full implementation for a sample connector, Salesforce®, that can be used as a reference:
- Template of the required files to enable adding the connector to the Theia user interface:
- SQL to be executed on the Theia database for the custom connector:
Gradle files that can be used as a starting point for building a .JAR file that includes your custom connector code:
Building the connector .JAR file
The first major step in creating a custom connector is to build the connector .JAR file.
- Implement each interface in the Javadocs as a Java class for your custom connector, using the sample Salesforce® connector as a guide.
- You will most likely need to implement additional utility type classes.
- Copy the Gradle files from the Salesforce connector code to your custom implementation.
- Rename the included salesforce.gradle file and use the renamed file for the subproject in your connector.
- Point the compile dependency to the Theia webapps/lib directory.
Configure UI extensions to control elements in the Theia user interface relating to the new connector, for example, what connectors are listed in the Connector Type drop-down box.
Modify the UI extension so that the new connector displays in the list of available connectors and other connector-specific elements display.
In addition, you can link to applications related to the connector, for example, for Google Drive, application shortcuts to Google Calendar™ and Gmail™; Similarly, for Cognos, application shortcuts to Report Studio and IBM Cognos Connection.
Any applications to be linked must be configured in the connector-api/ui extension/connector.<connector_name>/apps file. If no applications will be linked, the apps directory can be removed.
Deploying a custom connector
The final step in adding a custom connector is to deploy it.
- Create the custom-built connector .JAR file, as described in the "Building the connector .JAR file" section.
- Prepare the UI extension files, as described in the "UI extensions" section.
- Customize the provided SQL script to be run against the Theia server.
- Stop the Theia application.
Copy the generated .JAR file to:
- Log in to PostgreSQL and run the SQL file against the Theia database.
Copy the UI extension files to:
- Restart Theia.
Verify that the connector was deployed and that everything works correctly as follows:
- Add a connector using the custom connector type that was added.
- Mount a folder.
- Browse content.
- Execute an object.