<?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 Dinesh Chaudhary on Medium]]></title>
        <description><![CDATA[Stories by Dinesh Chaudhary on Medium]]></description>
        <link>https://medium.com/@dichaudhary?source=rss-b477ad6cd287------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*JN5SWc4MhZLkKAFG1L_mjg.jpeg</url>
            <title>Stories by Dinesh Chaudhary on Medium</title>
            <link>https://medium.com/@dichaudhary?source=rss-b477ad6cd287------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 00:33:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dichaudhary/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[AEM as a Cloud Service — Dispatcher Converter Tool]]></title>
            <link>https://medium.com/adobetech/aem-as-a-cloud-service-dispatcher-converter-tool-a668ecf5738c?source=rss-b477ad6cd287------2</link>
            <guid isPermaLink="false">https://medium.com/p/a668ecf5738c</guid>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[adobe-experience-cloud]]></category>
            <category><![CDATA[adobe-io]]></category>
            <dc:creator><![CDATA[Dinesh Chaudhary]]></dc:creator>
            <pubDate>Fri, 23 Jul 2021 13:03:22 GMT</pubDate>
            <atom:updated>2021-07-27T07:44:11.971Z</atom:updated>
            <content:encoded><![CDATA[<h3>AEM as a Cloud Service — Dispatcher Converter Tool</h3><p><em>Restructure dispatcher configs on AMS or on-prem to AEMaaCS compatible.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jq59MhCPo4eApKnpe9-hrA.png" /></figure><h3>Overview</h3><p>With Adobe Experience Manager (AEM) being available as a Cloud Service, there are a few notable changes on how Apache &amp; Dispatcher configurations can be structured so that they can be deployed on the cloud. Below is an important if not exhaustive change list for dispatcher configurations on AEMaaCS.</p><ul><li>Some Apache directives may not be used (for example Listen or LogLevel)</li><li>Only some pieces of the Dispatcher configuration can be put in include files and their naming is important. For example, filter rules that you want to reuse across different hosts must be put in a file called filters/filters.any.</li><li>There is an extra validation to disallow filter rules written using /glob to prevent security issues.</li><li>All virtual host sections should refer to port 80. Statement in virtual host section that refers to any port other than 80 will not get processed.</li></ul><p>This article outlines the <a href="https://github.com/adobe/aem-cloud-service-source-migration/tree/master/packages/dispatcher-converter"><strong>Dispatcher Converter</strong></a><strong> </strong>which is part of the initiative by Adobe of developing code refactoring tools to make existing content (code, package structure, indexes, configurations) compatible with AEM as a Cloud Service. This tool converts existing AEM Dispatcher configurations to AEM as a Cloud Service compatible Dispatcher configurations by honoring the changes listed above along with the ones checked by validator script which comes as part of <strong>Dispatcher Tools </strong>mentioned <a href="https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html?lang=en#validation-debug">here</a>.</p><h3>Usage</h3><ul><li>It is <strong>recommended to use this tool via the AIO CLI plugin for code refactoring tools</strong> which integrates all the code refactoring tools and minimizes the overhead of installation and setup of individual tools (refer to the article <a href="https://medium.com/adobetech/unified-experience-for-aem-as-a-cloud-service-code-refactoring-tools-50e931119059">Unified Experience for AEM as a Cloud Service Code Refactoring Tools</a> to understand how to install and execute the plugin).</li><li>It can also be executed standalone (see <a href="https://github.com/adobe/aem-cloud-service-source-migration/tree/master/packages/dispatcher-converter">here</a> for more details).</li></ul><h3>Configuration</h3><p>Before executing the tool, please go through the expected input configurations and the sample configuration provided <a href="https://github.com/adobe/aio-cli-plugin-aem-cloud-service-migration/tree/master/config#dispatcher-converter">here</a>.</p><h3>How it works</h3><h4>1. Configure Dispatcher Tools SDK</h4><p>Download and extract the Dispatcher Tools (part of the AEM as a Cloud Service SDK) from the Software Distribution portal. It consists of the following items :</p><ul><li>A vanilla file structure containing the default configuration files to include in a maven project for Dispatcher.</li><li>Tool for customers to validate that the Dispatcher configuration includes only AEM as a Cloud Service supported directives. Additionally, the tool also validates that the syntax is correct so apache can start successfully.</li><li>A Docker image that brings up the Dispatcher locally.</li></ul><h4>2. Copy the configuration to Target Folder</h4><p>Once the SDK path is configured with the other properties (on-prem / AMS), The following steps are executed :</p><ul><li>The dispatcher configuration path provided in the config.yaml is used to copy the configuration to the target folder.</li><li>The copied dispatcher configurations are processed by the tool and converted dispatcher configurations are placed under target folder.</li></ul><h4>3. Remove non-conforming segments</h4><p>In this part below non-conforming segments are removed:</p><ul><li>Unused Folders are removed</li><li>Non Publish Vhost Files are removed</li><li>Vhost sections not referring to Port 80 are removed</li><li>Variables used in configuration can also be renamed as per the requirement. For On Premise configurations, additional variables can be defined in variablesToReplace section in config file to be replaced.</li></ul><h4>4. Convert configuration segment related to httd.conf</h4><p>In this phase the tool changes the configuration dependent on httpd.conf which includes the below operations:</p><ul><li>The virtualhost files are changed — There can be one or more files of this type. They contain &lt;VirtualHost&gt; entries that match host names and allow Apache to handle each domain traffic with different rules.</li><li>Files are created in the available_vhosts directory and enabled with a symbolic link in the enabled_vhosts directory.</li><li>Create symlinks for virtualhost files in enabled vhost section.</li><li>Checking for non-allowlisted directives in the configuration.</li></ul><h4>5. Convert configuration segment related to dispatcher.any</h4><p>In this phase the tool changes the configuration dependent on dispatcher.any which includes the below operations:</p><ul><li>Creating/Changing farm files — There can be one or more of these files, and they contain farms to match host names and allow the dispatcher module to handle each farm with different rules.</li><li>Files are created in the available_farms directory and enabled with a symbolic link in the enabled_farms directory.</li><li>Creating symlinks for farm files under enabled farms section.</li><li>Creating render files — As part of the base framework, render file gets generated on startup. You are required to include this file in every farm you define, in the renders section.</li><li>Creating rules files — rules file is included from inside your .farm files. It specifies caching preferences.</li><li>Creating filter files — filter file is included from inside your .farm files. It has a set of rules that change what traffic should be filtered out and not make it to the backend.</li><li>Creating clientheaders files — clientheaders file is included from inside your .farm files. It specifies what request headers should be forwarded to the backend.</li><li>Creating rewrite files — rewrite file is included from inside your .vhost files. It has a set of rewrite rules for mod_rewrite.</li></ul><h4>6. Summary report</h4><ul><li>Every operation which is performed during the conversion is logged in dispatcher-converter-report.md, which can be referenced to verify the conversion.</li></ul><h3>File Structure</h3><p>The structure of the target(converted) project’s Dispatcher subfolder is described below :</p><pre>./<br>├── conf.d<br>│   ├── available_vhosts<br>│   │   └── default.vhost<br>│   ├── dispatcher_vhost.conf<br>│   ├── enabled_vhosts<br>│   │   ├── README<br>│   │   └── default.vhost -&gt; ../available_vhosts/default.vhost<br>│   └── rewrites<br>│   │   ├── default_rewrite.rules<br>│   │   └── rewrite.rules<br>│   └── variables<br>|       ├── custom.vars<br>│       └── global.vars<br>└── conf.dispatcher.d<br>    ├── available_farms<br>    │   └── default.farm<br>    ├── cache<br>    │   ├── default_invalidate.any<br>    │   ├── default_rules.any<br>    │   └── rules.any<br>    ├── clientheaders<br>    │   ├── clientheaders.any<br>    │   └── default_clientheaders.any<br>    ├── dispatcher.any<br>    ├── enabled_farms<br>    │   ├── README<br>    │   └── default.farm -&gt; ../available_farms/default.farm<br>    ├── filters<br>    │   ├── default_filters.any<br>    │   └── filters.any<br>    ├── renders<br>    │   └── default_renders.any<br>    └── virtualhosts<br>        ├── default_virtualhosts.any<br>        └── virtualhosts.any</pre><h3>Known Limitations</h3><ul><li>Rule file which exists in original configuration and having name non-conforming to Skyline Guidelines are removed.</li><li>If a removed file is required, it should be converted manually and used.</li></ul><h3>Validating the output</h3><blockquote><em>[NOTE] For more information on Dispatcher Validator, refer to </em><a href="https://docs.adobe.com/content/help/en/experience-manager-learn/cloud-service/local-development-environment-set-up/dispatcher-tools.html"><em>Adobe Experience Manager as a Cloud Service SDK</em></a><em>.</em></blockquote><ul><li>Run the dispatcher validator on the converted configurations, with the dispatcher sub-command :</li></ul><pre>$ validator dispatcher</pre><ul><li>If you encounter errors about missing include files, check whether you correctly renamed those files.</li><li>If you see errors concerning an <em>undefined</em> variable, rename it to DOCROOT.</li></ul><p>For troubleshooting other errors, refer to <a href="https://docs.adobe.com/content/help/en/experience-manager-learn/cloud-service/local-development-environment-set-up/dispatcher-tools.html#troubleshooting">Troubleshooting &amp; Local Validation of Dispatcher Configuration</a>.</p><h3>Demo</h3><p>The demo video shows how to execute the Dispatcher Converter tool for on-prem or AMS projects via the aio-cli-plugin-aem-cloud-service-migration.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqS_ctbeaEN4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqS_ctbeaEN4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqS_ctbeaEN4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb29b78b56b4dcb6a6e265d20e63c6c5/href">https://medium.com/media/bb29b78b56b4dcb6a6e265d20e63c6c5/href</a></iframe><h3>Contact us</h3><p>Your feedback would be greatly appreciated !!</p><p><a href="https://github.com/adobe/aem-cloud-service-source-migration">Please submit your pull requests and issues here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a668ecf5738c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/aem-as-a-cloud-service-dispatcher-converter-tool-a668ecf5738c">AEM as a Cloud Service — Dispatcher Converter Tool</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[Apache Sling Pipes — Bringing Back the Fun!]]></title>
            <link>https://medium.com/adobetech/apache-sling-pipes-bringing-back-the-fun-6b13edb4a17c?source=rss-b477ad6cd287------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b13edb4a17c</guid>
            <category><![CDATA[sling]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[gogo]]></category>
            <category><![CDATA[aem]]></category>
            <dc:creator><![CDATA[Dinesh Chaudhary]]></dc:creator>
            <pubDate>Mon, 07 Oct 2019 17:18:55 GMT</pubDate>
            <atom:updated>2019-10-12T11:36:02.953Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Sling Pipes — Bringing Back the Fun!</h3><p><em>A new contribution to Sling, and how to use it.</em></p><p><a href="https://sling.apache.org/documentation/bundles/sling-pipes.html">Apache Sling Pipes</a> were originally created to quickly achieve common development work by chaining together proven sling code blocks. Some common use cases include <a href="https://sling.apache.org/documentation/bundles/sling-pipes/readers.html#xpathpipe-xpathexpr">searching with Xpath</a> and <a href="https://sling.apache.org/documentation/bundles/sling-pipes/writers.html">writing</a>.</p><p>Sling Pipes lets you focus on the important question of “what to do,” and not just “how to do it.” Open your favorite console or Apache GoGo and write the below script:</p><pre>plumber.newPipe(resolver)<br>.xpath(&quot;/jcr:root/content/mysite//element(*,nt:base[@myProperty=&#39;badValue&#39;]&quot;)<br>.write(&quot;changetoGoodValue&quot;)<br>.run();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFMhGEQxkYv5nr0y-P96AA.png" /><figcaption>When you have too many tools for the job. :(</figcaption></figure><p>Pipes can prove to be helpful in other ways as well, such as to:</p><h3>Quickly create a Json and CSV servlet</h3><p>Suppose you have a need for a list of pages of a certain type and need the path, title, and last modified by value. This requirement holds in one sentence and is enough to be “compiled” in a (Sling) developer’s head so he builds you up that servlet. Most developers will build you more or less the same piece of code, that takes around 100 lines of code, which includes a lot of duplication (across developers, and across each developer history).</p><p>With Pipes, it is being narrowed down to the important piece; that is what are the variant bits in that boilerplate code (here using some <a href="https://sling.apache.org/documentation/bundles/sling-pipes/readers.html#sling-query-pipes">Sling Query Pipes</a>’ find pipe).</p><pre>plumber.newPipe(resolver)<br>.echo(&quot;/content/mysite&quot;)<br>.$(&quot;cq:Page&quot;)<br>.echo(&quot;jcr:content&quot;).name(&quot;content&quot;) .outputs(&quot;title&quot;,&#39;${content[&quot;jcr:title&quot;]}&#39;,&quot;modBy&quot;,&#39;${content[&quot;cq:lastModifiedBy&quot;]}&#39;)<br>.build(&quot;/services/page-mod&quot;);</pre><p>then</p><p>“GET /services/page-mod.json” will return</p><pre>{&quot;items&quot;:[<br>{&quot;6-4_upgrade_validation&quot;},<br>{&quot;English&quot;},<br>{&quot;Bulgarian&quot;},<br>....]</pre><p>“GET /services/page-mod.csv” will return a CSV file</p><h3>Develop a list component without Java code</h3><p>Now we could need a list component, with a choice of lists that are provided by the developer and without specifically more Java code.</p><p>Whether you present to the user a list of query names (with pipe references as values), or you directly use one, you have a PipeModel deployed with pipe bundle you can use in your scripts, as well as all the pipes you’ve already written, like here for us `/services/page-mod`.</p><p>You then need to have in your component instance a <a href="https://github.com/apache/sling-org-apache-sling-pipes/blob/master/src/test/resources/SLING-INF/jcr_root/content/list-component.json">reference to your pipe in a Pipes subnode</a> then just use the pipe model as use in your htl script and you’re done.</p><pre>&lt;ul class=&quot;pages&quot; data-sly-use.pipe=&quot;org.apache.sling.pipes.models.PipeModel&quot;data-sly-list.page=&quot;${pipe.outputs.mods}&quot;&gt;<br>   &lt;li data-sly-resource=&quot;${page.path}&quot;&gt;&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>a complete example is available in <a href="https://github.com/apache/sling-org-apache-sling-pipes/blob/master/src/test/resources/SLING-INF/jcr_root/apps/pipes-it/list/list.html">Pipes integration test</a></p><h3>Collect and package assets</h3><p>As a developer, it’s a relatively frequent use case to collect assets from a page on production to install them locally for testing purposes.</p><p>Assuming you have an instance with access to all assets needed on that page on production (typically stage or central dev author), we’ll crawl the production page for <em>src</em> references and package them up, PackagePipe being in filter collection mode, each output of RegexpPipe will be considered as a new one.</p><pre>plumber.newPipe(resolver)<br>.egrep(&quot;https://www.mysite.com/my-page.html&quot;)<br>.&#39;src=\&quot;https://images.mysite.com(?&lt;asset&gt;/[\\-\\w\\.\\/0-9]+)\&quot;&#39;)<br>.pkg(&quot;/etc/packages/dinesh/my-page-assets.zip&quot;)<br>.path(&#39;/content/dam${one.asset}&#39;)<br>.run()</pre><p>And that’s it, you’ll have your built-in package manager.</p><p>Similarly, let&#39;s say you have a use case of listing out all the locales under your site. Typically to achieve it, a developer will write java code that will iterate through the content structure and list out the locales or get it through content config stored in a common place. But with sling pipe it can be achieved easily as below .</p><pre>plumber.newPipe(resolver)<br>.echo(&quot;/content/site&quot;)<br>//for country (one level under home content page)<br>.$(&quot;cq:Page&quot;)<br>//for language (two level under home content page)<br>.$(&quot;cq:Page&quot;)<br>.build(&quot;/services/locales&quot;)</pre><p>The above gets build as a service that gives all the locales under the content structure, often we meet a requirement on top where this service should only be accessible by few folks which can be met with <a href="https://sling.apache.org/documentation/bundles/sling-pipes/writers.html">ACL’s pipe</a> with the below script.</p><pre>plumber.newPipe(resolver)<br>.echo(&quot;/services/locales&quot;)<br>.allow(&quot;dinesh&quot;) //an authorizable should exist with the name <br>.run()</pre><p>Moving content (resource) from one place to another also serves as common use case in our daily life. Consider executing the below example with your content. It should be noted that while moving, a destination folder shouldn’t have the resource named the same as source resource.</p><pre>plumber.newPipe(resolver)<br>.echo(&quot;/content/foo/old/location&quot;)<br>.mv(&quot;/content/bar/new/location&quot;)<br>.run()</pre><p>Few latest <a href="https://github.com/apache/sling-org-apache-sling-pipes/pull/11">commits</a> have ensured that we can also consider the ordering of nodes while moving content to a new location. “def” resource will be placed before “bar” under “foo” which assumes “foo” should exist.</p><pre>plumber.newPipe(resolver)<br>.echo(&quot;/abc/xyz/def&quot;)<br>.mv(&quot;/foo/bar&quot;)<br>.with(&quot;orderBeforeTarget&quot;,true)<br>.run()</pre><p>A big thanks to Nicolas Peltier for making <a href="https://github.com/apache/sling-org-apache-sling-pipes">sling pipe repository</a> open for community.</p><p><em>Courtesy:</em> An article written by Nicolas Peltier <a href="https://www.linkedin.com/pulse/aem-make-your-lazy-developer-life-easier-sling-pipes-peltier">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b13edb4a17c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/apache-sling-pipes-bringing-back-the-fun-6b13edb4a17c">Apache Sling Pipes — Bringing Back the Fun!</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>