Changes for page Generating Custom EO Java Classes
Last modified by David Avendasora on 2011/05/25 12:58
From version 58.1
edited by chuckhill
on 2006/11/01 19:55
on 2006/11/01 19:55
Change comment:
There is no comment for this version
To version 59.1
edited by David Avendasora
on 2011/05/25 12:58
on 2011/05/25 12:58
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -Generating EO Java Classes 1 +Generating Custom EO Java Classes - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. chuckhill1 +XWiki.avendasora - Content
-
... ... @@ -1,41 +1,40 @@ 1 -WOLips encapsulates thefunctionality of [[EOGenerator>>http://www.rubicode.com/Software/EOGenerator/]] sothatthe Java classescan begenerated fromwithinEclipse.WOLips cancreatean**.eogen**definitionforyou whenthemodeliscreated oryoucan create one afterthedel has beencreated by goingto **File** - **New** - **Other...** andselecting **EOGenerator**.1 +WOLips has the ability to generate .java files for the Entities in your project's EOModel files. In Project Builder and Xcode, and really old versions of WOLips, you had to do this yourself by using [[Rubicode's EOGenerator>>http://www.rubicode.com/Software/EOGenerator/]]. WOLips now has it's own built-in EOGenerator. It has a different templating engine ([[Velocity>>http://velocity.apache.org/]] instead of [[MiscMerge>>https://github.com/rentzsch/mogenerator/tree/master/MiscMerge]]) 2 2 3 -=== Installand ConfigureEOGenerator ===3 +=== Create and Configure an .eogen file for your EOModel === 4 4 5 -Before you can generate Java classes you will need to download and install EOGenerator. **EOGenerator is not part of Eclipse or WOLips.** After it is installed, tell Eclipse where it is in preferences: 5 +1. Right-click on your EOModel in WOLips and select WOLips Tools=>Create EOGenerator File. 6 +[[image:eogenIcon.jpg||border="1"]] 7 +1. Double click on the <ModelName>.eogen icon in the Package Explorer or Navigator: 8 +[[image:EOGenerator1.jpg||border="1"]] 9 +1. In the "Models" section, add the EOModel(s) that have Entities that you want to generate Java classes for. 10 +1. In the "Referenced Models" section, include any other EOModels that contain Prototypes or Entities that are used or referenced by the EOModels in the "Models" section. {{note}}Java classes will not be generated for Entities in the EOModels in the "Referenced Models" section.{{/note}} 6 6 7 - [[image:EOGeneratorPreferences.jpg]]12 +The File Names settings can be ignored unless you need to generate oddly formed file names. You will usually want to **Create Packages** (place the generated files in a directory corresponding to their package). It can useful to have different **Destination** and **Subclass Destination** directories. The totally generated classes in the Destination directory are not very interesting and can be tucked away out of sight. 8 8 9 - === Setup Configuration fora Model ===14 +[[image:EOGenerator2.jpg]] 10 10 11 -The nextpistofillin.eogenconfigurationforyourmodel.16 +The **Templates** determine how the Java code is generated. The setting should be self explanatory. The **Defines** are useful for extending the templates with custom values. 12 12 13 - {{info title="Multiple Models"}}18 +[[image:EOGenerator3.jpg]] 14 14 15 - Ifyou havemultiple models that youneed to generateJava classes for, andtheyneed different settings (templates, destination directoriesetc), each of these will need its own .eogen configuration.20 +=== Generate the Classes === 16 16 17 - {{/info}}22 +==== The Simplest Way is Set it on Automatic ==== 18 18 19 -Double click on the <ModelName>.eogen icon in the Package Explorer or Navigator: 20 -[[image:eogenIcon.jpg]] 21 -The top section of the editor looks like this: 24 +Use the WOLips build preferences to ensure your classes are regenerated every time you save changes to the EOModel 22 22 23 - [[image:EOGenerator1.jpg]]26 +{{panel}} 24 24 25 - Set the model(s) to generate Java forin the first area. In the second include models containing prototypes and models that are referenced by the models in the first group, but which should not have Java generatedfor the entities in them.28 +!Picture 16.jpg! 26 26 27 - The File Names settings can be ignore unless you need to generate oddly formed file names. You will usually want to **Create Packages** (place the generated files in a directory corresponding to their package). It can useful to have different **Destination** and **Subclass Destination** directories. The totally generated classes in the Destination directory are not very interesting and can be tucked away out of sight.30 +{{/panel}} 28 28 29 - [[image:EOGenerator2.jpg]]32 +==== Manual Generation during Development ==== 30 30 31 -The **Templates**determinehowtheJavacodeisgenerated.Thesettingshouldbe selfexplanatory.The **Defines**areusefulforextendingthe templateswithcustom values.34 +To generate the Java classes manually, simply right (control) click on the .eogen configuration and select **EOGenerate...** from the context menu. A dialog window will be shown when EOGenerator finishes so that you can verify what it did. 32 32 33 - [[image:EOGenerator3.jpg]]36 +==== Troubleshooting ==== 34 34 35 -=== Generate the Classes === 36 - 37 -To generate the Java classes, simply right (control) click on the .eogen configuration and select **EOGenerate...** from the context menu. A dialog window will be shown when EOGenerator finishes so that you can verify what it did. 38 - 39 39 {{note title="EOGenerator Not Running?"}} 40 40 41 41 Nothing happens? Just see a flicker of a progress bar at the bottom right? Go back to the Preferences. The path to the eogenerator executable is missing or incorrect.