Thursday, 22 June 2017

AEM 6.3 Content Fragments Basics


AEM 6.3 Supports Content Fragments to deliver content as a service.
Experience Fragments enables Experience-as-a-Service, where the CMS controls partial-page rendering, or Hybrid CMS, solutions that let you push your content to any channel — just as headless systems do — using a delivery tier that connects all those channels and shares data between them.

What is a content fragment?

  • Contains one or more Content Elements,
  • Content can have one or more  Variations.
  • Content fragment can be created based on templates which define the structure.
  • Content fragments are a type of new assets.
  • Content Fragment use existing Assets functionality & fully integrated with assets.
  • Content Fragments are well tied with Translation workflows, metadata schema.
         YouTube demo videos for Content Fragments:
         AEM 6.3 Content Fragments Basics
         Content Fragments AEM
         View Content fragment output in aem

A content fragment groups renditions, related items, associated items, metadata, model, elements, variations etc in a single Content.



Can we add a Content Fragment to a page?

Yes it can be added to a page using default content fragment component as other components.

Which is the API service for Content Fragments?
Latest AEM provides server side API com.adobe.cq.dam.cfm to programmatically interact with Content Fragments.



Related Posts

AEM Leading to head less CMS?
AEM Content Fragment output as JSON
AEM 6.3 Content Fragments Basics
How to create a Content Fragment? step by step tutorial
Create & Access the content fragment programmatically







AEM Leading to head less CMS?

Headless 
Now a days many goes with headless CMS. Here the content capabilities of a CMS are not used for rendering; the rendering output could be through any channel like websites, print, campaign or mobile apps. From Beginning AEM's one of the core module Apache Sling, allows to access the contents of the JCR through HTTP requests.

The DefaultGetServlet helps to render content in JSON format by using the json extension.
For eg: /content/site/en/page.infinity.json

In addition to the OOTB features, one can create Sling Servlet to expose content which ever format we want.



The latest AEM features:
AEM 6.3 is built with Content as a Service (CaaS) feature. Now AEM provides editor an aggregated view of content within the JCR called Content Fragments. This content can be assets, content fragments or pages, intended for external consumption.

Caas  = > content as a service
The CaaS way suggest that a CMS should only be used for managing content, not for controlling its presentation.

Caas features

  • The CMS just hosts the content.
  • Content structure here is highly customizable, which can be managed through a web framework.
  • The content can be available through RESTful API in formats like JSON/xml.

Advantages of Caas

  • Presentation is decoupled from content. The delivery channel could be websites, campaigns, print, mobile apps, and other devices and channels.
  • Here content supports different variations which could be varying for devices. Content author is not aware of the display part of the system.
  • Here the data is content centric and not page centric.


Some use cases of CaaS (scenarios when a content fragment to be used?)

Multi-channel approach: The same content can be used to render for websites or mobile which makes the system more flexible.
Mobile apps content backend: Real world want more latest content on mobile devices. This approach helps for pulling data from a live content system supporte by Caas.
MVC Front end support : Angular, ReactJS can be used to provide rich front end. Also the CMS front end has restrictions based on the architecture of CMS. Thus Caas model supports any MVC front end frame work.
Easy integration with existing services : There are cases where we need to use/ pull existing content to new system. Using the Caas API this is quite easy.

YouTube demo videos for Content Fragments:
AEM 6.3 Content Fragments Basics
Content Fragments AEM
View Content fragment output in aem

Related Posts

AEM Leading to head less CMS?
AEM Content Fragment output as JSON
AEM 6.3 Content Fragments Basics
How to create a Content Fragment? step by step tutorial
Create & Access the content fragment programmatically

Wednesday, 21 June 2017

Translate content in AEM for multi lingual sites


Translate content in AEM for multi lingual sites
AEM is widely accepted for its capability of handling regional sites using its multi site management system. On completion of creating a site, it can be converted into various language copies using various methods. A page content, asset, user generated content can be converted into its language variations to effectively utilize the multi lingual web site capability of AEM. AEM provides translation service provider interfaces to translate the content.



The content can be translated into language version using either Machine options or Human methods.
Machine Translation: In this case the service quickly converts the content into its language version.
Human Translation: Professional translators are involved to convert the content.

Below given the core steps to translate the content,


  • Create translation integration frame work configurations.
  • Connect AEM with translation service provider.
  • Link the language master framework configurations with translation service.
  • Identify the type of content to translate.
  • Creating the root pages of language copies.
  • Prepare the content for translation by authoring master.
  • Create projects to collect the content to translate and to prepare the translation.
  • Use the created translation project to manage the content translation process.


AEM has constantly worked to improve the language translation process more easily.
The latest AEM version's multilingual enhancements Streamline localization efforts with the ability to translate a source file along with derived file.

