Documentation Center

Content Service Data Model Transformer Extension

Configure a Content Service Data Model Transformer Extension if you want to transform fetched custom data from the Content Data Store. Typically, this kind of Extension is accompanied by a GraphQL Schema Extension to make the fetched and transformed data queryable through GraphQL queries.

A Content Service Data Model Transformer Extension can consist of one or more transformations and is configured as follows in the extensions array in your Add-on manifest file:
{
  "type": "CDModelTransformerExtension",
  "name":"EXTENSIONNAME",
  "supportedVersions":"11.5.0.0",
  "properties": {
    "entryPoint": "com.sdl.delivery.content.graphql.TransformerExtensionActivator",
    "loadingPhase": "AFTER_APP_INITIALIZED",
    "configurationSources": [
      {
        "name":"TRANSFORMATIONNAME",
        "type":"json",
        "properties":
        {
          "fetcherClass":"FETCHERCLASS",
          "transformerClass":"TRANSFORMERCLASS",
          "priority":"TRANSFORMATIONPRIORITY"
        }
      },
      ...
    ]
  }
}
where:
  • EXTENSIONNAME is the unique name you want to give to this Content Service Data Model Transformer Extension
  • configurationSources is an array of transformations to the Data Model
  • TRANSFORMATIONNAME is the unique name you want to give to one transformation in the Extension
  • FETCHERCLASS is an SDL Tridion Sites Java class in the com.sdl.delivery.content.model.core.datafetcher package, a class that fetcher a specific type of content.
  • TRANSFORMERCLASS is the fully qualified classname of your Java class that implements the transformer, which transforms the fetched data. This class must implement the com.sdl.delivery.content.model.core.datafetcher.transformer.ModelTransformer interface.
  • TRANSFORMATIONPRIORITY is a number that specifies the priority of this transformation, that is, when this transformation should be applied relative to other transformations. For example, given two transformations in the configurationSources array, one called FooTransformation with a priority of 50 and another called BarTransformation with a priority of 20, then BarTransformation willl be applied before FooTransformation.