Friday, May 31, 2013

How to configure custom mappings based on run mode?


Scenario: Having a requirement where we need to configure sling mappings based on run mode.

Example: Assume that we’ve three different environments called ‘author’, ‘preprod’ and ‘prod’

When we access http://<hostname>:<port>/projects   It has to redirect to three different urls based on run modes.

In author instance it should be redirected to  /content/test/author.html

In preprod instance it should be redirected to /content/test/preprod.html

In prod instance it should be redirected to /content/test/prod.html


1.  Create different config.<runmode> nodes (of type sling:Folder) inside /apps/system/

Eg:     type    Sling:Folder

config.preprod    type    Sling:Folder         type     Sling:Folder

2.   Create a new node of type Sling:OsgiConfig inside configuration folders.

       node name:

       type:            Sling:OsgiConfig

      2.a:    Add following properties to the node:

          1.  property name:

     type:    String

              value:    /etc/map.<runmode>

2. property name: resource.resolver.manglenamespaces

    type: Boolean

    value: true

3. property name: resource.resolver.default.vanity.redirect.status

    type: Decimal

    value: 302

4. property name:  resource.resolver.mapping

   type: String []

   value: /-/

5. property name:  resource.resolver.searchpath

   type: String []

   value: "/apps","/libs","/apps/foundation/components/primary","/libs/foundation/components/primary"

6. property name: resource.resolver.required.providers

   type: String[]


7. property name: resource.resolver.allowDirect

   type: Boolean

   value: true

8. property name: resource.resolver.virtual

   type: String[]

   value: /:/

3.    Create different map configurations inside /etc.

       In our example, we can create Sling:Folders with following names:


       b.   map.preprod


4.    Create configuration node for sling mapping inside /etc/map.<runmode>

     Eg:      Node name:     test

                 type:     Sling:OsgiConfig

       4.1  Add following properties to the config node

              a.   property name:    sling:match

                    type:    String

                   value:    <Some regular expression/match>

b.    property name: sling:redirect

      type: String

                value: <Some regular expression/match>

5.   Test it..

Whats new in CQ 5.6?

The list of all new features in  CQ 5.6, click here 

Thursday, May 30, 2013

Issue while initiating workflow


Problem: I've deleted 'instances' folder inside /etc/workflow/ directory.  When I initiate the workflow, the folder 'instances' is automatically created under /etc/workflow/ but the workflow is not triggered on the payload.


  • Make sure to delete the instances folder.
  • Save the changes
  • Create a instances node of type sling:folder
  • To the instances node add a property sling:resourceType with value equal to ‘cq/workflow/components/instances’

        Also add property jcr:title Instances

  • Restart the workflow bundle from felix console or restart the instance.

How to provide access to the groups for felix console?


1. Go to http://<hostname>:<port>/system/console/configMgr

2. Edit the configuration called “Apache Sling Web Console Security Provider”

Security Console

3. Add groups names to which you wanted to provide felix access.

4. Save.

How to migrate huge number of assets from one AEM instance to another?


We’ve found following best process:

1. Installed ‘recap’ package (rsync for CRX).

    More Info about Recap:

2. Go to http://<cqhost>:<port>/system/console/components

3. Disable following workflow launcher bundles:



4.  Go to http://<cqhost>:<port>/recap

    Create address , update fields as required and continue.

Note: Enable workflow launchers once the migration is done.

One of the important coding standard for fronted developers to speed up page loading time

Wednesday, May 29, 2013

How To Use Apache Maven to Build and Deploy OSGi Bundles to CQ?

Apache Maven is a successor to Apache Ant and is a key tool for CQ development.  Most of the heavy lifting in CQ is done by Java POJOs built and packaged as OSGi bundles and deployed to Apache Felix, which is CQ’s OSGi runtime framework.

There’s an outstanding 8-part introductory video tutorial series on Maven by Koushik Kothagal on YouTube.  That’s a great place to start to learn about Maven.

Here are the steps to get you set up:

1) If you haven’t done so yet, install and configure a 1.6 JDK.  Instructions here.

2) Download Apache Maven

3) Unzip to a folder.  Eg.  C:\Programs\Apache\Maven

4) Create separate folder for the Maven Repository - separate so that you can update Maven with a newer version without affecting the repo.  Eg. C:\Programs\Apache\Maven\local_repo

5) Configure system environment variables M2_HOME(C:\Programs\Apache\Maven\apache-maven-3.0.4) and M2_REPO(C:\Programs\Apache\Maven\local_repo)

6) Add the /bin folder of Maven to the beginning of the existing system environment variable Path as e.g. %M2_HOME%\bin;

7) Start a command prompt and test whether maven is working.

mvn —version

You should get a response such as this:

Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Programs\Apache\Maven\apache-maven-3.0.4
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Java home: C:\Programs\Java64-6\jre
Default locale: en_US, platform encoding: Cp1252
OS name: “windows 7”, version: “6.1”, arch: “amd64”, family: “windows”

8) Copy the Maven configuration file settings.xml from C:\Programs\Apache\Maven\apache-maven-3.0.4\conf\ to your Windows user profile.  Eg. C:\Users\JAYAN\.m2\

7) Edit settings.xml to configure the local repository.  Eg:


8) Sample Maven settings for Adobe’s public repository is available here.  Also see this from Adobe on integrating Adobe CQ FileVault and Apache Maven.

9) As a next step, see Craig Dickson’s article on the CQ Blueprints Maven Repository, developed by


