Sunday, 6 December 2015

Exception while calling a Servlet in AEM

Question:  I am trying to access a servlet with a doPost method from the JSP and getting the following exception -Caused by org.apache.sling.api.resource.PersistenceException: Resource at ‘/location/Stores’ is not modifiable.
  at rg.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)
My bundle is built successfully and the resource resolver shows the path as expected and resolves to the given path.Activate method of the servlet is successfully called.However while trying to give an Ajax call from the jsp it never reaches the doPost method.I tried it both with doPost and doGet.Please help.
Answer: Give your servlet path as /bin/location/Stores or /services/location/Stores which is configured in ‘Apache Sling Servlet Resolver’
If you want, you can add your own Servlet/Script resolver from /system/console/configMgr and your custom resourcePath will be resolved by the servlet resolver

Max number of users in CQ Publisher

There is no restriction on number of users in publisher. But if you have your users already outside, you can also have your own external login module for authentication and authorization. However, you need to ensure you are using AEM 6.0 or higher and Oak. With Jackrabbit/CRX 2, such scale was possible, but you do need to do some extra configuration if you have groups with thousands of members. Your post didn’t call this out specifically, but if you have tens of thousands of users, odds are you have some big groups 

How to find out AEM version you are using?

There are two ways to find the AEM version you are using:-
Bottom of Welcome Page [ http://host:port/libs/cq/core/content/welcome.html ] 
 AEM version welcome page
System Console [ http://host:port/system/console/status-productinfo ]
AEM version system console

JavaScript Use-API with Sightly

The Sightly JavaScript Use-API enables a Sightly file to access helper code written in JavaScript (server side execution). This allows all complex business logic to be encapsulated in the JavaScript code, while the Sightly code deals only with direct markup production.
A simple use of JavaScript Use-API can be be seen here. These are predefined method defined in sightly, those can be used in JS file to read the values and return it. Example has been shown with a simple component which excepts a title and description. These values are then read by server side JS using available Use API. Once read they will be returned to component sightly file for rendering in html.

 Read More

Tuesday, 24 November 2015

Personalize Content With Adobe AEM

Personalized content is a growing trend, and lately we've put a lot of effort in leveraging CQ5's built-in tools, as well as developing custom components that can consume rich marketing data from third parties. These components—out-of-the box or custom—are a real complement to an enterprise CMS when they are well used and well integrated. In addition, they can be especially useful to content authors and marketers when used to visualize and simulate different segmented experiences.
Let's say I have an online outdoor clothing store built on CQ5 and I want highlight the sunglasses section of my catalog. I have great sunglasses but I suspect this product section is too deep in the navigation, so visitors almost never find it. My plan is to create a personalized content that links to the sunglasses section on my homepage that will display if the visitor comes to the site via a specific search for sunglasses in a search engine.  

User Segmentation and Personalization in AEM

Personalization centers on providing the user with a tailor-made environment displaying dynamic content that is selected according to their specific needs; be this on the basis of predefined profiles, user selection, or interactive user behavior.

 Read More