Creating Custom CQ/AEM Workflow Process Step

It's no secret that CQ/AEM Workflows are quite powerful, but what happens when the default process steps aren't what you need? In a case like this you need to create your own custom process step. In this article I will detail the steps you need to take in accomplishing this. 1) This tutorial is going to be completed in java, drill down into the Java portion of your code base and create a java file....

9 JCR-SQL2 Queries Every AEM Developer Should Know

JCR-SQL2 queries are useful items in every AEM Developer's toolbag.  They are relatively quick, aren't deprecated and have a familiar SQL like grammer. JCR-SQL2 queries can be invoked from the JCR API: Session session = ...QueryManager queryManager = session.getWorkspace.getQueryManager();Query query = queryManager.createQuery("{QUERY}", Query.JCR_SQL2);QueryResult result = query.execute(); or through the Sling API: ResourceResolver resolver = ...Iterator<Resource> result = resolver.findResources("{QUERY}", Query.JCR_SQL2); Although there is an official specification for JCR-SQL2, there aren't a ton of really good resources out...

New from Apache Sling: JSP XSS Protection

Cross Site Scripting or XSS represents a serious threat to site owners and users and can be very difficult to properly prevent, especially given the weak tooling available in the JSP specification. Many times, developers depend on the <c:out /> tag from JSTL, however this tag does not provide robust XSS protection. On Friday, the Apache Sling Project released a new version of the Sling JSP Taglib, version 2.2.4 which contains new functionality help to...

CQ Users and Groups Permissions - Major Differences

In this article, I'll briefly illustrate a major difference between CQ 5.6.1 and AME6 when it comes to Users and Groups permissions. I am not fully aware the scale or the extent of the impact this might cause on upgrading from CQ 5.6.1 to AEM6, but I thought it's worth sharing.   CQ 5.6.1 AEM6 In CQ 5.6.1, users/groups permissions are stored in a JCR node called rep:policy under the node that was assigned right(s) to a...

Debugging Apache Axis 1.4 with SLF4J

In my previous blog post, I discussed getting Apache Axis 1.4 working in AEM. One of the more interesting things about Axis 1.4 is that it's not easy to log the actual request from the client and response from the server.  You can configure the LogHandler, however it is somewhat problematic in AEM to configure due to the classpath complexity in OSGi and it will only log to the system outputstream.  This is problematic in...

Running Apache Axis 1.4 in AEM

Despite doing several Web Service implementations over the last couple years, I have successfully avoided using Apache Axis until now.  A client's Web Service implementation was incompatible with the code generation tools available in more modern Web Service clients, such as Apache CXF.  While there is documentation around using Axis 2 with AEM, there isn't really anything available for Axis 1 in AEM, which is what I needed to use.  So, I rolled up my sleeves...

New from Apache Sling: Testing Tools 1.0.8

The Apache Sling Project just announced the release of Testing Tools 1.0.8.  This new release brings some great new features and fixes to anyone using Apache Sling Testing Tools for integration tests.  There are two fixes which are certainly worth highlighting. SLING-3328:  Simplify SlingTestBase usage with an already running instance This issue makes it easier to connect the Sling Testing Tools to a running Sling / AEM instance without requiring to set the jar.executor.jar.folder, jar.executor.jar.options,...

Handle form submission using AdapterFactory in Adobe CQ (AEM) OSGi Component

In this article, I will be addressing 2 issues: how to efficiently handle form submission map data in Java and how the AdapterFactory get implemented in Adobe CQ (AEM). How to efficiently handle form submission map data in Java You need 1 servlet, 1 service, and 2 classes: FormSubmissionHandlerServlet, FormSubmissionHandlerService, MyCustomClass, and MyCustomClassAdapterFactory FormSubmissionHandlerServlet is the main service that handles the HTTP request (AJAX request) and dispatches the work for the right candidate class that designed to handle...

Git Tricks I Use

After developing on AEM for quite some time, I've come to rely on git for a lot of things. Whether it's maintaining several of my own branches at once, firing off pull requests to get my stories into master, or pulling down someone else's branch to take a look at their work, git has become an indispensable part of my AEM development lifestyle. And, as a developer, I'm always looking for ways to make things...

Client-side custom form validation and submission in Adobe CQ

In this article, I'm going to discuss on how I integrated and implemented jQuery Form Validator and jQuery Form for handling form validation and submission with Adobe CQ5 (AEM). Assumption (for the sake of this example): Your CQ application/project name is: myapplication We have 3 different clientlibs categories: myapplication.jquery, myapplication.components (embeds myapplication.components.apps), and myapplication.components.apps (this category is for the clientlibs located in the apps level). The location for the 3 clientlibs are: /etc/designs/myapplication/jquery, /etc/designs/myapplication/components, /apps/myapplication/components/{component_name}/clientlibs. We include clientlibs in the CQ page...