Posts Tagged “Adobe CQ”

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

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

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

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

Creating a Custom Predicate for Querying by Version

Recently I found myself implementing a custom parametric search UI within CQ. The intent of this view was to allow a user to query for Resources based on any combination of parameters. For all but one of these parameters, I was able to leverage the OOTB predicates but for querying on version, however, I had to think outside the box a bit. While the other parameters could all, in some form or another, be evaluated...

Follow Up to Integration Tests in Adobe CQ

In my previous post, I had introduced the idea of integrating testing AEM (CQ5) projects using Apache Sling Testing Framework.  After using the integration testing framework for a while and learning more about the framework, I have come up with some improvements to my original post. 1. Support Testing Existing AEM/CQ5 Instance This makes your tests a lot quicker and easier, instead of starting up a new CQ instance just to run your integration tests,...

Issues with Touch UI in AEM 6

AEM 6 has been released, and with it comes an extension of the thin veneer known as “Touch-optimized UI.” In AEM 5.6, the Touch UI was limited to just the consoles; upon entering a page for content editing, one was greeted with the tried-and-true “Classic UI” interface. In AEM 6, Touch UI has been extended to provide an entire alternate user interface for authoring content. The “What’s New in AEM 6.0” video released by Adobe...

AEM6 Self Service Monitoring

Adobe Experience Manager 6.0 is the latest release in the long line of CQ/Adobe Experience Manager products. AEM6 now has monitoring capability beyond what was included in previous releases, built-in to the WCMS out of the box. Navigating to "Tools"->"Operations"->"Dashboard"->"Health Reports" will present you with a screen containing multiple color-coded 'tiles' representing monitored parameters like the one below. ![AEM6 Monitoring Dashboard](/images/posts/2014-05-22-aem6-self-monitoring/healthreports.jpg) As you can see, each tile is color-coded to provide an easy-to-view snapshot of...

WhitePaper: Creating a Better Web User Experience for Intranets & Portals

6D White Paper: The white paper identifies ways to create a better user experience for the visitor and author, and 5 key considerations when moving to a new CMS for Intranets and Portals. Excerpt Moving to a Content Management System Websites are usually moved into a content management system (CMS) for a couple of reasons. The new CMS usually provides a much better user experience for the person editing the site, often called the site...

Monitoring AEM with New Relic

I love New Relic.  Their server monitoring tools allow me to remotely monitor my various servers and development applications for free and their stuff just works.  Recently, we were running into an issue at Six Dimensions where a couple of our development servers were toppling over and without any real monitoring in place we couldn't tell why.  To address this, we've been rolling out New Relic on all of our development servers.   As part...

Modify the OOTB LinkChecker Config

I've come into the issue recently of needing to modify the prefix and suffix for invalid links detected by the linkchecker. This seemingly simple task is unfortunately not as easy as overlaying the /libs/cq/linkchecker/config.author/invalid to /apps/cq/linkchecker/config.author/invalid. For reasons unknown (to me at least) the standard overlay does not work for this type of update. Instead, after digging into the code, I found this information: REQUEST_ATTRIBUTE_NAME = LinkCheckerSettings.class.getName(); LinkCheckerSettings settings = (LinkCheckerSettings)request.getAttribute(REQUEST_ATTRIBUTE_NAME); The above lines indicate...

Hide/Show parsys on the fly with JavaScript

It is relatively painful to deal with tabs, accordion, or carousel component. Especially when we want to enhance content author experience. Here’s a use case to illustrate to you what I meant: We need to build a tabs component. We want author to manage tabs’ content on the page (not via child page or a separate page). We want author to drag and drop any component into any tab’s content they wish. Bug The screenshots...

CQ Dialog - Generate dynamic rootPath with ExtJS Plugin

This article will shows you how to: one write ExtJS plugin and calls it in CQ dialog and two generating rootPath with ExtJS plugin. We know that with xtype pathfield, we can set rootPath value to any location we want. The drawback is that it is static. If we set rootPath to /content, we fall into providing “no so good author experience” as content author needs to click through pages list to get to the...

How to Manage Field Dependencies in a CQ Dialog

I'm working on a front-end project with some relatively complex UI requirements for author dialog. The author UI requires field dependency. A set of fields is shown or hidden based on a certain selection author makes. After getting a working codes finalized, I thought that it is worth sharing with the community. Sample use case for field dependency: As a content author, I would like to be able to build a grid of maximum 12...

How NOT to Generate HTML

Recently, I have been working on an integeration between Adobe's Search and Promote and CQ5/AEM.  This work has reminded me of one of my least favorite anti-patterns, embedding HTML markup in Java code.  You tend to see this 'technique' a lot in Servlets, Tags and other Java web technologies.  This is a bad idea for several reasons: It breaks the MVC model It's hard to understand the HTML code It's difficult, if not impossible, to modify the...

Expression Language, Tags and You

