11/14/2016

AEM - Extend , Override , Overlay

Adobe Experience Manager (AEM) has come with many inbuilt or OOB (out of the box) components.
When we are going to design and develop a Web Page, we don't have to write the code from scratch or reinvent the wheel.
Following are the most important and very useful AEM Components.

1) Page
2) Parsys
3) iParsys
4) Carousel
5) Text
6) topnav

What is Extend?
Inheritance

1. component to component - sling:resourceSuperType

2. dialog to dialog - cqinclude, path to the parent dialog.

3. client libs - dependencies(property)
What is Override?

Create a component with same file name of the out of the box, for example, create a Page component

What is Overlay?

When a component includes a file that has the same name and relative location as a file in the component's supertype, it is called overlaying.

11/01/2016

OSGi - Bundles / Components / Services

Adobe Experience Manager (AEM) is an enterprise-grade web content management system

OSGi  - Open Source Gateway Interface
Apache Felix - is an OSGi framework
OSGi is modular software development, Modular software development is the concept, it built interface, black box implementation of interface.
We implement interfaces, build number of modules build components to create a big application. Everything you built is a component.


OSGi - The ideal framework for composite content frameworks
Adobe's content management platform is the mature, proven OSGi runtime framework based on Apache Felix
OSGi reduces complexity by providing a highly dynamic, modular architecture for composite applications.

OSGi benefits:
Reduced Complexity - with OSGi technology, you develop and deploy code and resources as modular bundles that hide their internals from each other, communicating through
well defined APIs. The high degree of encapsulation provided by bundles improves granularity and compositionality and provides robust dependency resolution, improved
control over visibility and easier debugging.

Greater reuse - The OSGi component model is inherently suited for code reuse.

Dynamism - The OSGi framework is highly dynamic. You can start and stop services when and as needed.
Easy deployment and management
Transaparency
Flexible versioning support - All bundles are explicitly versioned
Simple - The core OSGi consists few classes  and one package.
Lightweight - The OSGi framework is small and efficient
Flexible - Many frameworks takeover the entire virtual memory, OSGi on the other hand, can run standalone or inside a Java EE application server

10/31/2016

What is Adobe Experience Manager - AEM

AEM: Adobe Experience Manager is a web based client server system for building, managing and deploying commercial web applications/sites and related services. It combines a number of infrastructure level and application level functions into a single integrated package.
At infrastructure level, we have the following.
Web Application Server: AEM can be deployed in standalone mode (It includes an integrated Jetty web server) or as a web application within a third party application server (WebLogic, WebSphere etc.)
Web Application Framework: uses sling web application framework, that simplifies the writing of RESTful, content oriented web applications.
Content Repository: AEM includes a Java Content Repository (JCR),a type of hierarchical database designed specifically for unstructured and semi structured data. The repository stores not only the user facing content but also all code, templates and internal data used by the application.
Building on this base, AEM also offers a number of application-level features for the management of:
Websites
Mobile Applications
Digital Publications
Forms
Digital Assets
Communities
Online Commerce
Finally, customers can use these infrastructure and application-level building blocks to create customized solutions by building applications of their own.

Adobe Experience Manager (AEM) is an enterprise-grade web content management (WCM) system with wide range of powerful features.

Adobe Experience Manager AEM 6.2 - 9 Important Concepts

1) Content Distribution
It introduced in AEM 6.1, but most of the time it worked behind the scenes. That means it is sitting on the web framework Apache Sling.
Sling has better mechanism to distribute content between instances of sling. In AEM we have replication; authors activate content to replicate the content in publisher nodes. To publish the data from author to publisher developer has to set up replication agents, for different publisher servers, we will set up different publisher agents. Earlier versions of AEM don’t have the control over the data that is being replicated. I.e. when author publish large number of nodes / content, replication agents publish the data as it comes in, no priority of nodes or pages or content. If any particular section of data failed to publish with errors, the remaining content will be stop publishing till the error is cleared. Content distribution is the key in this scenario. 
Content distribution will provide the priority queuing, some activations will take priority than others, any backlog activations need to happen, if some content has to publish immediately then it can push to front of the line or queue, remaining content can be in wait.
There is also notion of error queue, so that if any content failed in publishing with an error the remaining data get halted, content distribution is useful to prioritize data/content and move out from the queue.
2) Users must be System Users
Sling method named - getServiceResourceResolver to obtains session instance.
This method replaces the use of the getAdministrativeResourceResolver method, which is deprecated in AEM 6.0
In AEM 6.1, users must be System users, which effectively means that their node in JCR is of type rep.SystemUser

