Creating a Column Control in Adobe CQ

- Dan Klco

Column Controls in Adobe CQ allow authors to easily create and configure column-based layouts.  This guide shows advanced users and developers how to create and configure a column control.

Step 1: Add a Parsys to a Component JSP

Include a Paragraph System into the page’s component JSP.  You can use any node name for the path, the resource type is ‘foundation/components/parsys’

<cq:includepath="par"resourceType="foundation/components/parsys "/>

Step 2: Configure the Paragraph System

To add a Column Control to the Paragraph System, you will first need to update the design.  Select design mode on the sidekick.

Selecting Design Mode

Selecting Design Mode



Read the complete post on the Six Dimensions blog.

Using XMLBeans in Adobe CQ

- Dan Klco

Apache XMLBeans is a powerful tool for reading, writing and updating XML files.  XMLBeans dynamically creates Java classes based on an XSD Schema.  This makes it powerful and easy to use, however can make it more complicated to integrate into OSGi based applications, such as Adobe CQ, as the XML Element to Java Class mapping uses the Java Classloader.

This guide shows you how to integrate XMLBeans in your Adobe CQ application.




Read the full post on the Six Dimensions blog.

CQ Project Planning: Development Strategy

- TJ Iaciofano

Several questions come up to me consistently while I move from client to client as a technical PM or solution architect. I felt compelled to list my responses to these questions so that you ask yourself the same questions every time you approach a new CQ5 project. MY response questions often lead to longer brainstorming sessions. Here are a few situations.

  • Components
    • Initial Topic:
      • What gets “componentized” versus consumed, integrated or remain separated with regard to CQ5?
    • My Response:
      • How reusable is this functionality?
      • What is the current life-cycle of this development? How frequently is it changed?
      • How modular does this need to be?
      • Will this functionality be replaced by another CQ effort running in parallel?
      • Do authors need to interact with it and set parameters and variables that customize it for that given instance of the function?
      • Would exposing dialogs to CQ authors help the website? or confuse the issue?
      • How complex do they expect the CQ effort to be? Duration? How does it impact project time-lines and time to market?



Read the complete post at the Six Dimensions blog.

Creating OSGi bundles for the Adobe Digital Marketing Suite using CRXDE

- Scott McDonald, Senior Content and Community Lead - Adobe Digital Marketing

You can create an OSGi bundle that can be used within the Adobe Digital Marketing Suite by using CDXDE. An OSGi bundle is essentially a Java module that contains application logic that meets your business requirements. An OSGi bundle lets you dynamically load, unload, configure, and control the Java module without restarting the server. CRXDE is the IDE that lets you develop applications for Adobe CQ (part of the Adobe Digital Marketing Suite).

An OSGi bundle can use third-party JAR files. That is, classes located within a third-party JAR file can be used within an OSGi bundle. To demonstrate how to create an OSGi bindle that uses a third-party JAR file, this development article uses a third-party JAR file and EchoService.jar. This JAR file contains the following basic Java class named EchoService2.