One of the things I've seen on many projects which makes code a lot more difficult to read and understand is scriptlet (aka Java inside JSPs). Especially now, there really isn't a good reason you need to ever use scriptlet inside your JSPs, but especially given the prevalence within CQ's codebase it's a common practice. ## Helpful tools Recently, myself and others have been contributing code to make it easier to develop JSPs in CQ...

Creating and Configuring your Maven Project for AEM

The goal of this document is to have a maven project that builds a single asset (the package profile) to deploy all Servlets, Services, and JCR Code. In addition to this, for development purposes we want to be able to build each item listed above individually, such that we do not require a full build to test a simple JSP change. For starters, this is a fairly common project structure that we'll be basing this...

Simple Web Console Templates

Awhile back, I wrote a blog post about [creating Apache Felix Web Console Plugins](/blog/2013-09-11/service-boss-level-part-2-custom-web-console-plugins/). It's a pretty great technique for creating a diagnostic configuration panel for complex services or applications, however the process for rendering HTML for the consoles is still somewhat stuck in the dark ages. Since servlets are used to render the HTML, you'll generally see HTML being written to the response in the Java code of the Web Console...

The Great and Powerful cq:EditConfig

One of the most under-appreciated features of AEM components, in my opinion, is the cq:EditConfig. This node allows developers to configure how a component is edited, add or remove functionality from the editor and generally tailor the authoring experience for component. The cq:EditConfig is simply a node with the primary type `cq:EditConfig` and the name cq:editConfig under the component root. The cq:EditConfig allows for configuring many important features of the component's editing experience including: *...

AEM Start/Stop Script Modification for a Cluster

When clustering AEM instances there is a required order for shutting down and starting the instances. This however can be very tricky in a shared nothing cluster as the master & slave can automatically swap places at any time for multiple reasons. This means in order to shut down an instance you typically need to identify the master instance first. Conversely in starting up an instance the slave can only be started after the master...

AEM Restricted Backup User

The AEM backup curl command is often passed using admin credentials however for security reasons it may be undesirable to store the AEM admin user's credentials in plaintext form in a system script. To mitigate this instead a generic user can be created and be granted more specific access rights to the granite backup console. This will allow to restrict what this user has the ability to do by only having granted rights to start,...

AEM Live Backup Strategy

AEM has a built in live backup mechanism which works rather well at creating an extractable archive of the complete instance it can take an extremely long and unmanageable amount of time due to the nature of what all it is creating an archive of. By default this backup will consist of the original CQ jar file and everything at an equal level and anything contained in any child directories of that path. While this...

Integration Tests in Adobe CQ

Awhile back I wrote a post on running integration tests in Apache Sling. This technique is useful for developers working directly on Apache Sling, but doesn't support downstream platforms like Adobe CQ/AEM.After some finagling and testing I was able to get a similar technique working using Adobe CQ / AEM instead of Apache Sling. To enable integration tests using Adobe CQ, add the following into your POM.DependenciesFirst, add plugins to copy required dependencies and the...

Six Dimensions Supports the Apache Sling Project: Resource.hasChildren

Recently, I had the chance to shepherd a new feature into the Apache Sling API. This feature adds the method hasChildren to the Resource andResourceResolver. My colleague, Brian Warner suggested adding this method after struggling to do this in a clean, correct way.What's new? The hasChildren method is a convenient shortcut for developers to check whether or not a Resource has child resources. This method returns correctly across different Resource Providers unlike the lower-level API's such as Node.hasNodes(). And this method enables developers to...

The 5 Hardest AEM Concepts for New Developers

Even experienced developers struggle when trying to transition to the Adobe Experience Manager (AEM) platform (formerly Day CQ5). Once you fully grok AEM, it can be a joy to develop against; the APIs are generally straightforward and it makes presenting content easier than any other platform I have encountered. So why do so many developers have trouble ramping up on AEM?AEM turns traditional WCMS products on their head. No other CMS really works in a...

New in AEM 5.6.1: Workflow Purge Scheduler

In previous versions of Adobe CQ5/AEM in order to purge old completed workflows, you needed to either write a custom job or install an additional package provided by DayCare.  Now in AEM 5.6.1, this functionality comes out of the box with the product.Why Purge Completed Workflows?So why would you want to purge completed workflows?  Workflow instances are stored as nodes inside CQ.  Generally, this doesn't pose a problem for author-generated workflows, at least not over...

Request cq:Components with AJAX

It's quite evident CQ utilizes AJAX frequently.If you've ever opened your network tab while using CQ you'll see asynchronous request going off here and there. When authoring new components, navigating content, developing in CRXDE lite and much more. If you're unsure what it is, AJAX let's us make asynchronous server request to content without having to do a full page reload.As a CQ developers we create may cq:Component's that are rendered with a page request but...

Service Boss Level Part 2: Custom Web Console Plugins