Till AEM 6 we have the liberty to use any user as service user, for invoking and executing any service. But from AEM 6.1 there was a slight change on how to define the ServiceUserMapping and how the service user or system user has to be created.
If we try to assign any arbitrary user as service user in AEM 6.1 we would face below error :

org.apache.sling.api.resource.LoginException: Cannot derive user name for bundle ch.inside.cqblog-bundle [452] and sub service readService

Note:- From AEM 6.1 service users can only be mapped to system users (jcr:primaryType = rep:SystemUser).

Why System User are Introduced in AEM 6 instead of Admin Users


Use of admin session and admin resource resolver through ResourceresolverFactory is now deprecated, that's why from AEM 6.1 Adobe forces developers to create system users and map them to Service User Mapper in Felix Console.

Prevent excessive use of administrative JCR Sessions and ResourceResolvers.
Allow services access to ResourceResolvers and JCR Sessions without requiring to hard-code or configure passwords.

Allow services to use service users and/or system user which are specially configured for service level access.

3) Touch UI:
Classic UI in CQ5 which is ExtJS based has been upgraded to Touch UI which supports touch enabled devices - build using Coral UI framework.
4) Indexing
OAK supports SOLR indexing implicitly

Jackrabbit runs on LUCENE
5)Clustering
CRX3 does not support application level clustering.

For clustering a database like Mongo is Required
6)AEM Mobile
AEM Apps is full featured framework for building out Templates, Components, Pages, merges all into Single Page applications, which will be shown on Mobile applications - Responsive design
DPS - Digital Publishing Suit
AEM Mobile handles content distribution, CMS connections, out-of-the-box navigation and a bunch of other things. 
7) Content Fragmentation
Rich Text page editor in AEM Touch UI has been enhanced to support Content Fragments. 

Content Fragment a name suggests separates the content into fragments that can be reused and provides the ability to manage text-based content and it’s associated assets.
Content Fragments are a content type that:
Contains one or more:
Text elements
References to associated assets (for example, images, videos, other fragments)  
Are independent from the delivery mechanism (i.e. page, channel).
Can contain variations of master elements to adjust fragment text according to the specific editorial or channel reuirements.
Have a hierarchical structure:
Content fragment: parent node 
Elements: child nodes 

Are defined by a Fragment Template.
8) Template Editor and Policies AEM Site Enhancement
In prior versions there is no option to Edit/Modify a template by Authors.Developers create templates to design a page and refer components suitable to that template.
Templates are used in AEM to provide consistent page structure through out the project.
Template console and Editor is one of the main feature that is shipped with AEM 6.2. 
Template console allows content  authors to: 
Create a new template (either new or by copying an existing template). Manage lifecycle of the template. 
Template editor allows content authors to: Add (available) components to the template and position them on a responsive grid. 
Pre-configure the components. Define which components can be edited on the resultant pages (created from the template).
9) Sightly - HTL (HTML Template Language)
HTL is a HTML templating language, introduced with AEM 6.0.  

The discussion of whether to use HTL or JSP (Java Server Pages) when developing your own components should be straightforward as HTL is now the recommended scripting language for AEM.

Both HTL and JSP can be used for developing components for both the classic and the touch-optimized UI. 
Although there can be a tendency to assume that HTL is only for the touch-optimized UI and JSP for the classic UI, 

this is a misconception and more due to timing - the touch-optimized UI and HTL were incorporated into AEM over approximately the same period and as HTL is now the recommended language it is being used for new components, which tend to be for the touch-optimized UI.