Tuesday 10 June 2014

Workflow, performance monitoring, logging in AEM


Workflow:

Used to automate process involved in page creation to publish.
http://localhost:4505/libs/cq/workflow/content/console.html
Launcher workflow enables to automate the workflow in AEM.
·         Instance tab shows running workflows which can be suspended or cancelled.
·         Models list all work flows created.
·         Archive : shows completed workflows
·         Failures: Shows all the failed workflows.

Error /Failure in Workflow custom process "Process implementation not found: "
The reason may be you are creating bundle using CRXDELite and below codes are commented.
#Export-Package: *
#Import-Package: *

Solution:So you have to uncomment to get the workflow success.

-------Similar Posts---------------
Mapping of requests in AEM
Interact With AEM
Run Modes
AEM
Apache Sling in AEM

-------------------------------------

Performance:
Logging
Request.log files will have all requests logged. Monitoring this log is the best way to track performance issues. We can also use some profilers to tackle the performance issues.
Tool helps to track last few requestsAuthor\crx-quickstart\opt\helpers > rlog.jar
To access logs,
From command prompt reach to the location of rlog.jar then > execute java -jar rlog.jar -n 10  ../../logs/request.log will give all slowest responses.
Readable: http://dev.day.com/docs/en/cq/current/deploying/performance.html
Timing chart URL will also help to find the performance timing of any page loading.
Common performance improvement methods: http://helpx.adobe.com/experience-manager/kb/performancetuningtips.html

AEM/CQ Common issues




Rectify Content Assist issue in AEM/ Adobe CQ(5.6)
-------------------------------------------------
We need CRXDE to have installedfuture pack to get content assist for JSP pages
Download link: http://blogs.adobe.com/livecycle/2012/06/developers-faq-on-cq5-5.html
·         Missing crx de libs(missing-crxde-libs.zip) to be install through package manager.
·         Now rename or delete user>.crxde folder, restart the crxde so that content assist works fine.

  -------Similar Posts---------------

Mapping of requests in AEM
Interact With AEM
Run Modes
AEM
Apache Sling in AEM
-------------------------------------
Notes: Some times cq5.6 gives error on jsp pages. Remove below codes to avoid issues:
header.jsp
<cq:include path="toptoolbar" resourceType="foundation/components/toolbar"/>
footer.jsp
<cq:include path="toolbar" resourceType="foundation/components/toolbar"/>



Error /Failure in Workflow custom process "Process implementation not found: "
The reason may be you are creating bundle using CRXDELite and below codes are commented.
#Export-Package: *
#Import-Package: *

Solution:So you have to uncomment to get the workflow success.

AEM OSGi Bundles:


OSGi Bundles:

Open Services Gateway Initiative (OSGi) helps developing and deploying modular applications and libraries in Java.Some of the major OSGi container implementations are Equinox, Knopflerfish, and Apache Felix. OSGi works on a set of services that an OSGi container must implement and a contract between the container and your application.
Resource folder can be used to put resource files like configuration files, xml files properties files etc.
Meta data of bundles:
·         Export-Package: *
Tells to export all packages to cq - makes available to cq
If we mention,
Export-Package: com.cq.test; it just makes this package available

·         Import-Package: *
Tells to import all packages from other bundles to our bundle - makes available to use those clases.

·         Private-Package:
Packages that should not be exposed to the OSGi container

·         Include-Resource:
used to include resource files like properties files available to our bundle.

Bundle-Activator Class:


Start() and stop() are the lifecycle of bundle activator class.
stop() can be implemented if any resource to be stopped, if our bundle failure happens abruptly.
public void stop(BundleContext context) throws Exception

-------Similar Posts---------------
Mapping of requests in AEM
Interact With AEM
Run Modes
AEM
Apache Sling in AEM

-------------------------------------

OSGi Vs JAR
-------------------
OSGi can be told as an advanced version of JAR. It uses more metadata to show/hide the visibility of classes in bundle. JAR is a private collection of classes where OSGI provides a safe way to make the classes available across.
Sample to create anAEM /Adobe CQ bundle and use it in a page
-------------------------------------------------------
Create the folder structure as below.





Create a bundle by right clicking on src folder. Enter the details as required.





Now the new bundle will have below structure.





Now under the test folder create an impl folder. This is used to write our custom Java class.
Now add TestService.class with a common output as below.

-------------
packagecom.cq.adobe.test.impl;


public class TestService{

public String getTestService(){

return "CQ developer training sessions";
    }

}
--------------

Right click com.adobe.test.bnd and build bundle (Tools>Build Bundle)

This creates jar file under install folder which is automatically placed to OSGi packages.

AEM/CQ Internalization


Internalization for content authoring

-----------------------------------------------------------------------
Assists author in his own language preference. Use i18n to specify the internationalization. iso code(fr,de,enetc) of the langue to be used for each node specific to each language
How to create internationalization for a project in AEM?
Follow below steps to create internationalization.
·         Create language folder using sling:Folder,
·         add property jcr:language with iso specification (jcr:language : en)
·         Add mixing

Translator: http://localhost:4505/libs/cq/i18n/translator.html
By Above tool/URL we can add new language internationalization messages. Click on 'Add' and enter fields and submit.
Admin/User language settings in AEM
Changing admin level language can be done through Administrator (right top) -> preferences->Language




Backups & restore CQ files

-------------------------------------
AEM provide online & offline backups.
Online:Online method creates a backup of the entire repository, including CQ5. We can perform this method while the repository is in use.
Offline:Creates a backup of the CRX repository files including all of the information stored in CRX, so you can restore the exact state of the repository during backup.
Also incremental so it updates only next day components to backup.

-------Similar Posts---------------
Mapping of requests in AEM
Interact With AEM
Run Modes
AEM
Apache Sling in AEM

-------------------------------------