Installing big packages in CQ5/CRX

If you have to install big packages in CQ5 it can be cumbersome. Uploading 2GB even locally take some time and the browsers uses memory. Here’s a nice workaround/solution.

cp ~/my-big-package.zip /path/to/cq/crx-quickstart/install

(create the install directory if not there)

monitoring the error.log you’ll see that OsgiInstallerImpl is monitoring that directory and will install the package.

I prefer to delete the package once the installation is completed but it’s not mdandatory.

If you’re installing a big set of DAM remember to disable the DAM workflows from the workflow launcher.

As installing packages is resource intensive, if you’re doing it on a live instance it’s better to plan and disconnect it for not causing disruption.

CQ5 “disable” linkcheker

Linkcheker it’s a very useful functionality that highlight to the author eventual broken links within, for example, a RichText widget. However when integrating already existent web application behind apache, there’s the need to “disable” completely it.

We won’t go to disable it properly but configuring it in a way that for him all links are not to be checked.

In CQ5.4, go into the Felix console and click con components (http://$server:$port/system/console/components) and search for: com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl. Click on the wrench (settings) and in the link check override patterns add the following regex (using the “+” button):

^.*$

Save and refresh the page in the author.

This will save the settings into the file crx-quickstart/launchpad/config/com/day/cq/rewriter/linkchecker/impl/LinkCheckerImpl.config.

This will work, but it will disable the Apache Sling JCR Resource Resolver as well, as it uses the LinkChecker service behind the scenes to transform the links.

A more intelligent approach is to use a negative RegEx saying to LinkChecker to ignore everything that is not in our /content/sitename. Use this regular expression:

^((?!/content/sitename).)*$

Replacing sitename with your correct path.

If you want to set the config into the CRX repository (so it can be exported/imported via package manager)  go to /libs/cq/linkchecker/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl using Content Explorer and edit the property service.check_override_patterns adding the regex previously mentioned.

Easy peasy! 🙂

CQ5 backup your sources from CRX

El grito de la gaviota - Seagull scream

by Dani_vr via flickr

updated on Feb 15th, 2011

Yes, it happens. CRX has lost my sources from one day to another. As usual you realize that you need a backup when it’s too late. So the question became: how can I backup my sources outside the crx? Packages!

First you have to create a package of what you want to backup via the package manager provided with CRX. I wont go in details of this operation. Then you can call every package operation from a command line like bash and curl application. Fortunately Mac OS X and Linux come with cURL out of the box so nothing special is needed.

Just download the pdf containing the bash code, fix the variable according to your needs and schedule it or execute by hand.

The script is missing at all the error checking and some other things but works well for the moment; maybe in the future I’ll start a new SF project with the script source.

For more information here is a couple of links (same page)