Develop your integration

The Integration Service provides the com.opentext.is.service.interfaces.IntegrationService interface, which you must implement in your integration. You also need to override the following method and provide a business logic:

override publishContent (PublishJobRequest publishJobRequest)

The following table describes properties defined in PublishJobRequest:

PublishJobRequest properties

Property Description
jobId The ID of the job that is created for the publication of assets.
externalId Holds that data that OTMM sends. The same data is sent back to OTMM as part of the response and OTMM will use it for further processing.
serviceName The name of the integration.
contentSourceArea A location that is shared area between the Integration Service and OTMM.
contentDirectory A directory that holds all the OTMM asset files and it is relative to the value set in the contentSourceArea property.
callbackURL The OTMM URL that the Integration Service invokes to send the response.
argumentDataMap A map holds argument number to value that is given by the user for the argument at the time of publication.

metadataValues

A list of MetadataValue objects. A metadata value object holds Integration Service metadata field ID to value of the OTMM metadata field that is mapped.

fileId

The ID of the asset.

name

The name of the asset.

metadataValues

A list of MetadataValue objects. A metadata value object holds Integration Service metadata field ID to value of the OTMM metadata field that is mapped.

serviceData

A data object that holds the arguments, metadata, and endpoint data of the integration.

additionalDataMap

A map that holds additional data that is given in the request to be required by service to process.

PublishJobResult properties

The following table describes properties defined in PublishJobResult:

Property Description
jobId The ID of the job to be published.
status The status of the job. The statuses that are permitted are: COMPLETED, FAILED, and COMPLETED_WITH_ERRORS.
resultMessage A message that provides the detailed results of the publish job operation.
objectURL A URL that is used to access the published content.
fileId The ID of the asset sent in the request.
objectId The ID of the file that is created in the endpoint.
auditURL

An analytics URL for the content being published to the endpoint.

Tip: This URL will be displayed in the Usage tab of the asset.

objectURL

A URL that is used to access the published content.

As Apache Camel™ (Camel) is included in Integration Service. You can use Apache Camel components to connect with endpoints. If you wish to use Apache Camel Component in custom integration, you need to implement a router to use the Camel component that publishes the content to the endpoints. The router is where the flow is defined. For example, to integrate two endpoints, code a Camel route to specify how these endpoints are integrated.

To use any Camel component in your own Palatino integration, you need to have a knowledge of Camel. For more information, see https://camel.apache.org/


Service Implementation

public class GoogleDriveIntegrationService implements IntegrationService {
@Override
public PublishJobResult publishContent(PublishJobRequest publishJobRequest) throws IntegrationServiceException
{
.......


Exchange sendExchange = ExchangeBuilder.anExchange(camelContext).withBody(googleDriveFileRequest).build();
Exchange outExchange = producerTemplate.send("direct:googledrive", sendExchange);

.......
}
}

Router Implementation

public class GoogleDriveRouterBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
try{
.from("direct:googledrive").process(new GoogleDriveProcessor()).to("google-drive://drive-files/insert")            
.process(new GoogleDriveResultProcessor()).log("Content is uploaded to Google Drive successfully.");
}catch(Exception e){}
}
}

Note: A sample implementation of an integration for the Integration Service is available on * My Support. The sample uses the Camel Google Drive component to publish the assets to Google Drive.