Pages

Thursday, January 10, 2013

CQ5 Tree Replication - Cowardly Refusing to tree-activate - Forcing to activate

The Problem

When you are in the tree activation component:
http://localhost:4502/etc/replication/treeactivation.html

You have a first level folder that you want to replicate to a publish instance, but you get a message "Cowardly refusing to tree-activate \"%s\"

For instance, when trying to activate /content

You could individually go through and replicate the second level tree elements down, but this will take too much time to do.

STOP AND THINK!!!

If you are still reading, you are doing something else wrong on a strategic level.

If you are tree replicating the /content folder, chances are you should be activating your page on the http://localhost:4502/siteadmin Website Management component.

If you really do have a lot of child folders outside of the /content folder, you should be managing with packages, which will replicate for you. See my cheatsheets on how to package, and how to deploy.

If you have made your own folder on the root level, then you should consider putting it under a more strategic position, or grouping your second level folders into a more logical structure. You shouldn't have a lot of second level folders for your code for a single project.

In the meantime, if something has gone wrong, and you don't want to suffer from carpal tunnel syndrome from overclicking your mouse, here is how to turn off the safeguard that prevents you from replicating down. (Note, this safeguard is here for a reason, mainly to prevent you from just shotgun replicating the /etc or the /lib folder)

How to ignore and do it anyway

Open up CRXDE or CRXDE Lite and point it to your author instance.

If you plan to use CRXDE Lite, go to
http://localhost:4502/crx/de/index.jsp

Then navigate to:
/libs/cq/replication/components/treeactivation/POST.jsp

either by navigating down the folder structure on the left, or pasting the folder slashes into the search box.

Open up POST.jsp, and navigate down to line 176, where you will find the following:

            // reject root and 1 level paths

            /*if (path.lastIndexOf('/') <= 0) {
                if (path.length() == 0) {
                    path = "/";
                }
                out.printf("<div class=\"error\">Cowardly refusing to tree-activate \"%s\"</div>", path);
                return;

            }*/

Add the /* and */ comments (in red) and save the file.

Now go back to http://localhost:4502/etc/replication/treeactivation.html, and the check has been released.

Again, use this at your own risk, as this can cause problems with the replicators.

No comments:

Post a Comment