Skip to content

Drupal Data Store Sync

BerezinLiz edited this page May 18, 2022 · 11 revisions

Overview

For clients who use Gigya's Data Store (DS), synchronization between Drupal and the Data Store is available by activating a separate module on top of the main Gigya Extension for Drupal.

The DS Sync module pulls user data from Gigya's Data Store and maps it into the user account database in Drupal.

Installation and Implementation

To implement DC sync, follow these steps:

1.Update Drupal   2.Enable Gigya DS   3.Configure DS Settings

1. Update Drupal

Open https://www.drupal.org/project/gigyaInformation published on non-SAP site, download the most recent release for Drupal version 8 (v. 8.x.-1.5.01 and up), and install it.

2. Enable Gigya DS

In Drupal, in the modules configuration section, check the checkbox for Gigya - Customer Identity Management - DS.

3. Configure DS Settings

There are two configurable options in the DS sync module:

  • Data extraction method - the default is to use "get" (see explanation below). You can leave the default or change it to "search".

  • Field mapping - you must define which DS fields are mapped to which Drupal fields. See below.

Both these configurations are done in a YAML file in JSON format. To configure, you first export the existing configurations, then edit them and import back the file of the same name:

  1. In Drupal, go to Administration > Configuration > Development > Synchronize.

  2. Click Export.

  3. Under Configuration type, select "Simple configuration".

  4. Under Configuration name, select "gigya_ds_settings".

    The configuration appears in the configuration window. The relevant parameters are:

    • gigya_ds_mapping - defines the field mapping

    • gigya_ds_use_search - defines the data extraction method.

  5. After editing the file, select the Import tab to write your changes to the database.

Configure Data Extraction Method

You can choose between the ds.search and ds.get data extraction method. The default is ds.get. The ds.get method may be used if only one OID is being passed. Our recommendation is as follows:

  • If you are passing one OID, use ds.get.

  • If you are sending multiple OIDs or sending multiple queries to the DS database, use search.

To change the configuration from get to search, in the configuration file, change the value of the gigya_ds_use_search parameter to "true":

    gigya_ds_use_search: true

Field Mapping

The matching of a DS field to a Drupal one is done in JSON format. Each mapping of one Gigya field to one Drupal field is an object, and the entire field mapping definition is an array of mapping objects. Prepare your field mapping, and then import it into Drupal as described below.

Define your field mapping in the gigya_ds_mapping parameter according to the following guidelines:

Example: The following file maps the ds.test.data field from Gigya DS to a field called field_custom2 in Drupal:

    [
     {
       "cmsName": "field_custom2",
       "cmsType": "string",
       "gigyaName": "ds.test.data", // In this example, "test" is the name of the table defined in DS, and "data" is the name of the field
       "gigyaType": "string",
       "custom": {
         "oid": "segments"
       }
     }
    ]

For each mapping (each object in the array), the following parameters apply:

Required Key Description
  cmsName The name of the field in Drupal. This should be identical to the Machine name of the field listed under Drupal Configuration > Manage fields. This name usually starts with 'field'.
cmsType The type of the Drupal field. Accepted values are integer, string, date or boolean.
  gigyaName Field in Gigya DS in the following format: ds.. , where ds is fixed, and the type (table) and field name should be specified (case sensitive).

Note: If the field was assigned a suffix in the Gigya DS, according to the field type (e.g., _i to denote an integer field), you should also add the suffix to the gigyaName field mapping.   | gigyaType | The type of the Gigya field.   | custom | An array in which to specify the Data Store oid parameter.

Clone this wiki locally