The Adobe CQ Blog Community

Adobe’s CQ Web Content Management System has a significant blogging community around it.  This attempts to document it.  It will be updated as new information becomes available.




How to set up Run modes in AEM



Run modes allow you to tune your CQ instance for a specific purpose; for example author, publish or development. This is done by defining collections of configuration parameters for each run mode. A basic set is applied for all run modes, additional sets are each tuned to the purpose of your specific environment.

All configuration settings are stored in the one repository and activated by setting the Run Mode.

Standard run modes are:

  • author
  • publish

You can also create environment specific run mode such as,

  • author, development
  • publish, test
  • author, intranet, us or as required...

There are two mechanisms for setting standard and environment specific run mode for your instance:

  • To set up standard run mode Use the naming convention:

For example, set a standard run mode by naming the jar file cq-author-4502 or cq-publish-4503

  • To set up environment specific run mode there are two methods,

Method 1:

Through <cq-installation-dir>/crx-quickstart/config/ Add the following properties (following example is for author, prod, marketing):*/(install|config)?,prod,marketing

In above case will get picked up (Or whatever with maximum match)

Method 2:

Through <cq-installation-dir>/crx-quickstart/config/ and system property (In start script):*/(install|config)?      #<------ In file,prod,marketing #<----- In start script or system property

In above case will get picked up (Or whatever with maximum match)

Configuration values for the run modes are saved in the repository. You can store all configurations in one repository as the run mode is indicated by a suffix on the folder name; for example:

 config, applicable for all run modes, used in author run mode
config.publish, used in publish run mode
config.<standard-run-mode>.<env-specific-mode>, used in the applicable run mode



Customize column control


OOTB provides components related to the  column controls, but If we directly drag and drop the components on to the page, we can't find such number of columns in the column control. Because we need to add styles to define different columns:
Here you go..
Customize column control:
Add the following styles in css:
/* layout 0 : 50% 50%  i.e., two columns wiht 50% , 50%*/
div.cq-colctrl-lt0 { }
div.cq-colctrl-lt0-c0 { width: 340px; margin-right:10px}
div.cq-colctrl-lt0-c1 { width: 340px; margin-left: 10px}
/* layout 1 : 33% 33% 33%  Three columns */
div.cq-colctrl-lt1 { }
div.cq-colctrl-lt1-c0 { width: 220px; margin-right: 10px;}
div.cq-colctrl-lt1-c1 { width: 220px; margin-left: 10px; margin-right: 10px;}
div.cq-colctrl-lt1-c2 { width: 220px; margin-left: 10px; }
Add follwoing colctrl design mode:
2;cq-colctrl-lt0      2 Columns (50%, 50%)
3;cq-colctrl-lt1      3 Columns (33%, 33%, 33%)

so that we can get options for two & three columns.

What Happens when a video is uploaded to DAM?

When a video is uploaded to CQ DAM, the same workflow (“DAM Update Asset”) that kicks in for PDFs (described here) also kicks in.

However, the following two worksteps are specific to video ingestion:

For these to work, ffmpeg needs to be downloaded and installed (CQ does NOT come packaged with it).  See here for instructions.

The workstep “FFmpeg thumnails” uses the built-in process “Create Video Thumbnails”.  It extracts video frames and uses them as thumbnails.  See below:

The ‘Arguments’ count:4,index:2,[140:100],[48:48],[319:319] means that 4 key frames will be extracted (count:4), the third extracted key frame (index:2, 0-based index) will be used to generate 3 thumbnails of dimensions140x100 pixels, 48x48 pixels, and 319x319 pixels.  More documentation on this available here.

The server.log will report all of this.  Example below:

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] **** Exec (info): [C:\Programs\FFMPEG\bin\ffmpeg.exe -i C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7954583360797884766.tmp\IMG_0268.MOV]

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] **** Exec (thumbs): [C:\Programs\FFMPEG\bin\ffmpeg.exe -ss 0.0 -i C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7954583360797884766.tmp\IMG_0268.MOV -vframes 1 -y C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7954583360797884766.tmp\tempthumb.1352590934080.0.jpg]

As you can see, there is disk I/O happening to the folder configured as the Java temp directory.  You can control this with the JVM init argument in CQ’s start.bat.  Example:\CQ_5.5_temp


*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] created 4 thumbnails

The workstep “FFmpeg transcoding” uses the built-in process “Transcode Video” to create additional renditions of the original video.

The arguments profile:firefoxhq,profile:hq,profile:flv means that all the three video profiles defined in CQ will be used. firefoxhq will create a highquality .ogg rendition, hq will create a high quality H.264 (.m4v) rendition andflv will create a low quality (320x240 pixels) Flash Video rendition.  To see these video profiles, navigate to Tools->DAM->Video Profiles (/miscadmin#/etc/dam/video).  See below:

You can edit these video profiles to fit your needs.

I recently shot a 1:26 minute video using a Canon EOS 5D MK III.  Shot in 1920x1080 at 30 frames per second, the file size was 955,114,640 bytes and in the .MOV format.  The video details, as listed by MediaInfo is shown below:

Upon ingestion to CQ DAM, metadata got extracted, thumbnails got generated (140 pixels x 100 pixels, 319x319, and 48x48), and two additional video renditions were generated (OGG and FLV at 320 pixels x 240 pixels).


The OGG rendition was available at /jcr:content/renditions/

The server.log reported this:

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] **** Exec: [C:\Programs\FFMPEG\bin\ffmpeg.exe -i C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7155082853427817219.tmp\IMG_0268.MOV -b 4096k -r 24000/1001 -bt 4069k -acodec libvorbis -ac 2 -ar 44100 -ab 128k -y C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7155082853427817219.tmp\IMG_0268.out.ogg]