You've got your awesome service.  It performs all sorts of complex tasks and maybe even uses a Sling Service Factory to provide multiple configurations.  But how do you know what it's doing?  Well, of course you need to have appropriate logging, but another tool you can leverage is the Apache Felix Web Console, by creating a custom Web Console Plugin.  Your plugin can be accessed through Adobe CQ and Apache Sling's Web Console and can display...

Service Boss Level: Service Factories

I've always wondered how the Apache Sling Logging Logger Configuration worked.  I like the idea of being able to configure multiple configuration instances through the OSGi Console and could see how this would cut down on the UI code I'd need to write in many circumstances.Since working on the Apache Sling project, I have taken the time to peruse the code for the Sling logger.  Unfortunately, the Sling logging code uses a fairly arcane method for registering the...

My CQ JSTL/EL Best Practises

In my last article My CQ JSP Development Best Practises we solely talked about JSP related issues, one of which was the use of JSTL/EL.  Not having a reasonable approach for dealing with JSTL/EL can land you in just as much trouble as a poorly constructed JSP.  These practises should help. Variables and MethodsComparison OperatorsTagfiles vs. Classic TagsScoped variables 1) Variable and MethodsThere are two operators to address JavaBean attribute's (getXXX), List and Map values, and scoped variables....

Six Dimensions Supports the Apache Sling Project: New Resource Access Tags

Recently, I had the chance to release a new version of the Sling JSP Taglib. This new version includes a large number of features and improvements which I hope will help developers in Sling-based platforms, including Adobe CQ, develop cleaner and more reusable JSP scripts.What's new? Well, the JSP Taglib allows for access to the Sling Repository without requiring any Java code.  With the previous version of the Sling Taglib, if you wanted to the get the...

New from Apache Sling: Resource Access Tags

Recently, I had the chance to release a new version of the Sling JSP Taglib. This new version includes a large number of features and improvments which I hope will help developers in Sling-based platforms, including Adobe CQ, develop cleaner and more reusable JSP scripts. What's new? Well, the JSP Taglib allows for access to the Sling Repository without requring any Java code. With the previous version of the Sling Taglib, if you wanted to...

My CQ JSP Development Best Practises

I would guess that many or most developers in the CQ development space have their own set of development best practises they operate with.  This is a topic very near and dear to my heart.  It is something that I have spent significant personal time pursuing.  At the end of the day I want readable, maintainable, extensible, bug free code that is not a burden.I have deliberately kept the list short.  These have been primarily...

CQ Resource Inclusion from a Servlet

Including resources from a JSP is super simple due to the many facilities within Sling and CQ.  But what if you wanted to include a CQ resource from a custom Sling Servlet?  All of this nice JSP based inclusion is built on top of the JavaEE API.  Take a look at the class: javax.servlet.jsp.PageContext and two of it's methods: public abstract void include(String relativeUrlPath) and public JspWriter pushBody(Writer writer). These two method will form the basis for all...

Beware of Export-Package

Quick - without checking the documentation, what does the Export-Package instruction do in the Maven Bundle Plugin?Did you say "sets what packages are exported by the bundle"?  If so, you're only half right.Recently, I was trying to diagnose some issues with a SOAP Web Services implementation in an existing code base.   Theoretically, everything was in place, however I was getting a ClassCastException when attempting to retrieve the OSGi Service for accessing the SOAP Web...

Ask the Experts: CQ5 Inheritance Model

In this series of blog posts we pose a question to experts in the Adobe CQ5 platform about Adobe CQ5, Enterprise Content Management and Web Development.What's the difference in CQ5's inheritance model versus standard Java?The main difference that I can think of is that in standard Java, you will write a class which inherits all the methods of a previous class. These methods can be modified and overwritten, and new methods even added to enhance...

EL Function Management

In my post Tagfile vs. Tag in a Sling or CQ5 Application we created the groundwork for developing Servlet artifacts: Tag files, Classic Tags, and EL Functions.  The definition of all these items require the file taglib.tld.  This defines the URL that identifies the library via the uri in a <%@taglib prefix=".." uri=".." %> JSP statement within a JSP.  Here we address creating EL functions and managing them.Additionally, I will provide some of my thoughts...

Custom PredicateEvaluators or: How I Learned to Stop Worrying and Love QueryBuilder

One client's AssetShare page contains a checkbox: Needs Meta-data. Checking this box is supposed to return all assets coming from the DAM that do not have metadata. Specifically in this case we check for a particular attribute (@dc:title) that's a child of the jcr:content/metadata node.Our story begins with the following problem: checking the box wouldn't return certain assets. Upon investigation, I discovered that the one asset not returning in the query HAD an @dc:title attribute,...

Three Commonly Missed CQ Best Practices

Recently, I saw this thread on the Day Communique Google Group.  In the thread, a developer asks why he cannot use CRXDE in their production environment.  As it turns out, his employer followed the best practices for hardening CQ instances as recommended by Adobe which disables the WebDav servlet CRXDE uses.  This thread demonstrates three common problems I've seen on CQ installations.  Especially, when the implementers of the CQ installation are not familiar with CQ and...

