Thursday, December 10, 2015

Internationalization of CQ/AEM Components

1. First of all, you need to configure languages in /etc/languages
2. Then, enable internationalization in your app by adding i18n folder and providing dictionaries.
3. Now, provide details and descriptions of your component in i18n keys.
4. Apply the same while creating your component as shown in image. You can do the same for all the titles/descriptions in Dialog, editConfig etc












5. Now, configure your user (admin/admin) to the language you want to see your component details in. For me it was en_US as follows.












And you're done

P.S dont leave space when you're putting keys in dialog/component/editconfig/actionconfig titles e.g.

If you'll have the value of text in cq:actions as follows, key will not be interpreted.

text: your_component_editconfig_title

Instead remove the space btwn text: and your_component_editconfig_title

like text:your_component_editconfig_title

Monday, November 23, 2015

AEM Multilingual Contents in Sightly


AEM Multilingual Contents in Sightly

There are two ways one can configure multilingual contents on AEM using Multisite Management.

1. Blueprints
2. Language Copy

A blueprint is the source for creating multiple contents with the same format. Say for example we have a site in English, French and German. All these sites have similar contents in three different languages. We can configure blueprint keeping English site as the source and create French and German live copies. Now there should be dictionaries configured as per https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n/translator.html

To enable the multilingual contents  your sightly pages to use the content key as follows.

${'your_internationalization_key_as_per_i18n_file' @ i18n}
Here the locale/language is selected as per the language of contents

${'your_internationalization_key_as_per_i18n_file' @ i18n, source='user'}
In this syntax the language is selected from the browser setting of the user.

${'your_internationalization_key_as_per_i18n_file' @ i18n, locale='de'}
In this syntax  the language is de (German) taken from the locale value assigned.

Tuesday, October 20, 2015

How to configure ExtJS 6 on Aptana/Eclipose

How to configure ExtJS 6 on Aptana/Eclipose



This is off-track, not related to CQ development. However, when you're a CQ developer you would want to explore the technologies related to it. That's what I've attempted to do.

There are many blogs and posts available on Internet that talk about how to configure ExtJS versions < 5. However, they're confusing and misleading if you're trying to configure ExtJS 6. Here are few small changes those should be done in order to save the efforts.


First of all ExtJS 6 doesn't come with jsb2 files. I was really confused about how to configure ExtJS when I dont see the jsb2 file. So now, instead of jsb2 file, you need to add new folder and select /ext-6.0.0/build folder like this



The same can be verified by typing Ext. and pressing ctrl+space to see if your ExtJS has been configured properly or not on a js file.

Further this site has detailed tutorial on ExtJS.

Monday, October 19, 2015

Workflow Authorization error

Workflow Authorization error



While working with Workflow in AEM 6 and above or CQ5.6, it is important to ensure all the user access is provided correctly in either case following error can be encountered. In my case, the user group itself was not present. Again, this was because I had copied workflow from other location and not created it on my instance from the scratch.


com.adobe.granite.workflow.core.job.JobHandler Could not advance workflow. com.adobe.granite.workflow.WorkflowException: org.apache.sling.api.SlingException: No Authorizable with ID null
at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(ParticipantNodeHandler.java:163)
at com.adobe.granite.workflow.core.advance.AdvanceUtil.transitionFrom(AdvanceUtil.java:143)
at com.adobe.granite.workflow.core.WorkflowSessionImpl.complete(WorkflowSessionImpl.java:633)
at com.adobe.granite.workflow.core.job.HandlerBase.complete(HandlerBase.java:498)
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:183)
at org.apache.sling.event.jobs.JobUtil$1.run(JobUtil.java:378)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.sling.api.SlingException: No Authorizable with ID null
at com.adobe.granite.workflow.core.util.SecurityUtil.getAuthorizable(SecurityUtil.java:54)
at com.adobe.granite.workflow.core.util.SecurityUtil.getAuthorizable(SecurityUtil.java:46)
at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(ParticipantNodeHandler.java:132)
... 8 more
Caused by: java.lang.Exception
... 11 more

Workflow version error

Workflow version error




I faced an exception like this while I was working on workflows for the first time

com.adobe.granite.workflow.core.jcr.WorkItemAdapterFactory error adapting a class of type [{org.apache.jackrabbit.core.NodeImpl}] to type [{java.lang.Class}] com.adobe.granite.workflow.model.VersionException: Version 1.84 does not exist for /etc/workflow/models/XYZ/XYZ-components-workflow/jcr:content/model
at com.adobe.granite.workflow.core.jcr.WorkflowModelManager.getWorkflowModel(WorkflowModelManager.java:96)
at com.adobe.granite.workflow.core.WorkflowSessionImpl.getModel(WorkflowSessionImpl.java:279)
at com.adobe.granite.workflow.core.util.NodeReader.createWorkflow(NodeReader.java:211)

The reason behind this exception is the version difference of workflow instance which I bump into because I was copying workflow from different locations and somehow the sync between the current workflow version and instance workflow version were messed up. Different workflow instances (as per their modification dates) can be seen at following location.

/etc/workflow/instances

AEM 6.0 with Multiple jdk

AEM 6.0 with Multiple jdk



Here I will be specifying the challenges I faced while trying to configure AEM 6.0 with multiple jdk on my local environment.

The first challenge I faced while working with AEM 6.0 was to make it run within my machine which is configured for java 1.8.
AEM 6.0 sp 1 does not work with jdk 1.8

For any AEM version starting from CQ5.6 it is required to install service pack 3. You can find the same on adobe site.

You can find more technical requirements at Adobe site

So I was left with one of the two options :
  1. Setting my machine to run of JDK 1.7  
    • Configuring the JAVA_HOME and Path environment variables to point to your JDK 1.7
    • Checking the same using java -version on command prompt
    • Also check which exe is there in system32 folder
  2. Running AEM 6.0 with JDK 1.7 (some how)
    • For this one you can use a java command that is twisted like


C:/Program Files/Java/jdk1.7.0_25/bin/java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=30303 -XX:MaxPermSize=1024M -Xmx1024m -jar aem-author-p4502.jar -nofork -gui


Some more AEM 6 Interview Questions for Architects

 Some more AEM 6 Interview Questions for Architects 1. Consider you have a workflow with two steps. One step is to transfer the asset from s...