Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tutorial:scenario [2020/04/16 10:56] (current)
Line 1: Line 1:
 +<WRAP indic>​Before launching the generation process, the list of <wrap edicode>​plugin entities</​wrap>​ must be set. For this first step, Adichatz uses, by default, ​ 3 different ways to launch ​ the generation process:
 +  - Generate <wrap adicode>​Pojos</​wrap>​ using Hibernate tools.
 +  - Determine a folder containing <wrap adicode>​Pojo</​wrap>​ java files.
 +  - Specify ​ list of plugin entities from previous built Adichatz plugins. (For instance, you can create a first plugin for manage server side using <wrap adicode>​Pojos</​wrap>​ generated by Hibernate Tools. A second plugin for the client side will be generated after having determined the list of plugin entities from the Server side plugin. ​  
  
 +From there, a default <wrap adicode>​Scenario Tree</​wrap>​ is built and stored inside '​**scenario.xml**'​ file.</​WRAP>​\\
 +<wrap adititle>​Adichatz proposes default scenarios for generating your application.</​wrap>​
 +<columns 100% l 100px>
 +{{tutorial:​scenario.png?​500 |Scenario}}
 +<​newcolumn lt>
 +Each scenario contains the way to generate an XML file from input.
 +<WRAP indic>By convention, generated XML files use the '​.axml"'​ extension.</​WRAP>​\\
 +For example, the scenario <wrap adicode>​org.adichatz.scenario.impl.EntityScenario</​wrap>​ class can take a **Film POJO** as input to build a file called '<​wrap adicode>​FilmMMGENERATED.axml</​wrap>'​.\\
 +In the same vein, <wrap adicode>​org.adichatz.scenario.impl.DetailScenario</​wrap>​ class, takes the **FilmMM** java class as input to build the '<​wrap adicode>​FilmDIGENERATED.axml</​wrap>'​ file.
 +\\ \\
 +<WRAP indic>​Later,​ '​**XML**'​ file will be used as input by the set of generators to build **JAVA** classes.</​WRAP>​
 +</​columns>​
 +\\
 +
 +
 +You can  create your own scenario classes or select a specific scenario class by entity and type:
 +<columns 100% l>
 +  * Open the '<​wrap adicode>​./​resources/​xml/​Scenario.xml</​wrap>'​ file with Scenario Editor.
 +  * Select <wrap adicode>​Generation</​wrap>​ page.
 +  * Open branch called '<​wrap adicode>​PluginEntity:​ <​nowiki>​adi://​myproject/​model.actor/​ActorMM</​nowiki></​wrap>'​.
 +  * Select item: <wrap adicode>​GenerationUnit:​ ActorTI - TABLE</​wrap>​.
 +  * In the Outline part, focus on <wrap adicode>​scenarioClassName</​wrap>​ field and select available table scenarios (CTL-Space).\\
 +<​newcolumn lt>
 +{{tutorial:​select_table_scenario.png?​550 |Select scenario for generation}}
 +</​columns>​
 +\\
 +
 +<WRAP indic>​The name of a file generated by scenarios ends by '​**GENERATED.axml**'​. If you want to customize an XML file ([[http://​www.adichatz.org/​document/​FilmDI.xml|see example]]) and you do not want
 + that the result will be affected by a future generation process, you just have to remove the '​**GENERATED**'​ from file name: For example, if you rename file from '<​wrap adicode>​FilmDIGENERATED.axml</​wrap>'​ to '<​wrap adicode>​FilmDI.axml</​wrap>',​ a new '<​wrap adicode>​FilmDIGENERATED.axml</​wrap>'​ will be created when relaunching scenario process but generator will take the '<​wrap adicode>​FilmDI.axml</​wrap>'​ file as input to generate java classes.
 +</​WRAP>​