Pages

Thursday, May 1, 2014

CQ 5.6.1 How to find the current run mode on an instance

The Problem

You suspect your instance is not running in publish mode, or is missing a custom run mode on startup and need to find out easily what runmode the instance is running under.

The Solution

Go to:
http://localhost:4502/system/console/status-slingsettings

You will see the following line down the bottom:

Run Modes = [samplecontent, author, crx2, crx3mongo]


Thursday, December 19, 2013

CQ5/AEM How do I find out exactly which maven dependency I need?

The Problem

You are writing a customization in Java for CQ5/AEM, but the class you need is not currently included in the project, but it is available in CQ5.

You may know what dependency you need, but are unsure as to the version. What is the best way to find the right dependency to include in CQ5?

The Solution

Go to:
http://localhost:4502/system/console/depfinder



This is the package dependency lookup service. If you type in the package/class you need in the field, and click on Find, you will get the dependency you need to include.

Just copy and paste the dependency into your pom file.

Saturday, November 2, 2013

CQ5/AEM Dispatcher gotchya - dispatcher failed to map segment from shared object permission denied

The Problem

Although your dispatcher mod file is there, you can't seem to load the mod_dispatcher file.

The Solution

First, double check in your httpd.conf file that you are actually pointing to the right place. Remember that your ServerRoot is the prefix appended to the mod_dispatcher.so path file.

If the file is where you would expect it to be, check that the user you are running apache under has the rights to see the file.
ls -al
will show full permissions of the directory listing.
chown group:user will change the file ownership

chmod 755 will give read and execute rights to the owner, the group and everyone.

Finally, if you are running Red Hat Enterprise Linux (RHEL), it is possible you are running selinux, and don't even know it.

Have a look under /etc/sysconfig/selinux.

In the file, you may see selinux=enforcing.

If this is the case, then selinux probably doesn't like the dispatcher mod, and is blocking it. You can drop the permissions down to permissive or disable to remove it entirely, but check with your systems administrator, as this will have other effects on the system.

Thursday, October 10, 2013

AEM/CQ5 How do I let users reset their own passwords?

The Problem

How do you allow users to reset their own passwords in the admin interface?

The Solution

I get asked this question so frequently, I thought I would make a blog post about it.

Go to the classic interface, and in the top right hand corner, click on your user button.



If you are logged in as the administrator, you do not get the Set Password option.

If you are logged in as administrator and impersonate a user, you will not see the option either.

I believe that this is what causes the confusion. You actually have to log out, and log in as a different user in the admin interface, and you will see the set password option.

Tuesday, September 24, 2013

AEM/CQ5 SQL2 How do I find all occurrences of a node by name

The Problem

You want to use a SQL2 query to retrieve all nodes that are named "nameofnode"

The Solution

SELECT * FROM [nt:base] AS s WHERE LOCALNAME() LIKE "nameofnode"

The LOCALNAME() function returns the node name. 

Tuesday, June 4, 2013

How to create your own sling adapter

The Problem

You want to create your own implementation of an adaptTo() class

The Solution

Coming Soon

CQ5/AEM What possibilities exist with adaptTo?

The Problem

You want to find out what you can adapt a particular object to, using the adaptTo(Object.class) method.

The Solution

Go to http://localhost:4502/system/console/adapters and have a look for the class in the first column, Adaptable Class.

The next column provides all of the classes that you can adapt the originating class to, any conditions that may be imposed, and the bundle that provides the information.

So for example, if you look up org.apache.sling.api.resource.Resource you will see that one of the listed adaptable classes is com.day.cq.wcm.api.Page

Thus, if you start with a Resource resource, you can do:
Page page = resource.adaptTo(Page.class)

You could even create an adaption of your own. For example, if you have a Node object, you can create an AdaptTo mapping to map to MyCustomNode.

Further items of interest

How to create your own sling adapter.