AEM Fiddle — Speed Up Experimentation/POC Work

Sanjay Kushawaha
TECHnotes4u
Published in
3 min readMar 17, 2021

Most of the time during AEM development when we want to do a small POC work or some code experimentation like writing java code to get the information of node properties, getting the size of assets etc. then there are lots of development setup require along with AEM setup. Most IDE like Eclipse, Visual Studio Code, or IntelliJ require the orchestration of scripts, resources, and sling:resourceTypes. For any simple code change to deploy on AEM server we need to do maven build followed by deployment to AEM Server.

To overcome these hassles Adobe provides different handy tools to ease out the development works. You can refer these tools from ACS AEM Commons and ACS AEM Tools.

One such tool is AEM Fiddle which can be used to sort out the above-mentioned problem. This tool helps begin coding and executing your code in few seconds. Please also note that it is not intended to be used as a full-fledged application development environment.

To setup AEM Fiddle you just need to download and install the ACS AEM Tool package from ACS AEM Tools and install in you AEM instance using package manager. In a minimal time, you will be ready to use the AEM Fiddle. Below details are described w.r.t AEM localhost author instance.

To access the installed AEM Fiddle you can follow either of ways listed below-

AEM Fiddle Interface

AEM Fiddle Interface Highlights

  • Left panel use to write code to execute in AEM.
  • Click on left top link Adobe Experience Manager/ACS AEM Tools/AEM Fiddle will take you to http://localhost:4502/aem/start.html page.
  • Right panel use to displays the output of code execution.
  • Left arrow in right arrow use to toggle the output and html.
  • Absolute resource path text box uses to write the script execution context. Default path is /etc/acs-tools/aemfiddle/jcr:content. If you want to check some other path context let’s say /content/we-retail/us/en then put this value in Absolute resource path and execute the code.
  • Run code button use to execute the code. Below is sample code execution snippet.
  • + sign click show various coding format options to select. By selecting the particular option — the coding Interface for selected language will open as shown below.
  • Horizontal bars beside + sign uses to show you saved POC file names. You can also use it to Create, Load, Update and Delete code snippets. Files rename option is unavailable from interface although you can rename it by using CRXDE. Below screenshot shows the saved sample POC files list.
  • When there is any issue in code then during code execution you can see the error reference to fix the issue.
  • Saved code files are stored under the logged in user’s profile node. Example: /home/users/admin/profile/fiddles/demo
  • Code contents are stored in corresponding file scriptdata property as shown in below screenshot.

Reference

https://adobe-consulting-services.github.io/acs-aem-tools/features/aem-fiddle/index.html

--

--