The eJSL language is the key component of the JooMDD infrastructure. It can be used to create semantic extension models for the Joomla CMS which can be used e.g. for automatic code generation.
eJSL supports the definition of several Joomla extension types like components, modules, plugins, and libraries.
→ eJSL Language Guide
In this section, we explain how you can create a new eJSL project by hand and by using our integrated project wizards within the Eclipse, PhpStorm, and ItelliJ IDEs.
Please make sure, that you've installed the JooMDD plugin first to follow the next steps.
→ How to install the JooMDD IDE plugins
- Create a new project of any type (e.g. a general, Java, or PHP project)
- Add a
src-gen
folder and place agenerator.properties
file within this folder. - Open the
generator.properties
file and insert the path to your output folder (please use"\\"
as directory separator in your path):
outputFolder=<Path to your project>\\src-gen
- Create a new file of any name with the ending .eJSL (e.g. model.eJSL) in the
src
folder
Instead of creating an eJSL project manually, you can get started easier by using the eJSL project wizard. So, the project structure containing the src-gen
folder and generator.properties
file will be created automatically. In addition you can use the project wizards to create example models which are helpful to understand the eJSL language.
Create a new project and within the "new Project" dialogue open the folder eJSL Wizard.
Within this folder you should see "EJSL Project". Give your project a name and select a model example template. Through a click on the Finish-Button the required project structure becomes generated containing source folders for your models (src) and for the code generated based on your models (src-gen). The chosen example model is created within the src folder which can be used for a straightforward introduction.
Create a new project and within the "new Project" dialogue click on the eJSL section.
Select a model example template and subsequently give you project a name. Through a click on the create-Button the required project structure becomes generated containing source folders for your models (src) and for the code generated based on your models (src-gen). The chosen example model is created within the src folder which can be used for a straightforward introduction.
Create a new project and within the "new Project" dialogue click on the eJSL section.
Select a model example template and subsequently give you project a name. Through a click on the Finish-Button the required project structure becomes generated containing source folders for your models (src) and for the code generated based on your models (src-gen). The chosen example model is created within the src folder which can be used for a straightforward introduction.
eJSL allows you the definition of different parts of a Joomla extension. Starting with the definition of a data structure (entities
) on to its presentation (pages
) up to the specification of Joomla-specific extensions
.
For an easier start we recommend the use of the example instances, provided by the project wizards.
While using the text-based editor you get support by the code completion typing Ctrl + Space. In addition, the editor supports you during modelling with live validation and syntax highlighting.
To do: Image of Text editor
Please visit the eJSL language guide for an overview of the language and how to use it for extension modelling.
When you save your model, the code generator creates your modelled Joomla extensions within the project's src-gen
folder. The extensions are installable within Joomla 3.x web sites and don't need any additional line of code. However, if you know what you do, you can extend the generated code through individual features.
Caution: All the code within the src-gen
folder becomes completely overwritten, when you change your model and save it. Therefore, we recommend to copy generated extensions to another folder within your project, where you can extend them without loosing them after a new code generation. Another and cleaner option is using a
versioning tool like git to store your individual added code.
The generated code is split into two parts. To do: Further explanation.
In addition, we provide jext2eJSL to create eJSL-based models based on existing Joomla 3.x extension packages. We are currently working on the documentation of jext2eJSL. If you are interested in using the tool, see the current (german) documentation here. Instead of executing the .jar file and using the GUI it is also possible to execute the application via CLI using the following arguments: -m <path to manifest file> -o <output path> -no-gui