5 Replies Latest reply on Dec 21, 2012 1:52 AM by stemau

    Trouble Integrating SiteCatalyst

    Perry H.

      Hello:

       

      We have attempting to integrate SiteCatalyst into our CQ5 deployment.  However, in our SiteCatalyst-enabled pages, we are seeing the following errors through Firebug:

       

      An error occurred at line: 6 in the generated java file
      Only a type can be imported. com.day.cq.analytics.sitecatalyst.util.ResourceHelper resolves to a package

      An error occurred at line: 6 in the jsp file: /libs/cq/personalization/components/clickstreamcloud/plugins/sitecatalyst.jsp
      ResourceHelper cannot be resolved
      3:                     org.apache.sling.api.resource.ValueMap"%>
      4: <%@include file="/libs/foundation/global.jsp"%>
      5: <%
      6: Resource analyticsResource = ResourceHelper.getAnalyticsResource(currentPage);
      7: if (analyticsResource!=null) {      
      8:     String analyticsPath = analyticsResource.getPath().replace("/jcr:content/analytics", "");
      9:     String section;
      </title></head>
          <body>
              <h1>Unable to compile class for JSP:

      An error occurred at line: 6 in the generated java file
      Only a type can be imported. com.day.cq.analytics.sitecatalyst.util.ResourceHelper resolves to a package

      An error occurred at line: 6 in the jsp file: /libs/cq/personalization/components/clickstreamcloud/plugins/sitecatalyst.jsp

       

      Thoughts on what we are missing in enabling SiteCatalyst?

       

      Thank you,

       

      Perry

        • 1. Re: Trouble Integrating SiteCatalyst
          Sham HC Level 7

          Above error indicates either dependency package is not started or installed. Please verify from Felix console all bundles are installed and started. If any of the bundles are not active, you may try starting them manually.

          • 2. Re: Trouble Integrating SiteCatalyst
            Perry H. Level 1

            The Day Communique 5 Analytics (com.day.cq.cq-analytics) bundle is up and started.  Is there a SiteCatalyst-specific bundle?

             

            Perry

            • 3. Re: Trouble Integrating SiteCatalyst
              Sham HC Level 7

              Is it upgraded instance ?  What file do you see under /libs/cq/personalization/components/clickstreamcloud/plugins/ ?

              • 4. Re: Trouble Integrating SiteCatalyst
                RMGJID

                Your getting the above error because ResourceHelper is not longer supported in CQ 5.5. You need to write alternate way to retrieve AnalyticsResource object from a page:

                 

                You may use the below method in your JSP and remove the ResourceHelper.getAnalyticsResource() and just use getAnalyticsResource() by writing the below method in the jsp scriptlet. Let me know if you face any issues.

                 

                public Resource getAnalyticsResource(Page page){

                 

                 

                        Page analyticsPage = page;

                        Resource analyticsResource = null;

                        while(analyticsPage!=null) {

                            if ((analyticsResource = analyticsPage.getContentResource("analytics"))!=null) {

                                break;

                            }

                            analyticsPage = analyticsPage.getParent();

                        }

                        return analyticsResource;

                 

                 

                    }

                • 5. Re: Trouble Integrating SiteCatalyst
                  stemau

                  Hi,

                  we have the same problem with an upgraded instance (5.4 to 5.5). We have two files in this path:

                  /libs/cq/personalization/components/clickstreamcloud/plugins/sitecatalyst.js.jsp

                  /libs/cq/personalization/components/clickstreamcloud/plugins/sitecatalyst.jsp

                   

                  In a clean 5.5 environment there is only

                  /libs/cq/personalization/components/clickstreamcloud/plugins/sitecatalyst.js.jsp

                   

                  So i guess the solution would be to create a filter that will remove /libs/cq/personalization/components/clickstreamcloud/plugins/sitecatalyst.jsp?

                   

                  But this makes me wonder if there are more issues like this. Why do we have legacy content left after the upgrade?