The FLV rendition was available at /jcr:content/renditions/  The server.log reported this:

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] processVideo: creating video using profile [flv]

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] **** Exec (info): [C:\Programs\FFMPEG\bin\ffmpeg.exe -i C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7155082853427817219.tmp\IMG_0268.MOV]

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] **** Exec: [C:\Programs\FFMPEG\bin\ffmpeg.exe -i C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7155082853427817219.tmp\IMG_0268.MOV -s 320x240 -b 200k -r 12 -acodec libmp3lame -ac 1 -ar 22050 -ab 56k -y C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam7155082853427817219.tmp\IMG_0268.out.flv]


The H.264 rendition failed with the following error messages:

*INFO* [Thread-85] FFMPEG Exec: Unrecognized option ‘directpred’

*INFO* [Thread-85] FFMPEG Exec: Failed to set value ‘3’ for option ‘directpred’

*ERROR* [JobHandler: /etc/workflow/instances/2012-11-10/model_788493259155:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] Process exited with an error: 1(Exit value: 1) Process exited with an error: 1(Exit value: 1)

To fix this, remove the custom ffmpeg arguments for the H.264 video profile, and set the audio codec as alac, as described here.


The M4V rendition will be available at /jcr:content/renditions/  The server.log will report this:

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_8772044570710:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] processVideo: creating video using profile [hq]

*INFO* [JobHandler: /etc/workflow/instances/2012-11-10/model_8772044570710:/content/dam/s7/IMG_0268.MOV/jcr:content/renditions/original] **** Exec (pass1): [C:\Programs\FFMPEG\bin\ffmpeg.exe -i C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam3621509705265785387.tmp\IMG_0268.MOV -b 6144k -r 24000/1001 -bt 8192k -vcodec libx264 -acodec alac -ac 2 -ar 44100 -ab 128k -y -pass 1 C:\Programs\Adobe\CQ_5.5\author\java_io_tmpdir\cqdam3621509705265785387.tmp\IMG_0268.out.m4v]

If everything is successful, the following JCR structure will be created (3 thumbnails, 3 video renditions + original video).

The metadata JCR node contained multiple properties, representing the metadata extracted from the original video:


API differences b/t CQ5.5 & 5.6


While developing workflows in AEM 5.6, please keep in mind that* has been updated with com.adobe.granite.workflows.*

Note: Still API works in AEM 5.6 but you will face some issue with it..

Example: Participant step will not avail in participant chooser step in the workflow model.


How to Efficiently Copy Large Amounts of Content Between CQ Repositories?

There are multiple options available in CQ to move content from one CQ instance to another.  These include “replication” (author->publish), create package->export->install elsewhere, VLT rcp command line and recap.

The File Vault (vlt) tool has a Remote Copy (rcp) option as well - one that is especially useful if you are moving GB or TB of digital assets (JCR node type dam:Asset) from DEV to STAGING to PRODUCTION.  Run all renditions workflows once on a very powerful DEV machine with large numbers of CPU cores and high throughput local storage.  Once done, perform vlt rcp to STAGING and PRODUCTION environments after turning off renditions workflows on those.

Since it streams data between online repositories, it does not use the Durbopackaging used by replication.  Tests by Adobe Performance Architect Gardner Buchanan shows that this is more storage efficient and avoids storage bloat (2:1 in the case of replication).

Gardner also recommends running multiple instances of vlt rcp against separate source tree structures to parallelize the whole operation.  To avoid unnecessary network traffic, run vlt rcp on one of the participant instances, not on a remote, third instance.

Also, tests indicate that the default batch size of 1000 should be reduced to 100 for better throughput.

Assuming that vlt is set up and configured, the following command will copy a large content tree at /content/dam/JJK-Folder-1 on one CQ “author” instance to another “author” instance.  In this case, both are running on the local machine but they can be remote.  Also, both don’t have to be in the same run mode.  Content can be remote copied from an “author” instance to a “publish instance.

vlt rcp -b 100 -r -u -n http://admin:admin@localhost:4502/crx/-/jcr:root/content/dam/JJK-Folder-1 http://admin:admin@localhost:4503/crx/-/jcr:root/content/dam/JJK-Folder-1

A test with 1,000 (1 MB) 1680 x 1050 JPG images copied 20,304 (dam:Asset) nodes (2,690,706,251 bytes) in 573,117 milliseconds - a throughput of 36 JCR nodes/second or 16 GB/hr.

In another test, I copied 44,802 (cq:Page) nodes (5,017,126 bytes) in 461,925 ms - that is a throughput of 97 JCR nodes/second or 37 MB/hr.

The process is differential, meaning only changed nodes are actually copied.  However, each and every source JCR node needs to be checked against each and every destination JCR node.


How to get a Resource object when we have node path?

In Java:
private ResourceResolverFactory resourceResolverFactory;
ResourceResolver resolver=null;
resolver = resourceResolverFactory.getAdministrativeResourceResolver(null);
Resource res=null;
res= resolver.getResource("PATH");

Resource res= resourceResolver.getResource("PATH");

How to get a Node, Get node property, Add/Update node property:
Node node = res.adaptTo(Node.class);

