AEM 6.3 upgrade - Client context to ContextHub | Community
Skip to main content
October 23, 2017
Solved

AEM 6.3 upgrade - Client context to ContextHub

  • October 23, 2017
  • 1 reply
  • 1175 views

Hello All,

We are in process of upgrading from AEM 6.1 to AEM 6.3 and in the process of moving from client context to contexthub.

We have got ContextHub working in AEM 6.3 instance but what we are not sure is how we migrate client context segmentation content to context hub (content that reside within /content/campaigns)

We did a quick check and changing just the segment information (change from client context segment to context hub segment) within experience did not retain the targeted content.

Please let us know if we need to do anything specific?

Many Thanks

Best Regards,

Shishank

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

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();
});
}
}

  1. Including the CSS and ContextHUb:

<cq:includeClientLib css="cardinalhealth.oe.customclientcontextlibs" /><cq:include path="contexthub" resourceType="granite/contexthub/components/contexthub"></cq:include>

  1. Get the COntextHUb Data:

//ContextHub tree details command:
var data = ContextHub.getStore('XXXX').getTree();

Note: XXXX is the store name

1 reply

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
October 24, 2017

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();
});
}
}

  1. Including the CSS and ContextHUb:

<cq:includeClientLib css="cardinalhealth.oe.customclientcontextlibs" /><cq:include path="contexthub" resourceType="granite/contexthub/components/contexthub"></cq:include>

  1. Get the COntextHUb Data:

//ContextHub tree details command:
var data = ContextHub.getStore('XXXX').getTree();

Note: XXXX is the store name

Kautuk Sahni