How to simplify AEM UI developing

In AEM very often we need to synchronize content (html, css, dialogs, nodes and so on) between local AEM instance  and development environment. We can achieve this in a few ways:

  1. deploy content bundle every time when we need content refresh with maven (common approach)
  2. use some IDE with built-in functionality for synchronization (Eclipse with Sling IDE plugin, Brackets)

There is also exists another way which I’m referrer to synchronize content – to use Jackrabbit FileVault (VLT) which introduces a JCR repository to filesystem mapping.

Let me show in few steps how to configure it (I believe all console commands are self-explained):

  1. Install the VLT:
    1. You can obtaine VLT command line client directly from AEM installation directory crx-quickstart/opt/filevault (inside directory build available in two archives tgz and zip) or you can compile it from source code (sources available here)
      VLT location
    2. Put VLT command line client to system PATH. If it was done correctly you should see output from this command in command line:
      vlt --help
  2. Install VLT service on local AEM instance:
    vlt --credentials admin:admin sync --uri http://localhost:4502/crx install

    If you see output like this:

    vlt --credentials admin:admin sync --uri http://localhost:4502/crx install
    
    Connecting via JCR remoting to http://localhost:4502/crx/server
    Preparing to install vault-sync-2.4.34.jar...
    Detected existing bundle: vault-sync-2.4.34.jar. Aborting installation. Specify --force to update.

    It means that service was already installed on AEM but you can override/update it with –force parameter like below:

    vlt --credentials admin:admin sync --uri http://localhost:4502/crx install --force
  3. Open console in content JCR_ROOT folder (folder with content – check folder path for example) and register it for synchronization:
    vlt --credentials admin:admin sync --uri http://localhost:4502/crx/server/-/jcr:root register
  4. Afterwards all modifications of content from development environment will be synchronized with OAK without additional actions.
  5. Check that folder from #3 was added for synchronization:
    vlt --credentials admin:admin sync --uri http://localhost:4502/crx status
    
    Connecting via JCR remoting to http://localhost:4502/crx/server
    Listing sync status for http://localhost:4502/crx/server/-/jcr:root
    - Sync service is enabled.
    - syncing directory: /home/evgeniy_fitsner/dev/test_project/content/src/main/content/jcr_root

    As we see from the log everything is good.

For more information about VLT and what can be done with it please read documentation:

  1. Apache Jackrabbit FileVault Documentation
  2. How to use the VLT Tool from Adobe