Archive for April, 2012

h1

Undo/Redo in Adobe CQ5.5 – What You Need to Know

April 30, 2012

CQ5.5 comes with a new undo/redo feature for page editing. You are now able to undo/redo any change that you made to a page. It’s a great new feature that however also comes with a bit of a learning curve if you want to use it correctly in your CQ project.

Any new component you write needs to be tested for undo/redo. Once tested and your satisfied it works correctly, you need to add your component to the whitelist of undo/redo components, otherwise a nasty popup will show up everytime somebody hits ctrl-z to undo any changes. To add your component to the whitelist, go to

http://localhost:4502/crx/de/index.jsp#/crx.default/jcr%3aroot/libs/wcm/core/config.author/com.day.cq.wcm.undo.UndoConfig

You’ll find a property cq.wcm.undo.whitelist, add your component to this list to make the message go away. Unfortunately, this is the only place to set this setting and may cause problems in the future when you upgrade CQ since everything in /libs may be overwritten by a hotfix.

Undo/Redo information for any text is stored in the browser either on the window or in a cookie, however, if you change an image, the information is stored in /var/undo. This only works if you have sufficient rights to store data in this location, by default, this is only granted to administrators, so regular users may not be able to undo/redo changes on images withing CQ. Also note, this may fill up the repository quickly since a copy of the image is stored in that location.

Undo/Redo can also be dangerous if multiple people work on the same page at any given time. There is no mechanism to make sure multiple users do not step on each other when making changes. Now with undo/redo, you can make large changes quickly and you may therefore alter a page in a way that you did not intend if there are other modifications from other users. You can turn undo/redo off altogether by setting the cq.wcm.undo.enabled property to false.

If you’re users don’t like the flashy style of CQ to show you what has been undone on a page, you can set the cq.wcm.undo.markermode property to select instead. This will just select the component that has been undone instead.

For more information about the undo/redo service please consult http://dev.day.com/docs/en/cq/current/administering/config_undo.html

Advertisements
h1

Using ticktick.sh to parse Json Responses from Adobe CQ5.5

April 24, 2012

ticktick.sh is a great little shell library that allows you to parse json responses from Adobe CQ. The following script is a simple example that pulls the current status of the installed, active and resolved bundles from the Felix System Console in Adobe CQ and presents the output. This can be used for example to check if the server is up and running. To use, download ticktick.sh, put it in the same folder as this script and run it.

The supported arguments are the credentials (admin:admin) and the url to the server root (http://localhost:4502).  You should see a nice pink status line with the information on how many bundles are active, resolved and installed as well as an error code of  zero if the server is up and a -1 if the server is still starting up.

curl -s -u $1 $2/system/console > /dev/null
if [ $? != 0 ]; then
	echo admin console on $2 not running
	exit -1
fi

. ./ticktick.sh

DATA=`curl -s -u $1 $2/system/console/bundles/.json`

tickParse "$DATA"

#echo ``status``
#echo current status total bundles: ``s[0]``, installed bundles: ``s[1]``, installed fragments ``s[2]``, bundles resolved ``s[3]``, bundles installed ``s[4]``

if [ ``s[4]`` = 0 ]; then

	echo ``status``: server fully up
	exit 0
else
	echo -e "33[2A33[35m"
	echo -n ``status``: server still activating bundles
	echo -e "33[K33[0m"
	exit -1
fi
h1

Developing the style and templates/components in parallel for Adobe CQ5

April 10, 2012

In order to speed up development of a site within CQ5, it helps adopting the following process:

  •  Devise templates and components for the site based on mockups
  •  Implement a standard HTML for all templates and components
  •  Develop the components necessary
  •  Develop CSS/JS necessary to support the components

Using this approach, the front end team can develop the CSS/JS necessary for the site in parallel with the developers implementing the components and templates for CQ5. Instead of using a waterfall model where the front end team develops the basic HTML structure first and then provides the code to the CQ5 developers, this approach makes sure the CSS/JS works well within Adobe CQ.

To further minimize the risk of browser incompatibilities and to make sure the site will also look good on mobile devices from the start, it helps adopting a basic CSS/JS framework, commonly known as grid systems.

Some grid systems to consider are:

The grid systems have a well known html structure and features such as reflow that help on smaller screens. Developing your components with a grid system in mind will also make sure the developed components can be reused in the future with a different stylesheet and make your CQ5 projects faster to implement and easier to adopt to a new site style and new features provided by the grid system.

The Adobe CQ5.5 version uses 960gs for the default geometrixx site, however, choosing twitter bootstrap will provide you with more out of the box functionality commonly found on today’s website.

update: we released a bootstrap templating integration for Adobe CQ 5.5 today. See the following link for more information

h1

Maven Archetype for a CQ5.5 Project

April 2, 2012

We added a maven archetype to cqblueprints.com to kick start Adobe CQ5.5 projects. You can use it by executing the following command line statement:

mvn archetype:generate -DarchetypeCatalog=http://dev.cqblueprints.com/nexus/content/repositories/releases/ -Dfilter=multi-module

Note: the above should be 1 line

for a completed guide to explain the project structure, please visit The CQ Project Maven Archetype