Get property:
String prop= node.getProperty("Prop_name").getValue().getString();
String prop = node.setProperty("Prop_name","Value");
Note: Don't forget to save the session when the node is updated.

Update Node using PersistableValueMap:
Resource resource = resolver.getResource("Node Path");
if(resource !=null)
PersistableValueMap valueMap= resource.adaptTo(PersistableValueMap.class);

How to get a JackRabbit session in the Workflow:
final JackrabbitSession jackrabbitSession = (JackrabbitSession) wfsession.getSession();
UserManager userManager = jackrabbitSession.getUserManager();

Difference between jsp include, cq include and sling include

Refer these links:

  • When developing AEM components, Adobe recommends that you use <cq:include>.

  • <cq:include> allows you to directly include script files by their name when using the script attribute. This takes component and resource type inheritance into account, and is often simpler than strict adherence to Sling's script resolution using selectors and extensions.

Difference between Dialog and Design_Dialog

The Dialog is a special kind of window with a form in the body and a button group in the footer. It is typically used to edit content, but can also just display information.

    design_dialog (nt:unstructured) -specifies the design editing options for this component.
1. How to retrieve values read from dialog (widget) to jsp?
Sol: String var= properties.get("<name of widget>","");
2. How to retrieve values from design_dialog to jsp?
Sol: String var= currentStyle.get("<name of widget>","");

How to get NODE properties?

Below is the sample code :

<%@page import="javax.jcr.Session,javax.jcr.Node,,,,"
     //Node node;
    Session session = slingRequest.getResourceResolver().adaptTo(Session.class);
    TagManager tagManager =   sling.getService(JcrTagManagerFactory.class).getTagManager(session);
    Tag tag = tagManager.resolve("/apps/webexample_siva/components/content/contact");
    //specify the path which you want to get
    Node node = tag.adaptTo(Node.class);
    String name= node.getName();
//Iterate node properties and displays node property name and value
     for(PropertyIterator propeIterator = node.getProperties() ; propeIterator.hasNext();)
         Property prop= propeIterator.nextProperty();
             <%=prop.getName() %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=prop.getString() %> <br />

How to retrieve configuration details in jsp/class

    ConfigurationAdmin configAdmin;
Configuration config = configAdmin.getConfiguration("");
Dictionary<?, ?> d = config.getProperties();
log.debug("Configurations Dictionary:{}"+d);
String hostName= (String) d.get("");

Configuring Email Notification

In order to send email from CQ, the Day CQ Mail Service needs to be configured properly.
Procedure: 1. Go to felix web console (http://<host-name>:<port>/system/console/configMgr)
2. Search for Day CQ Mail Service
3. Edit and configure as follows:
a.  The SMTP server port must be 25 or higher.
b.  The SMTP server host name must not be blank.
c.  The "From" address must not be blank. 
Screen shot:

Simple code to send an email
There are difference ways to send an email.
Method 1: Using SimpleEmail
        SimpleEmail email = new SimpleEmail();
email.addTo("", "John Doe");
email.setFrom("", "Me");
        email.setSubject("Test message");
        email.setMsg("This is a simple test of commons-email");
Method 2: Using HtmlEmail without using MessageGateway
        HtmlEmail email = new HtmlEmail();
        email.addTo("", "John Doe");
        email.setFrom("", "Me");
        email.setSubject("Test email with inline image");
        // set the html message //
        email.setHtmlMsg("<html>The apache logo - <img src=\"cid:"
        // set the alternative message
        email.setTextMsg("Your email client does not support HTML messages");
Note: We can also read smtp details from the felix console configurations instead of passing smtp details directly.

Participant step is NOT shown in the workflow participant step dropdown list + AEM 5.6

Issue: Wrote a custom participant in AEM 5.6. When I go to workflow model/participant step, the custom participant is not listed in the participant chooser drop down list.
participant issue

Fix:  update API
Use com.adobe.granite.workflow.* instead*

Workflows Issue with AEM5.6 + JAVA 1.7


Issue: Workflow Process implementation is not found.


02.05.2013 11:25:23.305 *ERROR* [JobHandler: /etc/workflow/instances/2013-05-02/model_79635435153979:/content/test 1] com.adobe.granite.workflow.core.job.JobHandler Process implementation not found: com.test.workflowtest.Test com.adobe.granite.workflow.WorkflowException: Process implementation not found: com.test.workflowtest.Test

          at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(Handle

          at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.jav a:139)


          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$ Source)

          at Source)



Add -XX:-UseSplitVerifier option to the JVM

Example, if you’re starting AEM using start.bat, then you need to update JVM options in start.bat file.

::* default JVM options
if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true -XX:-UseSplitVerifier

How to Convert a jar File into an OSGi Bundle?

Refer this link:

How to find out CURL command for any CQ operation?

  1. Use FireFox, open the FireBug
  2. Click on “Net” tab in FireBug, click “Enable”
  3. Perform CQ operation. For ex: Felix->JMX->com.adobe.granite.ldap->syncUser->enter user string. Ex: CN=Manoj Miryala,OU=ParkRidge,OU=User and Group Accounts,DC=us,DC=ad,DC=hertz,DC=com
  4. Click “invoke”
  5. In FireBug, you will see the whole request URL when you point the mouse on top of “POST java.lang.String” shown below. Copy that along with parameters from “Post” tab under it.
  6. clip_image002
  7. Post tab shows you the parameters that you need to pass to the CURL command.
  8. clip_image004
  9. Example curl command for JMX’s Syncuser operation is as follows

