forked from seam2/jboss-seam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tools.xml
executable file
·623 lines (492 loc) · 21.9 KB
/
Tools.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
<chapter id="tools">
<title>Seam tools</title>
<section>
<title>jBPM designer and viewer</title>
<para>
The jBPM designer and viewer will let you design and view in a nice way your business processes and your pageflows.
This convenient tool is part of JBoss Eclipse IDE and more details can be found in the jBPM's <ulink url="http://docs.jboss.com/jbpm/v3/gpd/">documentation</ulink>
</para>
<section>
<title>Business process designer</title>
<para>
This tool lets you design your own business process in a graphical way.
</para>
<screenshot>
<screeninfo>Business process designer</screeninfo>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="images/bpmd.png" align="center" scalefit="1"/>
</imageobject>
<imageobject role="html">
<imagedata fileref="images/bpmd.png" align="center"/>
</imageobject>
</mediaobject>
</screenshot>
</section>
<section>
<title>Pageflow viewer</title>
<para>
This tool let you design to some extend your pageflows and let you build graphical views of them so you can
easily share and compare ideas on how it should be designed.
</para>
<screenshot>
<screeninfo>Business process designer</screeninfo>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="images/bpmpfv.png" align="center" scalefit="1"/>
</imageobject>
<imageobject role="html">
<imagedata fileref="images/bpmpfv.png" align="center"/>
</imageobject>
</mediaobject>
</screenshot>
</section>
</section>
<!--
<section>
<title>CRUD-application generator</title>
<para>
This chapter, will give you a short overview of the support for Seam that is available in the Hibernate Tools.
Hibernate Tools is a set of tools for working with Hibernate and related technologies, such as JBoss Seam and EJB3.
The tools are available as a set of eclipse plugins and Ant tasks. You can download the Hibernate Tools from the JBoss Eclipse IDE or Hibernate Tools websites.
</para>
<para>
The specific support for Seam that is currently available is generation of a fully functional Seam based CRUD-application.
The CRUD-application can be generated based on your existing Hibernate mapping files or EJB3 annotated POJO's or even fully
reverse engineered from your existing database schema.
</para>
<para>
The following sections is focused on the features required to understand for usage with Seam. The content is derived from the Hibernate Tools reference documentation. Thus if you
need more detailed information please refer to the Hibernate Tools documentation.
</para>
<section>
<title>Creating a Hibernate configuration file</title>
<para>
To be able to reverse engineer and generate code a hibernate.properties
or hibernate.cfg.xml file is needed. The Hibernate Tools provide a wizard for generating the
hibernate.cfg.xml file if you do not already have such file.
</para>
<para>
Start the wizard by clicking "New Wizard" (Ctrl+N), select the
Hibernate/Hibernate Configuration file (cfg.xml) wizard and press "Next".
After selecting the wanted location for the hibernate.cfg.xml file, you
will see the following page:
</para>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="/images/hibernatecfgwizard.gif" format="gif" contentwidth="5cm" />
</imageobject>
<imageobject role="html">
<imagedata align="center"
fileref="/images/hibernatecfgwizard.gif"
format="gif" />
</imageobject>
</mediaobject>
<para>
Tip: The contents in the combo boxes for the JDBC driver class and
JDBC URL change automatically, depending on the Dialect and actual driver
you have chosen.
</para>
<para>
Enter your configuration information in this dialog. Details about
the configuration options can be found in Hibernate reference
documentation.
</para>
<para>
Press "Finish" to create the configuration file, after optionally
creating a Console onfiguration, the hibernate.cfg.xml will be
automatically opened in an editor. The last option "Create Console
Configuration" is enabled by default and when enabled i will automatically
use the hibernate.cfg.xml for the basis of a "Console
Configuration"
</para>
</section>
<section>
<title>Creating a Hibernate Console configuration</title>
<para>
A Console Configuration describes to the Hibernate plugin which configuration files
should be used to configure hibernate, including which classpath is needed to load the POJO's,
JDBC drivers etc. It is required to make usage of query prototyping, reverse engineering and
code generation. You can have multiple named console configurations. Normally you would just
need one per project, but more (or less) is definitly possible.
</para>
<para>
You create a console configuration by running the Console
Configuration wizard, shown in the following screenshot. The same wizard
will also be used if you are coming from the hibernate.cfg.xml wizard and
had enabled "Create Console Configuration".
</para>
<mediaobject>
<title>Creating a Hibernate Console configuration</title>
<imageobject role="fo">
<imagedata fileref="/images/consolecfgwizard.gif" format="GIF" />
</imageobject>
<imageobject role="html">
<imagedata align="center"
fileref="/images/consolecfgwizard.gif"
format="gif" />
</imageobject>
</mediaobject>
<para>
The following table describes the relevant settings. The wizard can
automatically detect default values for most of these if you started the
Wizard with the relevant java project selected
</para>
<table>
<title>Hibernate Console Configuration Parameters</title>
<tgroup cols="3">
<colspec colnum="1" colwidth="1*" />
<colspec colnum="2" colwidth="3*" />
<colspec colnum="3" colwidth="1*" />
<thead>
<row>
<entry align="center">
<para>Parameter</para>
</entry>
<entry align="center">
<para>Description</para>
</entry>
<entry align="center">
<para>Auto detected value</para>
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<para>Name</para>
</entry>
<entry>
<para>The unique name of the configuration</para>
</entry>
<entry>
<para>Name of the selected project</para>
</entry>
</row>
<row>
<entry>
<para>Property file</para>
</entry>
<entry>
<para>Path to a hibernate.properties file</para>
</entry>
<entry>
<para>First hibernate.properties file found in the selected
project</para>
</entry>
</row>
<row>
<entry>
<para>Configuration file</para>
</entry>
<entry>
<para>Path to a hibernate.cfg.xml file</para>
</entry>
<entry>
<para>First hibernate.cfg.xml file found in the selected
project</para>
</entry>
</row>
<row>
<entry>
<para>Enable Hibernate ejb3/annotations</para>
</entry>
<entry>
<para>Selecting this option enables usage of annotated classes.
hbm.xml files are of course still possible to use too. This
feature requires running the Eclipse IDE with a JDK 5 runtime,
otherwise you will get classloading and/or version
errors.</para>
</entry>
<entry>
<para>Not enabled</para>
</entry>
</row>
<row>
<entry>
<para>Mapping files</para>
</entry>
<entry>
<para>List of additional mapping files that should be loaded.
Note: A hibernate.cfg.xml can also contain mappings. Thus if
these a duplicated here, you will get "Duplicate mapping" errors
when using the console configuration.</para>
</entry>
<entry>
<para>If no hibernate.cfg.xml file is found, all hbm.xml files
found in the selected project</para>
</entry>
</row>
<row>
<entry>
<para>Classpath</para>
</entry>
<entry>
<para>The classpath for loading POJO and JDBC drivers. Do not
add Hibernate core libraries or dependencies, they are already
included. If you get ClassNotFound errors then check this list
for possible missing or redundant directories/jars.</para>
</entry>
<entry>
<para>The default build output directory and any JARs with a
class implementing java.sql.Driver in the selected
project</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para>Clicking "Finish" creates the configuration and shows it in the
"Hibernate Configurations" view</para>
<mediaobject>
<title>Console overview</title>
<imageobject role="fo">
<imagedata align="center"
fileref="/images/consoleoutline-before-reveng.gif"
format="GIF" />
</imageobject>
<imageobject role="html">
<imagedata align="center"
fileref="/images/consoleoutline-before-reveng.gif"
format="gif" />
</imageobject>
</mediaobject>
</section>
<section>
<title>Reverse engineering and code generation</title>
<para>
A very simple "click-and-generate" reverse engineering and code
generation facility is available. It is this facility that allows you to
generate the skeleton for a full Seam CRUD application.
</para>
<para>
To start working with this process, start the "Hibernate Code
Generation" which is available in the toolbar via the Hibernate icon or
via the "Run/Hibernate Code Generation" menu item.
</para>
<section>
<title>Code Generation Launcher</title>
<para>When you click on "Hibernate Code Generation" the standard Eclipse
launcher dialog will appear. In this dialog you can create, edit and
delete named Hibernate code generation "launchers".</para>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="/images/codegendropdown.gif" format="GIF" />
</imageobject>
<imageobject role="html">
<imagedata align="center"
fileref="/images/codegendropdown.gif"
format="gif" />
</imageobject>
</mediaobject>
<para>The dialog has the standard tabs "Refresh" and "Common" that can
be used to configure which directories should be automatically refreshed
and various general settings launchers, such as saving them in a project
for sharing the launcher within a team.</para>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="/images/codegenmaintab.gif" format="GIF" />
</imageobject>
<imageobject role="html">
<imagedata align="center"
fileref="/images/codegenmaintab.gif"
format="gif" />
</imageobject>
</mediaobject>
<para>The first time you create a code generation launcher you should
give it a meaningfull name, otherwise the default prefix
"New_Generation" will be used.</para>
<para>Note: The "At least one exporter option must be selected" is just
a warning stating that for this launch to work you need to select an
exporter on the Exporter tab. When an exporter has been selected the
warning will disappear.</para>
<para>On the "Main" tab you the following fields:</para>
<table>
<title>Code generation "Main" tab fields</title>
<tgroup cols="2">
<colspec colnum="1" colwidth="1*" />
<colspec colnum="2" colwidth="3*" />
<colspec colnum="3" colwidth="0.5*" />
<thead>
<row>
<entry align="center"><para>Field</para></entry>
<entry align="center"><para>Description</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>Console Configuration</para></entry>
<entry><para>The name of the console configuration which should
be used when code generating.</para></entry>
</row>
<row>
<entry><para>Output directory</para></entry>
<entry><para>Path to a directory into where all output will be
written by default. Be aware that existing files will be
overwritten, so be sure to specify the correct
directory.</para></entry>
</row>
<row>
<entry><para>Reverse engineer from JDBC
Connection</para></entry>
<entry><para>If enabled the tools will reverse engineer the
database available via the connection information in the
selected Hibernate Console Configuration and generate code based
on the database schema. If not enabled the code generation will
just be based on the mappings already specified in the Hibernate
Console configuration.</para></entry>
</row>
<row>
<entry><para>Package</para></entry>
<entry><para>The package name here is used as the default
package name for any entities found when reverse
engineering.</para></entry>
</row>
<row>
<entry><para>reveng.xml</para></entry>
<entry><para>Path to a reveng.xml file. A reveng.xml file allows
you to control certain aspects of the reverse engineering. e.g.
how jdbc types are mapped to hibernate types and especially
important which tables are included/excluded from the process.
Clicking "setup" allows you to select an existing reveng.xml
file or create a new one..</para></entry>
</row>
<row>
<entry><para>reveng. strategy</para></entry>
<entry><para>If reveng.xml does not provide enough customization
you can provide your own implementation of an
ReverseEngineeringStrategy. The class need to be in the claspath
of the Console Configuration, otherwise you will get class not
found exceptions.</para></entry>
</row>
<row>
<entry><para>Generate basic typed composite ids</para></entry>
<entry><para>This field should always be enabled when generating the Seam CRUD application.
A table that has a multi-colum primary key a
<composite-id> mapping will always be created. If this
option is enabled and there are matching foreign-keys each key
column is still considered a 'basic' scalar (string, long, etc.)
instead of a reference to an entity. If you disable this option
a <key-many-to-one> instead. Note: a <many-to-one>
property is still created, but is simply marked as non-updatable
and non-insertable.</para></entry>
</row>
<row>
<entry><para>Use custom templates</para></entry>
<entry><para>If enabled, the Template directory will be searched
first when looking up the velocity templates, allowing you to
redefine how the individual templates process the hibernate
mapping model.</para></entry>
</row>
<row>
<entry><para>Template directory</para></entry>
<entry><para>A path to a directory with custom velocity
templates.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Exporters</title>
<para>The exporters tab is used to specify which type of code that
should be generated. Each selection represents an "Exporter" that are
responsible for generating the code, hence the name.</para>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="/images/codegenselectseam.gif" format="GIF" />
</imageobject>
<imageobject role="html">
<imagedata align="center"
fileref="/images/codegenselectseam.gif"
format="gif" />
</imageobject>
</mediaobject>
<para>
The following table describes in short the various
exporters. The most relevant for Seam is of course the "JBoss Seam Skeleton app".
</para>
<table>
<title>Code generation "Exporter" tab fields</title>
<tgroup cols="2">
<colspec colnum="1" colwidth="1*" />
<colspec colnum="2" colwidth="3*" />
<colspec colnum="3" colwidth="0.5*" />
<thead>
<row>
<entry align="center"><para>Field</para></entry>
<entry align="center"><para>Description</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>Generate domain code</para></entry>
<entry><para>Generates POJO's for all the persistent classes and
components found in the given Hibernate
configuration.</para></entry>
</row>
<row>
<entry><para>JDK 1.5 constructs</para></entry>
<entry><para>When enabled the POJO's will use JDK 1.5
constructs.</para></entry>
</row>
<row>
<entry><para>EJB3/JSR-220 annotations</para></entry>
<entry><para>When enabled the POJO's will be annotated according
to the EJB3/JSR-220 persistency specification.</para></entry>
</row>
<row>
<entry><para>Generate DAO code</para></entry>
<entry><para>Generates a set of DAO's for each entity
found.</para></entry>
</row>
<row>
<entry><para>Generate Mappings</para></entry>
<entry><para>Generate mapping (hbm.xml) files for each
entity</para></entry>
</row>
<row>
<entry><para>Generate hibernate configuration
file</para></entry>
<entry><para>Generate a hibernate.cfg.xml file. Used to keep the
hibernate.cfg.xml uptodate with any new found mapping
files.</para></entry>
</row>
<row>
<entry><para>Generate schema html-documentation</para></entry>
<entry><para>Generates set of html pages that documents the
database schema and some of the mappings.</para></entry>
</row>
<row>
<entry><para>Generate JBoss Seam skeleton app
(beta)</para></entry>
<entry><para>Generates a complete JBoss Seam skeleton app. The
generation will include annotated POJO's, Seam controller beans
and a JSP for the presentation layer. See the generated
readme.txt for how to use it. </para><para>Note: this exporter
generates a full application, including a build.xml thus you
will get the best results if you use an output directory which
is the root of your project.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Generating and using the code</title>
<para>
When you have finished filling out the settings, simply press "Run" to start the generation of code.
This might take a little while if you are reverse engineering from a database.
</para>
<para>
When the generation have finished you should now have a complete skeleton Seam application in the output directory.
In the output directory there is a <literal>readme.txt</literal> file describing the steps needed to deploy and run the example.
</para>
<para>
If you want to regenerate/update the skeleton code then simply run the code generation again by selecting the "Hibernate Code Generation" in the toolbar or "Run" menu. Enjoy.
</para>
</section>
</section>
</section>
-->
</chapter>