6 Replies Latest reply on May 3, 2013 2:48 PM by Sham HC

    Client Context customization in CQ5 to personalize the content based on user profile

    MuneeswarReddy Level 1

      Hi,

       

      I would like to customize the CQ5 client context to personalize the content based on the user profile information which we receives from third party systems(ex: Oxygen single sign on).

      I have looked the CQ5 documentation but didn't find enough information.

       

      Here is the link, I have referred http://dev.day.com/docs/en/cq/current/developing/client_context_detail.html

       

      Could you please provide me some informaiton/examples, how to customize the client context in CQ5?

       

      It would be great, if you could provide more details/examples for this.

       

       

       

      Thanks

      Muni

        • 1. Re: Client Context customization in CQ5 to personalize the content based on user profile
          Sham HC Level 7

          Hi MuneeswarReddy,

           

          The document you refered should help to get started. Please let me know why area  you stuck up exactly?

           

          As an example to custamize the client context to remove geo location refer http://helpx.adobe.com/cq/kb/turn-off-geolocation.html

           

          Thanks,

          Sham

          @adobe_sham

          1 person found this helpful
          • 2. Re: Client Context customization in CQ5 to personalize the content based on user profile
            RMGJID

            If you see the node structure under "/etc/clientcontext/default", you will find the stores and each store is mapped to respective resource type. If you want to customize the client context, then you should prolly customize the stores inside it.

             

            Overlay from libs to apps or create a new stores as per your need. Follow the node structure under "/etc/clientcontext/default" and you should be able to understand how stores are mapped to resource types and how can we customize it.

             

            Let me know if any questions.

            • 3. Re: Client Context customization in CQ5 to personalize the content based on user profile
              RMGJID Level 1

              Profile store will be mapped to a resource type and inside the component there will be "js.jsp" file which loads the client context information. In this file you need to get the user login information and store in a StringWriter (see the file).

               

              Once the data (profile info) is stored here, then you should create appropriate trait and segments for personalizing the content.

              • 4. Re: Client Context customization in CQ5 to personalize the content based on user profile
                MuneeswarReddy Level 1

                Hi Rahul,

                 

                Thanks for the reply and for your suggestions. This helps me to understand the client context customization.

                 

                Here are my actual questions

                 

                1. How to create our own store(session or persisted session store).

                2. How to add/set new properties and their values at runtime.

                3. If we are using our own persisted session store, How can we set the lifetime for the cookie? I do see through API, the default life time for the cookie is 365 days but if want to set my preffered time, how to do that?

                 

                 

                Some how, I can able to solve the first 2 questions but still trying to solve 3 issue. It would be great if you can provide me some info.

                 

                Here is the code snipet for the first 2 questions.

                 

                    var storeName = "new-store";

                    var store = CQ_Analytics.StoreRegistry.getStore(storeName);

                    if ( !store ) {

                         store = CQ_Analytics.PersistedJSONStore.registerNewInstance(storeName, {"industry":"", "loginUser":"test"});

                    }

                    store.setProperty("loginUser", "test");

                    store.setProperty("authorizableId", "xyz");

                    store.setProperty("industry", "construction");

                 

                We have to put this code in the corresponding store init.js.jsp file.

                 

                 

                Thanks

                Muni

                • 5. Re: Client Context customization in CQ5 to personalize the content based on user profile
                  MuneeswarReddy Level 1

                  Hi Sham,

                   

                  Thanks for the reply and for your suggestions. This helps me to understand the client context customization.

                   

                  Here are my actual questions

                   

                  1. How to create our own store(session or persisted session store).

                  2. How to add/set new properties and their values at runtime.

                  3. If we are using our own persisted session store, How can we set the lifetime for the cookie? I do see through API, the default life time for the cookie is 365 days but if I want to set my preffered time, how to do that?  Here my main intention is to customize the persisted cookie.

                   

                   

                  Some how, I can able to solve the first 2 questions but still trying to solve 3 issue. It would be great if you can provide me some info.

                   

                  Here is the code snipet for the first 2 questions.

                   

                      var storeName = "new-store";

                      var store = CQ_Analytics.StoreRegistry.getStore(storeName);

                      if ( !store ) {

                           store = CQ_Analytics.PersistedJSONStore.registerNewInstance(storeName, {"industry":"", "loginUser":"test"});

                      }

                      store.setProperty("loginUser", "test");

                      store.setProperty("authorizableId", "xyz");

                      store.setProperty("industry", "construction");

                   

                  We have to put this code in the corresponding store init.js.jsp file.

                   

                   

                   

                  Thanks

                  Muni

                  • 6. Re: Client Context customization in CQ5 to personalize the content based on user profile
                    Sham HC Level 7

                    Hi Muni,

                     

                    I am not sure if we have any api to configure lifetime for the cookie. Can't you use removeProperty & clear.

                     

                    Thanks,

                    Sham

                    @adobe_sham