Wiki source code of EOModelDoc

Version 34.1 by Chuck Hill on 2008/07/31 20:54

Show last authors
1 == Overview ==
2
3 EOModelDoc is a command line tool to generate HTML documentation of a set of EOModels. It is a replacement for [[EOReporter>>http://www.rubicode.com/Software/EOReporter/]] (which will not work on Leopard and newer releases of OS X). EOModelDoc was funded by the Apple iTunes Store and released to the community.
4
5 On the WOLips side, from version 3.3.x, [[Entity Modeler>>Using Entity Modeler]] has a Documentation tab on all of the elements of a model that lets you record HTML documentation for your model, entities, attributes, etc. There is even an HTML preview. You can then run eomodeldoc to produce documentation much like javadoc for your model.
6
7 == Future Plans ==
8
9 From Mike Schrag: //There's not a nice build process for this one either, yet, because it includes all of the eclipse dependencies in the single jar. Eventually I'll make this nicer and include it actually inside of Eclipse. There are also modifications to the ERNeutralLook coming soon that will display popup help for you models based on the model documentation.//
10
11 == Download and Example Output ==
12
13 [[Download EOModelDoc jar>>http://webobjects.mdimension.com/wolips/eomodeldoc.jar]]
14
15 This is an example of the current state of eomodeldoc (the default templates are not done, but it will give you an idea of what it can do). The templates are all Velocity-based, and you can override them with custom versions. This was run in the BugTracker project folder. This model does not have documentation added to it with the new Entity Modeler yet, so it looks a little more bare than it would if it was documented properly. I'll probably document it just to have a full example to show.
16 [[View Example Output>>http://webobjects.mdimension.com/wolips/eomodeldoc_example/]]
17
18 == Usage ==
19
20 The command line syntax of for EOModelDoc:
21
22 ##java --jar eomodeldoc.jar --output /path/to/output/folder -model /path/to/model.eomodeld]** -modelgroup /path/to/working/dir] -templates /path/to/templates] -entityURLTemplate "http:~/~/domain/path/to/JavaDocs/$entity.classNamePath.html**##
23
24 |=Parameter|=Usage / Function
25 |output|Path to the directory where the output HTML files will be written.
26 |model|Path to one model to generate documentation for. This parameter can be used multiple times, once for each model.
27 |modelgroup|The path to an Eclipse or IDEA project. All models listed in the project will be documented. This defaults to the current working directory.
28 |templates|Path to the directory where the Velocity templates are stored. See the [[||anchor="Template Files"]] section below for details on these templates. If this is not specified, the default templates inside the eomodeldoc.jar file will be used.
29 |entityURLTemplate|URL to the JavaDocs for the classes in the model. This is used to create links from the EOModel documentation to the JavaDoc documentation. The dots in the classpath are replaced with "/" when the path is generated.
30
31 === Notes ===
32
33 * Only ##-output## is required
34 * Usually only one of ##-modelGroup## or ##-model## is used (i.e. not both at the same time)
35 * The ##-templates## path only needs to point the the templates that you have changed. If any templates are not found on that path, the defaults from the jar are used.
36 * For ##-entityURLTemplate## the ##http:~/~/domain/path/to/JavaDocs/## the path to the index.html file that JavaDoc generates. It will be something like ##http:~/~/developer.apple.com/documentation/MacOSXServer/Reference/WO54_Reference/##
37
38 === Usage Examples ===
39
40 Document one model:
41
42 {{code}}
43
44 java -jar /path/to/eomodeldoc.jar -model /path/to/model.eomodeld -output /tmp/eomodeldoc
45
46 {{/code}}
47
48
49 Document all models based on the Eclipse or IDEA project definition:
50
51 {{code}}
52
53 java -jar /path/to/eomodeldoc.jar -modelgroup /path/to/project -output /tmp/eomodeldoc
54
55 {{/code}}
56
57 Document all models based on the Eclipse/IDEA project definition (when current working directory is the top level of the project):
58
59 {{code}}
60
61 java -jar /path/to/eomodeldoc.jar -output /tmp/eomodeldoc
62
63 {{/code}}
64
65 == Running from Ant ==
66
67 There is no Ant task (yet) for EOModelDoc. You can run it with an ##java## task following this pattern:
68
69 {{code value="xml"}}
70
71 <java jar="/path/to/eomodeldoc.jar"
72 fork="true"
73 maxmemory="256m">
74 <arg value="-output" />
75 <arg value="/path/to/output/folder" />
76 <arg value="-modelgroup" />
77 <arg value="/path/to/working/dir" />
78 <arg value="-templates" />
79 <arg value="/path/to/templates" />
80 <arg value="-entityURLTemplate" />
81 <arg value="http://whatever?$${entity.classNamePath}.html" />
82 </java>
83
84 {{/code}}
85
86 {{code value="xml"}}
87
88 <java jar="/path/to/eomodeldoc.jar"
89 fork="true"
90 maxmemory="256m">
91 <arg value="-output" />
92 <arg value="/path/to/output/folder" />
93 <arg value="-model" />
94 <arg value="/path/to/modelA.eomodeld" />
95 <arg value="-model" />
96 <arg value="/path/to/modelB.eomodeld" />
97 <arg value="-model" />
98 <arg value="/path/to/modelC.eomodeld" />
99 <arg value="-templates" />
100 <arg value="/path/to/templates" />
101 <arg value="-entityURLTemplate" />
102 <arg value="http://whatever?$${entity.classNamePath}.html" />
103 </java>
104
105 {{/code}}
106
107 If you include this in the build.xml file in the project, it can be as simple as:
108
109 {{code value="xml"}}
110
111 <java jar="/path/to/eomodeldoc.jar"
112 fork="true"
113 maxmemory="256m">
114 <arg value="-output" />
115 <arg value="Documentation" />
116 <arg value="-modelgroup" />
117 <arg value="." />
118 </java>
119
120 {{/code}}
121
122 == Template Files ==
123
124 Default templates are included in the eomodeldoc.jar file. You can extract these templates to use as a basis for your own templates with this command:
125
126 {{code}}
127
128 unzip /path/to/eomodeldoc.jar *.vm -x "*/*"
129
130 {{/code}}
131
132 See the [[EOGenerator template documentation>>EOGenerator Templates and Additions]] documentation for information on customizing these templates. The ##-templates## path only needs to point the the templates that you have changed. If any templates are not found on that path, the defaults from the jar are used.
133
134 The templates and their function are:
135
136 |=Template Name|=Usage / Function
137 |indexModels.html.vm|Left pane index of all models.
138 |indexOverview.html.vm|Left pane index of the contents of all models (e.g. list of entities and stored procedures).
139 |modelOverview.html.vm|Left pane index of the contents of one model (e.g. list of entities and stored procedures).
140 |indexContent.html.vm|Main frame description of each model and contents of each model (e.g. list of entities and stored procedures).
141 |modelContent.html.vm|Main frame contents of one model (list of entities and stored procedures).|
142 |entityContent.html.vm|Main frame contents for one Entity
143 |storedProcedureContent.html.vm|Main frame contents for one stored procedure.
144 |index.html.vm|Top level index.html file defining frameset. You probably won't need to modify this.
145 |prototype.js.vm|[[Prototype>>http://www.prototypejs.org/learn]] JavaScript file so that the generated documentation can use Ajax whizziness. You probably won't need to modify this.
146 |eomodeldoc.css.vm|CSS file that controls what the generate output looks like.
147 |eomodeldoc.js.vm|JavaScript file that cleans up the display. You probably won't need to modify this.
148
149 Some pictures will illustrate this:
150
151 ----
152
153 [[image:EOModelDocTemplates1.png||width="800"]]
154
155 ----
156
157 [[image:EOModelDocTemplates2.png||width="800"]]
158
159 ----
160
161 [[image:EOModelDocTemplates3.png||width="800"]]
162
163
164 ----