Skip to content

senn/senn-ij-aem-comp-gen

Repository files navigation

senn-ij-aem-comp-gen // AEM Component Generator - IntelliJ Plugin

About

An IntelliJ plugin to easily create AEM components.
It has
  • an easy to use UI
  • creation of all/most files associated with components (content xml, html, dialog xml, edit config xml, client libs and sling model)
  • ad hoc parameters for creation (that are stored in memory in the IntelliJ session for ease of use)
  • the option to automatically open the created files in the editor

The plugin was created as a tool to be used by myself and optionally also other AEM developers. And also as a way to re-familiarize myself with Git.

It was in no way intended to follow best practices in IntelliJ plugin development guidelines.
It doesn't use the new Kotlin/Gradle approach and it does all operations directly to the filesystem using java.io instead of using IntelliJ's built-in Virtual Filesystem, PSI system and templating.

How to use

To use the plugin, download the latest release and drop it inside the plugins folder of your IntelliJ.
Ideally using this hierarchy: plugins/senn-ij-aem-comp-gen/lib/senn-ij-aem-comp-gen.jar but that's not required. Then start IntelliJ and rightclick on a folder or file and you should see the New > AEM Component Files option.

Click the context menu from anywhere within your project navigation: New > AEM Component Files
context menu
A popup dialog appears providing options what to create and where to place the generated files. Fill in the required info, select which files to generate and indicate whether to open the files in the editor after creation.
As an example, we'll create a Crypto component. We want to generate all the files and open them in the editor: dialog
Click OK and ...
created files created sling model
The files will be opened in the editor if the option was selected.

When creating another AEM Component, the plugin remembers the options you entered and selected the previous time and you only need to fill in the component name and component group.

It's important to remark that the plugin only works if the AEM parent module (ie. aem-guides-wknd) is the project root in IntelliJ containing the modules for ui.apps, core, etc.
If you have another project root and the AEM parent module is a subfolder within that project, the files will not be placed in the correct location.
It should work for normal AEM project setups.

Cheers,
Bart