I would recommend you to read this old post:- Re: ClientContext to ContextHub migration guide
tc82 gave the wonderful answer on ClientContext to ContextHub migration.
ContextHub Implementation
· Table of contents
- Introduction to ContextHub
- Files to be changes to replace CleintContext with ContextHub
Introduction to ContextHub:
- Name the folder as: contexthub
- Create a folder undern contexthub called modules
- Create a folder undern modules called commerce
- Create a folder undern commerce called clientlib
- Create a file under clientlib named as .content.xml
- Code for the .content.xml
style="padding-left:45px"
- Add the following line inside the css.txt
renderer.commerce.css
- Create a file under clientlib named as js.txt
- Add the following line inside the js.txt
renderer.commerce.js
- Create a file under clientlib named as renderer.commerce.css
- Add the following line inside the renderer.commerce.css
style="padding-left:45px"
- Create a folder under above path named: stores
- Create a folder under stores named: commerce
- Create a folder under commerce named: clientlib
- Create a file under clientlib called .content.xml
- Add the following code in the .content.xml
style="padding-left:45px"
- Add the following code:
store.commerce.js
- Create a new file under clientlib called store.commerce.js
- Add the followig code:
style="padding-left:45px"
- Create a folder named customclientcontextlibs
- Create a file .content.xml under customclientcontextlibs folder.
Add the following code:
style="padding-left:45px"function callingSatellitePageBottom(){
if (window.ContextHub) {
ContextHub.eventing.on(ContextHub.Constants.EVENT_INITIALIZED + ":XXXX", function(event, data) {
_satellite.pageBottom();
});
}
}
- Including the CSS and ContextHUb:
<cq:includeClientLib css="cardinalhealth.oe.customclientcontextlibs" /><cq:include path="contexthub" resourceType="granite/contexthub/components/contexthub"></cq:include>
- Get the COntextHUb Data:
//ContextHub tree details command:
var data = ContextHub.getStore('XXXX').getTree();
Note: XXXX is the store name
Kautuk Sahni