AEM Page Packager

February 26, 2019    aem tools


Problem

In general

Have your ever faced the problem that a component works on your local instance but does not work on your qa or your colleague’s instance? I am 100% sure that you have faced this. In this case you will ask your colleague to create a package with this page, so you can install it and test locally. But in case the component has configuration options to set up references to another content, for example image component, therefore you will need to beg you colleague to add those paths to the package filter as well (booooooooring manual work).

Particular case

Another quite good example might be your STA environment. Not always you will have an access to this environment and event to the crx to create a package. General process in such situations is to create a JIRA ticket or kindly ask someone who has the access to create a package and share it with you. Based on the current workload situation you might wait for this package for a quite long time, basically you will be blocked to work further on the issue.

And now just imagine if a QA Engineer or a Content Manager could create a package with one button and attach this package to the ticket!!! That might save many many hours in you daily job routine!

Here comes AEM Page Packager

Solution

Repository link

AEM Page Packager allows you to create a package with a page in one click and even more, it will add paths to the referenced content into the package filter as well.

Under the hood it works with the ReferenceProviders, therefore you will be able to add you own ReferenceProvider and adjust references you want in the resulting package.

How To install

It is simple AEM project based on the aem-project-archetype, therefore you can build and deploy it with

mvn clean install -PautoInstallPackage

(In case you have running AEM instance)

IMPORTAMT

You have to complete 2 steps below, so the tool will work properly

1.Service User Mapping

Add service user mapping (Sample config you can find in the repository). It is needed because the user might not have read/write permissions for the /etc/packages path.

2.Page Menu Overlay

Add a page menu overlay with additional button. (sample overlay also can be found in the repository)

 <page-packager
         jcr:primaryType="nt:unstructured"
         sling:resourceType="granite/ui/components/coral/foundation/button"
         text="i18.title.key"
         granite:class="js-page-packager"
         granite:title="i18.title.key">
     <granite:data jcr:primaryType="nt:unstructured"
                   path="${requestPathInfo.suffix}.pagepackager.zip"/>
 </page-packager>

And it will look similar to this

page packager button

P.S. Any ideas/comments/reviews are highly appreciated ;)




comments powered by Disqus