Tagfile vs. Tag in a Sling or CQ5 Application

Custom tags are cool, I guess.  The first couple I wrote were fun to write.  Kind of like driving through a new city, or part of the country.  The landscape is vibrant, new, unfamiliar, exciting.  When I came back several months later, things were just unfamiliar, and not so exciting.If you are taking the OCEJWCD test, there is no avoiding them.  However, my recommendation is, unless you are writing a Servlet framework, avoid them.  Unless...

Simple Container Component Start & End Bars

When creating a container component for Adobe CQ, you often run into an issue where the resulting page is difficult to author as there are too many parsys adjacent to each other.  As bad as this situation is for the component developer, imagine how confusing it must be to authors who don't have a detailed understanding of how the component works.  As you can see from the illustration below of a tab component, when you...

Changing a CQ Component's Design Path

Usually, the default location used by the CQ Designs configuration works, however there are cases where you may want to set the designs to exist at a different location. For example, you may want multiple components to share a configuration or have all of the instances of a component on a site share the same configuration.CQ provides the EditConfig object which can be used to configure how the edit dialog is loaded in CQ.To configure your design...

Creating Integration Tests in Apache Sling

One of the lesser known features in Apache Sling Testing Tools framework is the SlingTestBase, this class can be extended to allow you to create tests against a Sling instance which will be automatically created, started and then shut down when the tests are complete.Why Test this Way?First, you should have some form of automatic testing on your Apache Sling and Adobe CQ5 projects.  Automatic testing gives you better coverage against regression and changes breaking code...

Ask the Experts: MVC in Adobe CQ5

In this series of blog posts we pose a question to experts in the Adobe CQ5 platform about Adobe CQ5, Enterprise Content Management and Web Development.How does CQ5's architecture compare to a standard MVC scenario?As we all know, MVC stands for Model, View, & Controller. This is the logical separation of work into those three buckets to allow for more modular and readable code. CQ follows this model (even if you may not notice you're...

Creating Detailed Packages with the CQ Deploy Plugin

Sometimes you may want to create a package with more descriptive information than the CQ Deploy Plugin provides out of the box.  You may want to customize the group or add a description or even add dependencies.   This article shows you how to include Package Metadata into your package and how to deploy the package with the CQ deploy plugin.Updating the PackageIn order to do this, first install the package into CQ and update...

CQ Stats Broken: Careful with that Extension Eugene

Before I get into the details of the problem I want to discuss, I am going to give you my personal thoughts and opinion on what I think the current state of some of the "original" CQ tracking features are.  I also want to give a plug for CQ and Adobe's approach to CQ.  I am appreciative of both.I was the Technical Lead for the second rewrite (why do it once, when you can do...

JMeter, CQ SmokeTesting, and much much more

Sometimes when trying to solve one problem, I discover the answer to another yet undiscovered problem.My pet peeve with CQ development is detecting in a semi-automated painless fashion, when templates, components or client side functionality are broken.  While JUnit integration testing catches some issues, what about "client side" integration testing?  The question is, how do you make sure the build you just pushed with Jenkins, that was green, didn't break the functionality of a component,...

My CQ5 Bookmarks

I'm pretty sparing with bookmarks, however there are a few pages I use just about every day for my job developing for Adobe CQ5.  I have these daily use bookmarks in my bookmarks toolbar.  They are:CQ ToggleActually, this is a bookmarklet, but it allows me to easily switch between editing more and a more 'real' preview mode.CQ Widgets APIA must have for dialog development.  Documents the available dialog widgets as well as the CQ JavaScript...

Configuring CQ for a Shared-Everything Cluster

So recently I was tasked to set up a "Shared-All" or "Shared-Everything" cluster in CQ5.5 (SP 2.1).  I found out fairly quickly that the resources online do not describe this process very well, so I figured I would share my experience with the web!For those who are unaware, the "Shared-All" configuration of CQ5 is where both the datastore and file journal are on a NAS or shared mount between all clustered servers.  The reason we...

What is my CQ Mode?

Figuring out what is the current authoring mode in components in Adobe CQ can sometimes be a tricky prospect.  Determining the current authoring mode is important for component development when you may want to display different HTML or controls to authors than will be displayed to the end users.  As a best practice, the same interface should display in Author and Design mode, as hiding or showing components may affect design.The most obvious solution is...

Six Dimensions' Contribution to CQ 5.6

The new version of CQ5, Adobe Experience Manager 5.6, includes a contribution by Six Dimensions to the Apache Sling project.  This contribution adds a new method, getChildren to the Resource interface.  Now getChildren() in the Resource-API, available in AEM5.6 thanks to @klcodanr #sling #cq5 #aem dev.day.com/docs/en/cq/cur...- Feike Visser (@heervisscher) March 10, 2013This method allows you to use for-each loops to iterate through child resources and allows access the children of a resource using Expression Language and TagLibs....

