Configuring ContextHub
- Topics:
- Administering
CREATED FOR:
- Admin
ContextHub is a framework for storing, manipulating, and presenting context data. For more detail on ContextHub, please see the developer documentation. ContextHub replaces Client Context in the touch UI.
Configure the ContextHub toolbar to control whether it appears in Preview mode, to create ContextHub stores, and add UI modules using the Touch-Optimized UI.
Disabling ContextHub
By default, ContextHub is enabled in an AEM installation. ContextHub can be disabled to prevent it from loading js/css and initializing. There are two options to disable ContextHub:
-
Edit the ContextHub’s configuration and check the option Disable ContextHub
- In the rail click or tap Tools > Sites > ContextHub
- Click or tap the default Configuration Container
- Select the ContextHub Configuration and click or tap Edit Selected Element
- Click or tap Disable ContextHub and click or tap Save
or
- Use CRXDE Lite to set the property
disabled
to true under/libs/settings/cloudsettings
/etc/cloudsettings
to:/libs/settings/cloudsettings
/conf/global/settings/cloudsettings
/conf/<tenant>/settings/cloudsettings
Showing and Hiding the ContextHub UI
Configure the Adobe Granite ContextHub OSGi service to show or hide the ContextHub UI on your pages. The PID of this service is com.adobe.granite.contexthub.impl.ContextHubImpl.
To configure the service you can either use the Web Console or use a JCR node in the repository:
- Web Console: To show the UI, select the Show UI property. To hide the UI, clear the Hide UI property.
- JCR node: To show the UI, set the boolean
com.adobe.granite.contexthub.show_ui
property totrue
. To hide the UI, set the property tofalse
.
When showing the ContextHub UI, it only appears on pages on AEM author instances. The UI does not appear on pages of publish instances.
Adding ContextHub UI Modes and Modules
Configure the UI modes and modules that appear in the ContextHub toolbar in Preview mode:
- UI Modes: Groups of related modules
- Modules: Widgets that expose context data from a store and enable authors to manipulate the context
UI modes appear as a series of icons on the left side of the toolbar. When selected, the modules of a UI mode appear to the right.
Icons are references from the Coral UI icon library.
Adding a UI Mode
Add a UI mode to group related ContextHub modules. When you create the UI mode, you provide the title and icon that appear in the ContextHub toolbar.
-
On the Experience Manager rail, click or tap Tools > Sites > Context Hub.
-
Click or tap the default Configuration Container.
-
Click or tap the Context Hub Configuration.
-
Click or tap the Create button, and then click or tap Context Hub UI Mode.
-
Provide values for the following properties:
- UI Mode Title: The title that identifies the UI mode
- Mode Icon: The selector for the Coral UI icon to use, for example
coral-Icon--user
- Enabled: Select to show the UI mode in the ContextHub toolbar
-
Click or tap Save.
Adding a UI Module
Add a ContextHub UI module to a UI mode so that it appears in the ContextHub toolbar for previewing page content. When you add a UI module, you are creating an instance of a module type that is registered with ContextHub. To add a UI module, you must know the name of the associated module type.
AEM provides a base UI module type as well several sample UI Module types upon which you can base a UI module. The following table provides a brief description of each one. For information about developing a custom UI module, see Creating ContextHub UI Modules.
The UI module properties include a detail configuration where you can provide values for module-specific properties. You provide the detail configuration in JSON format. The Module Type column in the table provides links to information about the JSON code required for each UI module type.
Module Type | Description | Store |
---|---|---|
contexthub.base | A generic UI module type | Configured in the UI module properties |
contexthub.browserinfo | Displays information about the browser | surferinfo |
contexthub.datetime | Displays date and time information | datetime |
contexthub.device | Display the client device | emulators |
contexthub.location | Displays the latitude and longitude of the client, as well as the location on a map. Enables you to change the location. | geolocation |
contexthub.screen-orientation | Displays the screen orientation of the device (landscape or portrait) | emulators |
contexthub.tagcloud | Displays statistics about page tags | tagcloud |
granite.profile | Displays the profile information for the current user, including authorizableID, displayName and familyName. You can change the value of displayName and familyName. | profile |
-
On the Experience Manager rail, click or tap Tools > Sites > ContextHub.
-
Click or tap the Configuration Container to which you want to add a UI module.
-
Click or typ the ContextHub Configuration to which you want to add the UI module.
-
Click or tap the UI mode to which you are adding the UI module.
-
Click or tap the Create button, then click or tap ContextHub UI Module (generic).
-
Provide values for the following properties:
- UI Module Title: A title that identifies the UI module
- Module Type: The module type
- Enabled: Select to show the UI module in the ContextHub toolbar
-
(Optional) To override the default store configuration, enter a JSON object to configure the UI Module.
-
Click or tap Save.
Creating a ContextHub Store
Create a Context Hub store to persist user data and access the data as needed. ContextHub stores are based on registered store candidates. When you create the store, you need the value of the storeType with which the store candidate was registered. (See Creating Custom Store Candidates.)
Detailed Store Configuration
When you configure a store, the Detail Configuration property enables you to provide values for store-specific properties. The value is based on the config
parameter of the store’s init
function. Therefore, whether you need to provide this value, and the format of the value, depends on the store.
The value of the Detail Configuration property is a config
object in JSON format.
Sample Store Candidates
AEM provides the following sample store candidates upon which you can base a store.
Store Type | Description |
---|---|
aem.segmentation | Store for resolved and unresolved ContextHub segments. Automatically retrieves segments from the ContextHub SegmentManager |
aem.resolvedsegments | Stores the currently resolved segments. Listens to the ContextHub SegmentManager service to automatically update the store |
contexthub.geolocation | Stores the latitude and longitude of the browser location. |
contexthub.datetime | Stores the current date, time, and season for the browser location |
granite.emulators | Defines properties and capabilities for a number of devices, and detects the current client device |
contexthub.generic-jsonp | Retrieves and stores data from a JSONP service |
granite.profile | Stores profile data for the current user |
contexthub.surferinfo | Stores information about the client, such as device information, browser type, and window orientation |
contexthub.tagcloud | Stores page tags and tag counts |
-
On the Experience Manager rail, click or tap Tools > Sites > ContextHub.
-
Click or tap the default configuration container.
-
Click or tap Contexthub Configuration
-
To add a store, click or tap the Create icon and then click or tap ContexHub Store Configuration.
-
Provide values for the basic configuration properties and then click or tap Next:
- Configuration Title: The title that identifies the store
- Store Type: The value of the storeType property of the store candidate upon which to base the store
- Required: Select
- Enabled: Select to enable the store
-
(Optional) To override the default store configuration, enter a JSON object in the Detail Configuration (JSON) box.
-
Click or tap Save.
Example: Using a JSONP Service
This example illustrates how to configure a store and display the data in a UI module. In this example, the MD5 service of the jsontest.com site is used as a data source for a store. The service returns the MD5 hash code of a given string, in JSON format.
A contexthub.generic-jsonp store is configured so that it stores data for the service call https://md5.jsontest.com/?text=%22text%20to%20md5%22
. The service returns the following data which is displayed in a UI module:
{
"md5": "919a56ab62b6d5e1219fe1d95248a2c5",
"original": "\"text to md5\""
}
Creating a contexthub.generic-jsonp Store
The contexthub.generic-jsonp sample store candidate enables you to retrieve data from a JSONP service or a web servcie that returns JSON data. For this store candidate, use the store configuration to provide details about the JSONP service to use.
The init function of the ContextHub.Store.JSONPStore
Javascript class defines a config
object that initializes this store candidate. The config
object contains a service
object that includes details about the JSONP service. To configure the store, you provide the service
object in JSON format as the value for the Detail Configuration property.
To save data from the MD5 service of the jsontest.com site, use the procedure in Creating a ContextHub Store using the following properties:
-
Configuration Title: md5
-
Store Type: contexthub.generic-jsonp
-
Required: Select
-
Enabled: Select
-
Detail Configuration (JSON):
{ "service": { "jsonp": false, "timeout": 1000, "ttl": 1800000, "secure": false, "host": "md5.jsontest.com", "port": 80, "params":{ "text":"text to md5" } } }
Adding a UI Module for the md5 Data
Add a UI module to the ContextHub toolbar to display the data that is stored in the example md5 store. In this example, the contexthub.base module is used to produce the following UI module:
Use the procecure in Adding a UI Module to add the UI module to an existing UI Mode, such as the sample Perona UI Mode. For the UI Module, use the following property values:
-
UI Module Title: MD5
-
Module Type: contexthub.base
-
Detail Configuration (JSON):
{ "icon": "coral-Icon--data", "title": "MD5 Converstion", "storeMapping": { "md5": "md5" }, "template": "<p> {{md5.original}}</p>; <p>{{md5.md5}}</p>" }
Debugging ContextHub
A debugging mode for the ContextHub can be enabled to allow for troubleshooting. The debug mode can be enabled either through the ContextHub configuration or via CRXDE.
Via the Configuration
Edit the ContextHub’s configuration and check the option Debug
- In the rail click or tap Tools > Sites > ContextHub
- Click or tap the default Configuration Container
- Select the ContextHub Configuration and click or tap Edit Selected Element
- Click or tap Debug and click or tap Save
Via CRXDE
Use CRXDE Lite to set the property debug
to true under:
/conf/global/settings/cloudsettings
or/conf/<tenant>/settings/cloudsettings
debug property
is is /libs/settings/cloudsettings/legacy/contexthub
.Silent Mode
Silent mode suppresses all debug information. Unlike the normal debug option, which can be set independently for each ConextHub configuration, silent mode is a global setting which takes precedent over any debug settings on the ContextHub configuration level.
This is useful for your publish instance, where you don’t want any debug information at all. Because it is a global setting, it is enabled via OSGi.
- Open the Adobe Experience Manager Web Console Configuration at
http://<host>:<port>/system/console/configMgr
- Search for Adobe Granite ContextHub
- Click the configuration Adobe Granite ContextHub to edit its properties
- Check the option Silent Mode and click Save
Recovering ContextHub Configurations After Upgrading
When an upgrade to AEM is performed, the ContextHub configurations are backed up and stored in a safe location. During the upgrade, the default ContextHub configurations are installed, replacing the existing configurations. The backup is required to preserve any changes or additions that you have made.
ContextHub configurations are stored in a folder named contexthub
under the following nodes:
/conf/global/settings/cloudsettings
/conf/<tenant>/settings/cloudsettings
After an upgrade, the backup is stored in a folder named contexthub
below a node named:
/conf/global/settings/cloudsettings/default-pre-upgrade_yyyymmdd_xxxxxxx
or/conf/<tenant>/settings/cloudsettings/default-pre-upgrade_yyyymmdd_xxxxxxx
The yyyymmdd
portion of the node name is the date when the upgrade was performed.
To recover your ContextHub configurations, use CRXDE Lite to copy the nodes that represent your stores, UI modes, and UI modules from below the default-pre-upgrade_yyyymmdd_xxxxxx
node to below:
/conf/global/settings/cloudsettings
or/conf/<tenant>/settings/cloudsettings
Experience Manager
- Administering User Guide overview
- Sites Features
- Website Administration
- Reusing Content: Multi Site Manager and Live Copy
- Live Copy Overview Console
- Configuring Live Copy Synchronization
- Creating and Synchronizing Live Copies
- MSM Rollout Conflicts
- MSM Best Practices
- Translating Content for Multilingual Sites
- Managing Translation Projects
- Identifying Content to Translate
- Preparing Content for Translation
- Creating a Language Root Using the Classic UI
- Connecting to Microsoft Translator
- Configuring the Translation Integration Framework
- Language Copy Wizard
- Translation Enhancements
- Translation Best Practices
- Configurations and the Configuration Browser
- AEM FAQs
- Operations
- Dashboards
- Operations Dashboard
- Backup and Restore
- Data Store Garbage Collection
- Monitoring Server Resources Using the JMX Console
- Working with Logs
- Configure the Rich Text Editor
- Configure the Video component
- The Bulk Editor
- Configuring Email Notification
- Configuring RTE for Producing Accessible Sites
- The Link Checker
- Troubleshooting AEM
- Audit Log Maintenance in AEM 6
- Editor
- Managing Access to Workflows
- Using cURL with AEM
- Configuring Undo for Page Editing
- Proxy Server Tool (proxy.jar)
- Configuring for AEM Apps
- Administering Workflows
- Configuring Search Forms
- Tools Consoles
- Reporting
- Administering Workflow Instances
- Configuring Layout Container and Layout Mode
- Enabling Access to Classic UI
- Starting Workflows
- Configure the Rich Text Editor plug-ins
- Admin Consoles
- Security
- User Administration and Security
- User, Group and Access Rights Administration
- Security Checklist
- OWASP Top 10
- Running AEM in Production Ready Mode
- Identity Management
- Adobe IMS Authentication and Admin Console Support for AEM Managed Services
- Creating a Closed User Group
- Mitigating serialization issues in AEM
- User Synchronization
- Encapsulated Token Support
- Single Sign On
- How to Audit User Management Operations in AEM
- SSL By Default
- SAML 2.0 Authentication Handler
- Closed User Groups in AEM
- Granite Operations - User and Group Administration
- Enabling CRXDE Lite in AEM
- Configuring LDAP with AEM 6
- Configure the Admin Password on Installation
- Service Users in AEM
- Encryption Support for Configuration Properties
- Handling GDPR Requests for the AEM Foundation
- Content Disposition Filter
- Personalization
- eCommerce
- Integration
- Integrating with Third-Party Services
- Integrating with Salesforce
- Integrating with Adobe Target
- Integrating with Adobe Analytics
- Connecting to Adobe Analytics and Creating Frameworks
- Configuring Link Tracking for Adobe Analytics
- Mapping Component Data with Adobe Analytics Properties
- Configuring Video Tracking for Adobe Analytics
- HTTP2 Delivery of Content FAQ
- Troubleshooting your Adobe Campaign Integration
- SharePoint Connector Licenses, Copyright Notices, and Disclaimers
- SharePoint Connector
- DHTML Viewer End-of-Life FAQs
- Integrating with Adobe Campaign Classic
- Related Community Articles
- Integrating with Adobe Campaign Standard
- Flash Viewers End-of-Life Notice
- Integrating with Adobe Creative Cloud
- Integrating with Adobe Dynamic Tag Management
- Opting Into Adobe Analytics and Adobe Target
- AEM Portals and Portlets
- Integrating with Dynamic Media Classic
- Troubleshooting Integration Issues
- Integrating with BrightEdge Content Optimizer
- Best Practices for Email Templates
- Catalog Producer
- Integrating with Silverpop Engage
- Integrating with Adobe Campaign
- Integrating with ExactTarget
- Analytics with External Providers
- Integrating with the Adobe Marketing Cloud
- Manually Configuring the Integration with Adobe Target
- Prerequisites for Integrating with Adobe Target
- Adobe Classifications
- Solutions Integration
- Target Integration with Experience Fragments
- Best Practices
- Content Management