AEM Components Auto Generator
This plugin speeds up the tasks when creating new components. It provides a series of attributes that can be added to a source HTML to automate the creation of fully functional AEM components, with their corresponding dialogs and sling models.
CodeBay Framework to generate AEM components
How to use it:
- Press "Ctrl + Shift + P" (In windows) or "Command + Shift + P" (In IOs) and search for the plugin.
- Once pressed, the plugin should activated and started.
Working with the plugin
How to work with the plugin:
Workflow
The first thing to mention is how the plugin works:
- The plugin asks an input that must follow some specific semantic rules.
- Once the input has been given, the plugin creates the components
- The order of the component creation is from the top of the given HTML to the bottom.
- In each component:
- It updates the general component info, HTML and dialog in that specific order
- It created the model and the package-info of the created models if the file does not exists.
Note: If an absolute path is given, it will create the models in theGivenFolder/model
Semantic rules
The way the plugin works is by inserting an HTML structure with specified properties where it will get all the information.
You must follow a structure and semantic rules to correctly create a component.
- All components begin with an element in wich you need to specify the component path and package of the model.
- After the path you can insert as many elements as components you want to create, in this elements the name and the group of each component needs to be specified.
- Insert inside these new elements as many properties as necessary.
Here is a list of the properties and its uses:
Code Snippets
In relative path
<div aem-component-path="ui.apps\src\main\content\jcr_root\apps\myProject\components\new-components"
aem-models-package="com.codebay.myproject.core.models.newcomponents">
<div aem-component-name="books/infographicBook" aem-component-group="My Project - Structure">
<h1 class="test-for class attr" aem-property="title"
aem-property-type="textarea" aem-property-value="Default title value" aem-property-label="Preview title">
<div aem-property="subTitle" aem-property-type="textfield" aem-property-value="Default subtitle value">
<a aem-attribute-href-name="href" aem-attribute-href-label="Href Label" aem-attribute-href-type="textfield" aem-attribute-href-value="#" aem-property="subTitleColoring" aem-property-type="colorfield" aem-property-label="Subtitle Coloring"></a>
</div>
<img aem-attribute-src-name="src" aem-attribute-src-label="Src Label" aem-attribute-src-type="textfield" aem-attribute-src-value="#"/>
<p aem-property="upperTitle" aem-property-type="textarea" aem-property-label="Upper title"></p>
</h1>
<p aem-property="number" aem-property-type="numberfield"></p>
<ul aem-property="myMultifield" aem-property-type="multifield" aem-property-label="My Multifield">
<li aem-property="title" aem-property-type="textfield" aem-property-label="Property 1">Title</li>
<li aem-property="description" aem-property-type="select" aem-property-options="option1,option2"
aem-property-label="Description">Lorem ipsum</li>
</ul>
<li aem-property="mySelect" aem-property-type="select" aem-property-options="option1,option2,option3"
aem-property-label="Select Example"></li>
</div>
<div aem-component-name="authorInfo" aem-component-group="My Project - Structure"
aem-models-package="com.codebay.myproject.core.models">
<h1 class="class1 class2" aem-property-attribute-title="name" aem-property="name"
aem-property-type="textfield" aem-property-value="Default Name value" aem-property-label="Name">
</h1>
<div aem-property="surname" aem-property-type="textfield" aem-property-value="Default Surname value">
<span aem-property="favouritecolor" aem-property-type="colorfield" aem-property-label="Favourite Coloring"></span>
</div>
<p aem-property="age" aem-property-type="numberfield" aem-property-label="Numberfield"></p>
</div>
</div>
With an absolute path
<div aem-component-path="\c:\Users\my-user\Desktop" aem-models-package="com.codebay.project2.models">
<div aem-component-name="component1" aem-component-group="My group - My Group">
<h1 class="class1" aem-property-attribute-title="Preview" aem-property="title"
aem-property-type="textarea" aem-property-value="Default title value" aem-property-label="Preview title">
<div aem-property="subTitle" aem-property-type="textfield" aem-property-value="Default subtitle value">
<img aem-attribute-src-name="source" aem-attribute-src-label="Source" aem-attribute-src-type="textfield" aem-attribute-src-value="#" aem-property="subTitleColoring" aem-property-type="colorfield" aem-property-label="Subtitle Coloring"/>
</div>
<a aem-attribute-href-name="href" aem-attribute-href-label="Href" aem-attribute-href-type="textfield" aem-attribute-href-value="#"></a>
<p aem-property="upperTitle" aem-property-type="textarea" aem-property-label="Upper title"></p>
</h1>
<p aem-property="text" aem-property-type="numberfield"></p>
<ul aem-property="myMultifield" aem-property-type="multifield" aem-property-label="My Multifield">
<li aem-property="property1" aem-property-type="textfield" aem-property-label="Property 1">Title</li>
<li aem-property="property2" aem-property-type="select" aem-property-options="option1,option2"
aem-property-label="Property 2">Property 2</li>
</ul>
<li aem-property="mySelect" aem-property-type="select" aem-property-options="option1,option2"></li>
</div>
</div>
NOTE: You can add various components of various paths at the same time.
Reporting Issues
You can report any issue at our official repository on AEM Components Auto Generator GitHub