AEM Context-Aware Configurations in Java Backend Example Code
AEM Context-Aware Configurations to enable developers to define adaptable application settings based on specific site or content contexts. This feature significantly simplifies the management of environment-specific configurations, allowing for dynamic application behavior adjustment without changing the core application code. In this article, we will step through how developers can incorporate and retrieve context-aware configurations from […]
HTL caconfig Global Variable for Context-Aware Configuration in AEM
Context-Aware configuration contains a Scripting Binding Values provider with automatically registeres a caconfig variable in your HTL/Sightly scripts to directly access context-aware configurations. It supports both singleton configurations and configuration lists. Please note that configuration lists are only supported when configuration metadata is present (e.g. via an annotation class). In this article we will step […]
AuthenticationSupport service missing. Cannot authenticate request.
Encountering the “AuthenticationSupport service missing. Cannot authenticate request” OR the “HTTP ERROR 404 Not Found org.apache.felix.http.base.internal.dispatch.DispatcherServlet” errors in Adobe Experience Manager (AEM) can halt your development progress, presenting a significant obstacle. This error often points to underlying issues with the AEM instance’s ability to access or initialize critical repository services. Fortunately, there’s a practical approach […]
Generate Custom Oak Indexes with the Oak Index Definition Generator
Indexing in Adobe Experience Manager is very important. It’s not just about making things faster; it totally changes how we handle and find data online. With the Oak Index Definition Generator, developers get a really handy tool to shape how searches work behind the scenes. This tool isn’t just about making indexes, it’s about making […]
Handling Http Requests, HttpClient, in AEM
When integrating with external services or APIs from Adobe Experience Manager (AEM), utilizing the HttpClient for outbound HTTP requests is a common requirement. It’s crucial to handle these connections efficiently, securely, and in a way that is compatible with AEM’s architecture to ensure optimal performance and maintainability of your code. AEM provides a specialized factory, […]
Differences Between Using Free ChatGPT 3.5 vs AEM Developer GPT
When comparing ChatGPT 3.5 with the AEM Developer GPT (OpenAI ChatGPT Plus), the key differences lie in their breadth of knowledge, specialization, and the ability to stay current with the latest technologies. ChatGPT 3.5, while impressively versatile, is grounded in a wide array of knowledge that spans up to its last training cut-off in 2021, […]
ChatGPT for AEM Developers, AEM Developer GPT
When working on Adobe Experience Manager (AEM) projects, finding the right support for coding can be a game-changer. That’s where AEM Developer GPT comes in – a dedicated generative AI tool designed specifically for AEM developers. It’s here to make your life easier, whether you’re looking to generate code examples quickly or seeking answers to […]
AEM 6.5.5 Not Indexing Problem *Fixed*
In the course of establishing a new multitenant website, we opted to re-use the search mechanism for both site1 and site2. However, following the deployment of our code to the cloud QA environment, a significant hurdle surfaced: site2’s search consistently failed to produce results. This revelation made us to invest considerable effort in a detailed […]
AEM Chrome Extension for Content Authors, Developers, and CMS Admins Across All AEM Versions
Navigating Adobe Experience Manager (AEM) can often feel like a repetitive dance for content authors, developers, and administrators. Moving between pages, Touch UI editor, Classic UI editor, page properties, and CRXDE Lite involves the manual hassle of copying URLs and making adjustments – a time-consuming chore that needs a fresh approach. Enter the AEM Chrome […]
Execute JavaScript in the Author Environment for AEM Components AEM 6.5+
To execute JavaScript specifically for the AEM Author Environment, developers can add a condition to check for a Cookie stored in the browser, ‘cq-authoring-mode’; this works on AEM 6.5+. When the Cookie of ‘cq-authoring-mode’ exists, then execute JavaScript during authoring on the editor.html. Only in the Author Environment, the Cookie, ‘cq-authoring-mode’, will exist. Below is […]
Targeting CSS in the Editor.html for AEM Components for AEMaaCS
Sometimes as developers, we would need to inject some CSS into our pages in the edit-modes to enhance the experience of our authors. One key skill as an AEM developer knowing how to customize the authoring experience in the editor.html (while content authors are editing the page). This article explores the techniques of targeting CSS […]
Benefits of SlingSafeMethodsServlet with Code Examples
A robust security strategy is pivotal to safeguarding applications. As an AEM developer, we must really understand the SlingSafeMethodsServlet, an invaluable feature within the Apache Sling framework. This article explores the core concepts, practical benefits, and the heightened security it brings to servlet development. The org.apache.sling.api.servlets.SlingSafeMethodsServlet is an extension of the trusted HttpServlet in Apache […]
Try-With-Resources: Ensuring Session Closure, AEM Code Example
In the dynamic realm of Java programming in AEM, effective resource management is a cornerstone of writing robust and reliable code. The “try-with-resources” statement, introduced in Java 7, emerges as a powerful ally in simplifying resource handling. This article delves into the practical implementation of “Try-With-Resources” within the context of a specific code snippet, emphasizing […]
Brian Li AEM Enthusiast and AEM Technical Lead in Vancouver
Welcome to my blog! I’m Brian Li, an enthusiastic AEM technical explorer based in Vancouver. Within my blog, I invite you to join me on a journey through the fascinating world of Adobe Experience Manager (AEM). From the intricacies of AJAX, Java, JavaScript, and HTML to the dynamic landscape of crafting digital experiences, I’m here […]
AEM Convert Excel to JSON Simple Servlet Example
In this article, I present a straightforward yet powerful solution that demonstrates how to seamlessly convert Excel data into JSON format using Adobe Experience Manager (AEM). By implementing a custom servlet, I will illustrate the process of converting an Excel sheet named ‘example.xlsx’ into structured JSON data; it can be downloaded below for you following […]
JCR SQL2 ISDESCENDANTNODE Multiple Paths Example
While working with the JCR SQL2 Queries, you may encounter scenarios where content is distributed across various branches of the repository. Querying these branches efficiently is key to implement features to capture requirements. In this article, we will focus o how to collect and query for distributed across various branches of the repository. Using the […]
AEM User Story Example: Accordion Component
Being an AEM tech lead, I’ve sat through countless meetings about ticket creation. One thing that keeps popping up? The struggle to create that ‘perfect’ ticket. You know, the one where everything’s clear, and nobody has to ping you with a dozen follow-up questions. So, I took a shot at crafting a solid example of […]
Optimizing & Debugging Search Queries, Explain Query Tool AEM
The “Explain Query Tool” tool assists developers in understanding, optimizing, and debugging search queries, which are crucial for the AEM’s performance and accurate content delivery. Understanding the Explain Query Tool The Explain Query Tool essentially breaks down and explains the steps and processes a query goes through in AEM. Think of it as a ‘debug […]
Retrieving the Current Page in an AEM Servlet via ResourceType
In the context of “Retrieving the Current Page in an AEM Servlet via ResourceType”, it is great to understand how this is done. This guide provides a simplified walkthrough on how you can adeptly achieve this. In the code example, we will associating the servlet with a resourceType. 123456789101112131415161718192021222324252627282930313233343536373839package com.example.aem.servlets; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import […]
AEM 6.5 On-Prem, Embed AEM Core Component’s to the Project
The AEMaaCS platform contains the Adobe AEM Core Components pre-installed into the /libs folder, but however, AEM 6.5 on-prem does automatically contain this; we must install it manually. For legacy AEM 6.5 project utilizing the Adobe AEM Core Components, they must configure & install this library to each environment (authors, publishers) with the correct version. […]
How to Embed wcm.io Context-Aware Configuration Editor
This blog article serves as your guide to seamlessly integrate and deploy the wcm.io Context-Aware Configuration Editor – a powerful tool that streamlines configuration management within AEM projects. Throughout this article, we will delve into the step-by-step process of configuring, installing, embedding, and deploying the wcm.io Context-Aware Configuration Editor. By following these instructions, you’ll be […]
AEM Sling Servlet: resourceTypes for POST & GET Code Example Code
When working with Sling Servlets in AEM, the choice between using a resource type or a sling path as the basis for your servlet’s operation is crucial. This article delves into the benefits of utilizing resource types and provides practical examples of how resource types can streamline your development process for both POST and GET […]
AEM JCR SQL2 Full Text Search Case Insensitive
One of the key features of AEM is its support for searching and querying content stored in its Java Content Repository (JCR). In this article, we will explore how to perform a case-insensitive full-text search using the JCR_SQL2 query language in AEM and provide a practical example of achieving this through a servlet. Performing Case-Insensitive […]
Granite UI, Touch UI helpPath
helpPath typically refers to a configuration property that defines the path to the location where help content or documentation is stored within the AEM repository. The helpPath configuration property is often used in AEM components or templates to specify the location where users can access contextual help documentation related to the specific component or template. […]
Sling Resource Merging Properties
In the realm of AEM developers have a powerful tool at their disposal that allows for seamless customization—Sling Resource Merging. This feature might sound a bit technical, but fear not! In this article, we’ll break down the key aspects of Sling Resource Merging and delve into its properties, showing you how they can simplify your […]
How to access Design Dialogue Properties in Sling Model
Design Dialogs are especially useful for creating components that need to be easily configurable through editable template and policies without directly editing the underlying code. They enable a clear separation between content and presentation, allowing content authors to make changes without needing technical expertise. Design Dialogs are defined using the AEM Touch UI Dialog, which […]
Granite UI, Touch UI trackingFeature
In Adobe Experience Manager (AEM), the terms “tracking code” and “tracking feature” are used to refer to elements that help you gather analytics data about the usage and performance of components or features within your AEM instance. Let’s break down what each term means: 1. Tracking Code The term “tracking code” generally refers to a […]
JUNIT 5: ArgumentCaptor with Mockito
Unit testing isn’t just about confirming your code works; it’s about ensuring it excels. Mockito, a trusted mock framework, introduces the ArgumentCaptor, a potent tool for honing your unit tests. This feature empowers you to capture and assert method arguments, leading to highly targeted tests. In this article, we’ll delve into the realm of ArgumentCaptor […]
JUNIT 5: JCR SQL 2 Unit Tests w/ Sling Servlet
I’ve dedicated quite a chunk of my personal time to crafting this blog post, and yes, I’ve rigorousl… This page is premium content. By supporting this website, please subscribe. Subscribe now for $1 for 1 month of premium content. Username or E-mail Password Remember Me Forgot Password
Search in AEM
This comprehensive guide offers AEM developers like you a roadmap to implement powerful search functionality using AEM Search APIs. Unravel the potential of three core AEM Search APIs: XPath Search API, JCR SQL2 Search API, and Query Builder Search API. Each API brings unique features to the table, and we’ll guide you through their capabilities […]
Query Builder API Exclude Pages or Paths
This blog article focuses on searching cq:Page under a particular path, but exclude sub pages. In this article we will share you the Query Builder API’s Query, and share with you the Java code implementation of a servlet. At the end of this article, you should be able to search cq:Page nodes under a particular […]
50 Visual Studio | VS Code Hot Key / Shortcuts for Mac 2023
Welcome to our guide on 50 Visual Studio Code shortcuts for Mac users. Whether you’re a seasoned developer or just starting, mastering these keyboard shortcuts will significantly enhance your coding productivity. Let’s dive in and discover the most efficient key combinations for a seamless coding experience! For Window users, visit this article, 50 Visual Studio […]
50 Visual Studio | VS Code Hot Key / Shortcuts for Windows 2023
Welcome to our guide on 50 Visual Studio Code shortcuts for Windows users. Whether you’re a seasoned developer or just starting, mastering these keyboard shortcuts will significantly enhance your coding productivity. Let’s dive in and discover the most efficient key combinations for a seamless coding experience! For Mac users, visit this article, 50 Visual Studio […]
AEM Sightly Official Documentation: Everything You Need to Know
This blog particularly promotes Adobe’s AEM Sightly documentation, which lives inside of their github repository. In this article, we’ll explore the significance of AEM Sightly and how its official documentation can be a valuable resource for developers working with Adobe Experience Manager. With understanding Adobe’s Sightly documentation, you will be equipped with the right tools […]
AEM RichText Remove P Tag on Sightly
You may have been trying to search the internet for an out of box solution to remove the single paragraph container for Touch UI, and have found something like removeSingleParagraphContainer. But however, this attribute was for the Classic UI and deprecated. From my knowledge, there isn’t anything out of the box that can remove the […]
Why Indexing in AEM is so important for Search
As we are developers implement search, I would like to share the importance of indexing in AEM. I would like to express that this is a simple post, but enough information to get you to understand the importance of indexing. Continue and read the article below to see the significance & Importance of Indexing in […]
AEM Effective Pagination with Query Builder API
There are many ways to implement pagination for AEM content. Effectively choosing the right solution will indeed Bu decrease development time, and promote a performant experience to your end users. AEM has multiple search API’s like xPath, JCR SQL2, Node JCR, Query Builder, etc… But in my opinion, the Query Builder API would be the […]
A Simple Guide to AEM Search APIs: Exploring Your Options for Powerful Search Functionality
As an AEM developer, the ability and skill to identify solutions and implementations to quickly and efficiently search through vast amounts of content is crucial. Understanding the all the AEM platform’s search API capabilities will ensure you are a effective developer, when implementing solutions for AEM search. In this article, we will explore the various […]
Add inline CSS with AEM Sightly
AEM Sightly is a templating language that simplifies the integration of HTML and server-side logic. One of the key features of Sightly is the ability to use add inline-css to the component itself, so that your user experience requirements can be full-filed. In this article, we will explore how AEM Sightly enables developers to apply […]
AEM Rich Text Editor rendering aria-labels
You have written some custom JavaScript for the AEM Core Text Component, core/wcm/components/text/v2/text, which allows content producers to configure the HTML attribute “aria-label” to anchor “a” tags. When the page is being rendered on the page, the “aria-label” for the links, “a” tags, are not visible. You as a developer check crx/de and you do […]
AEM Query Builder Examples with Content Fragments
In this article, I will share some example AEM Query Builder API Search Queries that queries for Content Fragments. 1. Find all Content Fragments with Content Fragment Model 123456type=dam:Asset path=/content/dam/sourcedcode boolproperty=jcr:content/contentFragment boolproperty.value=true property=jcr:content/data/cq:model property.value=/conf/sourcedcode/settings/dam/cfm/models/model1 http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=type%3Ddam%3AAsset%0D%0Apath%3D%2Fcontent%2Fdam%0D%0Aboolproperty%3Djcr%3Acontent%2FcontentFragment%0D%0Aboolproperty.value%3Dtrue%0D%0Aproperty%3Djcr%3Acontent%2Fdata%2Fcq%3Amodel%0D%0Aproperty.value%3D%2Fconf%2Fsourcedcode%2Fsettings%2Fdam%2Fcfm%2Fmodels%2Fmodel1 2. Find all Content Fragments with Content Fragment Model & Property 12345678type=dam:Asset path=/content/dam/sourcedcode boolproperty=jcr:content/contentFragment boolproperty.value=true 1_property=jcr:content/data/cq:model 1_property_1.value=/conf/sourcedcode/settings/dam/cfm/models/model1 2_property=jcr:content/data/master/title 2_property.value=example http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=path%3D%2Fcontent%2Fdam%2Fsourcedcode%0D%0Aboolproperty%3Djcr%3Acontent%2FcontentFragment%0D%0Aboolproperty.value%3Dtrue%0D%0A1_property%3Djcr%3Acontent%2Fdata%2Fcq%3Amodel%0D%0A1_property_1.value%3D%2Fconf%2Fsourcedcode%2Fsettings%2Fdam%2Fcfm%2Fmodels%2Fmodel1%0D%0A2_property%3Djcr%3Acontent%2Fdata%2Fmaster%2Ftitle%0D%0A2_property.value%3Dexample […]
@SlingServletPaths Example Code in AEM
This is a quick reference to example code, which will show you how to use the most base instantiation of @SlingServletPaths. The output is a simple JSON response with application/JSON, 200 OK, and response body = { “property1”: “value1” }. Quick note: it’s not recommended to use @SlingServletPaths. Check out the caveats when implementing servlets […]
How to Enable AEM Style System Configuration for Components
AEM Style System enables a user-friendly interface, for non-technical users who can easily make style adjustments, fostering creativity and agility. Integrating seamlessly with Adobe Experience Manager, the AEM Style System enables content authors to apply predefined styles effortlessly, maintaining brand consistency across platforms and devices. As developers are trying to create new AEM component’s this […]
AEM Touch UI (Granite UI) Tabs: Example Code
Almost all components require developers to put together the Touch UI experience with tabs as the base of their components. It’s a simple XML code configuration, however, sometimes finding the reference isn’t that easy to find online. This article is just a simple reference article where I share the configuration as XML, so it can […]
AEM Touch UI Show Hide Tabs by Style System Configuration
It’s no doubt that AEM’s Style System for Components has become more popular over the past few years, and is used by almost every author in this industry. However, there are some feature flaws in the product for the authoring experience, where sometimes we would like to show or hide Touch UI tabs depending on […]
AEM Style System Component Information with Code Sling Models
As an AEM full-stack web developer who frequently works with AEM components, it’s not uncommon to require access to the AEM Style System configuration of a specific component. This information can prove invaluable when writing conditional algorithms to manipulate data output. However, the question remains: how can one retrieve the necessary AEM Style System information […]
Checking run mode from Sightly HTL in AEM in 2023
While we are developing in the modern world of AEM, sometimes we may want to understand if our backend implementation is being executed under “development”, “staging”, and “production”. In the past, we use the SlingSettingsService, but unfortunately, the SlingSettingsService is flagged as a deprecated service in AEM. According to one of the most prominent AEM […]
Set AEM Local Environment and Secret Variables AEMaaCS
As an AEM developer developing for the AEMaaCS SDK, it’s essential to have a local environment properly set up for development purposes. You may encounter environment-specific and secret variables in your OSGI configuration files. As an AEM developer trying to familiarize new features of the AEMaaCS SDK development environment, setting up environment-specific and secret variables […]
AEM Sightly Component(s) Empty CQ PlaceHolder
In almost all cases, component’s that are not configured, dragged onto the page should have some sort of indicator telling content authors that they should configure the component; a few of us calls this the empty component placeholder or “cq-placeholder”. A novice AEM full-stack may not be geared with the right tools, and so they […]
AEM Developers Courses 2023 That Really Helped Me
There are a couple of courses that I would like to share that have really helped me, not just in interviews, but also in my daily AEM development regime. In my opinion, I think these are the best courses for anyone who is either getting started as an AEM developer or who is already working […]
jackrabbit-filter: Filter root’s ancestor ‘/etc/mobile/groups’
A mobile emulator is a tool used to test how a website or application will appear and function on a mobile device. It allows developers to preview and test their mobile websites or applications without the need for an actual mobile device. There are several mobile emulators available for AEM, such as the iOS Simulator […]
How to login to AEMaaCS Local Publish crx/de system/console
As an AEM developer working in the AEMaaCS environment, it’s common to need to run AEMaaCS local author and publish while developing in your local environment. Typically, authenticating into the AEMaaCS local author environment is straightforward, but accessing the AEMaaCS local publish environment requires some additional steps. The AEMaaCS local publish environment runs on port […]
What are AEM Content Fragments & it’s Use Cases
AEM Content Fragments, CF, are units of reusable and modular content in AEM that can be managed and shared across multiple pages and digital channels. They allow content to be created and managed independently of the pages and templates that use them, making it easier to maintain consistent and up-to-date content across multiple channels. CF’s […]
JUNIT5: What Exactly is org.mockito.junit.jupiter.MockitoExtension and Sling Model Example
org.mockito.junit.jupiter.MockitoExtension is a JUnit 5 extension provided by the Mockito library. It allows you to use the Mockito framework to create and inject mocked objects into your JUnit 5 test classes. This extension provides several features such as annotation-based mock creation, automatic detection of unused stubs, and support for the Mockito API. It enables you […]
AEM JUNIT5 with io.wcm.testing.mock.aem.junit5.AemContextExtension
io.wcm.testing.mock.aem.junit5.AemContextExtension is an extension for JUnit 5 that provides a way to run AEM (Adobe Experience Manager) unit tests with mocked AEM objects. This extension allows you to set up an AemContext object in your JUnit 5 test class, which provides access to mocked AEM objects such as the ResourceResolver, SlingSettings, and more. This makes […]
Mocking Static Methods in JUNIT5
PowerMock is a Java framework that allows you to unit test code that uses static methods, constructors, and private methods. PowerMock uses a combination of bytecode manipulation and reflection to enable the mocking of these types of methods. PowerMock is not officially supported by JUnit 5. PowerMock is built on top of EasyMock and provides […]
Advancing Your AEM Skills: Tips for Junior Developers
AEM has grown in popularity over the past few years, and AEM developers are in high demand as a result, as they can assist businesses in utilizing the platform to produce compelling digital experiences. This article is for an AEM junior developer who wants to stand out from the competition. I will provide some detail […]
error: immutable file ‘conf.d/dispatcher_vhost.conf’ has been changed!
While setting up Adobe Experience Manager (AEM) as a Cloud Service’s dispatcher SDK on my local Mac machine, following this Adobe documentation, I encountered an error while running the command “./bin/validate.sh src”. The error message read “error: immutable file ‘conf.d/dispatcher_vhost.conf’ has been changed!”. After some research, I found that the issue was related to the […]
AEM Programmatically Write/Update/Modify AEM JCR node property/properties
In this article, I will be presenting code snippets for how we can programmatically update AEM JCR nodes in AEM using Java; using the org.apache.sling.api.resource.ModifiableValueMap and javax.jcr.Node API. In this article, we are showcasing the way that you would programmatically update AEM JCR nodes in your local machine, logged in as a System Users in […]
JUnit 5: Mocking the HttpClient in Java
Unfortunately when building AEM backend logic, the org.apache.http.client.HttpClient is non-trivial to write unit tests. In my case, I scavenged across the net to find a solution where you can make an GET and POST request via HttpClient in particular for AEM, and unit test is performing as expected. In order for me write successful to […]
Deploying Core Module of the AEM Project
For rapid AEM backend developer, we would like to build the AEM core module bundle to our running local AEM instance. In this article, we will configure the core bundle with an automated script. Simple build the project with mvn clean install -PautoInstallBundle. This is actually a standard that is shipped from the aem-project-archetype-39, but […]
Create System | Service Users in AEM 6.5 with Code Configurations
In this article we will walk through how to configure your AEM project to have the AEM environment self configure System Users in AEM with code, so that you would not need to do it the manual way. With the leverage of the org.apache.sling.jcr.api v2.4.0 bundle provided by AEM 6.5.4+ or AEM as a Cloud […]
resourceResolverFactory.getAdministrativeResourceResolver(null) WhiteList Bundle for Administrative Login
When working for organizations with the goal of migrating from AEM 6X to 6.5 or to AEM Cloud as a Service. It’s very common that the AEM backend code still utilizes the deprecated resourceResolverFactory.getAdministrativeResourceResolver(null) @depricated API. This method has been deprecated as of 2.4 (bundle version 2.5.0) because of inherent security issues. Services requiring specific […]
WCM Core Components Sling Models Interfaces Design
While reviewing Adobe’s WCM Core components you may realize that the Sling model all have JAVA interfaces. Why do they follow this design pattern, and what benefits does it help to the overall design of their Sling models? In this article, I will share my understanding of why Adobe designed its Sling models like this. […]
Webpack Dev Server ^3.9.0 unable to POST (send data to server)
While working on the web pack dev server (version ^3.9.0), you may have changed some configurations with the proxy configuration, so you can proxy specific paths like /api or /bin to refer to a server of your choice; in this example, we are referencing to our AEM local environment in localhost:4502. While making server calls, […]
AEM Sightly Comments with Examples
When writing comments in your Sightly HTL file, it’s best practice not to use HTML comments, but to use the sightly, HTML Template Language. 1. HTL comments are not evaluated and returned back as an empty string in the server-side rendered results. This is best practice when developers are including some comments for other developers […]
Race Conditions with window.Granite?.I18n
We have created a JavaScript micro-frontend in VueJS to handle a new feature for our website. The JavaScript micro-frontend is set up nicely inside of a maven module. Along with it’s own Node Package Manager configuration, we used the aem-clientlib-generator to generate a client library under /apps/sourcedcode/clientlibs/micro-frontend. Within our VueJS application, we have a utility […]
What are AEM ExtraClientlibs?
When dealing with cq:ClientLibraryFolder (node type), you may have come across a property called extraClientlibs. What are extraClientlibs and how does it work? As you may recall, when you want to add custom functionality or styling to the Touch Dialogues (in edit author mode, editor.html), we must include cq.authoring.editor.sites.page as a dependency and cq.authoring.editor.sites.page.hook as […]
What Version Sightly, Apache Sling Scripting HTL Engine, is my AEM Using?
How do I find out which Sightly, Apache Sling Scripting HTL Engine (runtime) version is being used in my AEM environment? You may want to know because while writing code, you would want to know which API is avaiable to use. The Apache Sling Scripting HTL Runtime provides support for executing HTL Java compiled units […]
AEM Components are not showing up on Page Templates
As an AEM content author, you will sometimes notice that no components are available in the parsys (drag and drop area). You try to double-click on the parsys or try to view components on the component’s finder, and nothing shows up. This is because the page mis-configured to allow components to be used on the […]
AEM Granite UI Coral 3 Number Field Default Value
This article is for how can we set the default positive or negative integer value for the Granite UI 1.0 Coral 3 numberfield, granite/ui/components/coral/foundation/form/numberfield. Apparently the Granite UI 1.0 documentation for the granite/ui/components/coral/foundation/form/numberfield, does not support default value configuration for the numberfield. Keep reading… I mean, they do… you can set a default value for […]
Find all AEM Pages with Specific Page Properties with Query Builder API
The Query Builder is a great tool that allows us to search for nodes in the JCR. We often as AEM developers use this tool to build a query for us to use in the backend to build query descriptions (predicates); the set of predicates produced will call the Predicate Evaluator which knows how to […]
AEM Granite UI Multifield Maximum Items Validation
For almost all cases of AEM implementations, adding validation for maximum items for the Granite UI Multifield is a must. In this article, we will put together a script that will register a new validator (foundation.validation.validator) to the foundation-registry (the foundation-registry is used in the Granite UI framework). In this solution, we will be utilizing […]
Add AEM Custom Frontend CSS JavaScript Editor.html
I would like to re-share one of my existing blog articles on how to add a custom client library for the AEM Author Editor (editor.html). It’s a very simple configuration that requires one dependency and one client category. This method is specific to customizing page authoring in AEM. Click on this link for exactly how […]
AEM i18n Not Showing Translations
A common question for AEM developers is, why are my i18n translations not showing up in my AEM environment? Recently, I have seen this problem coming up and I have the solution just for you. During deployment, whether it is from AEM Author or Publish, when deploying new dictionary keys, it’s uncommon for new i18n […]
Granite UI Multifield Sightly Traverse | Iterate Simple Example
In this article, we will share an example on on how we can iterate and traverse through multifield nodes that have been generated by the Touch UI using Sightly in a very simple way. Going through this article, we will be setting up multifield Granite UI links (as if we are building a menu navigation). […]
How to change a user’s password on AEM
During development, sometimes our environments are not set up with single Sign-On, so creating users manually will be a manual task in our AEM environment. When creating users manually, AEM engineers need to insert a secure password, and sometimes the password will be lost. Updating user passwords for non-single sign-on users is very simple. In […]
Importing rep:policy nodes in the ui.content maven content package
While working on a new AEM project (typically using https://github.com/adobe/aem-project-archetype), we might sometimes want to deploy new content with rep:policy nodes in particular, to give permission controls to allow jcr:read everyone to view the root content pages like /content/sourcedcode. There comes when a problem while building the ui.content maven module. Sometimes the rep:policy node is […]
Adding Custom Client Library for AEM Author Editor Touch UI
You can use Clientlibs to extend the default implementation and add new functionality while reusing the default functions, objects, and methods. When customizing, you can create your own clientlib under / apps. Specifically, when you want to add CSS or JavaScript to your AEM Author Editor, Touch UI Dialogs, you would want to create a […]
HTL Java Use-API Code Example
The HTML Template Language (HTL) Java Use-API allows an HTL file to use data-sly-use to access helper functions in a custom Java class. This allows any sophisticated business logic to be wrapped in Java code, while the HTL code is just responsible for direct markup generation. A simple POJO can be used as a Java […]
Checking run mode from Sightly HTL in AEM
Sometimes during development, we would need to check the run mode in our AEM environment, so we can show different content based on the context. From the Sightly HTL API, it’s possible to check for the wcmmode, but not the runmode. In this article, we will set up a sling model helper which will be […]
How to Generate Unique AEM Component ID with Confidence
You frequently require a special ID for the AEM component. Either a backend server-side call or a custom JS action trigger are required. If the component is dragged and placed on the page more than once, the hard-coded field ID is not guaranteed to be unique. When considering ID, you might consider directly using the […]
Transferable Skills to become an AEM Full Stack Developer in 2022
If you have worked on a backend project with technologies like Tomcat, JBoss, etc… and also worked on the front-end project with technologies like ReactJS, VueJS, or AngularJS… or a full-stack project that is similar to what is mentioned, it shouldn’t be too difficult for full-stack developers to move into the AEM-universe. AEM’s primarily uses […]
Find all AEM Pages with Tags with Query Builder API
The Query Builder is a great tool that allows us to search for nodes in the JCR. We often as AEM developers use this tool to build a query for us to use in the backend to build query descriptions (predicates); the set of predicates produced will call the Predicate Evaluator which knows how to […]
How to Write AEM Reusable Touch UI, Granite UI Configuration
Why are we repeating ourselves, writing the same Touch UI (Granite UI Component) configuration again and again as developers? It’s been like the 10th time that we have created a Granite UI Component configuration, an identical block of code. The RTE Granite UI Component should only contain basic format options. Is there a way for […]
AEM Client Library Debugger & Client Library Test Tool
A quick way to validate your AEM client libraries via registered clientlib categories is by using the AEM, out-of-the-box, “AEM Client Library Debugger Test Tool”. The tool is very bareboned. When you are on the tool page, you’ll find a Categories input field. Simply insert your to-be-tested clientlib category value here and press “submit”. Your […]
Send Out Emails with AEM Servlet
In this article, we will be setting up the local AEM author developer’s environment to send out an email utilizing the Day CQ Mail Service. This article includes code snippets to a Sling Servlet that will be used to send out the email. We will be using a Google Gmail account as the SMTP Mail […]
JUnit 4: AEM How to Mock @RequestAttribute value in Sling Model
This blog article will show code an example for JUnit 4, for how the Request Attribute is being mocked. This example will only cover mocking the @RequestAttribute with the use of @PostConstruct runtime phase, When you are in the code runtime phase of the constructor injection, this will not work (I spent a bit of […]
Get Cookie Example of AEM Servlet and Sling Model
In this short article, we will show two code examples; for example, one will be showcasing how cookies values can be accessed for an AEM Servlet, and for example two, Sling Model. 1. AEM Servlet Get Cookie Example 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465package com.sourcedcode.core.servlet; import com.cat.wcm.core.util.JSONObject; import org.apache.commons.lang.StringUtils; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.servlets.SlingAllMethodsServlet; import org.osgi.service.component.annotations.Component; import javax.servlet.Servlet; import […]
Set Cookie Example of AEM Servlet and Sling Model
In this short article, we will show two code examples; for example, one will be showcasing how cookies values can be set for an AEM Servlet, and for example two, Sling Model. 1. AEM Servlet Set Cookie Example 12345678910111213141516171819202122232425262728293031323334353637package com.sourcedcode.core.servlets; import com.cat.wcm.core.util.JSONObject; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.servlets.SlingAllMethodsServlet; import org.osgi.service.component.annotations.Component; import javax.servlet.Servlet; import javax.servlet.http.Cookie; import […]
How to Dynamically Include an Experience Fragment in Sightly
In this article, we will dynamically reference an AEM experience fragment to a page, dynamically using code. Sightly Implementation Hard Coded Example The first example uses sightly to reference an experience fragment, /content/experience-fragments/we-retail/equipment, and the required variation, master. This will only work when the path includes the experience fragment variation path. The value here is […]
Revealing Module Pattern in JavaScript, Jquery, for AEM Client Libraries
This is a reference to the code that I have written. I call this my version of the perfect AEM JavaScript Jquery Component that uses the Revealing Module Pattern. The Revealing Module Pattern in JavaScript is a design pattern that helps us organize our JavaScript in modules. This pattern makes it possible for us not […]
Find AEM JCR Nodes with Full Text Search
Every AEM developer knows that a JCR node consists of properties and values. Whenever a component is configured or whenever page properties are set, the value is saved in the JCR node as properties and values. There are times when we would like to search all the JCR node properties, to match the value with […]
AEM IntelliJ Debug Error:osgi: [sourcedcode.core] Classes found in the wrong directory: {META-INF/versions/9/javax/xml/bind/ModuleUtil.class=javax.xml.bind.ModuleUtil}
Writing unit tests for AEM Backend code on IntelliJ can sometimes be challenging; mocking objects, initializing OSGI components, etc… It’s most beneficial when we can write unit tests utilizing the JUnit debug feature on IntelliJ. While trying to debug code in JUnit, I was getting an error of 1Error:osgi: [sourcedcode.core] Classes found in the wrong […]
ACS Commons multi-field extension, acs-commons-nested, checkbox is not working
This article will provide a solution to the ACS Commons multi-field extension, checkbox Granite UI Component. While utilizing the ACS Commons multi-field extension, for everything I tried, I am not able to get the checkbox Granite UI component working as expected. Not an elegant way to solve the problem, but something that actually works and […]
How to Re-Sync a Live Copy Language Root to a Blueprint in AEM MSM
On some occasions, the rollout behavior becomes dysfunctional where our rollout behavior no longer rollout content to the expected content structure within AEM. Authors will be frustrated and start to manually create singular live copy pages from the language master to the designated content tree, and this job just becomes very tedious. AEM MSM tools […]
AEM RichText Remove P Tag, removeSingleParagraphContainer, for Touch UI
You may have been trying to search the internet for an out of box solution to remove the single paragraph container for Touch UI, and have found something like removeSingleParagraphContainer. But however, this attribute was for the Classic UI and deprecated. From my knowledge, there isn’t anything out of the box that can remove the […]
How to Pass Data Parameters to WCMUsePojo from Sightly HTL Component
You can pass data parameters from Sightly HTL component to the WCMUsePojo backend in a very simple way. You can simply call the get(String name, Class type) method from the available public methods from the com.adobe.cq.sightly.WCMUsePojo class. For implementation, use the get(String name, Class type) method, we obtain the values sent from Sightly as attributes; […]
How to Pass Data Parameters to Sling Modal from Sightly HTL Component
You can pass data parameters from Sightly HTL component to the Sling Model backend by request attributes. For implementation, utilising the org.apache.sling.models.annotations.Model, we will add required options parameter, adaptable, with the value of SlingHttpServletRequest.class. Next, we can utilize the annotation, org.apache.sling.models.annotations.injectorspecific.RequestAttribute (@RequestAttribute), which will find the matching name of the attribute that is being passed […]
AEM RichText TouchUI, Enabling Code Editor, Source Edit
Sometimes we need to give our power content authors, the flexibility to review their HTML markup from the richText editor, so they can ensure that the semantics are looking as expected. As AEM developers we are summoned to enable and deliver this requirement. In this article, I will provide a code example on how we […]