Overview of the Translation Connector Framework

The Oracle Content Management translation framework enables you to translate sites and assets using external Language Service Providers.

To help you build a new translation connector, Oracle Content Management provides the Translation Connector SDK.

The connector framework abstracts the functionality that is provided and implemented by end connectors. It does so by providing the REST API interface for configuring a translation connector and for calling translation connector functionality to download translation jobs from sites and upload the resulting translations back into Oracle Content Management.

Translation Connector SDK

The Translation Connector SDK for Oracle Content Management is a sample NodeJS implementation of the Translation Connector REST APIs. The sample accepts a translation job zip file, translates all the resources in the file, which includes metadata file of site pages and both metadata file and native file of assets, and then returns a new zip file containing all the translations.

The Translation Connector SDK is part of Content Toolkit, which is available from GitHub. To help you build a new translation connector, this SDK contains a sample translation connector:

  • JSDoc for the sample translation connector
  • A NodeJS sample translation connector implementation of the REST interfaces
  • A NodeJS mock Language Server Provider that the sample runs against

Note:

The Translation Connector SDK requires the user to have access to a language service provider (LSP) to do the actual string translations. A mock LSP server is included in the SDK to mimic the responses from the LSP by simply prepending the targeted locales onto the strings.

This SDK consists of three main modules:

  • SampleConnector: A sample translation connector that implements the required Oracle Content Management Translation Connector API.
  • SampleJobManager: A file-system based sample job manager that maintains the state of the connector jobs while they are translated.
  • TranslationProviderInterface: A set of APIs used to call the Language Service Provider to submit documents for translation and retrieve the translated documents.

The Sample Translation Connector code is split up into three areas:

  • /translation-connector:
    • /connector: Implements the required Oracle Content Management Cloud Translation Connector APIs.
    • /job-manager: This sample implementation of a file-based persistence store unzips the translation job, translates it, and then zips up the translations.
    • /provider: Implements the Language Service Provider APIs to upload, translate, and download documents.

In addition, you can use the mock LSP for testing:

  • /mockserver: A mock LSP, which simply adds the requested translation locale to all the strings.

Translation connectors are deployable packages that use Restful services for the remote stores implementing the REST interfaces (SPIs/SDK) defined by Oracle Content Management. They internally use cloud store native SDKs to connect to remote systems.

Translation Connector REST APIs

You can deploy and run translation connectors anywhere and implement them with any technology stack, as long as they can be called from Oracle Content Management through REST APIs.

The Translation Connector SDK includes the following API classes:

  • ConnectorApi
  • MockTranslationProvider
  • PersistenceStoreInterface
  • SampleBasicAuth
  • SampleConnector
  • SampleConnectorRouter
  • SampleFileDownloader
  • SampleFileImporter
  • SampleFilePersistenceStore
  • SampleFileTranslator
  • SampleJobManager
  • TranslationFilter
  • TranslationProviderInterface

Your translation connector needs to support the translation connector REST APIs.

The following table describes the REST APIs for Oracle Content Management translation connectors.

API Description
GET http://host:port/connector/rest/api Returns the versions of the Translation Connector REST API that the connector supports; for example: ["v1"]
GET http://host:port/connector/rest/api/v1/server Returns the connector configuration information; for example, required parameters that the user needs to pass to the connector.
POST http://host:port/connector/rest/api/v1/job Creates a new job in the connector and returns a unique translated job.
GET http://host:port/connector/rest/api/v1/job/{id} Returns status information about the specified job.
POST http://host:port/connector/rest/api/v1/job/{id}/translate Sends an Oracle Content Management translation zip file for the job to be translated.
GET http://host:port/connector/rest/api/v1/job/{id}/translation Returns the translated job in the Oracle Content Management translated zip file format
DELETE http://host:port/connector/rest/api/v1/job/{id} Deletes the job from the connector (and from the LSP if required)