curl -d "user=CN=Manoj Miryala,OU=ParkRidge,OU=User and Group Accounts,DC=us,DC=ad,DC=hertz,DC=com" --user admin:admin http://hertz614:5402/system/console/jmx/com.adobe.granite.ldap%3Ahost%3DHertz00.US.AD.HERTZ.COM%2Cport%3D389%2Ctype%3DTools/op/syncUser/java.lang.String --trace-ascii debugdump.txt

Conclusion: The same procedure can be done to find out the exact URL for the request with parameters and then use CURL to perform the same operation. This is very useful to automate CQ operations.

GET and POST operations using CURL

  1. To create a property of a new node or modify the existing node, use the below,

curl -u admin:admin -F"text=modified Hello World" http://localhost:4502/content/sample

  1. To read a property of a node, use the below. Here /content/sample is the node and text is the property.

curl -u admin:admin -G http://localhost:4502/content/sample/text

How to use JMX console with AEM?

1. Change <crx-quickstart>/opt/helpers/instsrv.bat file with the following:

set jvm_mx=2048m( Default value is 1024)


2. Reinstall CQ windows service by running commands instsrv.bat -uninstall CQ55, instsrv.bat CQ55 and start CQ

3. Go to Command prompt, type “jconsole”. Select “Remote Process” radio button and enter “localhost:9010” and click “Connect”.

How to stop default Email Notifications?

1. Go to /system/console/configMgr

Eg: http://<hostname>:<port>/system/console/configMgr

2. Edit the configuration called 'Day CQ workflow Email Notification Service'

3. Disable 'Notify on Abort' and 'Notify on Complete' options.

DAM asset upload guidelines

Q:Is it good a have a folder/Asset name contains spaces.

Ans: It is not recommended to name folders/files with spaces in it. - and _ are the only special characters that are recommended.

Q:What is the max size limit of an Asset?

Ans: 10 to 30 MB size is recommended, but there is no limit to the size, in general.

Q: What is the maximum number of Assets that can be uploaded in a folder?

Ans: Adobe recommends not more than 200 to 250 at one level. The more the number of assets, the slower that AEM/DAM UI will load.

Note: Following approach is recommended when we have too many ( i.e., >250) Assets in a single dam folder:

1. Categorized the assets if possible lets say based upon your business areas or anything similar. Based on that create your high level of folders in DAM.

2. Now under all these folders create sub folders hierarchy like a, aa, ab ac... and b, ba, bb, bc ... and c, ca, cb, cc and after some level of depth store your assets which makes each folder to have assets in between 100-200.


DAM Structure.png

Q:What is the recommendation for DAM structure

A: Here is a typical structure of DAM assets <WEBSITE>


Ex: enUS
         <SECTION> EX: specialoffers
             <Subsections> Ex: banners, logos, misc etc.,

Don’t like new AEM 5.6 Touch based UI?

There is a way to set your own GUI(old or new). Follow this link and configure “Day Root Mapping” in Felix as explained here

Setting up WEBDAV on Windows vista,7 clients

WebDav can be configured on Windows vista and 7 operating systems, but there is a registry change that is required. Personally, I don’t feel comfortable changing any thing in the Windows registry. To avoid that, I usually use some of the open source tools such as “BitKinex” or “NetDrive”.

  1. How to configure WEBDAV on Windows vista, 7 or any other, follow this link.
  2. NetDrive can be downloaded here
  3. image
  4. BitKinex can be downloaded here. Follow the below steps to access AEM/CRX.
    • Configure your AEM instance's connection parameters by using "File->Quick Connect". URL: http://localhost:7402/crx/repository/crx.default
    • Go to "Datasource->Properties->Server->SiteMap", select Directory(WebDAV-complaint) from the dropdown "The Location Specifics" and click "OK"
    • It would show the CRX folders/files

Some of the COMMON CURL commands to work with AEM

  • Build a AEM/CRX package: curl -u admin:admin -X POST http://localhost:5502/crx/packmgr/service/.json/etc/packages/my_packages/
  • Download a package: curl -C - -O -u admin:admin http://localhost:5502/etc/packages/my_packages/
  • Delete all packages after a certain date: See [this]
  • How to change all AEM passwords: See [this]
  • How to run online backup / Datastore GC / Tar Optimization using curl in AEM 5.5: See [this]
  • How to use CURL command to find pending and blocking job in the replication Queue in AEM 5.4 / WEM: See [this]
  • How to flush Cache using Curl Command: See [this]
  • How to create encoded password that you can use for curl in CQ/WEM: see [this]
  • How to do user management using POST API / CURL in AEM 5.5: see [this]
  • How to change Admin password in AEM5.5: see [this]
  • How to reduce downtime for consistency check and fix AEM5.4 / WEM: See [this]
  • How to transfer file from one CRX to other modified after certain date using CURL in AEM / WEM / CRX: see [this]

Since Apache Sling makes sure that all “activated” (published) CQ DAM assets have URIs, you can programmatically download DAM content with a command line HTTP utility such as cURL.  cURL also lets you include these commands in a Windows batch or PowerShell script.

c:\Programs\cURL>curl > C:\TEMP\manual.pdf

Many administrative and maintenance operations can also be remotely executed on both the “author” and “publish” CQ instances if you had Administrator (“admin”) credentials.

1) Create a folder in /apps called myFolder:

