Showing posts with label AEM 6.3. Show all posts
Showing posts with label AEM 6.3. Show all posts

Saturday 13 June 2020

Configure the https(SSL) on AEM instance quickly

There are cases where during development we may need to setup https connection in our existing AEM instance.

By following procedure we can have both http and https on same AEM instance. This is very helpful while testing some of the AEM features which require SSL connections.

To start with, we need keys and certificates to configure SSL on AEM. We will use OpenSSL to set up keys and certificates. The method is tested on window, but should work on any other OS seamless way.

How to setup OpenSSL on Windows

  • Download OpenSSL from any URL - Ensure its relevant to your OS (including 86 Vs 64 Bit)
  • Unzip it.
  • Set the classpath

  • place the conf file in below path (Else you may get an error that openSSL conf cannot be found)

Now the OpenSSL is configured on your windows
  • Using command prompt execute below commands

### Create Private Key
$ openssl genrsa -aes256 -out localhostprivate.key 4096

### Generate Certificate Signing Request using private key
$ openssl req -sha256 -new -key localhostprivate.key -out localhost.csr -subj "/CN=localhost"

### Generate the SSL certificate and sign with the private key, will expire one year from now
$ openssl x509 -req -days 365 -in localhost.csr -signkey localhostprivate.key -out localhost.crt

### Convert Private Key to DER format - SSL wizard requires key to be in DER format
$ openssl pkcs8 -topk8 -inform PEM -outform DER -in localhostprivate.key -out localhostprivate.der -nocrypt

You will have the certificates now in local drive as shown below.

Use the SSL Wizard in AEM

Now login to AEM

Tools > Security > SSL Configuration

For store credentials provide the Key store and Trust store password. [I have used admin for all, since its a localhost]

Friday 24 May 2019

How to fix JSON deprecated API error in AEM? Alternatives of Deprecated JSON API in AEM

When ever we need to retrieve a value from JSON using its key, JSONParser is a better and easy approach.

We know in AEM 6.3, all json related operations are deprecated from package org.apache.commons.json.

For eg  JSONParse, JSONObject.

Let us try to fix this using GSON. AEM has default GSON library to parse the JSON or for JSON processing & conversations.

How to convert a String to JsonObject using Gson library.

Below is the common syntax to use GSON in java code. To use this ensure your pom.xml has the GSON dependency added.

The pattern to use GSON is,

Gson gson = new Gson();
YourClass yourClassObject = new YourClass();
String jsonString = gson.toJson(yourClassObject);

Below given a real case example.

Say we have a multifield in AEM which has a JSON string array as,

String personalData = {"name": "Alex","age":"27","details": "User says at Washington"}

// Now we need to create a Java model class as given below. Remember to match the fields(keys in JSON with string variables )

