Custom Sling Model Injector using Annotations
Published
Sling Model Injectors allow developers to retrieve and inject data directly into Sling models. However, sometimes,
standard injectors aren't enough when you need to pull custom or complex data, such as tag properties or content fragments. In
such cases, custom Sling Model injectors can be developed to meet specific data requirements.
Dynamically Populate Select Options in AEM Component Dialog
Published
Creating dynamic and interactive components can significantly enhance the authoring experience. One effective enhancement is dynamically
populating the options of a select field within a component dialog. This is especially useful when the options need to be fetched from an external source
or depend on other selections made by the author.
Setup ACS AEM Commons in AEM Projects
Published
ACS AEM Commons is a collection of reusable components and utilities designed to enhance the functionality of AEM.
It offers a variety of features that help developers tackle common challenges and simplify development tasks through effective solutions.
Content Migration AMS to AEMaaCS
Published
Content transfer is a crucial step when migrating AEM projects to AEMaaCS, especially with large volumes of content.
To streamline this process, Adobe provides Content Transfer Tool (CTT), which can be used to initiate the migration of existing
content from a source AEM instance (on-premise or AMS) to the target AEM Cloud Service instance.
Setting Up Custom Domain in AEM Cloud
Published
It is good practice to have a Domain for your site that is memorable for customer and reflects your brand's identity.
Adding a custom domain name in AEMaaCS requires interaction between DNS service and Cloud Manager. A user must be a member of Business
Owner or Deployment Manager role to complete this task.
Tailing logs on AEM as Cloud Service
Published
Tailing logs is a very basic need that every developer performs daily, as logs serve as the frontline for debugging
AEM applications. While AEM 6.5 allows tailing logs via the System Console or SSH into AEM servers, AEM Cloud Service no longer
provides this access. Instead, Adobe Cloud Manager supports accessing AEMaaCS logs via Adobe I/O CLI with Cloud Manager plugin,
which allows for downloading and tailing logs. Additionally, Adobe Cloud Manager allows for the download of logs, by day, via
environment's Download Logs action.
Environment Variables and Secrets in AEMaaCS
Published
Environment variables allow AEM code and applications to adapt based on context, enabling different configurations
for development, production, or staging environments. They can be updated or deleted as needed, no code changes or deployments
required. By separating code from configuration, they enhance security and keep sensitive information out of version control.
Custom OSGi Configuration in AEM
Published
OSGi Configuration allow us to configure run-mode specific properties. All the out-of-the-box OSGi configurations
are available at /system/console/configMgr while custom configurations can be created as per business requirements. These configurations
are typically managed within the AEM project's ui.config module in the code repository.
AEM Dispatcher Caching Flush Strategies
Published
When caching is implemented for your website, it's essential to clear the dispatcher cache after publishing pages
to ensure the most recent content is displayed to end users. To reflect changes made by authors, we need to configure Replication
Agent on Author instance to push changes to the Publish instance and Dispatcher Flush Agent on Publisher instance to invalidate
the Dispatcher cache. Once the cache is invalidated, next request will be served from the publisher, and the response will be added
to the cache; subsequent requests will be served from the cache without interacting with the publisher.
Update Java JDK to v11 for AEM Cloud
Published
By default, AEM projects are built by Cloud Manager build process using Oracle 8 JDK, but AEM Cloud Service customers are strongly advised
to set the JDK version used to execute Maven to 11 for improved performance, security, and support over earlier versions.
Start AEM in Debug Mode
Published
Troubleshooting and debugging are crucial aspects of working with AEM, allowing developers to identify, analyze, and fix issues
in their code. Since AEM projects often involve extensive custom code for Models, Services, Servlets, and Schedulers, debugging allows real-time
inspection and provides valuable insights into the root cause, enabling effective fixes. To debug an AEM application, you can use Java Remote Debugging.
Update AEM Archetype using Repository Modernizer
Published
AEM Project Archetype is a Maven template creates a minimal, best-practices-based AEM project. Over the years, AEM Project
Archetype has been revolutionized with significant advancements, introducing many new features and possibilities into AEM projects. The
latest Archetype emphasizing the separation of content and code into discrete subpackages to maintain the distinction between mutable and
immutable content. To align existing projects with AEM’s Cloud Service structure, the Repository Modernizer tool can be used to refactor and
reorganize project packages, separating content and code into the appropriate packages.
Form Submission from Publisher to Author Instance
Published
Modified
In General, when an end user submits a form, the request is routed to the publish
environment. Any modifications made at the CRX/DE during the execution of the post request are
stored in the publish environment. However, a request may arise where upon form submission,
certain data such as a content fragment needs to be created on the author instance. Following approval
from business-level users, the content will be published to the publish environment, making it publicly
accessible on the internet.
SonarQube Setup for AEM Development
Published
In AEM development, prioritizing code quality is essential. Even during deployment via Cloud Manager, it's
crucial to meet specific metrics for security, reliability, maintainability, and code coverage. SonarQube enables continuous
code inspections, identifying issues early in the development lifecycle that could affect these metrics. Though integration,
developers can ensure the maintenance of clean, efficient, and secure code throughout the AEM development process.
Caching Experience Fragments
Published
Experience Fragments (XF) often face cache invalidation issues, where modifying and publishing an XF does not update
the pages referencing it because the XF content is cached within each individual page rather than a shared repository. As a result,
authors have to manually activate or invalidate each page to see the updated XF content, making the process tedious and impractical.
Custom Metadata in AEM Assets
Published
Custom metadata that allows authors to define additional properties for digital assets beyond the
standard metadata fields. These custom metadata fields in AEM Assets enhance asset management by allowing
organizations to tailor information to their specific needs. They facilitate the inclusion of project
specific details, campaign tags, and other relevant data, streamlining more effective asset categorization
and management.
Content Fragments vs Experience Fragments
Published
Adobe Experience Manager (AEM) provides powerful tools for managing and delivering content efficiently. Two essential
components in AEM are Content Fragments (CF) and Experience Fragments (XF). While both are used to create reusable content,
each serves a distinct purpose and offers unique capabilities.
Best Practices Analyzer for AEMaaCS Migration
Published
Best Practices Analyzer (BPA) evaluates the current AEM implementation, identifying
areas not in alignment with AEM best practices and offering guidance on how to improve. It also
expedites the assessment of readiness for transitioning from an existing Adobe Experience Manager
(AEM) deployment to AEM as a Cloud Service. This tool generates a report pinpointing potential
areas for refactoring, marking the initial phase of migrating to AEM as a Cloud Service.
Extend AEM Page Properties
Published
Page properties in AEM serve as metadata that provide essential information about a webpage. While AEM
provides a standard set of properties to meet basic web project needs, organizations often enhance them with extra
functionalities or custom data fields to effectively address more complex or unique requirements in content management.
AEM Workflow Custom Process
Published
AEM provides a set of pre-defined workflow process that cover common scenarios, but sometimes
these built-in features may not fully handle the complexities of specific workflows. In such cases, AEM allows
developers to create custom processes, enhancing the functionality of standard workflows to meet unique requirements.
Setting Up Headless Authentication with Salesforce
Published
Modified
Viewed141 times
With headless authentication, backend authentication can be segregated from frontend identity experiences,
enhancing faster login experience. It enables each channel to provide unique UI experiences according to their brand guidelines.
Replicate data-sly-resource in AEM SPA Component
Published
Viewed128 times
In traditional AEM development, composite components are built by combining several atomic components
through the data-sly-resource statement. For instance, Teaser component is built using image, text, and
button components. However, in the SPA paradigm, neither React nor Angular implementations offer direct
alternatives for this approach.
Caching AEM Pages with Dynamic Content
Published
In general, when a page is retrieved from cache, all users view identical content. However, websites with gated
or authenticated pages, certain sections — such as displaying a logged-in user's name or a login button for anonymous
users — must remain dynamic and not be cached. Considering this scenario, Sling Dynamic Include (SDI) in AEM supports the
dynamic generation of specific components, while also enabling the retrieval of others from cache.
Mock Static Methods with Mockito
Published
In the pursuit of clean object-oriented code, the need to mock static methods may suggest design flaws or code smells,
prompting consideration for refactoring. Nevertheless, there are situations where mocking static methods remains crucial
despite refactoring efforts.
Show/Hide AEM Dialog Fields on Dropdown Selection
Published
Viewed442 times
Enabling Show/Hide functionality for AEM dialog fields improves user experience by allowing content authors to
focus on relevant fields, thereby making the authoring process more efficient and less error-prone.
Web Optimized Image Delivery for AEM Custom Components
Published
Web Optimized Image Delivery feature of AEM as a Cloud service delivers image assets from
the DAM in WebP format. WebP can reduce the download size of an image by about 25% on average, which
results in faster page loading.
Install SSL Certificate from PFX file
Published
Viewed112 times
Installing SSL certificate is crucial for securing websites, ensuring encryption of data transmission between
users browser and the site to protect sensitive information. Let's explore the process of installing SSL certificate from
PFX file, providing step-by-step instructions for a seamless setup.
AEM Gated Pages Caching Strategies
Published
Viewed163 times
In General, requests containing authentication information are not cached because the cached document is
served to the client without authentication. However, if the requirements permit the caching of authenticated documents,
this can be activated by setting the /allowAuthorized property to "1". Additionally, need to implement the AuthChecker module,
which verifies users access permissions for a page before delivering the cached content.
Project Lombok in AEM Projects
Published
In AEM backend Java development, Sling Models are utilized to retrieve dialog values using annotations. However,
writing boilerplate code such as getter methods for passing these values to HTL can be tedious. To simplify this
process, Project Lombok can be integrated, automatically generating the necessary boilerplate code
with annotations like @Getter. This streamlines development tasks by eliminating the need for manual getter method creation.
Query Builder CheatSheet
Published
Modified
Query Builder offers an easy way of querying the content repository of AEM. The API is
built using the JCR API. AEM includes a Query Debugger tool that allows you to execute search queries
on the JCR (Java Content Repository). Utilize this tool to perform a dry run of the AEM queries, optimize
them, and then implement them into your code.
Fetch Multifield Values using Sling Model
Published
Viewed206 times
In accordance with specific project requirements, there might be a need to incorporate Multifield within the
component dialog. Let's explore how to retrieve Multifield data and effectively utilize it in HTL.
Restricting AEM Dispatcher Access in Lower Environments
Published
Viewed113 times
AEM's dispatcher is not restricted and is publicly accessible by default. While unrestricted access is
suitable for production environments, it's recommended to restrict access in lower environments such as
dev and stage to your organization or specific users. This can be achieved through IP Allow Lists or Basic Authentication.
Integrate Adaptive Forms in AEM Sites
Published
Modified
There are two potential scenarios for integrating Adaptive forms into AEM Sites: one for new projects
and another for existing projects. Adobe has developed the aem-core-forms-components which can be used to
incorporate forms standard components into AEM Sites.
AEM Component Dialog CheatSheet
Published
Modified
Viewed330 times
Granite UI provides a large range of the basic components needed to create component
dialog on the authoring environment. These components are constructed using Coral UI-based elements.
Create Content Fragment Programmatically
Published
Viewed210 times
Creating a content fragment programmatically requires setting up a system user with Read
permission for the content fragment model and Read, Modify, Create permissions for the asset folder where
the content fragment will be stored. Additionally, ensure the content fragment model and asset folder are
created for saving the content fragment.
Setting Default Values in AEM Component Dialog
Published
Modified
Viewed192 times
In AEM components, it's often necessary to establish default values.
This ensures that when components are dragged onto the page, they display predefined initial values.
This functionality is achievable through the utilization of cq:template and cq:templatePath.