Home

Taking Advantage of Git Branch Descriptions

If you're anything like me, you may accumulate a sizable number of branches locally over time. Based on old standards and what I'd consider some good practice, my branch names always follow the same format: myLDAPName/Issue# For example, jboyle/1641. While in my case this maps directly to a JIRA issue and is short and easy to type, it isn't very descriptive and after creating a number of branches, it becomes challenging to remember what branch...

ModifiableValueMap Not Found: Considerations in Using ModifiableValueMaps in an API

So let's just say you are designing an API which allows both reading and writing of attributes for a Resource.  Of course, you want to use consistent code to persist the values, so you use the (relatively) new CRUD features in the Sling API to both get and set the property values.  To save code, you might use a ModifiableValueMap for both operations, which works great in author as an administrative user.   The Problem At some...

Accessing Request Variables in Sightly

You can implement some interesting stuff in Sightly, the newest templating language for Adobe Experience Manager, including Tower of Hanoi.  At the same time, there are a few practical applications which are not available in Sightly, including accessing request scoped variables in Sightly.  While Gabriel's suggested approaches in the Stack Overflow post are absolutely correct in this situation, there are still certain situations where request variables can be very useful.   A good example is for sharing a variable...

Adding non-string properties using Sling Testing Tools

Recently, I was creating integration test following this article. Everything was working out nicely but then I couldn't figure out how to create anything other than a String data type in the JCR. I was specifically trying to create a Date data type. I found a nice document about the sling post servlet and Date properties. This showed the proper format for Date String but all the examples where for HTML forms. I tried formatting...

Escaping the Dreaded VerifyError

Recently (read early this afternoon) I was doing my best to beat my head against the desk until something useful spilled out.  The problem I was having was with a relatively old, but frequently updated codebase where recently certain random services would not start. The project had recently updated from Java 1.6 to Java 1.8 and at some point, the problem occurred but had not been noticed immediately as it only affected a small subset of...

Sling Models for Fun and Profit

Recently, I finally had a chance to leverage Sling Models for a new project.  If you are not familiar with Sling Models, they allow developers to inject methods and fields based on resource properties, other resources and OSGi services.  For those developing in AEM 6, Sling Models are available as part of the default installation, for those on older versions of AEM / CQ5, Sling Models are available as downloadable bundles on the Sling website.  Sling Models...

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...