public class PersonalData {
    public String name;
    public String age;
    public String details;

//Now in our sling model or relevant class, the GSON invocation could be something like;

Gson gson = new Gson(); 
PersonalData persondata = gson.fromJson(personalData, PersonalData.class);

Another simple example is
Say we have a multifield as shown below.

String organization = {"org": "Google"}

// Our Java model class
public class OrgData {
    public String org;

//invoking the method
Gson gson = new Gson(); 
OrgData orgdata = gson.fromJson(organization, OrgData.class);

Another example using JSON Element

package com.aem.core;


//This class takes a json string and parse it to get its value from a key.
/*Say we have a json {"key":"value"}
Then to get its 'value' easily without using Java regular expression or patterns
We can use this approach

public class MyJsonParser {

//You can run this code directly to test how it works
    public static void main(String[] args) {
        Gson gson = new Gson();
        String jsonString = "{\"key\":\"value\"}";
//Create JSON element from JSON String
        JsonElement element = gson.fromJson(jsonString, JsonElement.class);
//Fomr a Json Object from element       
        JsonObject jsonObject = element.getAsJsonObject();
//Below line takes the 'key' from json and print its 'value'

We can also use Jackson for JSON parsing in AEM.

More Like This:

AEM 6.5 Site related new features

AEM 6.5 Specific new features in Assets section

New Features in AEM 6.5 Forms

Foundation updates in AEM 6.5 which a developer should be aware of

Cloud Manager for AEM 6.5 New features

Storage concepts in AEM 6.5   

HTML Template language updates which needs to be observed with AEM 6.5

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.


  •     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 


  •     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


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


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

Related Links
Brands in AEM-Personalizaton 
Client Context

AEM 6.3 New Features which a developer should be aware of

AEM 6.3 New Features Which a developer should be aware of..

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 ?
  •     Enhanced functionality
  •     Customer Fixes
  •     High priority customer enhancements
  •     general bug fixes for product stabilization
  •     Also includes feature pack, hot fix, and service packs
Release Notes: Read here

New things for administrators.
The latest AEM 6.3 introduces support for below operating systems and servers
  • Server OS
           Microsoft Windows Server 2016
  • Application Server
           IBM WebSphere version 9.0
           IBM WebSphere Server Continuous Delivery (LibertyProfile) with IBM JRE 1.8
Useful new features for developers are listed below based on the developer priority.

Content Repository Changes:
  • A new TarMK format is used in 6.3 which ensures optimized runtime and maintenance performance. Ensure if we are doing a release upgrade, the existing Tar files to be rewritten to the new Oak Segment Tar file format to comply with AEM 6.3.
User Interface Enhancements:
  • In AEM 6.3 the user interface has been fully transitioned to the Web Component based Coral 3 UI framework(To comply with 2017 Adobe Marketing Cloud UI design). Classic UI is still available but majority of the touch UI entry points for classic UI are disabled considering Adobe's plan to deprecate the Classic UI in AEM in April 2018.
Security Improvements:
  • Quick start install through command line asks user to setup admin password, so that default password in not in use.
  • For https access of AEM, an SSL setup configuration has been added now in 6.3
  • Now store all OSGI configuration properties in a protected encrypted form instead of plain text.
  • Cross-Origin Resource Sharing can be configured for separate policies(for different origins) and resource paths.
  • OAuth level enhancements for token authorization.
  • All closed user group operations are now more scalable, reliable, and faster with AEM latest version.
Scalability Additions
  •  To accelerate usage of AEM UI and content from author instance in a secure way, AEM 6.3 prompts usage of CDN's.
Upgrade related improvements
  •  Basically the upgrade process is much quicker now, with multiple automated processes.
  •  Pre-Upgrade Compatibility Checks are now faster.
  •  Pre-Upgrade Maintenance Optimization now uses Java Management Extensions(JMX) which allows for automation of methods.
  •  Post-Upgrade Check Automation now scan for errors after installation.
Projects and workflow Improvements
  •  Projects section provides a calendar view of projects. Also we now can quickly create projects reusing team structure.
  •  Workflow inbox are organised with calendar view which allows to search and filter tasks.
Page, Components and Template Editor Changes
  •  AEM 6.3 features various refinements, improved loading speed and smarter reloading.
  •  In 6.3 the Core Components are open source and distributed via GitHub, so a better distribution environment, ability for implementation partners and customers to contribute back.
Content & Experience Fragments
  •  Content Fragments allow working on text based content out-side the context of an experience.
  •  Experience Fragments allow to manage sections of experiences that can easily be reused and distributed.
Adobe Experience Cloud Integrations
  •  3rd party tags can be pulled through Adobe cloud integration now.
  •  The Page Editor provides a simple way to load the Activity Map, which provides a dashboard of real-time analytics to monitor audience engagement of the web pages.
MSM Add ons
  • Previous Blueprint Control Center is now replaced with new Livecopy Overview UI which provides an instant view of the status.
  • Commerce Integrations
  • Commerce Integrations made easier for some of the providers like Magento,Symphony, SAP hybris 6.x version.
Communities & Assets improvements
  •  Enhancements to Community Site management like New account management features with email-based verification, New We.Retail Community reference implementation etc.
  •  New and enhanced Assets Insights capabilities and integration like Assets Templates, better collaboration, 3D files support, Scalabilty and Performance, Search improvements.
 Dont have the AEM 6.3 Installer yet, still interested to see the UI? Please watch the video.

Related Links
Brands in AEM-Personalizaton 
Client Context