close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2101

Table Of Contents

11.1 PDE Mapping as Metadata

To integrate PDE (preview driven editing) functionality to a client, a mapping from the field name in the GraphQL schema to the content type property is required. This mapping is defined on the Headless Server and delivered via MetadataProvider as metadata on fields.

Configuration

The mapping is configured in file propertyMapping.json. For an interface type, a field name and the corresponding document type property name is listed.

Property mapping configuration (propertyMapping.json):

{
  "CMCollection": {
    "teasableItems": "properties.items",
    "bannerItems": "properties.items",
    "detailItems": "properties.items"
  },
  ...

The configured mapping applies also to types that implement the interface.

Configuration is only required for fields whose name differs from the document type property name and for implied content properties.

The default is properties.<fieldname>.

Implied content properties like id, type etc. are suffixed with "_" and need to be configured explicitly in the mapping file. A default configuration is provided.

Example response of metadata request with PDE mapping:

{
"data": {
  "metadata": {
    "types": [
      {
        "name": "CMCollectionImpl",
        "fields": [
        {
          "name": "id",
          "metadata": {
            "mapping": "id_"
          }
        },
        {
          "name": "teasableItems",
          "metadata": {
            "mapping": "properties.items"
          }
        },
        ...
      }
    ]
  }
}

Scope

PDE mapping metadata is provided for ObjectTypeDefinitions that implement an interface, for example CMArticleImpl.

The MetadataProvider for PDE Mapping is configured for preview.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.