Start a conversation

Adding a Custom Connector

Custom connectors

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:
    <theia_installation_archive>/connector-api/code/Javadocs
  • Full implementation for a sample connector, Salesforce®, that can be  used as a  reference:   
    <theia_installation_archive>/connector-api/code/salesforce
  • Template of the required files to enable adding the connector to the Theia user interface:    
    <theia_installation_archive>/connector-api/ui extension
  • SQL to be executed on the Theia database for the  custom connector:    
    <theia_installation_archive>/connector-api/sql
  • Gradle files that  can be used as a starting point for building a .JAR file  that includes your custom connector code:    
    <theia_installation_archive>/connector-api/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.
  1. Copy the Gradle files from the Salesforce connector code to your custom implementation.
  2. Rename the included salesforce.gradle file and use the  renamed file for the subproject in your connector.
  3. Point the compile dependency to the Theia webapps/lib directory.

UI extensions

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.
  1. Stop the Theia application.
  2. Copy the generated .JAR file to:
    <theia>/app/apache-tomcat-{version}/webapps/theia/WEB_INF/lib
      
  3. Log in to PostgreSQL and  run the SQL file against the Theia database.
  4. Copy the UI extension files to: 
    <theia>/app/apache-tomcat-{version}/webapps/theia/extensions
    
  5. Restart Theia. 
  6. Verify that the connector was deployed and that everything works correctly as  follows:
    1. Add a connector using the custom connector type that was added.
    2. Mount a folder.
    3. Browse content.
    4. Execute an object.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. David Saia

  2. Posted
  3. Updated

Comments