<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Suvadeep Dey on Medium]]></title>
        <description><![CDATA[Stories by Suvadeep Dey on Medium]]></description>
        <link>https://medium.com/@suvadeepdey?source=rss-be2aee223f85------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MaAnVyFxfRyurpLt827rfg.jpeg</url>
            <title>Stories by Suvadeep Dey on Medium</title>
            <link>https://medium.com/@suvadeepdey?source=rss-be2aee223f85------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:45:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@suvadeepdey/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Search Videos by Transcripts in Adobe Experience Manager]]></title>
            <link>https://suvadeepdey.medium.com/search-videos-by-transcripts-in-adobe-experience-manager-23d3d30dc654?source=rss-be2aee223f85------2</link>
            <guid isPermaLink="false">https://medium.com/p/23d3d30dc654</guid>
            <dc:creator><![CDATA[Suvadeep Dey]]></dc:creator>
            <pubDate>Thu, 06 Jun 2024 11:47:22 GMT</pubDate>
            <atom:updated>2024-06-06T11:47:22.081Z</atom:updated>
            <content:encoded><![CDATA[<p>The purpose of this article is to present the steps which would make it possible to search for videos in Adobe Experience Manager DAM based on video transcripts so that an author can leverage this feature and be able to place videos on a page that are specific to the context of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-OriWnLgcG3HshFsS4JRw.png" /></figure><h3>Use case</h3><p>We are considering a use case where an author uploads a video asset ( e.g. MP4) to AEM DAM which triggers a workflow where the same video file is then uploaded to Azure video indexer to leverage the Azure Video Indexer APIs. This enables the processing of the video after which the transcript of the video can be extracted using the APIs and then stored in a DB. Once the transcript data is available in the DB, it is possible to do a text based search from some other application e.g. AEM, which will return the link to the video file(s) in AEM DAM associated with the provided text.</p><h3>Pre-requisites</h3><p>The following are the pre-requisites</p><ol><li>Creating a Microsoft Account to access <a href="https://www.videoindexer.ai/account/login">Azure Video Indexer</a>. There is a limit of total video uploads of 2400 mins during the free trial phase. There are other information that is available <a href="https://learn.microsoft.com/en-us/azure/azure-video-indexer/avi-support-matrix">here</a>.</li><li>Setting up a local AEM as a Cloud Service (AEMaaCS) author instance.</li><li>Knowledge of how to create custom components including OSGI in AEM.</li><li>Setting up a local Mongo Database. This can be installed from <a href="https://www.mongodb.com/docs/manual/administration/install-community">MongoDB Community Edition</a> as par your environment.</li></ol><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncVpdl2ZymYY2WFIFhiMxw.png" /><figcaption>Architecture of proposed approach.</figcaption></figure><h3>Steps</h3><p>The following are the steps to be followed:</p><ol><li>Start by creating or using an existing Microsoft account to log in to <a href="https://www.videoindexer.ai/account/login">Azure Video Indexer</a>.</li><li>Once logged into the portal, please make note of the Account Id that one can get from the Gear icon and then viewing the Account Id under Account Settings.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzLHAQPUCYLMwbcPo7oMdQ.png" /><figcaption>Account Settings</figcaption></figure><p>3. We need to invoke the below APIs sequentially and programmatically from AEMaaCS.</p><p>4. API — Get Account Access Token from permission — <a href="https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Get-Account-Access-Token-With-Permission">https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Get-Account-Access-Token-With-Permission</a> (Please click on <strong>Try It</strong> that appears next to the documentation of the API to generate the curl command or sample code that can be used as a reference at the time of coding)</p><pre>curl  -X GET &#39;https://api.videoindexer.ai/Auth/&lt;location&gt;/Accounts/&lt;accountid&gt;/AccessTokenWithPermission?permission=Contributor&#39; --header &#39;Cache-Control: no-cache&#39;</pre><p>5. API — Upload Video — <a href="https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Upload-Video">https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Upload-Video</a> (Please click on <strong>Try It</strong> that appears next to the documentation of the API to generate the curl command or sample code that can be used as a reference at the time of coding)</p><pre>curl  -X POST &#39;https://api.videoindexer.ai/&lt;location&gt;/Accounts/&lt;accountid&gt;/Videos?name=&lt;videoname&gt;&amp;videoUrl=&lt;encoded video url in case video is in S3 or some other system&gt;&#39; <br>  --header &#39;Cache-Control: no-cache&#39; --header &#39;Ocp-Apim-Subscription-Key: &lt;key available from Try It feature&gt;&#39; --header &#39;Authorization: Bearer token&#39;</pre><p>6. OSGI configuration for both Azure Video Indexer and MongoDB needs to be created in AEMaaCS and referred in the Java code in AEMaaCS.</p><p>7. Video will be uploaded programmatically to the Azure Video Indexer through a custom Process Step in AEM workflow once author adds the video to the DAM. It should be visible in both the indexer portal and MongoDB in addition to AEM DAM. A videoid is returned from Azure Indexer which is stored in the DB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1cVcGhRs9cw2OdtSkU4VA.png" /><figcaption>Video uploaded to the Azure Video Indexer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2vkBGYyJqPdwtHL37pEL4w.png" /><figcaption>Video data also added in MongoDB.</figcaption></figure><p>8. The transcript of the video will be updated in MongoDB once the indexing of the video is completed in the Azure Video Indexer. The amount of time taken is proportional to the size of the video file. The transript is extracted using the API <a href="https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Get-Video-Index">https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Get-Video-Index</a> (Please click on <strong>Try It</strong> that appears next to the documentation of the API to generate the curl command or sample code that can be used as a reference at the time of coding)</p><pre>curl  -X GET \<br>  &#39;https://api.videoindexer.ai/&lt;location&gt;/Accounts/&lt;accountid&gt;/Videos/&lt;videoid&gt;/Index&#39; \<br>  --header &#39;Authorization: Bearer token&#39; \<br>  --header &#39;Ocp-Apim-Subscription-Key: &lt;available from the Try it feature&gt;&#39;</pre><figure><img alt="Transcript data in Mongo" src="https://cdn-images-1.medium.com/max/1024/1*2v7WSH0UhP4MLqT6Lt_8PQ.png" /><figcaption>Transcript data in Mongo</figcaption></figure><p>9. The next step is to either create a custom video component or overlay an existing component where author can enter the search text which will list all videos from DB. This will enable the author to choose the video to be shown on the page. In this scenario, we have overlayed the Embed component where the dialog can look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odjEU4TbnU6ic8Xlnuvo2w.png" /></figure><p>10. Author then chooses the appropriate video that is relevant for the page and finally proceeds to publish the page.</p><h3>References</h3><ul><li><a href="https://api-portal.videoindexer.ai/">Home</a></li><li><a href="https://api-portal.videoindexer.ai/api-details#api=Operations&amp;operation=Get-Account-Access-Token">APIs: Details</a></li><li><a href="https://www.mongodb.com/docs/manual/crud/">MongoDB CRUD Operations - Database Manual - MongoDB Docs</a></li><li><a href="https://learn.microsoft.com/en-us/azure/azure-video-indexer/avi-support-matrix">Azure AI Video Indexer support matrix and service limits</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23d3d30dc654" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Adobe Experience Manager with Adobe Commerce and Setting Up Multi-Store View]]></title>
            <link>https://medium.com/adobetech/integrating-adobe-experience-manager-with-adobe-commerce-and-setting-up-multi-store-view-9325b1c3c873?source=rss-be2aee223f85------2</link>
            <guid isPermaLink="false">https://medium.com/p/9325b1c3c873</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[online-shopping]]></category>
            <category><![CDATA[adobe-experience-cloud]]></category>
            <dc:creator><![CDATA[Suvadeep Dey]]></dc:creator>
            <pubDate>Tue, 06 Dec 2022 19:41:56 GMT</pubDate>
            <atom:updated>2022-12-15T23:56:06.449Z</atom:updated>
            <content:encoded><![CDATA[<p>The purpose of this article is to document the steps that are required to successfully integrate Adobe Experience Manager CS (hereafter known as AEMaaCS) and Adobe Commerce and then set up a multi-store view so that we can show a different view of categories and products for each category to the end user.</p><p>In addition to multi-store setup, complex deployments are also supported where one AEMaaCS instance can be connected to multiple commerce backend systems with each having multi-store setup done (<em>please refer to the References section below where this </em><a href="https://blog.developer.adobe.com/use-aem-as-a-cloud-service-with-multiple-adobe-commerce-systems-9295612a9554"><em>deployment</em></a><em> is highlighted</em>). Hence, both can be used in combination.</p><h3><strong>Use case</strong></h3><p>We are taking up a simplified use case with respect to a multi-store setup. The use case is to set up 2 stores of the same website across 2 countries — the U.S. and Spain with the pricing of products being shown as par the applicable currency viz. USD and Euro and displaying the catalog in AEMaaCS demonstrating the entire checkout flow.</p><h3><strong>Pre-requisites</strong></h3><p>The following are the pre-requisites</p><p>Admin access to an Adobe Commerce instance.</p><p>Access to a AEMaaCS sandbox with the Commerce add-on enabled and the GraphQL endpoint configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8SvlstSrCZIDgYUNWq57g.png" /><figcaption>Commerce Add-on is enabled at a Program level</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOWf_nWn5hwhRUAShuOokQ.png" /><figcaption>GraphQL Commerce endpoint being configured at a Program Level</figcaption></figure><p>WKND Commerce template using the Reference Demo that is available on the AEMaaCS sandboxes.</p><h3><strong>Steps</strong></h3><p>Log into the Adobe Commerce instance using admin credentials and browse to Stores -&gt; Settings -&gt; All Stores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*cVzHoROaoPjTIwHewcykMw.png" /></figure><p>Clicking on All Stores will bring up a screen that has all the websites, stores, and their store views of this Adobe Commerce instance. We need to click on Create Store View which will bring up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UJeMaltY8VKK-cHw0_Ti_Q.png" /></figure><p>Save Store View needs to be clicked after entering relevant data in the above fields which will bring up the below screen. The Code that is entered on this screen is important as we are going to use this later on at the time of configuring CIF in AEMaaCS instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dwzqZzkrSsYK-VA3KhNwQ.png" /></figure><p>In the above screenshot, there is a single store for the Main Website having 2 different Store Views viz. default will have the currency set to USD, and WKND Spanish will have the currency set to Euro.</p><p>The next step is to set up the default currency for the new store view which has a code of wkndspanish.</p><p>Log into the Adobe Commerce instance using admin credentials and browse to Stores -&gt; Settings -&gt; Configuration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*cVzHoROaoPjTIwHewcykMw.png" /></figure><p>Clicking on Configuration should bring up a screen that should show all the configurations for the default scope. The scope should be changed to the WKND Spanish before proceeding to change the configuration for this store view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*CtGpUubgd9-12sN4Ixz1-w.png" /><figcaption>Scope selector provides the mechanism to change the scope at the time of configuring categories, products, etc.</figcaption></figure><p>Browse to General -&gt; Currency Setup and make Euro as the default display currency for WKND Spanish store view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8vtbAmSdztlOFapf9crpA.png" /></figure><p>The next step is to make a few updates to the Categories and Products for the WKND Spanish store view. It is possible to enable/disable or update categories or products as per the scope.</p><p>Log in to Adobe Commerce instance with admin credentials and then browse to Catalog -&gt; Categories. Once, on this screen, one can use the scope selector on top to switch between the different store views and enable/disable categories as per requirement. We have disabled some of the categories for the WKND Spanish store view as below. This will remove the disabled category at the time of configuring any of the components such as Category Carousal or Product Carousel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuCn4R-BTmUwchkqy-gcLw.png" /><figcaption>The greyed out categories have been disabled using the toggle button in the above screen.</figcaption></figure><p>One can create/update products as well by browsing Catalog -&gt; Products. We will update one of the products for the purpose of this document in order to show the difference between both store views.</p><p>Selecting a product, we will use the scope selector to choose WKND Spanish store view. This will bring up the details of the product that we can update. In this scenario, we enabled the product for this store view as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1U2ovTQrXpF-nCXlTWirIg.png" /><figcaption>This is a configurable product</figcaption></figure><p>The cache needs to be flushed after all the configuration changes have been made by browsing System -&gt; Tools -&gt; Cache Management and clicking on Flush Cache. One can also choose to flush each cache individually.</p><p>The output of all the above updates is as below</p><h3>Default store view</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zmh4O67cSa30MT1h6NYQnQ.png" /></figure><h3>WKND Spanish store view</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXQ7g1uEWBeBJS5INhn74A.png" /></figure><p>As can be observed from the above 2 screenshots, the number of products in the category in addition to the currency has been updated. The navigation menu has also been updated for the WKND Spanish store view where we are not displaying all the categories. We should now see a similar experience in AEMaaCS as well after a successful integration.</p><p>The next step is to connect AEMaaCS to the Adobe Commerce instance. Log into AEMaaCS instance and then browse to Tools -&gt; Configuration browser.</p><p>Once a Quicksite for WKND Commerce has been created on the AEMaaCS instance, we should see a default WKND Commerce configuration as below. We will create a child under this node naming it Spanish. Both parent and child nodes have the Cloud Configurations enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*whMkizgyjqiG9-0mwTObAg.png" /></figure><p>Once the above is completed, one needs to browse to Tools -&gt; Cloud Services -&gt; CIF Configuration which will bring up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDkZyEhvIkvds0DbhD9q2w.png" /></figure><p>Select the configuration folder (either WKND Commerce or Spanish) and click on Create -&gt; Commerce configuration which will bring up the screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vu3JeqtBcj3BDpf1VpCGWg.png" /></figure><p>This establishes the connection between AEMaaCS and Adobe Commerce. If done successfully, you should be able to view the following if you browse to the English Shop page (Default Store View) and Spanish Shop page (WKND Spanish Store View) that has the product carousal component pointed to same category but under different scope.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULbvtYKlHLNv7BJlvUNiBQ.png" /><figcaption>All products and currency displayed in USD</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jlb3jYjXAQexXn9fC_LhEg.png" /><figcaption>Only one product displayed along with currency in Euro</figcaption></figure><p>From there on, the user will add to the cart and initiate the checkout flow and ending with an acknowledgment of the order from Adobe Commerce.</p><p>One can also view this order by logging into Adobe Commerce as admin and browsing to Sales -&gt; Orders which brings up the Order data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_MTc89ciVoWUvbclP-OhAA.png" /></figure><h4>References</h4><ul><li><a href="https://experienceleague.adobe.com/docs/experience-manager-65/commerce/home.html?lang=en">AEM Content and Commerce</a></li><li><a href="https://blog.developer.adobe.com/use-aem-as-a-cloud-service-with-multiple-adobe-commerce-systems-9295612a9554">Use AEM as a Cloud Service with Multiple Adobe Commerce Systems</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9325b1c3c873" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/integrating-adobe-experience-manager-with-adobe-commerce-and-setting-up-multi-store-view-9325b1c3c873">Integrating Adobe Experience Manager with Adobe Commerce and Setting Up Multi-Store View</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Support for a New Locale in Adaptive Forms in Adobe Experience Manager]]></title>
            <link>https://medium.com/adobetech/adding-support-for-a-new-locale-in-adaptive-forms-in-adobe-experience-manager-8b54c55fd266?source=rss-be2aee223f85------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b54c55fd266</guid>
            <category><![CDATA[extensibility]]></category>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[adaptive]]></category>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[adobe-experience-cloud]]></category>
            <dc:creator><![CDATA[Suvadeep Dey]]></dc:creator>
            <pubDate>Wed, 01 Jun 2022 14:07:10 GMT</pubDate>
            <atom:updated>2022-06-03T10:25:20.526Z</atom:updated>
            <content:encoded><![CDATA[<p>The aim of this article is to provide the steps necessary to add support for a new locale in Adaptive Forms in AEM. This is based on a recently implemented real-world use case using AEM 6.5.12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*E397GdbTf28fOpTGNuP9Lg.png" /></figure><h3><strong>Use case</strong></h3><p>There is often a need for an Adaptive Form to support new locales that are not available out of the box in AEM Forms. We are going to see 2 examples of adding support for Malay and Singaporean Tamil languages.</p><h3><strong>Steps to add the support for the two languages</strong></h3><p>We are going to add support for Malay which has an ISO code of <strong>“ms”</strong> and Tamil from Singapore which together with the country code is <strong>“ta_SG”</strong>. The steps to add the support are as follows:</p><ol><li>Create a node called languages of nt:unstructured type under /etc if it does not already exist and add the default and the new languages to be supported in a multi-string property called languages as per the below screenshot</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KA__V4tGJPRERONnBO33nw.png" /><figcaption><strong>ta-sg</strong> and <strong>ms</strong> have been added in the above languages property</figcaption></figure><p>2. In the above screenshot we have added <strong>ta-sg</strong> (Tamil Singapore) and <strong>ms</strong> (Malay) in addition to the already existing languages.</p><p>3. Browse to <a href="http://localhost:4502/system/console/configMgr">http://&lt;host&gt;:&lt;port&gt;/system/console/configMgr</a> and open the configuration called Guide Localization Service to add the new languages to be supported as par below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BJIOr60Hl3Oi6_52Uun_w.png" /><figcaption><strong>ta-sg</strong> and <strong>ms</strong> have been added in the above configuration</figcaption></figure><p>4. The next steps are to add client libraries for each of the locales for Adaptive Forms and XFA. Create a nt:folder node called languageguidesupport under /etc/clientlibs if not already existing.</p><p>5. Once languageguidesupport folder is created, one needs to create cq:ClientLibraryFolder for each new language to be supported. Please refer screenshot below for steps 4 and 5. Please also note the naming convention where both language and country codes have been provided e.g. ta_sg and only language code has been provided e.g. ms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*b7bAqvTKleyOFypaXnC86g.png" /><figcaption>locale specific clientlibs created for AF and XFA</figcaption></figure><p>The clientlib <strong>&lt;locale&gt;af</strong> should have 2 multi-string properties:</p><p>a)<strong> categories</strong> having a value of guides.I18N.<strong>ms</strong></p><p>b) <strong>dependencies</strong> having values xfaforms.3rdparty, xfaforms.I18N.<strong>ms</strong> and guides.common</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RI1s6PZ7qwJNtitDOLwxkA.png" /></figure><p>The clientlib <strong>&lt;locale&gt;xfa</strong> should have a single multi-string property:</p><p>a) <strong>categories</strong> having a value of xfaforms.I18N.<strong>ms</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEavCRh40V09Lrz7c4pbgw.png" /></figure><p>The above steps (a) and (b) have to be repeated for ta_sg as well.</p><p>Please note the <strong>locale</strong> in all the above properties. In the case of both language and country, the value of the locale in the above property will be of the form languageCountry e.g. frCA, taSG, etc. with no ‘-’ or ‘_’ between the language and country codes.</p><p>6. The following folder hierarchy should be present under the <strong>&lt;locale&gt;af</strong> and <strong>&lt;locale&gt;xfa</strong> nodes for each locale</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*aeTRJFYzzqTD3RZDeOOveg.png" /><figcaption>folder hierarchy for each new locale</figcaption></figure><h4><strong>Adaptive Form e.g. msaf or ta_sgaf</strong></h4><p>The file i18n.js can be copied from /libs/fd/af/runtime/clientlibs/I18N/en/javascript/i18n.js and updated as par the locale.</p><p>The file LogMessages.js can be copied from /libs/fd/af/runtime/clientlibs/I18N/en/javascript/LogMessages.js and updated as par the locale</p><p>The file js.txt can be copied from /libs/fd/af/runtime/clientlibs/I18N/en/js.txt</p><h4><strong>XFA e.g. msxfa or ta_sgxfa</strong></h4><p>The file I18N.js can be copied from /libs/fd/xfaforms/clientlibs/I18N/pt_BR/I18N.js and updated as par the locale.</p><p>7. Once all the above 6 steps have been taken care of, the final step is to restart the AEM instance so that the newly added locales are available at the time of translating the Adaptive Form.</p><h3><strong>Steps to translate the form</strong></h3><p>The form can be translated to the required languages by following the below steps</p><ol><li>Browse to <a href="https://experienceleague.adobe.com/docs/experience-manager-65/forms/adaptive-forms-advanced-authoring/using-aem-translation-workflow-to-localize-adaptive-forms.html?lang=en">https://experienceleague.adobe.com/docs/experience-manager-65/forms/adaptive-forms-advanced-authoring/using-aem-translation-workflow-to-localize-adaptive-forms.html?lang=en</a> and follow the steps.</li><li>You should be able to see the newly added locale at the time of adding the dictionary</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjdNTH2z1q2y7jqYVR7_pA.png" /><figcaption>ms and ta are visible in the dropdown</figcaption></figure><p>3. Once the translation project is created, the job has to be executed following the normal AEM process of translation. Post successful translation, locale specific nodes should be automatically created under assets node in the adaptive form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*1PLu-U0-yrgi673KXCBXnA.png" /><figcaption>locale specific nodes created for ms, ta-sg and zh-cn post executing the translation job</figcaption></figure><p>Please note that default machine translation provider may not support translation for some of the languages in which case we will browse to the AEM translator at <a href="http://localhost:4502/libs/cq/i18n/translator.html">http://&lt;host&gt;:&lt;port&gt;/libs/cq/i18n/translator.html</a> and translate manually by either exporting and importing XLIFF files and providing to human translators or making the changes on the translator UI itself.</p><p>We will have to select the dictionary node in the translator UI and then update the content for each language as par the below screenshot. Once done, the form needs to be published by following normal AEM replication mechanism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ID3ie9cS7cX6JG-malmM2g.png" /><figcaption>translated content to be authored or XLIFF to be exported or imported to be provided to a human translator</figcaption></figure><h3><strong>Viewing the translated form</strong></h3><ol><li>Once the translation has been completed, you will observe that unlike site translation where a separate language node gets created in the site hierarchy, nothing of this sort happens in case of Forms translation. You can invoke the translated form through the <strong>Preview</strong> mode and URL that looks like <a href="https://author507.adobedemo.com/editor.html/content/forms/af/cpf/survey.ms.html">https://&lt;host&gt;/content/forms/af/survey.<strong>ms</strong>.html</a> or <a href="https://author507.adobedemo.com/editor.html/content/forms/af/cpf/survey.ms.html">https://&lt;host&gt;/content/forms/af/survey.<strong>ta-sg</strong>.html</a>. Please note the locale in the selector.</li><li>Another way to view the translated form is to invoke the URL <a href="https://author507.adobedemo.com/editor.html/content/forms/af/cpf/survey.html?afAcceptLang=ms">https://&lt;host&gt;/content/forms/af/survey.html?afAcceptLang=<strong>ms</strong></a> or <a href="https://author507.adobedemo.com/editor.html/content/forms/af/cpf/survey.html?afAcceptLang=ms">https://&lt;host&gt;/content/forms/af/survey.html?afAcceptLang=</a><strong>ta-sg</strong>. This URL is not cacheable.</li><li>An important point to note is that the translated content will not be viewable in the <strong>Edit</strong> mode of the form.</li></ol><p><strong>References:</strong></p><ul><li><a href="https://experienceleague.adobe.com/docs/experience-manager-65/forms/manage-administer-aem-forms/supporting-new-language-localization.html?lang=en">Supporting new locales for adaptive forms localization</a></li><li><a href="https://experienceleague.adobe.com/docs/experience-manager-65/forms/adaptive-forms-advanced-authoring/using-aem-translation-workflow-to-localize-adaptive-forms.html?lang=en">Using AEM translation workflow to localize adaptive forms and document of record</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b54c55fd266" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/adding-support-for-a-new-locale-in-adaptive-forms-in-adobe-experience-manager-8b54c55fd266">Adding Support for a New Locale in Adaptive Forms in Adobe Experience Manager</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Interactive Communication in AEM Forms]]></title>
            <link>https://medium.com/adobetech/implementing-interactive-communication-in-aem-forms-5304d29d82a4?source=rss-be2aee223f85------2</link>
            <guid isPermaLink="false">https://medium.com/p/5304d29d82a4</guid>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[interaction-design]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[adobe-experience-cloud]]></category>
            <category><![CDATA[forms]]></category>
            <dc:creator><![CDATA[Suvadeep Dey]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 19:33:17 GMT</pubDate>
            <atom:updated>2021-12-03T19:33:32.918Z</atom:updated>
            <content:encoded><![CDATA[<p>This article aims to provide down the steps required to implement Interactive Communication in AEM Forms. This is a very complex process as par various online product documentation. The idea behind this article is to try and simplify the same by taking up a commonly used simple use case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*E397GdbTf28fOpTGNuP9Lg.png" /></figure><h3><strong>Use cases</strong></h3><p>Interactive Communication is an integral part of any transaction that a user carries out with a website in today’s online world. The transactions could range from online tickets, getting financial documents through an email from financial services firms, travel itinerary from travel portals, etc.</p><p>The below could be some of the possible use cases where an interactive communication is used:</p><ol><li>A user submits his/her details on an online form and the system after processing responds back to the user with an email that has an attachment in the shape of a interactive communication. This has both the data entered by the user and also some other information that is provided by the system and merged before sending out the final output.</li><li>A scheduler runs a process in the backend which in course of time sends out emails to all customers of an Organization that has an attachment in the shape of an interactive communication.</li></ol><h3><strong>Steps to implement Interactive Communication</strong></h3><p>We are proceeding with the 1st example from the above use cases. The following are the steps to implement Interactive Communication taking an example of ABC as an Organization where a user is submitting information through an Adaptive form to apply for an insurance policy.</p><ol><li><strong><em>Creating a Configuration</em></strong> — This is the first step and is created by browsing to AEM -&gt; Tools -&gt;Configuration Browser. Once in Configuration Browser, one needs to click on the Create Button which will bring up a dialog where relevant information needs to be entered. Cloud Configuration should be checked.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OBn4ROoQD21cLslsX5lMVg.png" /></figure><p>2. <strong><em>Creating a Data Source</em></strong> — This step is required to inform the downstream process about the source of data. This starts with browsing to AEM -&gt; Tools -&gt; Cloud Services -&gt; Data Source. The previously created Configuration, ABC is selected and then the Create button is clicked which brings up the Create Data Source Configuration Screen as par the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnyWdftxsKTc5YMpNV0AvA.png" /></figure><p>A title, name and Service Type (OData Service, RESTful Service and SOAP Web Service) needs to be specified and then Next is clicked which brings up the below screen. We will be choosing RESTful service for the purpose of this document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIflrCkWxLznsTHqhtEQng.png" /></figure><p>We will specify the metadata of the RESTful sevice which is already present as a swagger document (for more information on swagger, please feel free to visit <a href="https://swagger.io/">https://swagger.io/</a>), which will populate all other fields. Create button is then clicked to create the Data Source.</p><p>3. <strong><em>Creating a Form Data Model </em></strong>— Creating a FDM starts with browsing to AEM -&gt; Forms -&gt; Data Integrations and clicking on Create button and choosing Form Data Model from the menu. This will bring up the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xg6lEktOaxfht_zEWcoPFA.png" /></figure><p>The title and Data Source Configuration that was created in the previous step is specified and Next is clicked which brings up the next screen where one selects the actual Data Source, in this case ABC and clicks on the Create button. The FDM is then opened by hovering over the same and clicking on the pencil icon which brings up the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ON9-pVB84Rzt8WgGrtXjmg.png" /></figure><p>The checkbox next to all the fields and Service from the Datasource has to be selected and then Add Selected button needs to be clicked which will add all the information on the canvas as par the above screen. The Save button has to be clicked once followed by clicking on the checkbox next to the name of the model (Policy). This will show an Edit Properties link on the top navigation and that needs to be clicked which will bring up the below screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2nH22jyUOeRULao0DSrwg.png" /></figure><p>The Top Level Method toggle has to be switched on which will enable one to specify the read and the write services. In the above example, we only have the POST /insurancepolicy service to be selected which takes the model as the request body. The purpose of this POST call is to submit the information provided in the form. The next step is to click on the Done button followed by clicking on the Save button. One can also test the services by going to the Services tab and sending a dummy request.</p><p>4. <strong><em>Creating an Adaptive Form</em></strong> — An adaptive form is created by browsing to AEM -&gt; Forms -&gt; Forms and Documents.The above Form Data Model is selected at the time of creating the form. This will make it possible to map all the fields in the form with their corresponding properties in the FDM.</p><p>5. <strong><em>Creating one or more Document Fragments</em></strong> — We need to create the Document Fragments which are used at the time of creating the final Interactive Communication. This can be done by going to AEM -&gt; Forms -&gt; Document Fragments and clicking on Create button. This will bring up various options such as Text, List, Condition, Layout, Folder and File Upload. We will use the Text for the purpose of creating the Document Fragments. As the name suggests, Text is used where there is a need to have plain text in the Interactive Communication that comprises of areas which have static text and text that gets replaced dynamically at runtime. Clicking on Text brings up the below screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OEJNsr6he0v8X9V_eJ5ixg.png" /></figure><p>As can be seen, we have specified a Title and also chosen the previously created FDM. Clicking on Next brings up the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grZBs3LO2Vi3JtWZp6QWrQ.png" /></figure><p>This screen is used to prepare the Document Fragment. This allows us to format the document as par required styling. Additionally the yellow highlighted area is the dynamic text that will be populated at runtime. This is created by selecting the field on the left pane and clicking on Add Selected which will insert this field at the location of the cursor. The Save button is then clicked once the Document Fragment is prepared.</p><p>The above cycle is repeated for each Document Fragment that might be required to create an Interactive Communication e.g. address, policy information paragraph, footer, signature area, etc.</p><p>5. <strong><em>Creating a template</em></strong> — This step is required so that we have placeholders in the Interactive Communication to drag and drop the Document Fragments. The template is a XDP file that is created using Forms Designer and then uploaded to Forms -&gt; Forms and Documents -&gt; ABC folder (folder needs to be created). The template once created mainly consists of empty Subforms and looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-LcLwFnPMA0oJEa9mgjZA.png" /></figure><p>6. <strong><em>Creating an Interactive Communication</em></strong> — This is the part where all the above artifacts are used to create the Interactive Communication. One needs to browse to AEM -&gt; Forms and Documents and click on the Create button, choosing Interactive Communication. This will bring up the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQo1Q3qPUAMsIBfUd2YP-A.png" /></figure><p>The title and FDM are specified. The other fields such as Prefill service and Post Process Type needs to be specified as par requirement. Clicking on the Next button brings up the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMFgFr8HyNsAsh9kf-WtLg.png" /></figure><p>We will be creating the Interactive Communication only for the Print channel which will create a PDF document out of it. This PDF document will be attached to the email that will be sent to a customer. The print template is the earlier created XDP. Finally, the Interactive Communication is created by clicking on the Create button.</p><p>The Interactive Communication is then opened for Editing which brings up the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNhR3_vQBrPrOxhJkDLL0A.png" /></figure><p>As one can see, the Subforms in the template come up as placeholders where the Document Fragments can be dragged and dropped.</p><p>All the above steps completes the task of creating and preparing the Interactive Communication for further usage in the process.</p><p>7. <strong><em>Code to merge all the information in forms and elsewhere in the process</em></strong></p><p>The code that is implemented needs to use the various forms and printchannel APIs that are publicly available. Javadocs are available at <a href="https://www.adobe.io/experience-manager/reference-materials/6-4/forms/javadocs/com/adobe/fd/ccm/channels/print/api/model/package-summary.html">https://www.adobe.io/experience-manager/reference-materials/6-4/forms/javadocs/com/adobe/fd/ccm/channels/print/api/model/package-summary.html</a>.</p><p><strong>References</strong></p><p>Very detailed information on the above topic is available at <a href="https://experienceleague.adobe.com/docs/experience-manager-65/forms/getting-started/create-first-interactive-communication/create-your-first-interactive-communication.html?lang=en">https://experienceleague.adobe.com/docs/experience-manager-65/forms/getting-started/create-first-interactive-communication/create-your-first-interactive-communication.html?lang=en</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5304d29d82a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/implementing-interactive-communication-in-aem-forms-5304d29d82a4">Implementing Interactive Communication in AEM Forms</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Steps to Merge XML Data in Existing PDF Forms]]></title>
            <link>https://medium.com/adobetech/steps-to-merge-xml-data-in-existing-pdf-forms-f517424983c4?source=rss-be2aee223f85------2</link>
            <guid isPermaLink="false">https://medium.com/p/f517424983c4</guid>
            <category><![CDATA[adobe-document-cloud]]></category>
            <category><![CDATA[pdf]]></category>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[adobe-experience-manager]]></category>
            <dc:creator><![CDATA[Suvadeep Dey]]></dc:creator>
            <pubDate>Tue, 04 May 2021 13:19:34 GMT</pubDate>
            <atom:updated>2021-05-07T21:00:43.458Z</atom:updated>
            <content:encoded><![CDATA[<h4>This article provides the steps to programmatically merge XML data to a existing offline PDF form.</h4><figure><img alt="Adobe Experience Manager" src="https://cdn-images-1.medium.com/max/492/1*iGozlsryg-yWa7wAzwQQWw.png" /></figure><h3><strong>The business use case</strong></h3><p>An organization wants to provide a mechanism to its customers to dynamically populate their demographic data from some other 3rd party system to an offline PDF form, thus saving their customers a lot of time, providing a better experience and automating the form fill-up process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LxX3eHm5T1pNOpzf61vdFQ.png" /><figcaption>Flow of Data merge into Offline PDF form.</figcaption></figure><h4><strong>Prerequisites</strong></h4><ol><li>AEM 6.4+</li><li>Forms Add-on</li><li>AEM Maven project should have the following dependencies (artifactId)</li></ol><pre>adobe-lc-forms-bedrock-connector<br>adobe-aemds-core-docmanager<br>adobe-aemfd-docassurance<br>com.adobe.aemfd</pre><p>4. Acrobat PDF license to edit the PDF files</p><h4><strong>Solution</strong></h4><p>The solution is to use AEM Forms technology by leveraging the Forms API to automatically merge the XML with the existing PDF forms.</p><ol><li>Prepare the offline PDF for merge functionality to verify whether the field names in the PDF meet the XML specification with respect to XML tag naming. The field names in the PDF correspond to the XML tag names. This can be done by the following steps —</li></ol><p>a) Open the PDF file in Adobe PDF reader.One should have the license to also edit the PDF</p><p>b) Select the option <em>Edit the PDF</em> from the right side pane in the PDF reader and this will open the file for editing.</p><p>c) Once the file is open for editing, select File menu -&gt; Create -&gt; Create Form -&gt; click on Start button</p><p>d) This will make all the fields of the PDF visible on the right side pane as a tree structure where one can edit the actual names of the fields and make the field names to meet the XML tag naming specification e.g. <em>field names should not have a ‘ ’ in their names </em>because XML tags should not have a space in their name. In case the field names are found to have ‘ ‘ in their names, a good practice would be to just replace them with a character such as ‘_’ or delete the ‘ ‘ altogether. The field <em>During the lease</em> could be converted to <em>During_the_lease </em>or<em> DuringTheLease, etc.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*LB0phpJfIbDuGg_22EhwAw.png" /></figure><p>e) Once all the fields are taken care of, the PDF needs to be saved from File -&gt; Save As.</p><p>2. The next step is to generate a sample XML data that can be used as an input for the merge functionality. This needs to be done in the following way —</p><p>a) Open the PDF in Forms Designer ensuring that the option “Creating an Interactive Form with Fixed pages” is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMNttoyIQXyfSsmgC4Gbpw.png" /></figure><p>b) Clicking on Finish will load the form in the Forms Designer with the individual fields of the form visible on the left pane of the tool</p><p>c) The next step is to generate Preview Data for the form so that we have the sample XML data that will be required for further testing. This can be done by clicking on the File menu -&gt; Form Properties -&gt; Preview.</p><p>d) Once on the preview panel, specify a file on the local filesystem where you want the file to be generated and click on the Generate Preview Data button. This will bring up a dialog box where it will show you the form elements again and upon confirming will create the preview data with dummy text inside valid XML tags.</p><p>e) This dummy text will be present in a single hierarchy. A small snippet follows</p><p>&lt;topmostSubform&gt;<br> &lt;Name&gt;Ego ille&lt;/Name&gt;<br> &lt;No&gt;Si manu vacuas&lt;/No&gt;<br> &lt;Street&gt;Apros tres et quidem&lt;/Street&gt;<br> &lt;Apt&gt;Mirum est&lt;/Apt&gt;<br> &lt;Municipality&gt;Licebit auctore&lt;/Municipality&gt;<br> &lt;Postalcode&gt;Proinde&lt;/Postalcode&gt;<br> &lt;TelephoneNo&gt;Am undique&lt;/TelephoneNo&gt;<br> &lt;OtherTelephoneNocellphone&gt;Ad retia sedebam&lt;/OtherTelephoneNocellphone&gt;<br>&lt;/topmostSubform&gt;</p><p>The above XML is our test data with which we can verify the working of the automated functionality.</p><p>3. The final step is to implement the code that will merge XML data with the offline PDF that is already stored in AEM assets.</p><p>a) An OSGI service class is implemented for this that has a method having 2 parameters — path to the PDF file and the XML data that has the data from the 3rd party system</p><pre>Asset asset = resourceResolver.getResource(formTemplate).adaptTo(Asset.<strong>class</strong>);<br>pdfInputStream = asset.getOriginal().getStream();</pre><pre>// Offline PDF present in content DAM<br>Document pdfDocument = <strong>new </strong>Document(pdfInputStream);<br>// xmlData is from 3rd party system or earlier generated dummy XML<br>String xmlData = xmlData; <br>Document xmlDocument = <strong>new </strong>Document(<strong>new </strong>ByteArrayInputStream(xmlData.getBytes(StandardCharsets.<strong><em>UTF_8</em></strong>)));<br>PDFOutputOptions pdfOptions = <strong>new </strong>PDFOutputOptions();<br>pdfOptions.setAcrobatVersion(AcrobatVersion.<strong><em>Acrobat_11</em></strong>);<em><br></em>generatedDocument = <strong>this</strong>.<strong>outputService</strong>.generatePDFOutput(pdfDocument, xmlDocument, pdfOptions);<br>outputInStream = generatedDocument.getInputStream();<br>out = response.getOutputStream();<br><strong>int </strong>length;<br><strong>byte</strong>[] buffer = <strong>new byte</strong>[4096];<br><strong>while </strong>((length = outputInStream.read(buffer)) &gt; 0) {<br>    out.write(buffer, 0, length);<br>}</pre><h3>Summary</h3><p>Finally, using the above steps, a user will have an offline PDF form on their desktop that is pre-filled with their demographic data.</p><p>Referring all of the above, it should be clear on how to programmatically merge XML data into an existing offline PDF form.</p><p>It should be easy to implement the same in any AEM Forms implementation that meets the pre-requisites.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f517424983c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/steps-to-merge-xml-data-in-existing-pdf-forms-f517424983c4">Steps to Merge XML Data in Existing PDF Forms</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enabling Reader Extension to PDF using AEM Forms APIs]]></title>
            <link>https://medium.com/adobetech/enabling-reader-extension-to-pdf-using-aem-forms-apis-1788419869c?source=rss-be2aee223f85------2</link>
            <guid isPermaLink="false">https://medium.com/p/1788419869c</guid>
            <category><![CDATA[pdf]]></category>
            <category><![CDATA[aem-forms]]></category>
            <category><![CDATA[adobe-experience-cloud]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[forms]]></category>
            <dc:creator><![CDATA[Suvadeep Dey]]></dc:creator>
            <pubDate>Tue, 11 Aug 2020 15:39:47 GMT</pubDate>
            <atom:updated>2020-08-14T20:48:23.264Z</atom:updated>
            <content:encoded><![CDATA[<h4>This article provides the steps on how to programmatically enable Reader Extension to a PDF file using AEM Forms APIs.</h4><figure><img alt="Adobe Experience Manager" src="https://cdn-images-1.medium.com/max/400/1*VQYj4fEvAHMSzpg-Cjs57Q.png" /><figcaption>Adobe Experience Manager</figcaption></figure><h3><strong>The business use case</strong></h3><p>An organization wants to provide a seamless onboarding experience to their prospective users. The organization wants to do this by allowing their users to switch from an online to an offline PDF form mid-way or even download an offline form to start the process where they can continue to enter their details and finally submit the information. This will provide a seamless onboarding experience to the user thus leading to more satisfied users in the long run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*yxixCzBvpuCLVBtYC9_GwA.png" /></figure><p><strong><em>Pre-requisites</em></strong></p><ol><li>AEM 6.4+</li><li>Forms Add-on</li><li>AEM Maven project should have the following dependencies (artifactId)</li></ol><pre>adobe-lc-forms-bedrock-connector<br>adobe-aemds-core-docmanager<br>adobe-aemfd-docassurance<br>adobe-aemfd-readerextensions<br>adobe-aemfd-signatures<br>com.adobe.aemfd</pre><p><strong>Solution</strong></p><p>The solution is to use AEM forms technology and leveraging the reader extension mechanism where a PDF form can be enabled for editing to the end user. The process of programmatically enabling reader extension in the application is a technical one and comprises of the following steps</p><ol><li>Open the sling.properties that is there in the folder crx-quickstart/conf folder of your AEM extension and add the below lines</li></ol><pre>sling.bootdelegation.class.com.rsa.jsafe.provider.JsafeJCE=com.rsa.*<br>sling.bootdelegation.class.org.bouncycastle.jce.provider.BouncyCastleProvider=org.bouncycastle.</pre><p>2. Configure the Apache Sling Service User Mapper Service for user fd-service and add a mapping in the format of <strong>‘bundleId [ “:” subServiceName ] “=” userName’</strong></p><p>3. Add the same mapping in Apache Sling Service User Mapper Service Amendment</p><p><em>Steps 2 and 3 are required in order to get the repository connection and is the preferred way instead of using resolverFactory.loginAdministrative</em></p><p>4. The next step is to create a keystore for user fd-service and adding the provided certificate for the reader extension</p><p>a) Go to AEM Logo -&gt; Tools -&gt; Security -&gt; Users -&gt; fd-service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*M6WHRdyv2TENYqsnvN5kFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*l4GoLaPAyEyCf0LbA8W5rQ.png" /></figure><p>b) Clicking on Keystore will bring up the screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*mbNfNBWo1Fk9hwahCbGVGw.jpeg" /></figure><p>c) Clicking on Create Keystore will bring up the screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*wLwSuvKvs-XcJVEQG8GkkQ.jpeg" /></figure><p>d) Add a New Password and click Save after adding in both fields. This will bring up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*SyBuKD7GVtRmyHr1vmp5hw.jpeg" /></figure><p>e) Enter data in the relevant section in the above screen. The following needs to be entered for the fields</p><blockquote>&quot;realias&quot; for New Alias<br>Select the provided PFX file that you would be having for the field Keystore File<br>Enter the password for the PFX file in the fields Keystore File Password and Private Key Password <br>The Private Key Alias can be extracting by executing the command <strong>&quot;keytool list -v -keystore &lt;path to PFX file&gt; -storetype pkcs12&quot;</strong></blockquote><p>f) Click on Save and Close to exit the editing of fd-service.</p><p>5) The AEM form is created based on a XSD schema which allows us to Download a Document of Record as a XDP file. This can be done by clicking on the Download Document of Record link as shown in the below screenshot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*VQZ-k2NgTQvp1jsT2wJRzA.png" /></figure><p>6) The XDP file can be saved as Adobe Dynamic XML (PDF) using Livecycle Designer which can be stored in AEM as a template.</p><p>a) This template can be provided on need basis and the data in the XML from the online form can be merged programmatically and provided for download as an offline form to the end user. This step is only for scenarios where a user is either filling up an online form and wants to save a draft on their system or there is a requirement to merge with some data from the system. A code snippet is provided below</p><pre>org.w3c.dom.Node result = (org.w3c.dom.Node) xPath.evaluate(&quot;afData/afBoundData/details&quot;, doc, XPathConstants.NODE);</pre><pre>Document xmlDocument = new Document(new ByteArrayInputStream((XMLUtils.nodeToString(result)).getBytes(StandardCharsets.UTF_8)));</pre><pre>Document pdfDocument = new Document(inputStream);</pre><pre>Document generatedDocument = this.formsService.importData(pdfDocument, xmlDocument);</pre><p>b) The next step is to programmatically apply the reader extension to the generated document before being sent for download as an offline PDF. A code snippet is provided below. Note that the credential alias is same as the value that was provided at the time of creating the KeyStore.</p><pre>public Document enableReaderExtension(Document document, ResourceResolver resolver) throws Exception {</pre><pre>UsageRights usageRights = new UsageRights();usageRights.setEnabledComments(true);<br>usageRights.setEnabledFormFillIn(true);<br>usageRights.setEnabledDigitalSignatures(true);<br>usageRights.setEnabledEmbeddedFiles(true);<br>usageRights.setEnabledFormDataImportExport(true);</pre><pre>ReaderExtensionOptions readerOpts = ReaderExtensionOptions.getInstance();</pre><pre>readerOpts.setReOptions(new ReaderExtensionsOptionSpec(usageRights, &quot;Enable commenting in PDF and Form Fill In&quot;));<br>readerOpts.setCredentialAlias(&quot;<strong>realias</strong>&quot;);<br>readerOpts.setResourceResolver(resolver);</pre><pre>ReaderExtensionsOptionSpec reOptionsSpec = new ReaderExtensionsOptionSpec(usageRights, &quot;Sample ARES&quot;);<br>readerOpts.setReOptions(reOptionsSpec);</pre><pre>return this.docAssuranceService.secureDocument(document, null, null, readerOpts, null);</pre><pre>}</pre><p>7) The Document that is returned from the above method is then finally made available for download to the user. A code snippet is provided below</p><pre>Document generatedDocument = this.docService.enableReaderExtension(generatedDocument, resolver);<br>   outputInStream = generatedDocument.getInputStream();</pre><pre>response.setContentType(&quot;application/pdf&quot;);<br>response.setHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=accountapplication.pdf&quot;);<br>out = response.getOutputStream();<br>byte[] buffer = new byte[4096];<br>int length;<br>while ((length = outputInStream.read(buffer)) &gt; 0) {<br>    out.write(buffer, 0, length);<br>}<br>out.flush();</pre><h3><strong>Summary</strong></h3><p>Finally, using the above steps, a user will have an offline PDF form on their device/desktop, on which they can fill up the information. The information will be sent to the server once the user clicks on the Submit button on the form.</p><p>Referring all of the above, it should be clear on how to programmatically apply the reader extension on an offline PDF form and allow the users to submit information once they come online.</p><p>It should be easy to implement the same in any AEM Forms implementation that meets the pre-requisites.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1788419869c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/enabling-reader-extension-to-pdf-using-aem-forms-apis-1788419869c">Enabling Reader Extension to PDF using AEM Forms APIs</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>