Pages

Wednesday, March 27, 2013

AEM/CQ5 contents of clientlibs on instance

The Problem

You want to see what client libraries are running on your cq5 instance.

The Solution

Go to:
http://localhost:4502/libs/granite/ui/content/dumplibs.html


Monday, March 25, 2013

ERROR Failed to execute goal (install-package)

The Problem

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (install-package) on project bigpondpoc-content: Command execution failed. Cannot run program "curl" (in directory "C:\Documents and Settings\username\workspace\myproject\content"): CreatePRocess error=2, The system cannot find the file specified -> [Help 1]

The Solution

You have not installed cURL on your system.

Download cURL from http://curl.haxx.se/download.html and download the latest zip file.

If running under windows, unzip it to a folder of your behest and add a path variable to that folder using your windows environment variables.

(Windows Key + Break, to bring up Control Panel\System and Security\System.
Advanced System Settings
Environment variables
Under system variables, find path, and add ;c:\myPathToCurl)

This should resolve the issue.

How to change the root publish page from /content/geometrixx-outdoors/en.html to what you require

The Problem

When you type in http://www.yourwebsite.com you get redirected to

http://www.yourwebsite.com/content/geometrixx-outdoors/en.html

The Solution

It is best to fix the core of the problem, which is the target redirect on the /content folder.

A bit of mechanical sympathy first, however.

When you type in the default / url, cq5 will look at the Target Path setting in the Day CQ Root Mapping component.

This setting by default is set to /content.html

You can change the url at this point, however, it is not advisable to do so, as if the url ever changes, you will need to make a configuration change, rather than a content change.

So when you first hit the / directory, the Day CQ Root Mapping servlet changes the request to be /content

Within the /content folder, which can be viewed by using CRXDE Lite/Explorer, you will see that the sling:target setting, is to /geohome.

/geohome is set as the vanityPath for the geometrixx-outdoors site, which in turn has a redirectTarget set to /content/geomtetrixx/en

So if we change the /content folder to have the next correct address, such as /mysite or the equivalent starting point coded into the author instance, this will then replicate seamlessly to the publisher, and means that you don't have to rely upon apache rewrite rules to serve up the correct website.

AEM CQ5.6 How to change the admin password

The Problem

You want to change the cq5.6/AEM admin password on the publish and server instance.

The Solution

Go to: (Or whatever the address/port of your admin instance is)
http://localhost:4502/libs/granite/security/content/admin.html

Double click on the admin user, scroll down, click on the pencil icon, and change the admin user. NOTE: the first password is the new password, and the second password in the current password. So, for a fresh install, put in the new password first, followed by admin as the second password.

Repeat for
http://localhost:4503/libs/granite/security/content/admin.html or equivalent.

Wednesday, March 20, 2013

CQ5/AEM How to customize your workflow completed email and cater for different languages

The Problem:

You want to customize your workflow completed email, and add support for different languages.

The Solution:

1. Open CRXDE Lite by going to:
http://localhost:4502/crx/de
2. Go to /etc/workflow/notification/email/default/en.txt
3. Double click to open the file and customize away.

If you want to have different languages, make a copy of the en.txt file, and name it to the specific language(s). i.e. fr.txt de.txt nl.txt

How to send an approval or rejection email in a CQ5/AEM page publishing workflow

The Problem

You want to send an email in a workflow to send an email to the author of a page, that a page has been approved or rejected.

The Solution

1. Set up email on your CQ5/AEM author instance with these instructions.
2. Create a new workflow by logging into the admin interface, and going to:
http://localhost:4502/libs/cq/workflow/content/console.html