Consistent and Clean Rich Text and Images in CQ5

How can you improve on the humble TextImage component; the basis for most Adobe CQ5 website implementations?  This component (as one would imagine from the name) allows authors to put both text and an image on the page.  There are both Text and Image components which are suited for each separate task, however it has always seemed silly to me to have two components when one can do both jobs.Well, one of the first tasks...

Creating Flexible CQ5 Pages

One of Adobe's CQ5 Best Practices is to limit the number of Templates, I would suggest it is a best practice to limit the number of page components and create as many templates as necessary.Templates in Adobe CQ5 function differently than they do in many other CMS systems.  CQ Templates are placeholders for sample content and references to the component to render the sample content.  Often, projects create a 1:1 mapping between CQ Templates and...

Protecting Packages and Replication Agents

By default, unless you are specifically blocking parts of CQ from your dispatcher, you could be exposing your Packages and Replication agents to the world.You can fix this by adding this snippet to the /filter section of your dispatcher.any file:      /0006     {         /glob "* /etc/*"         /type "deny" }     /0007     {         /glob "* /etc/clientlibs/*"         /type "allow"     }      /0008     {         /glob "* /etc/designs/*"         /type "allow"     }  It doesn't matter where in the filter you...

END Form component is not delivered by the CQ elves...

I have long wondered how that stupid 'end' Form component shows up when you drop a 'start' Form component on a page.  Just like magic, that little bugger appears out of the ether.  The secret to this one is no longer a secret to you or me.Shame on me, and please forgive me, I did not write down the exact method I used to find this.  When I am "in the zone" hunting for something...

Configuring Telephone Tags within Rich Text components and the Link Checker

If you define a rich text field (xtype=richtext) in your componets dialog, if you try to enter a telephone link like<a href="tel:+13174562564">317-456-2564</a>when you try to save the content, the telephone link will be stripped out and not saved.You need to add the htmlRules and links node to your rich text field node <htmlRules jcr:primaryType="nt:unstructured">                             <links jcr:primaryType="nt:unstructured"                                     protocols="[http://,https://,ftp://,tel:,mailto:,file://]"    />                     </htmlRules>The tel: tag is defined in the protocols properties.Which should look like this, when it is...

Handling File Upload in Adobe CQ

You need to handle a file upload in Adobe CQ.  So, you notice CQ already has Apache Commons FileUpload installed, so you decide to use it to handle the file upload.You write your servlet code and end up with something like this:// Check that we have a file upload requestfinal boolean isMultipart = ServletFileUpload.isMultipartContent(request);PrintWriter out = null;try {  out = response.getWriter();  if (isMultipart) {    // Create a new file upload handler    final ServletFileUpload upload =...

Overriding the default damadmin or siteadmin pages in CQ5

Overriding foundation content in CQ5 was made fairly easy by our friends on the Adobe CQ team.  In the vast majority of cases, we can just replicate the path of the original code under libs to our apps folder.  In the case of siteadmin and damadmin, this would mean we need to copy the root node from the original path: /libs/wcm/core/content/damadmin or /libs/wcm/core/content/siteadmin to /apps/wcm/core/content/damadmin.  However, since these particular nodes are accessed through a vanityURL...

Note to self: This is Mike. BAD Idea to ...

... throw your laptop through the glass block window.Yes.  I'm back at it in spades on something that should be pretty simple.  Problem is there is lots of rhetoric on how it should/could/would be done, but honestly nothing of practical use.  This was not simply 10 minutes of Googling, throw my hand up and "Ach du lieber gott!"  No no no.  My most egregious sin is once I get it in my head that it...

Last Chance to Register for CQ5 Personalization Webinar

Today is the last chance to register for the CQ5 Personalization webinar.  The webinar will be held today, December 12th, 2012, at 1:00PM EST (12:00 - 1:00 PM CST 10:00 - 11:0 AM PST).The fifth of ten webinar series, will explore:Strategies for Personalization in CQ5Group vs Individual PersonalizationBlueprints/Live CopyCampaigns/TeasersClick here to download/watch the webinar!

Gotcha: Sling Servlet Requires a Name

I recently had the opportunity to delve into the code for the Sling Resources to document the @SlingServlet annotation.  One of the more interesting things I discovered was that in addition to everything stated on the Sling documentation about what is required to register a servlet, there is one additional requirement.Each Servlet which is to be created and registered, must have an unique name.  The SlingServletResolver, which handles the resolution of Servlets, generates the name...

New in Apache Sling: getChildren