c:\Programs\cURL>curl -u admin:admin -Fjcr:primaryType=sling:Folder http://localhost:4502/content/dam/myFolder

2) Copy the folder /content/dam/geometrixx/icons/ (and its contents) to /content/dam/myFolder

c:\Programs\cURL>curl -u admin:admin -F:operation=copy -F:dest=/content/dam/myFolder/ http://localhost:4502/content/dam/geometrixx/icons/

3) Backup the CQ instance to the server filesystem (/content/BACKUP/  For example, if the CQ author instance is at C:\Programs\Adobe\CQ_5.5\author, then the backup will be made to C:\Programs\Adobe\CQ_5.5\BACKUP\

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository/op/startBackup/java.lang.String?target=/BACKUP/

CURL client for Windows

Download CURL for win32 [here] Note: Search for Win32 - Generic for 32 bit and Win64 - No SSL for 64 bit operating system

Curl plug-in for Eclipse: It can be downloaded from [here]

How Thumbnail images are generated by AEM and configuration files to modify the OOTB behavior?

The thumbnail renditions are generated by DAM update workflow when an image is uploaded to DAM. Out of the box, the image(s) shown in content finder has two views.
    1. Mosaic View:  Uses the rendition 100 *140
    2. List View:        Uses the rendition 48*48

The renditions are configured in ContentFinderTab.js which is located at /libs/cq/ui/widgets/source/widgets/wcm/ContentFinderTab.js.

Example screen shot for changing Mosaic view for particular rendition.

To customize Mosaic view for particular rendition, you can do it by overlying ContentFinderTab.js. i.e. Create the ContentFinderTab.js under /apps/cq/ui/widgets/source/widgets/wcm/ and modify it as required.

Friday, May 24, 2013

How to find out if AEM or CQ instance is secure or not?

1.  Download the below package from package share and install it in CQ instance.

2.  URL to get to the secure screen: http://localhost:4502/etc/securecq.html


rsync for AEM

Recap is a package built by Mark Adamcin. This is one of the award winning pacakges in the contest. It can be downloaded from Adobe package share or from here.


Steps to find out implementation of a CQ Node

(i) Looking for the implementation of a Node

To know the implementation or how to implement certain nodes For Example: cq:actionConfigs, Go to CRX -> Search -> type the following red text in the query (CRXDE lite).

/jcr:root/libs//element(cq:actionConfigs, nt:base)

When u want to see the implementation for a different node, just change the node name in the query

/jcr:root/libs//element(NODE NAME, nt:base)

How can CURL be used to perform GET and POST operations in CQ?

1. To create a property of a new node or modify the existing node, use the below,

curl -u admin:admin -F"text=modified Hello World" http://localhost:4502/content/sample

2. To read a property of a node, use the below. Here /content/sample is the node and text is the property.

curl -u admin:admin -G http://localhost:4502/content/sample/text

How to enable workflow on a folder?

1. Go to /libs/wcm/core/content/damadmin/actions/workflow
2. Edit the property "conditions" and delete "CQ.wcm.SiteAdmin.noFolder" from the arraylist.

How to enable Lock/Unlock features for DAM?

Navigate to ‘/libs/wcm/core/content/damadmin/actions/lock’ or unlock using CRXDE or DE lite, change the properties: disabled=false and add toolbar, _contextmenu to context property.


How to find members of a group in CQ?

Issue the below command in your favorite browser to see the members of administrators group. You can change ‘administrators’ to what ever the group name you want to.


How to enable JMX console with CQ?

1. Change <crx-quickstart>/opt/helpers/instsrv.bat file with the following:

set jvm_mx=2048m( Default value is 1024)


2. Reinstall CQ windows service by running commands instsrv.bat -uninstall CQ55, instsrv.bat CQ55 and start CQ

3. Go to Command prompt, type “jconsole”. Select “Remote Process” radio button and enter “localhost:9010” and click “Connect”.

Setup developer machine with Eclipse for a new CQ project

1) Follow the steps here

2) To be able to build maven module projects with out any errors, you need to add the below to the “Parent” maven project’s pom.xml


















<ignore />













<ignore />













<ignore />







3) Change settings.xml to use nexus as dependency manager.

4) Add Adobe maven repository to nexus and CQ Blueprints repository to nexus by following the URLs: and

5) Once all is done, you can run one of the module project as directed in the documentation with Goal as “auto-deploy”

My HUGE list of AEM bookmarks



Knowledge Base - How to use CQ5 as maven repository
M2Eclipse book
Managing CQ/CRX Packages Using Maven
Maven Public Repository - check versions
Maven: CRX Plugin automating deployments of CRX/CQ based applications | Cognifide Blog
Maven: The Complete Reference: Table of Contents / Documentation
Sonatype Nexus
Using Nexus as a Maven Repository for CQ Team Development (Blue Prints.Using Nexus as a Maven Repository for CQ Team Development) - XWiki
Managing Packages Using Maven
The CQ Project Maven Archetype (Blue Prints.The CQ Project Maven Archetype) - XWiki
How To Use Apache Maven to Build and Deploy OSGi Bundles to CQ



CQ blog - provision
CQ Blog 11
CQ Blog 12 by Jayan
CQ Blog 13
CQ Blog 14
CQ blogs 10
CQ blogs 3
CQ blogs 4
CQ blogs 5
CQ blogs 6
CQ blogs 7
CQ blogs 8
CQ blogs 9
CQ Useful blogs
CQ useful blogs 2
CQ Developer Support



