Wiki source code of Getting started

Version 9.1 by Lachlan Deck on 2009/09/01 19:52

Show last authors
1 == Introduction ==
2
3 This guide is aimed at those who'd like to set up a local wolips development environment. This guide is mainly targeted towards maven users of WOLips, however much of guide is useful, whether you use maven or ant, so far as installation instructions for eclipse plugins. At least, these are the steps that I (ldeck) travel through and it is essentially a brain-dump to save me from future maintenance work :-).
4
5 == Outline ==
6
7 {{toc style="disc" indent="20px"}}{{/toc}}
8
9 == Install Maven ==
10
11 You can download and install maven for most platforms [[here>>http://maven.apache.org/download]].
12
13 {{tip title="Mac Tip"}}
14
15 install macports [http://www.macports.org/install.php], then on the terminal
16 {noformat}sudo port install maven2{noformat}
17
18 In future, to keep this up to date:
19 {noformat}sudo port upgrade maven2{noformat}
20
21 {{/tip}}
22
23 == Download Eclipse ==
24
25 Eclipse can be downloaded and installed from [[www.eclipse.org/downloads/>>http://www.eclipse.org/downloads/]]. For mac it's just a simple matter of unpacking the zip file downloaded into /Applications or /Users/youraccount/Applications.
26
27 {{tip title="Which one do I choose?"}}
28
29 Eclipse Classic (161MB) is a popular choice among WO developers.
30 However, the more lightweight Eclipse IDE for Java Developers (91MB) should work.
31
32 {{/tip}}
33
34 == Launch Eclipse ==
35
36 Open eclipse by double clicking on the application icon (from where you installed it).
37 [[image:LaunchEclipse.png]]
38
39 Eclipse will then ask you for the location of a 'workspace' which is where eclipse will store its metadata.
40 [[image:LaunchEclipseWorkspace.png]]
41
42 == Install Eclipse plugins ==
43
44 Various plugins have prerequisites, and some are just useful anyway, so here's a suggested order of installing some useful plugins when setting up a brand new eclipse environment.
45
46 ==== Step 1 - Choose the menu item: Help > install new software... ====
47
48 [[image:install_menu.png]]
49
50 This will open the install window:
51 [[image:install_window.png]]
52
53 ==== Step 2 - install the testNG plugin (for a simple example) ====
54
55 ===== a) Click the "Add..." button to define the update site, fill in the details, click OK. =====
56
57 [[image:addsite_testng.png]]
58
59 ===== b) Tick the plugin fragments to install =====
60
61 [[image:fragments_testng.png]]
62
63 ===== c) Click next repeatedly, confirming license agreements, finally clicking "Finish" to install. =====
64
65 ===== d) after the software plugin has installed, it will prompt you for a restart of eclipse. Click Yes. =====
66
67 [[image:install_restart.png]]
68
69 ===== e) after eclipse has restarted, continue... =====
70
71 ==== Step 3 - install Groovy ====
72
73 Repeat step 2 with the following detail changes:
74 Site name: Groovy-dev
75 Site location: http:~/~/dist.codehaus.org/groovy/distributions/updateDev/
76
77 ==== Step 4 - Install subversive connectors ====
78
79 Repeat step 2 with the following detail changes:
80 Site name: Subversive-connectors
81 Site location: http:~/~/community.polarion.com/projects/subversive/download/eclipse/2.0/galileo-site/
82 Fragments selected: 'Subversive SVN Connectors', 'SVNKit 1.3 Implementation (Optional)'
83
84 [[image:fragments_subversive.png]]
85
86 ===== Step 5 - Install egit =====
87
88 Repeat step 2 with the following detail changes:
89 Site name: egit
90 Site location: http:~/~/www.jgit.org/updates
91
92 ===== Step 6 - Install m2eclipse =====
93
94 Repeat step 2 with the following detail changes:
95 Site name: m2eclipse
96 Site location: http:~/~/m2eclipse.sonatype.org/update-dev/
97 Fragments selected: all fragments of 'Maven Integration'
98 [[image:fragments_m2eclipse.png]]
99
100 ===== Step 6 - Install WOLips =====
101
102 Choose an update site that's appropriate for the version of Eclipse you're running. The update site for Eclipse 3.5 is as follows. (Ask on the mailing list for future versions if it's not been updated here).
103
104 Repeat step 2 with the following detail changes:
105 Site name: WOLips//3//5
106 Site location: http:~/~/webobjects.mdimension.com/wolips/eclipse_3_5/
107 Fragments selected: all fragments of 'Maven Integration'
108 [[image:fragments_wolips.png]]
109
110 ===== Step 7 - Other plugins =====
111
112 Oh, sure I also install jadclipse (http:~/~/jadclipse.sf.net/update) for keeping in touch with things but that's beyond the scope of this guide.
113
114 == Configuring Eclipse ==
115
116 ==== wolips binding validation ====
117
118 [[image:wolips_bindingsvalidation.png]]
119
120 ==== wolips spaces around html tags (off) ====
121
122 [[image:wolips_nospaces.png]]
123
124 ==== wolips launching ====
125
126 As of this writing, wolips has forgotten to set the key "-WOHost" with value "localhost". Add it.
127 I also untick a few things that don't need to be specifically ticked so that your project's properties are used (as you're mimicking the deployment env locally)
128 [[image:wolips_launching.png]]
129
130 ==== Set the default jvm ====
131
132 [[image:prefs_jvm.png]]
133
134 ==== Java typing prefs ====
135
136 [[image:prefs_java_typing.png]]
137
138 ==== Java Templates prefs ====
139
140 [[image:prefs_java_templates.png]]
141
142 ==== Run / Debug prefs ====
143
144 I'll have 4 spaces per tab rather than 8 thanks!
145 And I prefer to kill the console buffer manually rather than lose messages that might be important.
146 [[image:prefs_console.png]]
147
148 ==== Launch configurations ====
149
150 I don't like them disappearing on me when I close / delete projects
151 [[image:prefs_launchconfig.png]]
152
153 ==== Lines numbers please ====
154
155 [[image:prefs_linenumbers.png]]
156
157 ==== UTF-8 Thanks ====
158
159 [[image:prefs_utf8.png]]
160
161 == Creating a project ==
162
163 TODO
164
165 == Launching your project ==
166
167 ==== Configure eomodel connection dictionaries, log4j, additional properties ====
168
169 In my application projects I create an additional folder called 'Properties' which contains additional property files for differing launches.
170 e.g.,
171 When connecting to a local database I use the local files listed below during launch:
172
173 {{noformat}}
174
175 jdbc.local.properties
176 log4j.local.properties
177 runtime.local.properties
178 ...
179 jdbc.test.properties
180 log4j.test.properties
181 runtime.test.properties
182
183 {{/noformat}}
184
185 To achieve this switching easily I define in the launch configuration for the application the following two additional properties (from those defined globally in WOLips prefs)
186
187 * key: --runtime.config.dir value:"../../Properties"--
188 * key: --runtime.config.name value:".local"--
189
190 And in my application's Properties file I have the following properties declared
191
192 {{noformat}}
193
194 runtime.config.dir=Properties
195 runtime.config.name=
196
197 er.extensions.ERXProperties.OptionalConfigurationFiles=(\
198 @@runtime.config.dir@@/log4j@@runtime.config.name@@.properties,\
199 @@runtime.config.dir@@/jdbc@@runtime.config.name@@.properties,\
200 @@runtime.config.dir@@/runtime@@runtime.config.name@@.properties\
201 )
202
203 {{/noformat}}
204
205 Naturally, within the jdbc property files are the relevant project wonder properties for configuring the eomodels connection dictionaries, withing the lo4j files are the relevant config for log4j, and runtime properties is available for any special configuration for that particular environment.