Tuesday, April 11, 2017

Integration of Adobe Experience Manager(AEM) with Salesforce - Part3

Integration of Adobe Experience Manager(AEM) with Salesforce - Part3

This post will explain the approach to extend the basic Adobe Experience Manager(AEM) Salesforce connector to search for the Salesforce objects other than Lead/Contact.

Refer the following post for details on integrating Salesforce with Adobe Experience Manager(AEM)
 https://www.albinsblog.com/2017/03/integrationofaemcq5withsalesforcepart1.html
https://www.albinsblog.com/2017/04/integrationofaemcq5withsalesforcepart2.html

Prerequisite  - Configure the Salesforce cloud connection, refer the above mentioned post for more details.
Enable the Salesforce cloud configuration for the Home page of the websites.

Dependency:

Add the below Maven dependency to the project
For 6.0 and 6.1
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>aem-api</artifactId>
    <version>6.0.0.1</version>
    <scope>provided</scope>
</dependency>

For 6.2
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.2.0</version>
    <classifier>apis</classifier>
    <scope>provided</scope>
</dependency>



Saturday, April 8, 2017

In place upgrade of Adobe Experience Manager(AEM) to 6.2 version

In place upgrade of Adobe Experience Manager(AEM) to 6.2 version

This post will explain the steps to in place upgrade of Adobe Experience Manager(AEM) server to 6.2 version
  • Backup the current Adobe Experience Manager(AEM) instance
  • Copy aem-quickstart-6.2.0.jar next to current Adobe Experience Manager(AEM) crx-quickstart
  • Perform regular maintenance activities - including workflow purge
  • Run the Traversal check and Data store consistency check one by one - http://localhost:4502/system/console/repositorycheck
  • Disable custom login moduels if any - make sure the default login module is configured as below in crx-quickstart/repository/repository.xml
        <LoginModule class="com.day.crx.core.CRXLoginModule">
            <param name="anonymousId" value="anonymous"/>
            <param name="adminId" value="admin"/>
            <param name="disableNTLMAuth" value="true"/>
            <param name="tokenExpiration" value="43200000"/>
            <!-- param name="trust_credentials_attribute" value="d5b9167e95dad6e7d3b5d6fa8df48af8"/ -->
</LoginModule>
  • Stop the Adobe Experience Manager(AEM) server
  • Remove all log files under crx-quickstart/logs
  • chown -R aem:aem crx-quickstart(this command is required if AEM is running with different user)
  • su aem(this commad is required if AEM is running with diffrent user)
  • If you are migrating from AEM 5.x or AEM 6.0 with a CRX2 backend then follow URL - https://www.albinsblog.com/2015/09/upgrading-aemadobe-cq5-5.6.1-to-aemadobe-cq5-6.1.html
  • If you are migrating from AEM 6.0 with a oak backend or 6.1 then execute java -jar aem-quickstart-6.2.0.jar -r author,crx3,crx3tar
  • Monitor error.log and stderr.log – Once the migration is completed stderr.log will show the following message                                                                                                                           
          “Opening browser using cmd=x-www-browser "http://localhost:4502/"  || gnome-open                       "http://localhost:4502/"  || firefox "http://localhost:4502/"  || mozilla "http://localhost:4502/"               || konqueror "http://localhost:4502/"  || netscape "http://localhost:4502/"  || chromium-browser           "http://localhost:4502/"  || opera "http://localhost:4502/"  || links "http://localhost:4502/"  ||                lynx "http://localhost:4502/"
           Startup time:442 seconds
           http://localhost:4502/
           Quickstart started”

URL to check the version - http://localhost:4502/system/console/productinfo

Check the bundles in Installed state, most of the obsolete bundles will be removed after upgrade but some cases some of  the obsolete bundles will not be uninstalled - This can be ignored or uninstalled manually (better to compare the bundles with fresh 6.2 installation).Refer the following URL for details on obsolete bundles https://docs.adobe.com/docs/en/aem/6-2/deploy/upgrade/obsolete-bundles.html

Custom core bundles may not start due to the dependency issues. Refer the following URL for API difference between 6.1 and 6.2 - https://docs.adobe.com/docs/en/aem/6-2/develop/ref/diff-previous/changes/changes-summary.html

Update the maven dependency with correct version by identifying the version through depfinder -
http://localhost:4502/system/console/depfinder




Tuesday, April 4, 2017

Integration of Adobe Experience Manager(AEM) with Salesforce - Part2

Integration of Adobe Experience Manager(AEM) with Salesforce - Part2

This post will explain the common issues faced while integrating Salesforce with Adobe Experience Manager(AEM).

Refer https://www.albinsblog.com/2017/03/integrationofaemcq5withsalesforcepart1.html for details on integrating Salesforce with Adobe Experience Manager(AEM)

redirect_mismatch: 

The redirect_mismatch error will be displayed if the calback URL configured in the Salesforce connected app and the redirect_uri send by the Adobe Experience Manager(AEM) Connector is not matching.



Verify the callback URL configured in the Salesforce connected app is same as the value send by AEM connector.
Make sure the AEM Salesforce connector is opened via https URL



Monday, April 3, 2017

Updating the Salesforce Connector jar(cq-mcm-salesforce) to support Proxy server and TLS 1.1 - Adobe CQ5/AEM