Administration - Adding a new dialect in CQ(language) 2
Administration - Adding new Dialect(language) in CQ
Administration - Backing up CQ authoring servers with no downtime
Administration - CLT tools for CQ5
Administration - Configuring Email Notification
Administration - Customizing the DAM Console columns
Administration - Determine the right CRX bundle cache size for your application
Administration - Disk space growing on the CQ author server?
Administration - Event Handling in CQ
Administration - Groovy and JMX
Administration - Groovy web console for Adobe CQ5 and JCR
Administration - Groovy with JCR
Administration - Groovy with JCR 2
Administration - How to add a custom Login Module in CQ5.5
Administration - How to allow only certain IP address to connect to author instance
Administration - How to change all password using curl in CQ / WEM (Till CQ5.4)
Administration - How to delete Versions in CRX
Administration - How to find long running queries
Administration - How to install CRX packages automatically on server startup
Administration - How to Remove .html extension from URL in CQ
Administration - How to remove lock files in CQ / WEM
Administration - How to remove version history in CQ / WEM
Administration - How to upload an image via Sling POST servlet
Administration - How to use vlt tool to copy data from one CRX to other CRX
Administration - How to write CQ / WEM init script for Linux
Administration - Monitoring Server Resources Using the JMX Console
Administration - Page Activity Report
Administration -Monitoring events in an automated fashion
Clustering - How to fix Out Of sync cluster issue CQ / CRX / WEM / ADEP
Clustering - How to rotate TarJournal in Shared Nothing Clustering
Configuring Undo for Page Editing
CQ 55 Platform Architecture Refurbish
CQ GUI - How to use and debug CQ Client Library
Curl - create pages
Curl - How to do user management using POST API / CURL in CQ5.5
Curl - How to manage bundle using curl command
Curl Commands - create encoded password
Curl-online backup / Datastore GC / Tar Optimization using curl in CQ5.5
DAM - Extending CQ DAM Search
DAM - Integrating FFmpeg
CQ5 util classes
XSS Cheat Sheet
How to Perform System Clean Up in Adobe CQ / AEM
Adding a custom tab to Content Finder
Root Mapping-projects(new UI) or OLD UI
Development - Accessing repository programmatically
Development - Adding a custom tab to Content Finder
Development - Annotation in custom components
Development - API Differences between CQ 5.4 and CQ 5.5
Development - Basic CQ5 code examples
Development - Building and Deploying OSGi Bundles
Development - Connecting to SQL Databases
Development - content finder customization
Development - CQ API vs CRX API vs JCR API
Development - CQ Developer Tricks
Development - CQ5 Exercise for Starters
Development - Creating custom CQ email services
Development - Creating multiple pages in one REST call
Development - Creating version using PageManager
Development - CRX/JCR Tools
Development - Default servlet VS Script resolution
Development - Defaults in your CQ5 component
Development - Deploying 3rd Party Libraries
Development - Developing CQ components | Best practices
Development - Developing For CQ5 With IntelliJ IDEA 11
Development - Developing REST Web Services Tutorial
Development - Developing with Eclipse
Development - Email Component
Development - Externalizing URLs
Development - Getting to Know the Externalizer
Development - How can I configure the PDF rewriter
Development - How to find all the pages modified or activated after certain time
Development - How to get default components in your parsys
Development - how to make sure Links on a page are valid
Development - How to read an external file in CQ
Development - How to use SVN with VLT in CQ / WEM
Development - InheritanceValueMap
Development - Integrating custom CQ widgets with third-party libraries
Development - Integrating JQuery with CQ
Development - Integrating MSSQL DB with CQ
Development - JSON for whole CQ page
Development - Load test on CQ Author using ToughDay
Development - Run Modes set up in CQ
Development - Run Modes set up in CQ
Development - source code syntax highlighting
Development - The Page Exporter
Development - Tips and Tricks from the CQ Community
Development-Eclipse plugins for CQ/CRX
Disable/enable DAM Media Handlers in workflows
Dispatcher - How to flush Cache using Curl Command
Dispatcher - How to set up dynamic flushing based on path in CQ
Geometrixx - How to remove Geometrixx from CQ5.4 / WEM
How to create package based on Xpath in CQ5 / WEM
http and https version of site in CQ
Installation - How to clone publish server
Installation - Sanity checks for Adobe CQ5 installations
Integrating Services with the JMX Console
JMX - Custom Class in JMX
Migration - Migration tasks
OSGi Sling Service Example
OSGi- The Dynamic Module System for Java
Packages - How to delete packages created before certain date from package manager using curl in CQ / WEM
Purge workflows
Replication - FTP CQ Content using Static Agent
Replication - How to clear replication queue in CQ / WEM
Replication - How to stop CQ to retry replication queue in CQ / WEM
Replication - How to use CURL command to find pending and blocking job in the replication Queue in CQ5.4 / WEM
Replication - Logging CQ replication activate, deactivate, delete operations
Replication - Monitoring Replication Queue Status in an automated fashion « Experience Delivers
REST with Java (JAX-RS) using Jersey - Tutorial
Search- How to rebuild index in CQ5 / WEM
Send Email step in the workflow
Setting up FileVault auto Sync
SiteCatalyst Documentation
SiteCatalyst documentation 2
Social Plugins
TarPM - How to truncate and interpret Tar File in CQ / WEM
TarPM-How to improve Tar Optimization and Indexing process
Timewarp feature in CQ - simulate state of a page at specific time in the past
Translations - How to add a supported language to the CQ / WEM
Translations - How to use multi language translation in JSP in CQ / WEM
Translator - cq5
Unit Testing in cq
Unit testing the Email notification
Users/Groups - How to add ACL to a node
Users/Groups - How to check if some one has replication rights for a path in CQ5 / WEM
Users/Groups - Migration Of ACLs via Package Manager
Users/Groups - Synchronize User with LDAP - manual and automate
Using Components as Boilerplates
Using XMLBeans in Adobe CQ
Webinars from Adobe
Workflow - Show/Hide wfs in the sidekick
Development - Extending CQ Analytics
Administration - Limit access to specific pages in Publish
Administration - How to define a repository based configuration for a specific instance only
Development - How to add a custom page extension
Development - How To Integrate a SOAP Web-Service Toolkit with Adobe CQ » Sean Steimer
Development - Web Services
Development - Apache CXF Web Services
Development - Web Services - CXF and OSGi with CQ5
Development - Serving Static Assets from an Alternate URL (Blue Prints.Serving Static Assets from an Alternate URL
Administration - Akamai or CDN Cache Flush Service (Blue Prints.Cache Flush Service)
CURL- how to use CURL with SLING
OSGI - Dumping all OSGI configuration to a text file or zip
CQ - Obtaining Page information/metadata in JSON Format
Administration - manually invalidating dispatcher cache
Development - CQ5 Translator/dictionary service
Curl - Curl for packages
Administration - Grant access to OSGi-console to other users « Experience Delivers
Development - How to find the runmodes of a CQ5 instance « Experience Delivers
CURL - REST API Guide for Workflows
Development: How to Debug a CQ5 App Using Eclipse
Administration: Performance Tuning Tips
Administration: CQ Site Admin actions
Administration: How to clone an existing CQ instance
Workflow: Configuring participant e-mail notification.
Administration: How to hide CMS Console Buttons on welcome page
Admin - Create a custom log file
Admin - How to disable WebDAV access
Administration - How to configure the dispatcher in front of an authoring environment
Administration - How to manage Hot backup Or Manage Disaster Recovery in CQ
Administration - How to set up run mode
Development - Creating custom CQ email services
Adobe CQ/Adobe WEM: How to change package install behavior in CQ / WEM
How to specify multiple email recipients in CQ email templates? | Content Management
Using Dispatcher with Multiple Domains
Administration - Improving CQ performance
Administration - Troubleshoot Dispatcher flushing issues
Administration - A lot of notes about Dispatcher
Administration: How to manage Hot backup Or Manage Disaster Recovery in CQ
Administration: How to implement CQ scheduler to run on a event
Administration - How to Configure the CQ Dispatcher Flush Agent on a Publish Instance
Development - Custom Reports
Development - Handling File Upload
Clustering - advacned Q&A
Disaster recovery using Clustering
Using Dispatcher with Multiple Domains
How to Secure Communication between the Dispatcher and CQ
Sling Resource Resolver
How to exclude certain paths of content from being indexed
How to modify the search index configurations in CQ5
How to optimize lucene index to gain diskspace and efficiency
How to use 'Boosts' at Indexing Time and at Query Runtime
Performance Tuning Tips by changing CRX Search cacheSize param
maintenance mode in CQ
Recommended Sequence of CQ Maintenance Operations
How to Get Command Shell Access to CQ's JCR Repository
Search Queries to Determine the Size of CQ's Repository
An FFMPEG Primer for CQ on Windows (64-bit)
Windows PowerShell Script to Programmatically Create 100s of CQ Users
How to Query CQ's JCR with SQL or XPath
How to Use CQ's Query Debugger Tool
The Clay Tablet Adobe CQ Translation Connector
Administration: How to Create Custom Authentication Handler for Custom Login
Development: How to Integrate 3rd party Jar file in CQ / WEM
Development:How to Convert a jar File into an OSGi Bundle
Administration: Custom Login Modules
Administration: How to add a custom Login Module
Custom Replication Event Listener
Clay Tablet Adobe CQ Translation Connector
Administration-How to Configure CQ Backup to Output the crx-quickstart Files Rather Than a Zip
Administration-How to Efficiently Copy Large Amounts of Content Between CQ Repositories
Administration- Hiding workflows in SideKick
Read/Write content node(s) or files from/into the CRX repository
CQ:include vs JSP include vs Sling:include
Security Checklist: changing the default passwords
jsp:include request/response diagram
jsp:forward request/response flow
Recap - rsync for CQ/AEM
How to Synchronize User with LDAP
Creating Adobe CQ bundles that consume web services
How to install CRX packages automatically on server startup
checkstyle - coding standard tool
CQ5 Bookmarks
CQ5 | Widgets API
Overview (TLDDoc Generated Documentation)
CQ Toggle
Monitoring Diskspace and Memory Usage -
CQ Security Checklist
What is the difference between c:import, sling:include, and cq:include?
Content Compare and Import tool


Adobe download licensing site
Daycare - Support Portal
DigitalPulse Debugger for SiteCatalyst
Adobe Nexus repo
Adobe Forums: CQ5
Knowledge Base articles - Administration
Adobe CQ5 Certification
All CQ Blogs
Package share - new


Micro CMS - custom CMS on CRX
CRX - CRX through HTTP/REST calls
CRX - How to use RMI to connect CRX from an external application