Synchronization between Umbraco 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 Umbraco.
The DS Sync module adds the ability to pull data from Gigya's Data Store and map it into the user account database in Umbraco.
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.
- Umbraco version 7.2 and above
- Gigya CMS Module for Umbraco version 1.0 and above
Installation and Implementation
To implement DS sync follow these steps:
1. Install Gigya DS Package in Umbraco
- Download the package here: Gigya_DS_184.108.40.206.zip
- In Umbraco, go to the Developers tab. Open the 'Packages' folder and select 'Install local package'.
- Choose to upload the package.zip file, confirm the warning and click 'Load Package'.
- On the next screen, click 'Accept licence', then 'Install package'.
- The site should refresh automatically, and now includes Gigya DS package.
2. Enable Gigya DS for Selected Umbraco Users
- Go to the Users tab in Umbraco. Open the 'Users' folder and select the relevant user.
- Under Sections, check the Gigya DS checkbox.
- Save your changes and refresh the page. The user can now access the Gigya DS tab from the left-hand menu.
3. Configure DS Settings
In the Gigya DS Settings tab which is now available on the left-hand menu, map Gigya DS fields to the relevant fields in Umbraco.
To map fields from Gigya DS to Umbraco:
- Open the Gigya DS Settings tab from the menu on the left-hand side. Select Global Settings.
- Under Gigya DS Field, specify the DS field to be mapped, in the following format: ds.type.field. Examples include:
- Enter the Data Store Object.
- Select the Umbraco field from the dropdown.
- When you've finished adding fields, click 'Publish'. Note that empty or partially filled mapping definitions will generate an error, so remove unnecessary lines by clicking 'Remove'.
- All sites inherit the global settings by default. To configure a different mapping for a specific site, open that site in the Gigya DS Settings tab and uncheck Inherited from Global Settings.
Data Extraction Method
For performance reasons, the Gigya DS settings are cached in memory for a default of 60 minutes. This can be changed by adding an AppSetting with Gigya.DS.CacheMins as the key. For example:
When settings are updated through the Umbraco backoffice, the cached settings are cleared from memory. This is fine in a single server environment but won’t work for a load balanced environment as each server has its own cache. To clear the cache on the other servers you could republish the settings there or restart the app pool.
Manually Retrieving Gigya DS Data
DS data can be manually retrieved using the Gigya.Module.DS.Helpers.GigyaDsHelper class. In order to reference the module code you will need to add a reference to these dll's in your project:
Below is an example of how you could retrieve DS data manually. If you want to use your own settings this can be done by passing your own settings models into the GigyaDsHelper constructor.
Using Hooks to Manipulate Data Before Mapping into Umbraco
After the DS fields have been retrieved, an event is fired which can be subscribed to in order to manipulate the account info object before the fields are mapped to Umbraco. The following code sample demonstrates how to do this. Usually this code would be added to Global.asax.cs.
The events described in the core Gigya module for Umbraco can also be used to manipulate data. See Field Mapping.
The logger used is GigyaUmbracoLogger, so it's possible to enable debug mode just for Gigya. To log debug messages in Umbraco:
- Open the <project root>/Config/log4net.config file.
Add the following piece of code:
- In the Umbraco admin module, go to Settings > Gigya.
- Make sure the Debug Mode box is checked.
- If logs appear empty, make sure that debug mode is enabled for the log4net file either at the global level or for GigyaUmbracoLogger.
- If a Gigya field is not being saved to Umbraco, check the field mappings on the DS Settings page. Make sure the names are correct and they are the same type (for example, don’t try to map a Gigya field that’s a string to an Umbraco numeric. Note that incorrect field mappings should appear in the log when debug mode is enabled.
To remove the Gigya DS package (still retaining the core Gigya package):
- Click the Developer tab on the left.
- Open the Packages folder and expand Installed Packages.
- Select 'Gigya DS'. In the Uninstall package tab make sure you uncheck “/bin/Gigya.Module.Core.dll”, as this file is used by the core Gigya module. All other files can be removed.
- Click Confirm uninstall.