Updating the Salesforce Connector jar(cq-mcm-salesforce) to support Proxy server and TLS 1.1 - Adobe CQ5/AEM


Updating the Salesforce Connector jar(cq-mcm-salesforce) to support Proxy server and TLS 1.1 - Adobe CQ5/Adobe Experience Manager(AEM)

Steps to update Salesforce Connector jar(cq-mcm-salesforce) to support Proxy server and TLS 1.1

The AEM Salesforce connector is not supporting the Proxy Server and TLS 1.1 or TLS 1.2 versions:

This is the defect with AEM Salesforce Connector, the connector will not be able to connect to Salesforce server behind the proxy server. The SalesforceClient.java class in the connector should be changed to enable the proxy server.

The connector will not be able to connect to Salesforce server if the Adobe Experience Manager(AEM) server is ruuning with Jave version less than 1.8, Java versions less than 1.8 will not support TLS 1.1 or higher version by default but Salesforce expect TLS 1.1 or TLS 1.2 to establish the connectivity. The SalesforceClient.java class in the connector should be changed to support the TLS 1.1 or TLS 1.2, if the  AEM server is running with Java version less than 1.8

I have tested this in Adobe Experience Manager(AEM) 6.1 version, this should be the same case with 6.2 also. Raise an issue with Adobe to get the hotfix until the issue is permanently fixed.

The below is the quick fix to resolve the issue.

Download the /libs/mcm/salesforce/install/cq-mcm-salesforce-1.2.8.jar through package manager

Create a sample project -  mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype  -DarchetypeVersion=10 -DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/

              groupId=com.day.cq.mcm
              artifactId=cq-mcm-salesforce
              version=1.2.8
              package=com.adobe.cq.mcm.salesforce 
             Enter mcm for other values
 
Execute mvn eclipse:eclipse command in the parent folder of the project and load the project to eclipse

Extract the downloaded jar file and decompile the class files using JAD
Create all the java classes manually in core project with same package details and copy the content from decompiled classes
Replace the pom.xml of core project with the pom.xml content from the decompiled jar





Saturday, April 1, 2017

Generating the missing renditions for the Asset - Adobe CQ5/AEM

Generating the missing renditions for the Asset - Adobe CQ5/AEM

This post will explain the approach to generate the missing renditions for the asset(images) under a specific folder location in  Adobe Experience Manager(AEM)

Create a custom workflow with "Create Thumpnail" step


Edit "Create Thumpnail" step and configure the required renditions.


Servlet to re-generate the missing renditions:

Modify the workflow model path in the servlet with the actual path, the servlet is configured to handle the renditions 370.208 and 470.264(the same renditions are configured in the workflow). The code change is required to handle new renditions by the servlet.

Parameters:
path= the parent path of the assets(images) folder
test=true/false(true - Dry run, false - generate the renditions)



Wednesday, March 29, 2017

How to customize the page properties Dialog to include dynamic DropDownList in AEM/CQ5

How to customize the page properties Dialog to include dynamic DropDownList in AEM/CQ5

This post will explain the details to customize page properties Dialog in both Touch and Classic UI's, the version used for implementing this is Adobe Experience Manager(AEM) 6.1.

The basic page properties dialog will be displayed if the sling:resourceSuperType of the page rendering component is specified as foundation page component(wcm/foundation/components/page for Sightly and foundation/components/page for JSP)

Steps to customize the basic page properties and including dynamic DropDownList to the dialog.

/apps/training/components/page-content/ will be referred as the page rendering component path in the post.

Classic UI:

Copy /libs/foundation/components/page/dialog to /apps/training/components/page-content/
Rename the new node to required name e.g. custom

Copy /libs/foundation/components/page/tab_basic to /apps/training/components/page-content/
Rename /apps/training/components/page-content/tab_basic to required name e.g tab_custom

Remove all the nodes under  /apps/training/components/page-content/tab_custom/items

Change path value in the node /apps/training/components/page-content/dialog/items/tabs/items/custom to /apps/training/components/page-content/tab_custom.infinity.json

Change title property of the node /apps/training/components/page-content/tab_custom to required value e.g Custom

Save All configurations

Open the page from site Admin(e.g. http://localhost:4502/cf#/content/training-site/en.html), now the new tab(Custom) will be added to the page properties with empty panel



Friday, March 24, 2017

Integration of Adobe Experience Manager(AEM) with Salesforce - Part1

Integration of Adobe Experience Manager(AEM) with Salesforce - Part1

Adobe Experience Manager(AEM) Salesforce cloud connector can be used to integrate to Salesforce via connected App configured in the Salesforce

The Adobe Experience Manager(AEM) Salesfore integration supports the following functionalities:
  • Lead Search
  • Contact Search
  • Export AEM user as Salesforce Lead
  • Associate an AEM user with a Salesforce "Contact" or "Lead"
The connector can be extended to support the additional functionalities.


Defining the connected App in Salesforce:

A connected app integrates an application with Salesforce using APIs
Connected apps use standard SAML and OAuth protocols to authenticate and provide tokens for use with Salesforce APIs. The required security policies can be set to control the connected Apps access.

Login to Salesforce - login.salesforce.com
Click on the user name- Setup- Click on Create then Apps
Create New connected App
Enter the name and Email address