There are new options to translate linked assets within InDesign files, Content Fragments.
AEM by default provides a translator tool to manage English strings to their language versions.

The console for managing the various translations of texts is available at http://<hostname>:<port-number>/libs/cq/i18n/translator.html
You can see the translator lists the texts with its various language translations listed.
Options like search, filter and edit the English and translated texts are provided here.

AEM also provides XML based language conversions(Using Translation ApI's), we can also export dictionaries to XLIFF(XML Localization Interchange File Format) format for translating, then import the translations back into the dictionaries.

Thursday, 8 June 2017

AEM Content Solutions

Have you thought the ways we can implement a website in AEM? I am going to discuss some of the approaches here. Do let me know your thoughts through the post comments area.

1) AEM - The traditional way:

Here AEM is used as a pure solution. All the content and data are fed into AEM. The pages are authored in AEM including the DAM assets. In this scenario, there is no integration of any type of application with AEM. Here rendering is done through AEM.

2) AEM - As Hybrid Approach:

This is the most common way. Here the pages, assets are fed into AEM through authoring. Integrations like data access, social integrations are handled through web service calls. In this scenario there is always an integration layer, which could be used for search, data base authentication etc. Here rendering is through AEM.

3) AEM - As web content Model

Not a common way of implementing  projects in industry, but yet to analyse the abundant capabilities. Here AEM is used as a data storage layer. The data gets into AEM from various sources like DB, third party data etc. Once the data is available in AEM, it can be made available to other systems through a different user interface technology other than AEM provided. Here rendering is through different technology. AEM makes the data available in a generalised way(Either JSON or XML formats) to the front end here.

How do we make the AEM content to third party applications?

The usual way of making AEM content to third party application is through a web service layer. We can utilise the sling API's to invoke the specific component or page and create required custom format JSON and pass it to service layer.

AEM contents are page oriented. How do we make component level information?
Have you heard of content fragments? The latest AEM provide content fragments - makes the Content As A Service (CaaS) way of implementation. These are components like structure which are not bonded to a specific page. We can author a content data with its metadata. Content fragments can even be transformed to its language versions. Watch this place for more details.

Thursday, 1 June 2017

Sling models - Adobe Recommended Way Of Object Binding

Sling Models
Sling Models are widely used with in AEM now. They are simple POJO classes(support both class and interface) mapped automatically with Sling Objects( resources, also request objects). Example use cases in AEM are they allow us to access jcr node property values directly into java classes. Also helps to wire the OSGi Services. Sling Models uses annotations & annotations Mark a class as adaptable via Sling Models.


Why sling models:

  • Adobe recommended Sling Models as the best practice.
  • Provides convenient injection annotations for data retrieval.
  • Pure POJO classes. Entirely annotation driven.
  • Less code to write & easy to extend from other Sling Models.
  • Quite simple setup for unit testing.
  • Flexibility of smooth integration with JSP or sightly.


Two major differences with WCM Use class and Sling Model

  1. WCM Use classes expect you to overwrite the activate() method, But Sling Models provides @PostConstruct annotation, where the init method will be called.
  2. ECM Use classes use Felix annotation @Reference to reference the OSGI service, whereas in Sling Models, you will use @Inject or @OSGiService


Below given the complete list of annotation references


  • @Model - declares a model class or interface
  • @Inject - marks a field or method as injectable
  • @Named - declare a name for the injection (otherwise, defaults based on field or method name).
  • @Optional - marks a field or method injection as optional
  • @Source - explictly tie an injected field or method to a particular injector (by name). Can also be on other annotations.
  • @Filter - an OSGi service filter
  • @PostConstruct - methods to call upon model option creation (only for model classes)
  • @Via - use a JavaBean property of the adaptable as the source of the injection
  • @Default - set default values for a field or method
  • @Path - only used together with the resource-path injector to specify the path of a resource


While working with AEM latest versions, do we need any update for Sling models?
You can check the version of Sling Model from AEM Console.



If you are working with AEM 6.2, download the latest Sling Models API and Implementation bundles from Sling and then manually upload them to AEM bundles console, because AEM 6.2 has Sling Models API and Implementation version 1.2. If you are workig with AEM 6.3 you dont have to do this step.

In future when Sling new major release available, you can still manually import them into your 6.3 server.( Ensure to check Adobe’s documentation for additional dependency package to be installed.)

Sample Code: Sling Model Vs Sightly

// @Model declares a model class or interface
@Model(adaptables = Resource.class) public class MyCustomClass {
// @Inject marks a field or method as injectable
// age can be empty
@Inject @Optional
private String age;
// we expected always an firstName-property
@Inject
private String firstName;
// OSGi Externalizer Service
@Inject
private Externalizer externalizer;

    // Executed after the class is created
    @PostConstruct  protected void init() {
     //init here  
     }

 }

