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
- 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.
- 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
- In the Drupal Admin Configuration Panel, go to Configuration > Web services > Gigya Settings > Gigya DS Settings.
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:
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.<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.
gigyaType The type of the Gigya field. custom An array in which to specify the Data Store oid parameter.
Configure Data Extraction Method
- 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.
|gigya_client_fetch_ds_data_only||Function that fetches DS data for the current UID.|
|gigya_client_gigya_ds_data_alter||$ds_data||Hook that enables changing the DS data array.|