Recently I had the pleasure of contributing to the Apache Sling project.  Among other things, I contributed a suggested improvement to have Sling Resources return an Iterable<Resource> of the child resources.  Recently, the Apache Sling released an update to the Sling API,  including an implementation of this improvement.  With the new API change, developers will be able to leverage the enhanced for-each loops available in Java 6. This will allow developers to write code like:for(Resource child...

Register for a Webinar on Personalizing Content with Adobe CQ5

Six Dimensions and 6D-Labs are pleased to announce the 5th in their series of CQ5 webinars: "Personalization"  This webinar will cover best practices in creating and deploying personalization strategies in Adobe CQ5.This webinar is intended for anyone with experience and exposure to CQ5 or another Web Content Management System.  This webinar will be especially helpful for teams who are planning on deploying personalized content in Adobe CQ5.When: Thursday, December 12, 2012 Time: 1:00 - 2:00...

Loading Classes in Adobe CQ

So you've got a problem.  You need to load a resource from the Classpath or you need to dynamically load a class and you're using Adobe CQ.  Since Adobe CQ uses an OSGi container, a regular ClassLoader will not be able to retrieve the class information from the OSGi Bundles.Never fear, Apache Sling provides the Dynamic ClassLoader Service.  This OSGi Service allows you to retrieve a ClassLoader which will allow you to interact with classes...

CQ Dev Architecture #01 - We're Building What?

In this blog post, and the subsequent 6 or so we will discuss one possible way of building a complete CQ development environment, "DevOps", development architecture, or whatever moniker you prefer.  To roughly outline this a bit for you:What we are building (this post)Create yourself an AWS AMINeeded Servers and their ConfigurationIDE Setup - EclipseMaven POM creation, organization, and CQ ProjectsCI / Jenkins Setup, configuration and build projectsWhat I don't like about my setupSome of...

Why does my TextImage Resource Type Keep Changing!?

On my current project, we ran into a very weird issue where the dialog kept changing when user's dragged images into the TextImage component we overrode from the foundation TextImage component.  Specifically, this only seemed to happen when user's dragged images into the component inline. After doing some investigation, I found that the sling:resourceType on the nodes was changing when the image was dragged into the component.  The culprit is the CQ Edit Configuration in the...

Captains Log, Stardate 1210.9: Where the heck are my CQ Logs

The usual way for viewing remote CQ logs seem pretty barbaric and kludgy to me.  Cat, tail, VI, less, and a partridge in a pear tree.  They all require way too many steps, especially if I am in the heat of the development cycle.  If I am leisurely browsing through the park one day trying to look at my logs, and I'm not in a hurry, they will do.  But I like the solution below...

Why Aren't My Public Events Working?

Creating widgets with Public Events and other widget JavaScript functionality allows for the creation of extremely powerful and user friendly dialogs.  Unfortunately, it can be difficult and frustrating to figure out what is the cause when the functions fail to work.Often, Public Events won't fire and there will be no indication in the console or errors as to why.  Here are some tips which may make it easier to figure out why your Public Event...

Use the same JSON source to create a Dialog and JSP State Selection List

So I needed to create a selection list of all the US states, as a dialog control and also as a selection list in my components JSP.So rather than hard code values in my dialog or as html <option> values, I thought it would be cleaner to use a JSON array of US state objects.I found a JSON list of US states on the web, and I modifed it to have the following structure[   {text:"Alabama",...

WYSIWYG HTML Source Editor Considered Harmful

Most Web Content Management system's Rich Text or WYSIWYG editors have an optional feature to allow authors to directly edit the HTML instead of using the WYSIWYG.  Among one of the first decisions made on a WCMS implementation project is to enable or disable this feature.  Proponents of the HTML editor argue for author flexibility and for freedom to directly enter markup.  I would argue, however, the HTML editor should not be enabled.What's Wrong with...

Workflow Launcher Blues

When creating workflow launchers I recently thought it a good idea to organize them within the /etc/workflow/launcher/config node by creating sub-node's to contain the customized launcher's organized by company name. Given the fact that the models support this, I figured this would be similar.  The only need, I thought, similar to the model sub-nodes is that the subnode of config would have to be of the same type as the config node itself.  With the...

Releasing an Adobe CQ5 Project with Apache Maven

Apache Maven's release plugin is a powerful tool for automatically incrementing version, tagging code and creating a release. Unfortunately, this plugin is not very forgiving and doesn't do a good job of telling you what you did wrong when it fails. Setting up Maven to release your CQ5 project can seem daunting, but if you follow a few simple rules it can be easy to set up and save you a ton of time in the...

Dumping CQ Configuration

Often when providing remote support, you may want to send a complete snapshot of a CQ instance's configuration and state to others to help debugging.  Generating a report of the complete status of the OSGi configuration, environment state and logs is as easy as invoking a single url. The OSGi console will generate a report of the following items when you invoke: {SERVER}:{PORT}/system/console/config/configuration-status.zipAll Log FilesWire AdminThreadsSystem PropertiesSling Thread PoolsSling SettingsSling Servlet FiltersSling Scheduler JobsSling Resource Resolver...

CQ5.5 OSGi (/system/console) Permissions

In the past, I've had several clients requesting access to the OSGi console, or /system/console, for users other then the built in "admin" user.  This is a fairly straightforward configuration but there is limited information about it online.  Out of the box CQ permissions unfortunately do not handle the OSGi / Felix stack.  Because of this, assigning a user to the "administrators" group in CQ is not enough to grant them access to the OSGi...

Building a dialogue to have 2 or more images

Most of time when I build a component I only require a single image so the dialog I build will look something like this<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"    jcr:primaryType="cq:TabPanel"    activeTab="{Long}0"    helpPath="en/cq/current/wcm/default_components.html#Text Image"    xtype="tabpanel">    <items jcr:primaryType="cq:WidgetCollection">        <tab1            jcr:primaryType="cq:Widget"            ddGroups="[media]"            fileNameParameter="/fileName"            fileReferenceParameter="/fileReference"            name="/file"            requestSuffix=".img.png"            sizeLimit="100"            title="Image"            xtype="html5smartimage">        </tab1>        <tab2            jcr:primaryType="cq:Widget"            title="Advanced Image Properties"   ...

MessageGatewayService vs MessageGateway

When creating services which use the CQ5's MessageGateway API to send emails, it can be tempting to use the following to directly reference the MessageGateway you need in your service: @ReferenceMessageGateway<HtmlEmail> messageGateway; Unfortunately, this can cause issues as the MessageGateway will not be available if the Day CQ Mail Service is not configured.   If the Day CQ Mail Service is not configured the MessageGateway service will not be registered in OSGi.  This will mean...

Sending Email with the Adobe CQ API

Sending emails through Adobe CQ can be easy, however there really isn't an example which brings the entire process together.  This blog post will guide you through the process of configuring Adobe CQ to send email, creating a component for sending email, creating an email template and finally creating a servlet which will send the email.First, though, what are the benefits of the Adobe CQ Email API?  The Adobe CQ API provides a method for...

Toggle CQ Author and Preview Bookmarklet

When using Adobe CQ5, you often want to be able to switch between author and preview mode.  Unfortunately, the preview included in the Sidekick does not provide a complete preview as it does not remove the Sidekick or the Content Finder.I created a bookmarklet which will switch the page between authoring mode and a preview where the Sidekick and Content Finder are removed and the WCMMode is set to disabled.  This bookmarklet preserves query string...

Calling all CQ5 Developers: OSGi v. JSPs Webinar

Do you develop components for Adobe CQ5 and wish there were a better way of abstracting your commonly used Java code?  Have you heard of OSGi, but haven't had a chance to actually implement it on your project?  Six Dimensions and 6D Lab's upcoming webinar OSGi v. JSPs, might be just the thing you need!About the WebinarThis webinar is the third in our series of CQ5 webinars and will cover best practices in developing and...

Select from Pages in a CQ5 Dialog

When constructing a dialog, you may want to present users with a list of pages to select from.  Browse and path fields work well for selecting from a tree, but often you may need to show just the pages from a single folder or from some discrete list.Using the optionsProviderOne way to do this is to create a selection field and populate the value through a JavaScript function in the optionsProvider field.  This field is...

Announcing the Release of CQ Deploy Version 0.1.4

The Six Dimensions Labs team is proud to introduce version 0.1.4 of CQ Deploy, an Apache Maven plugin for deploying Maven projects into Adobe CQ repositories.The CQ Deploy plugin allows developers deploy CQ projects using Maven in an easy and consistant manner.  The CQ Deploy Plugin is capable of deploying both packages and bundles and is compatible with CQ 5.2-5.5.The current release, version 0.1.4 brings:Added the ability to skip the installation of bundles.Added the ability...

Good to Know: InheritanceValueMap

The InheritanceValueMap is a new interface introduced in CQ 5.4.  This interface is meant to make it much easier for developers to access properties inherited from parent pages.  To do this, the interface provides two methods, getInherited(String,Class) and getInherited(String, Object), each of these methods will check for a value on the current resource and then check up the page hierarchy for another page with a value on the same content attribute.  It will only attempt...

Introducing CQ Deploy Version 0.1.3

The Six Dimensions Labs team is proud to introduce version 0.1.3 of CQ Deploy, an Apache Maven plugin for deploying Maven projects into Adobe CQ repositories.The CQ Deploy plugin allows developers deploy CQ projects using Maven in an easy and consistant manner.  The CQ Deploy Plugin is capable of deploying both packages and bundles and is compatible with CQ 5.2-5.5.The current release, version 0.1.3 brings:Added unit tests to test failure resultsAdded support for optional install...

Maven CQ5 Package Build: Updating Properties.xml

This article describes the process of adding and automatically updating a CQ5 Package properties.xml as a part of a Maven build.Why do I need a Properties.xml?Certain CQ5.4 Hotfixes are known to cause issues where packages without a properties.xml will not install properly.  If you attempt to install a package into a CQ instance with the affected Hotfix, you will see this error:java.lang.NullPointerException at com.day.jcr.vault.packaging.impl.InstallHookProcessor.registerHooks(InstallHookProcessor.java:80) at com.day.jcr.vault.packaging.impl.ZipVaultPackage.prepareExtract(ZipVaultPackage.java:303) at com.day.jcr.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:341) at com.day.jcr.vault.packaging.impl.JcrPackageImpl.install(JcrPackageImpl.java:314) at com.day.crx.packaging.impl.J2EEPackageManager.consoleInstall(J2EEPackageManager.java:304) at com.day.crx.packaging.impl.J2EEPackageManager.doPost(J2EEPackageManager.java:152) at...

Webinar: CQ5 Development Setup, Maven Build and Deployment

Six Dimensions and 6D-Labs are pleased to announce its 2nd CQ webinar "CQ5 Development Setup: Maven Build and Deployment"  This webinar will cover best practices in building and deploying CQ5 applications.This Webinar is intended for technical audiences, i.e., developers and architects who have existing experience with CQ5.When: Thursday, June 21, 2012 Time: 11:00 - 12:00 PST (1:00 - 2:00 CST 2:00 - 3:00 EST) Where: You'll be sent a Webinar registration upon completing the signup.Topics:The...

Introducing CQ Deploy Version 0.1.1

The Six Dimensions Labs team is proud to introduce version 0.1.1 of CQ Deploy, an Apache Maven plugin for deploying Maven projects into Adobe CQ repositories.The CQ Deploy plugin allows developers deploy CQ projects using Maven in an easy and consistant manner.  The CQ Deploy Plugin is capable of deploying both packages and bundles and is compatible with CQ 5.2-5.5.The current release, version 0.1.1 brings:Improved documentationImproved loggingA fix for an issue where creating new folders...

The Unofficial Guide to the Adobe CQ5 Translator

The Adobe CQ5 Translator is a powerful tool for managing and updating translations.  Using this tool you can create, update and remove i18n values across multiple languages in multiple translation dictionaries or groups of i18n keys.Using the CQ5 TranslatorTo use the CQ5 Translator access the URL http://{SERVER}:{PORT}/libs/cq/i18n/translator.html, replacing the server and port with the correct values for your environment.  This will pull up the CQ5 Translator as shown below.The CQ5 Translator The CQ5 translator allows...

CQ5 Upgrade Gotcha: Tag Localization

In CQ 5.4, Adobe added the ability to translate tags through the Tag Manager.  Unfortunately, due to the way this was implemented, it can cause issues when upgrading from CQ 5.3 or older.After performing the upgrade and importing the existing tags, you may find there are no languages available to translate the tags.  The Localization section will be visible, however no languages are available.Fortunately, the fix for this issue is easy.  Update the node at...

Introducing CQ Deploy: A Maven Plugin for Deploying CQ Projects

The Six Dimensions Labs team is proud to introduce CQ Deploy, an Apache Maven plugin for deploying Maven projects into Adobe CQ repositories.The CQ Deploy plugin provides two goals, to help developers deploy Maven projects:install-package This goal is used to install CQ Packages into CQ Repositories.install-bundle This gloal is used to install bundles into CQ Repositories.  This goal is different from the Maven Sling Plugin's deploy method.  Whereas the Maven Sling Plugin installs the bundle...

SCR JavaDoc Tags Deprecated in CQ 5.5

Teams migrating to Adobe CQ 5.5 have one more thing to check during the upgrade.  In CQ 5.5, the SCR JavaDoc tags are deprecated, because of this, you can no longer create bundles in CRXDE or CRXDE Lite when the code in the bundles contains SCR JavaDoc tags.  When Adobe ported CRX over to run inside of the OSGi Container, they created a bundle for the CRXDE functionality.  This includes the remote compiling and bundle builder...

Good to Know: The Sling PersistableValueMap

The Sling ValueMap makes retrieving properties from CQ easy and removes a lot of the error-prone code you have to use when using the JCR APIs, however it does not allow setting of properties.  This unfortunately results in developers using the Sling ValueMap to retrieve properties and JCR Nodes and Properties to set properties.  This doesn't have to be the case though!  Sling also provides an interface which allows for retrieving properties like a ValueMap...

New in CQ 5.5: Sling Adapters Console

Adobe CQ 5.5 has a new, long overdue feature in the Felix Console.  The Sling Adapters Console lists all of the available Sling Adapter Factories as well as their Adapter Classes, Adaptable Classes, condition information and Providing bundle.  This information can be invaluable for developers to determine what classes can be adapted and what they can be adapted into as well as checking the functioning of custom adapters.  Developers can access this information by logging...

New in CQ 5.5: Dependency Finder

Adobe just released CQ 5.5, the latest version of their flagship enterprise Web Experience Management product.  Along with a new UI, numerous speed and stability fixes and deeper integrations with Adobe's other products, CQ 5.5 comes with some new tools to make using and developing on CQ easier. One of the new tools is the Dependency Finder, which comes shipped in the Apache Felix console.  This tool can be very useful to developers to find...