Drupal 7 Sync with Gigya Data Store - DS

Skip to end of metadata
Go to start of metadata

Overview

Synchronization between Drupal and Gigya's Data Store (DS) is provided through an optional, separate module that can be installed on top of the main Gigya Extension for Drupal.

The DS Sync module adds the ability to pull data from Gigya's Data Store and map it into the user account database in Drupal.

Customers who only use Gigya's account storage, and do not use the Gigya Data Store service, do not have to install this additional module.

Installation and Implementation

To implement DS sync follow these steps:

1. Update Drupal

  1. Open https://www.drupal.org/project/gigya, download the most recent release for Drupal version 7 (v. 7.x.-5.2 and up), and install it. 
  2. Go to https://www.drupal.org/upgrade/running-update-php to update Drupal's user interface to include Gigya's DS module. If you are prompted to update the Encrypt module beforehand, confirm and continue. 

In Drupal, the update creates a gigya_ids table, and adds the Gigya DS Settings tab to the Admin panel.

2. Enable Gigya DS

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

 

3. Configure DS Settings

Field Mapping

  1. In the Drupal Admin Configuration Panel, go to Configuration > Web services > Gigya Settings > Gigya DS Settings.
  2. Enter the field mapping in JSON format into the Gigya DS Mapping text box.

    We recommend that you work with a code editor for configuring the JSON mapping, then copy the code into Gigya DS Mapping.

    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: 

    RequiredKeyDescription
    cmsNameThe 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'.

    cmsTypeThe type of the Drupal field. Accepted values are integer, string, date or boolean.
    gigyaName

    Field in Gigya DS in the following format: ds.<type>.<fieldname> , where ds is fixed, and the type (table) and field name should be specified (case sensitive).

    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.

    gigyaTypeThe type of the Gigya field.

Configure Data Extraction Method

Choose between the ds.search and ds.get data extraction method. The ds.get method may be used if only one OID is being passed. In most cases, the recommendation is to use ds.search

  1. Under the Gigya DS Settings tab, Check the Use search checkbox to use the ds.search data extraction method. Otherwise, data will be extracted using ds.get

  2. Click Save configuration

After changing a configuration, we recommend you clear the browser cache to ensure changes go into effect. In Drupal, you can clear the cache by opening Configuration > Performance and selecting Clear the cache.

Calling and Transforming DS Data

You can manually fetch data from the Data Store. You can also listen to specified events using a hook, and transform DS data as needed. 

You can download our sample "Gigya Client" module and install according to Drupal's documentation.. For example, the gigya_client_fetch_ds_data_only function fetches users from Gigya's Data Store by their Drupal user ID; and the gigya_client_gigya_ds_data_alter function maps the data of the "abc" array to the "d" field. 

Review the code and use the module as a reference for your own hook implementations.

Available Actions

NameParametersDescription
gigya_client_fetch_ds_data_only Function that fetches DS data for the current UID.
gigya_client_gigya_ds_data_alter$ds_dataHook that enables changing the DS data array.
  • No labels