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
- Open a command line and go to a folder where you want to generate a new connector project.
- Run the following Maven command:
mvn archetype:generateA list of all available Maven archetypes are shown. - 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) - Enter the number to select the connector archetype (1 in the example).
- Select the version. Normally, you should pick the latest one in the list.
- 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.
- 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
- Edit the manifest.json file, as needed.
- From the command line, go to the folder where you previously created your connector project.
- Run the following Maven command to generate a package for uploading to the Add-ons feature.
mvn packageNote: You can also build the package from within your IDE. - Upload the package (as a ZIP file) to the Add-ons feature.
- 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.
- Upload the custom configuration file to the connector's details view in the Add-ons feature.
Note: The configuration JSON file must be separately uploaded after uploading the ZIP package. It will be ignored if part of the ZIP package.
- If the connector's integration uses Public Content API, then restart the Content Service.
- If the connector's integration uses ECL, then refresh the Content Manager Explorer (such as using F5).
Results
Related tasks
Related reference