How sightly calls the Sling Model class

<div data-sly-use.customClass=customsite.customproject.MyCustomClass>
${ customClass.firstName }
</div>

Thursday, 4 May 2017

Personalization in AEM 6.3

Personalization in AEM 6.3 - Basic Configurations

In AEM 6.3 personalization works based on Experience, Activities and ContextHub. Let us see how can we test a basic Personalization in AEM 6.3. AEM 6.3 configuration is almost same as in AEM 6.2.

Below are the steps to create personalization in Latest AEM.

  • -Add and configure ContextHub Segments
  • -Create a Brand and related Activity, (We need to select ContextHub as Engine and create its Experiences from the new segments);
  • -Add targets and relevant personalization components for each Experience.
  • -Configure the targeted component to use ContextHub as Engine;
  • -Test the configuration

Programmatic personalization
Create personalization in older version of AEM

Watch the AEM 6.3 Personalization video here

Let us create a sample personalization component in 'We.Retail' site. We.Retail is a demo site pre configured in AEM 6.3.

Once we open a We.Retail page we can see the  Targeting option as below. By default BRAND is selected as 'Geometric Outdoors'.



To create our own activity for the selected brand, click on the '+' symbol as shown below . In the new activity form  Enter a name (For eg:'My Target') and select target engine. (Context Hub is selected to ensure we are using our own segmentation from AEM). We can also use Adobe Target configuration to create personalization.



Once new activity is created, select the activity as shown below.



Now in Targeting mode, click on 'Start Targeting', A default experience will be always enabled. Now add new experience by clicking on  '+ Add Experience Targeting'



Select the Context Hub Segments which you have created referring Previous post. Basically we have one male(Test Male CH) and one female(Test Female CH) ContextHub segments created as experience.




Now author an image component in empty area of the page.



Right click , select Target, so that the component is enabled for target.



Now right click and  select Experiences,



Once you select the 'My Target', you can see all configured experiences appearing.( We can disable any of them in case they are not needed.)



Now go back to targeting mode, start targeting, select the component and select the experience to be updated. Click on 'add offer'.



Select the new image to be appeared on the corresponding experience. Click 'Next' for 'Create', 'Target', 'Goals & Settings' and save the Targeting.



We are done with our targeting configuration.

Testing the configuration:

Now click on preview select the user/ Persona and change for male and female.



Once male user is selected from PERSONA



Once female user is selected from PERSONA




We can test the persona, Geo-changes using Client context also.

Above post is an updated version of AEM 6.2 Personalization. If interested in seeing actual  AEM 6.3 Personalization, watch the video here

Related Posts:

Tuesday, 2 May 2017

AEM 6.3 New features at a glance

AEM 6.3 New features at a glance

Adobe has release 6.3 version which is termed as a Minor Release, with general availability date April 26, 2017. AEM 6.3 is basically an upgrade to AEM 6.2 code base. JCR version used in current version is Apache Jackrabbit Oak 1.6.1. Quickstart uses Eclipse Jetty version 9.2.19.

What is fresh in AEM6.3 ?
  1.     Enhanced functionality
  2.     Customer Fixes
  3.     High priority customer enhancements
  4.     general bug fixes for product stabilization
  5.     Also includes feature pack, hot fix, and service packs
Here we have listed the new features for quicker understanding.


Assets

  •     Search Boosting with Asset Metadata
  •     Advanced Configuration f Multi Value And Tag Search Predicates
  •     Comparing Assets using Review Task Compare
  •     Check-in/ Check-out assets with the AEM Desktop app
  •     Introduction to smart Tags
  •     Using Annotations in Assets
  •     Asset Tempates
  •     Dynamic Media Color Management
  •     Custom Video Thumbnails
  •     Non Flash Dynamic Media Player
  •     Dynamic Video Viewer Enhancements 

Sites

  •     Enhancements to Content Fragments
  •     Introducing Experience Fragments
  •     Touch UI Authoring Improvements
  •     Template Editor Enhancements
  •     Blueprint Configuration Manager Touch UI Interface
  •     Mixed Media Content Fragments
  •     Activity Map Integration
  •     Timewarp
  •     Live Copy Touch UI Interface
  •     Translation of AEM Content Fragments
  •     New Communities Features

Projects and Collaboration

  •     Calendar with AEM Projects
  •     Calendar with Inbox
  •     Project Masters

Platform

  •     Online Revision Cleanup
  •     New SSL Wizard
  •     Sling Model Exporters
  •     Sling Dynamic Include

Forms

  •     User Profile Integrations
  •     Data Integrations
  •     JDBC Based Form Data Model
  •     Service Creation in Form Data Model


Related Links
Brands in AEM-Personalizaton 
AEM-Personalizaton
Client Context
ContextHub