3. Click on the New button in the top left hand corner
4. Enter the title and name for your workflow. In this case:
Title: Page Approval Workflow
Name: page-approval-workflow
Click on OK.
5. Double click on the new workflow
6. You will see Step 1 as being an approval step from an administrator. You can double click on this step and change it to any group that you want to approve the article for publish. In this case, we will keep this as an admin user.
7. on the sidekick, go to Workflow, and find the OR Split process, and drag it on just after Step 1
8. on the sidekick, go to Collaboration Workflow, and find the Send Email component.
9. Drag and drop the Send Email component onto both splits of the workflow.
10. Double click on the email step on the left, and name it Approve Page, and give a description along the lines of Approve Page and sends an email to the initiator of the workflow.
11. Double click on the email step on the right, and name it Reject Page, and give a description along the lines of Reject Page with a description along the lines of Sends an email to the initiator of the workflow that the page has been rejected.
12. Click on Save
13. Open a new browser window, and go to crxde lite by navigating to:
http://localhost:4502/crx/de
14. Go to the following directory:
/etc/workflow and create a new folder named "demoproject"
15. create a folder inside called email
16. create a new file called emailapproval.txt
17. create a new file called emailrejection.txt
18. Click Save All
19. double click on emailapproval.txt and enter something along the following lines (Only enter the parts between, but not including the <<<<<<>>>>>>  characters

Note, instead of my.name@whoeveryouare.com, enter the email address you set up as the CQ Mail Service user. I.e. john.doe@gmail.com This avoids any malarkey with spam filters.

<<<<<<<<<<<<Start of File>>>>>>>>>>>>>>>

From: My Name <my.name@whoeveryouare.com>
To: ${initiator.email}
Subject: Page Approval Granted

Hi ${initiator.name},
Your page ${payload.path} has been approved and published.

Regards,
Your local friendly CQ5 Admin


-----------------------------------------
All Workflow properties:
${properties}

<<<<<<<<<<<<End of File>>>>>>>>>>>>>>>

20. Double click on emailrejection.txt and enter the following

<<<<<<<<<<<<Start of File>>>>>>>>>>>>>>>

From: My Name <my.name@whoeveryouare.com>
To: ${initiator.email}
Subject: Page Rejected

Hi ${initiator.name},
Your page ${payload.path} has been rejected. Please make changes and resubmit for approval.

Regards,
Your local friendly CQ5 Admin

<<<<<<<<<<<<End of File>>>>>>>>>>>>>>>

21. Click on Save all, and go back to your workflow window.
22. Double click on the Approve Page step
23. go to the Arguments tab, and enter the following as the email template path:
/etc/workflow/demoproject/email/emailapproval.txt
24. click OK
25. Double click on the Reject Page step

26. go to the Arguments tab, and enter the following as the email template path:
/etc/workflow/demoproject/email/emailrejection.txt
27. click OK
28. Go to the sidekick, and select the WCM Workflow tag.
29. Add the activate page/asset step to the left hand side of the OR tag, just after the approval tag.
30. Click on Save
31. Go to the users section, and add a new user belonging to the content-authors group, with your email address specified as the user's email. You will also need to add the user to the workflow-users group.
32. In a seperate browser, log in as the newly created user.
33. Go to:
http://localhost:4502/siteadmin#/content/geometrixx-media/en
34. Click on the workflow button after highlighting the gadgets page.
35. Select page approval workflow and submit.
36. Go to the original browser, where you are logged in as admin, and navigate to:
http://localhost:4502/inbox
37. Double click on the page, and you will see the page appear in edit mode.
38. Go back to the inbox page as in step 36, and click once on the workflow.
39. Click on complete.
40. Drop down the Next step combobox, and select reject.
41. Click OK.
42. The workflow should have been rejected at this point, and an email sent to the originator of the workflow process.
43. Repeat the process with your newly created user and resubmit the page. This time, as the admin user, approve the workflow.
44. You will see that the page has been published, and you should have received an email telling you that your page has been approved.

GOTCHYA: CQ5/AEM Could not start workflow

The Problem

You are logged in as a non-admin user, and when you try to initiate a workflow, you get a popup message stating "Could not start workflow".

The Solution

Your user probably is not added to the workflow-users group, which grants permission to initiate workflows. Add the user or the user's group to the workflow-users group, and your problem is solved.

Sunday, March 10, 2013

Explosion when trying to access JCR repository

The Problem

I was trying to access the JCR via the following code.

                try {
repository = JcrUtils.getRepository("http://localhost:4502/crx/server");
} catch (RepositoryException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

CSVImageImporter csvImageImporter=new CSVImageImporter();
try {
Credentials cd = new SimpleCredentials("admin", "admin".toCharArray());
session=repository.login(cd);
                }

This resulted in the following exception:


javax.jcr.RepositoryException: Unable to access a repository with the following settings:

    org.apache.jackrabbit.repository.uri: http://localhost:4502/crx/server
The following RepositoryFactory classes were consulted:
    org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
Perhaps the repository you are trying to access is not available at the moment.
at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:204)
at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:244)
at au.com.someone.dam.csvimporter.ImportImageCSVTest.importCSVTest(ImportImageCSVTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

The Solution

Although I had added :
                    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
    <artifactId>jackrabbit-jcr-commons</artifactId>
    <version>2.2.0</version>
   </dependency>

To my pom, I also needed to add:
                        <dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr2dav</artifactId>
<version>2.6.0</version>
</dependency>

Friday, March 1, 2013

Reset forgotten password in CQ5.4

The Problem

The administrator password has been forgotten for a CQ5.4 instance.

For CQ5.5 click here
For CQ5.6 click here

The Solution

Go to /crx-quickstart/server/etc/server.xml

find the <admin> node, and replace the whole fragment with

<admin>
<crypt>adpexzg3FUZAk</crypt>
</admin>

Your password should be reset to admin:admin again.


Reset forgotten password in CQ5.6

Leave a comment to prioritise this post to be written by me.

Reset forgotten password in CQ5.5

Leave a comment to prioritise this post to be written by me.