Wednesday, April 11, 2018

How to recompile clientlibs and invalidate cache?

The clientlibs in AEM consists of JS and CSS and in some instances they get cached; which as would be obvious; causes issues.
To remove this cache and rebuild the clientlibs, following link is quite useful:

<domain-name>/libs/granite/ui/content/dumplibs.rebuild.html

There are individual buttons to invalidate cache and rebuild the libraries on this page.
For faster access, there is a query parameter for each process that can be appended to the URL:

Invalidate Caches: ?invalidate=true
Rebuild Libraries: ?rebuild=true



Please note for AEM 6.1, certain issues have been reported and solution provided. You can check the following link if you face an issue:

https://forums.adobe.com/thread/2327420

Tuesday, May 2, 2017

How to access all AEM logs via Felix Console


Sometimes, we need to get all AEM logs but might not have SSH access to the server.
In such scenarios, we can rely on the Felix Console.

1) Go to <domain>/system/console/status-slinglogs












The screen rolls automatically when the log files get updated for the current day.
However, all log files can also be downloaded via 4 options:

1) Download As Text

This will open a text document: <domain>/system/console/status-slinglogs.txt that has content from all log files

2) Download As Zip

This will download a zip file named 'status-slinglogs.zip' on your machine.
All system and custom log files can be extracted from this zip file.


3) Download Full Text

This will open a text document: <domain>/system/console/status-slinglogs/configuration-status-<date>.txt that has information about all bundles and content from all log files

4) Download Full Zip

This will download a zip file named 'configuration-status-20170503-050248.zip' on your machine.
All bundles details, config details and log files can be extracted from this zip file.



Thursday, January 19, 2017

How to avoid AEM generated wrapping divs




'cq:htmlTag' can be used to manipulate the wrapper divs that are generated by default by AEM.

This can be added as an nt:unstructured node under the component.

Following properties need to be defined for this node:
1. cq:tagName : The tag that needs to be generated for the component (div, span etc.)
2. class : The CSS class names that would be added to the tag generated as per 1.
3. id : The id of the tag that would be added to the tag generated as per 1.

Either of 2 or 3 or both can be used. However, if neither 'id' nor 'class' is defined, the tag doesn't get generated and AEM behaves in the default manner generating it's own wrapping div.

As an example,


This will generate the component as -
    <div id="component-id" class="grid-tile">
    .
    .
    </div>

How to recompile component JSPs in AEM via Felix Console

In the latest versions of AEM, there is a new feature available, which can be used to recompile the component JSPs.

This helps in resolving issues like:

- Latest changes not available on package install
- ClassNotFound exception on package install

This functionality can be accessed by:

  1. Login to Felix Console and go to Sling >> JSP OR directly go to <aem-domain>/system/console/slingjsp
  2. Click on the Recompile JSPs button



Thursday, October 13, 2016

How to disable link checker for selective links




Several times in a project, there is a requirement that the OOTB link checking in AEM needs to be disabled for specific links.

There are 2 options to achieve this:


x-cq-linkchecker="valid"  : This will make the linkchecker mark the link as valid.
x-cq-linkchecker="skip"  : This will make the linkchecker skip the link.

These tags should need to be added on the <a> tag directly, for example:
<a href="xxx" x-cq-linkchecker="skip">Link</a>


How to recompile clientlibs and invalidate cache?

The clientlibs in AEM consists of JS and CSS and in some instances they get cached; which as would be obvious; causes issues. To remove th...