package com.adobe.myexample;
public class EchoService2 {
    public String sayHello(String val){
        return "Echo Service says: " +val ;

Note: Before following along with this development article, install Adobe CQ 5.5 and have it running. Also, ensure that you have CRXDE, which is the development environment. Finally create a JAR file named EchoService.jar and ensure that it contains the EchoService2 class shown above. 

The objective of this article is to demonstrate how to create an Adobe CQ project that uses an OSGi bundle. The OSGi bundle uses the EchoService.jar file and makes use of the EchoService2 class. To create an Adobe CQ project that uses an OSGi bundle, perform the following tasks:

  1. Create an Adobe CQ 5.5 application that contains the page that displays results from the OSGi bundle.
  2. Create a template on which the page component is based.
  3. Create a render component that uses the template.
  4. Create the OSGi bundle that uses the EchoService JAR file.
  5. Modify the JSP to call a Java method defined in the OSGi bundle.
  6. Create a new site that contains a page that displays content from the OSGi bundle.



Read the full post at Scott's Digital Community.

Unit Testing in Adobe/Day/CQ5

- Jochen Toppe

There are a two approaches to effectively test your code in CQ5 – either outside of CQ5 using standard unit tests instantiated from your build tool (i.e. maven). While this approach will cover most simple functionality, the need will quickly arise to execute unit tests within CQ5/Sling/OSGi.

Testing outside of CQ5

In addition to your standard junit tests, you can grab a hold of the CRX repository and start writing some basic tests against that. As you can see in the following example, you ca even wrap the JCR-repository in its Sling equivalent:

package com.jtoee.cq.test;

import org.a~pache.jackrabbit.commons.JcrUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.jcr.Repository;
import javax.jcr.RepositoryException;

public class SimpleTest {
    private Logger log = LoggerFactory.getLogger(SimpleTest.class);

    public void runTest() {
        try {
            log.debug("Connecting to respository");
            Repository repository = JcrUtils.
            SlingRepository slingRepo =
                    new RepositoryUtil.RepositoryWrapper(repository);
            log.debug("Retrieved sling repository");
            // .. do something
        } catch (RepositoryException e) {
            log.debug("Exception retrieving repository.", e);

Testing within CQ5

If you’ve dug into CQ5 a little more, you’ve noticed the the power of the OSGi container and have probably started writing a lot of components (services) and wired them together via dependency injection. Luckily there’s a very easy way to run unit tests directly in the container and even use the OSGi-style dependency injection directly in your test, allowing you not only to write simple unit tests but also more involved automated integration tests.

According to the Apache Sling testing guideline there are a few approaches but I shall only focus on one of them today.



Read the full blog post at this URL.

Integrating the JQuery Framework into DAY CQ

- Scott McDonald

You can integrate the JQuery Framework into DAY CQ (5.4) thereby enabling you to build components that take advantage of the JQuery framework. The JQuery framework is a popular JavaScript library that simplifies the creation of powerful components. For example, you can build components that contain visual effects, data grids that display information, user forms that capture information from end users, and so on. For more information about JQuery, see

The component that is created in this development article renders text and uses a JQuery fade effect. That is, the text becomes visible over a period of five seconds. The objective of this article is not to demonstrate how to create a complex JQeury effect, but rather guide you through the process of creating a CQ page and then how to make use of the JQuery framework.

NOTE: Before following along with this development article, make sure that you install DAY CQ 5.4 and have it running. Also, make sure that you have CRXDE, which is the development environment.

To create a DAY CQ page that uses the JQuery framework, perform the following tasks:

  1. Create a CQ 5.4 application that contains the page that displays the JQuery fade effect. 
  2. Create a template on which the component that uses JQuery is based.
  3. Create a render component that uses the template.
  4. Add the JQuery framework to the component.
  5. Modify the component to use JQuery application logic.
  6. Create a site that contains a page that displays the component that contains a JQuery effect.

Create a CQ 5.4 application

You can create a DAY CQ application that contains templates, components, and pages. Before you create application assets such as templates, components, and pages, you create an application, which is essentially a specific folder structure. You can create this folder by using CRXDE Lite.

The following illustration shows a typical application folder structure  .

Read the full post at this URL.

Escaping xpath queries

node name in xpath query cannot start with numbers:

So, use org.apache.jackrabbit.util.ISO9075 as shown in:

Example xpath servlet (/apps/sandbox/xpath/xpath.jsp):



Read the full blog post at this URL.

Reverse Replication woes

- Sensei Martin

So, in my previous post I said how wonderful FP37434 is (the replication stabilisation FP). Unfortunately, it did not solve our problem and we now have a large volume of content to reverse replicate (~50k nodes in /var/replication/outbox across all our publish servers).

We are currently facing 2 problems. When the RR agent polls, the publish server with FP37434 exhibits a huge native memory leak (approx 8GB of native memory is being claimed) causing a great deal of paging on the system.

When we batch this down to only 10 items in the outbox, we noticed that the author takes 30 minutes to process 10 nodes.

Adding extra logging ( at DEBUG level shows that the Author is doing valid work for 30 minutes processing just 10 nodes from the outbox.



Read the complete post at this URL.

Replication Stablization hotfix

- Sensei Martin

If the flush agent on a publish server stops working, then you probably need cq-5.3.0-featurepack-37434. This featurepack is a nice cumulative one - so no painful installation of dependencies (phew)! And it fixes a LOT of bugs mainly around stabilizing the replication services. We tried installing feature-pack 37434 via CRX package manager but, it broke the instance in that it would just serve up 404 pages. However, following the below procedure, we were able to install the feature pack.



Read the full blog post at this URL.

Improving performance with browser caching

- Sensei Martin

On requests, check that you are using browser caching.

Last-Modified should be set.

Expires should be set (seems to be dynamically set if max-age is set on cache-control). On cache-control - watch out for must-revalidate - this seems to bypass the cache.

This is not good:- Cache-Control max-age=0

This is OK:- Cache-Control max-age=1800, public, must-revalidate

NB, public is to allow caching on SSL links.

This is BEST:- Cache-Control max-age=18000, public

Are the flash files cached?


Read the original blog post at this URL.