Creating a connector using the template for Java

Use the Tridion Connector Template for Java to quickly build a new Java connector.

Before you begin

This task requires that you have the following software installed on your machine:

  • JDK 8 or higher
  • Apache Maven 3.x or higher

Procedure

  1. Open a command line and go to a folder where you want to generate a new connector project.
  2. Run the following Maven command:
    mvn archetype:generate
    A list of all available Maven archetypes are shown.
  3. To filter the output, type tcf. An archetype for the Tridion Integration Framework should appear (here called the "Tridion Connector Framework").
    Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : tcf
    Choose archetype:
    1: remote -> com.sdl.tridion.connectorframework:tcf-archetype (Archetype to create SDL Tridion connectors)
    
  4. Enter the number to select the connector archetype (1 in the example).
  5. Select the version. Normally, you should pick the latest one in the list.
  6. Specify the following additional details as input to the generation:
    groupId
    The group ID to use in the generated Maven file, for example, com.company.myconnector.
    artifactId
    The artifact ID to use in the generated Maven file, for example, myconnector.
    version
    The version to use in the generated Maven file, for example, 1.0.0.
    package
    The base package for the generated Java classes. By default, this is the same as the group ID.
    connectorName
    The name of the connector. Use Pascal case, for example, MyConnector.
  7. After entering all values, type Y to confirm the entered data.

    The command builds the Connector project with everything you need to build your custom Connector. The project includes the following resources and samples:

    • Entity types
    • Capability implementations
    • Test data
    • Icons
    • Add-on manifest
    • Connector configuration
  8. Edit the manifest.json file, as needed.
  9. From the command line, go to the folder where you previously created your connector project.
  10. Run the following Maven command to generate a package for uploading to the Add-ons feature.
    mvn package
  11. Upload the package (as a ZIP file) to the Add-ons feature.
  12. Open the PROJECT_NAME.json configuration file that is created from the template, and edit the configuration, as needed.

    In general, evaluate the available properties described in a separate topic and configure as needed for your scenario.

    When External Content Library (ECL) is the Application Client, set a value for stubFolders where the value the Item URI of the Folder (under Building Blocks) where ECL will add internal, Tridion Sites representations of external entities.

  13. Upload the custom configuration file to the Connector's details view in the Add-ons feature.
  14. If the Connector's integration uses Public Content API, then restart the Content Service.
  15. If the Connector's integration uses ECL, then refresh the Content Manager Explorer (such as using F5).

Results

The Connector is ready for use in your SDL Tridion Sites implementation.