Friday, August 19, 2016

How to invalidate the dispatcher cache for dam assets referred from multiple sites? - Adobe CQ5/AEM

How to invalidate the dispatcher cache for dam assets referred from multiple sites? - Adobe CQ5/AEM

Sometimes, we may have the scenario like the same DAM asset is referred from multiple sites and cached locally(site specific) in Adobe Experience Manager(AEM) dispatcher for the different sites. The local cache of the different sites should be invalidated whenever the asset is modified.

This post will explain how to achieve the above mentioned scenario.

Create a user in all the publisher and provide only the access to DAM- /content/dam


Create a flush agent for individual sites with the following details in all the publishers(repeat the below step for all the sites)



Friday, July 8, 2016

How to populate the current page path to the dialog through EXT JS - Adobe Experience Manager(AEM) 6.1

This post will explain, how to populate the current page path to the dialog through EXT JS - Adobe Experience Manager(AEM ) 6.1

Add the listener for the widget and use the below script.

function(widget) {
        var currentPath;
if(CQ.wcm.SiteAdmin.hasListSelection()) {
        var grid = CQ.wcm.SiteAdmin.getActiveGrid();
        var selections = grid.getSelectionModel().getSelections();
currentPath = selections[0].id;
console.log(currentPath);
widget.setValue(currentPath)
}
}







Thursday, June 23, 2016

Caused by: org.apache.sling.api.resource.PersistenceException: Resource is not modifiable - Adobe CQ5/AEM

 Caused by: org.apache.sling.api.resource.PersistenceException: Resource is not modifiable - Adobe CQ5/AEM


The below exception will be thrown most of the cases while accessing the servlet with post from Adobe Experience Manager(AEM).

The actual issue is Adobe Experience Manager(AEM) could not ale to resolve the servlet and assumes it as a resource path but this is not a valid resource path, the below exception will be thrown when AEM tries to set the property values.

Caused by: org.apache.sling.api.resource.PersistenceException: Resource at '/services/formservlet' is not modifiable.
    at org.apache.sling.servlets.post.impl.helper.SlingPropertyValueHandler.setProperty(SlingPropertyValueHandler.java:153)
    at org.apache.sling.servlets.post.impl.operations.ModifyOperation.writeContent(ModifyOperation.java:411)
    at org.apache.sling.servlets.post.impl.operations.ModifyOperation.doRun(ModifyOperation.java:101)

The steps to narrow down the issue:

Resolve the Servlet:

Go to http://<<AEM Host>>:4503/system/console/configMgr - Sling--> Sling Servlet Resolver and resolve the servlet path, if the servlet path is resolved then there is no issue if not the servlet is not configured properly.

Path resolved to a Servlet




Tuesday, June 21, 2016

Dispatcher Cache Invalidation for Multi Site Configuration - Adobe CQ5(AEM)

Dispatcher Cache Invalidation for Multi Site Configuration - Adobe CQ5(AEM)

This post will explain the approach to invalidate the cache for particular site in multi site configuration - Adobe CQ5(AEM).

Recently, i was working on a dispatcher caching issue with multi site configuration - The cache was not getting invalidated in all the dispatcher.

The setup is with multiple dispatcher connected via load balancer. The load balancer will route the request to individual dispatchers via round robin algorithm. The dispatcher is configured with individual virtual host and farm for every site(Load balanced DNS is used).

The flush agent was configured in publisher for every site with load balanced DNS(the flush agent was equal to number of sites configured in dispatcher) - The issue here is when ever publisher send the invalidation request that is not reaching the corresponding dispatcher as the flush agent is configured with load balanced DNS for invalidation URI - The request will be send to random dispatcher from the load balancer due to this the cache will not be invalidated in all the dispatcher.

Solution:

Create a flush agent in individual publisher that points to individual dispatcher(based on the renders configuration). The flush agent should be configured with dispatchers server name(one flush agent in one publisher)

http://dispatcher1.server.name:80/dispatcher/invalidate.cache