I discussed with Pascal an idea I have since a long time in my mind about apps within Magnolia.
He asked me to write it down that he and Boris could have a look at it together. So here it is
Project Creator App
The idea is is basically, that the main structure of a project is created by a wizard like app.
What it would create:
- The site definitions needed
- The module itself within magnolia
- All templates and dialogs as proper extends form STK
- The physical module structure containing the poms and module descriptors
- Bootstrapping all the created definitions into the modules
So the final result would be a proper module structure in the file system, containing all the work created by the app, ready to check in and build.
1. Lower Entry Barriers
We are trying with Magnolia Academy to lower the entry barrier for new projects. For people trying out Magnolia the first time.
Also we put a lot of effort into documentation, to make this easier.
But from my experience in training, written information, presentations and movies only help to a certain degree.
The first usage of it is still usually quite hard, because doing something and understanding it are two different things.
2. Project Best Practice
Also we had in the past quite a lot of discussions about the best practice on how to start a project.
Which was not easy to define and is still not in documentation at one single place as a guide line, because to many things coming there together:
- What IDE you use
- Do you have Maven knowledge
- Do you have STK knowledge
- ...and so on
3. Usage of STK
Some client still hesitate to use STK out of various reasons. Quite often out of "not understanding that STK is not the html, its powerful mechanism useful to any project" reasons.
Providing a project creator app doing a lot of work out of the box, but based on the STK will increase the usage of STK.
Providing a quick creation of projects out of the box, but based on STK, will be a strong counter force of not using STK at all.
I'm strongly convinced, that such a Project Creator App could close all these gaps, being exactly the connector of all this information coming together at one place.
Being asked the right and relevant questions already help understanding what a project builds upon and what steps are done after the others.
Main steps what the app would do
These are just rough steps of the wizard/creator. I'm sure some more thoughts have to be invested into this. More nice possibilities are likely to be found if invested more.
- Project and Module definitions
- Input about project names (for Maven)
- Input about artifact names (for Maven)
- Input about module names (for Magnolia)
- Creation of the module(s) in config/modules in Magnolia
(will not work without jar, clear, but for having correct bootstrap paths of registered items)
- Site definition creation
- Creation of the site definition(s) needed
- Input about the site it should apply to
- Creates the top root node and maps to it.
- Input about the areas needed site wide
- Creates the according area configurations
- Input about the STK pages needed
- Creates them directly in the site definitions templates availability
- Creates the basic extends of all these templates in the project modules
- Input about the languages server content wise
- Creates the correct i18n configuration
- Input about the theme that should be used.
- Creates a basic theme configuration and a theme module. Containing a copy of the pop.
- Add the mapping to the created theme.
- Input about the usage of mobile
- Creates a mobile theme, its sub variation in the site definition
- Asks relevant questions about mobile related things such as which areas not to use for mobile.
- Creates the correct sub variation configurations.
- Templates & Dialogs creation
- The base extend is done of each available template by step 2. Now the more granular configurations can be created.
- Letting parts of the original templates choose in a graphical UI.
- As we can know by Java reflection exactly what is configurable, the users can be asked in a graphical way what they want to use¬ use.
- Each possible configuration and property can be used with check boxes.
- The wizard steps create then the according configurations in the template definitions as extend and extends overrides.
- Page templates extends & configuration.
- Input about the page templates what should be used specifically.
- For each template the merged behavior of the site definitions prototype and the current template is shown. Also of course the stkTemplate in between.
- The additional overwriting properties are added.
- The needed override extends are created.
- The area configurations of available components are added for each area.
- Component extends creation & configuration.
- Input about the component templates what should be used specifically.
- After all the page templates are known and their available components, all the used components are known.
- All extends of the components get added and their registration in the page templates areas.
- Same algorithm on the component definitions as for the page definitions, ui like choosing.
- Creation of the dialog extends & configuration
- As all page & component that are used are known, all their dialogs can be also extended and being registered.
- Of every used dialog by pages and components a dialog extends is created, and the new dialog is registered on the definitions.
- Also UI like the possible controls and their properties can be chosen.
- Creation of the physical project
- Creation of the physical modules
- The project structure is created with the Maven archetypes within the file system of the webapp.
- All needed information was gathered in step 1 of the app.
- The project folder, parent pom and all sub-module are being created, containing valid pom files and module descriptors.
- Extraction of all configurations as bootstraps
- All created definitions form step 2&3 are exported into the according modules.
- Creation of the physical modules
- A complete project is created and ready to use!
- The created project can now be checked in into version conteol.
- A first maven built can be ran on it.
- It can already be imported into the IDE an the real development can start.
- Each step & sub step could always show, what configuration it created or changed -> direct learning effect
- Each step could supply information according to what has been done right now -> links to the academy movies, links to documentation etc.
That would provide a perfect "coming" together of all this separate information.
Resources estimation for development
Of course a estimation is hard to do.
It depends a lot on to which extend such a app should catch all corner cases.
How fancy such a UI should be, and how backward compatible it should be. Meaning if you can reran such a wizard also on existing projects.
And of course on how many bugs of M5 will appear and contradict the actual development of the app itself such as missing or wrong working functionalists etc.
I would assume:
- 2 core developers 1 Month of work
- My coordination of the ideas and technical STK aspects 1-2 Weeks.
I hope you like the idea!