1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="content-type"
5 content="text/html; charset=ISO-8859-1">
6 <title>Tutorial of developing and changing QuantumDb</title>
11 Subject: Tutorial of developing and changing QuantumDb<br>
13 To modify the quantumdb plug-in, first you get it to a development
14 system, usually Eclipse itself.<br>
15 <h3> 1. Getting the project from CVS.<br>
17 First you go to <span style="font-weight: bold;">Open a Perspective</span>
18 and open the <span style="font-weight: bold;">CVS repository exploring
19 perspective</span>. It can be in the <span style="font-weight: bold;">Others...</span>.
20 You get a perspective. You right-click on the <span
21 style="font-weight: bold;">CVS Repositories</span> view and create a <span
22 style="font-weight: bold;">New -> Repository Location...</span><br>
23 The data to access quantum is:<br>
25 Host: <span style="font-weight: bold;">cvs.sourceforge.net</span><br>
26 Repository Path: <span style="font-weight: bold;">/cvsroot/quantum</span><br>
27 User: <span style="font-weight: bold;">anonymous</span><br>
30 There is no password for <span style="font-style: italic;">anonymous</span>.
31 You can substitute the User and Password for you own, if you are
32 registered in <a href="http://sourceforge.net">sourcefoge.net</a>. If
33 you want developer access, remember to use <span
34 style="font-style: italic;">extssh</span> as the connexion type, so as
35 to be able to update the cvs repository with your changes (that need a
36 ssh connection in <a href="http://sourceforge.net">sourceforge</a>)<br>
38 After that, if you are connected to the Net, you will be able to get
39 the project files. You will see a <span style="font-weight: bold;">HEAD</span>
40 sub-item, a <span style="font-weight: bold;">Branches</span>, and a <span
41 style="font-weight: bold;">Versions</span>. You select the <span
42 style="font-weight: bold;">HEAD</span>, and then right-click onto <span
43 style="font-weight: bold;">quantum-plugin</span>. Then select <span
44 style="font-weight: bold;">Check Out As...</span>. You cannot check it
45 out as a Project, because some files are not present, mainly the <span
46 style="font-style: italic;">.project</span> and <span
47 style="font-style: italic;">.classpath</span>.<br>
49 <h3> 2. Configuring the project.<br>
51 So you "Check Out As..." and select an Plug-In project, call it as you
52 wish, (I will use "com.quantum") and then select an Empty Plug In. If
53 everything goes ok, you should end with a new project and about 1600
54 errors. The errors are caused because you have now a default classpath,
55 and the quantumdb project uses some plug-ins, so these plug-ins
56 directories must be referenced.<br>
58 My classpath for Eclipse 2.0 is as follows:<br>
60 <span style="font-family: monospace;"><nobr> <?xml version="1.0"
61 encoding="UTF-8"?></nobr></span><br style="font-family: monospace;">
62 <span style="font-family: monospace;"><nobr> <classpath></nobr></span><br
63 style="font-family: monospace;">
64 <span style="font-family: monospace;"><nobr>
65 <classpathentry kind="src" path="src"/></nobr></span><br
66 style="font-family: monospace;">
67 <span style="font-family: monospace;"><nobr>
68 <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT"
69 sourcepath="JRE_SRC"/></nobr></span><br
70 style="font-family: monospace;">
71 <span style="font-family: monospace;"><nobr>
72 <classpathentry kind="lib"</nobr></span><br
73 style="font-family: monospace;">
74 <span style="font-family: monospace;"><nobr>
75
76 path="C:/Parsec/eclipse/plugins/org.eclipse.core.boot_2.0.2/boot.jar"
77 sourcepath="C:/Parsec/eclipse/plugins/org.eclipse.platform.source_2.0.2/src/org.eclipse.core.boot_2.0.2/bootsrc.zip"/></nobr></span><br
78 style="font-family: monospace;">
79 <span style="font-family: monospace;"><nobr>
80 <classpathentry kind="lib"</nobr></span><br
81 style="font-family: monospace;">
82 <span style="font-family: monospace;"><nobr>
83
84 path="C:/Parsec/eclipse/plugins/org.eclipse.core.runtime_2.0.2/runtime.jar"
85 sourcepath="C:/Parsec/eclipse/plugins/org.eclipse.platform.source_2.0.2/src/org.eclipse.core.runtime_2.0.2/runtimesrc.zip"/></nobr></span><br
86 style="font-family: monospace;">
87 <span style="font-family: monospace;"><nobr>
88 <classpathentry kind="lib"</nobr></span><br
89 style="font-family: monospace;">
90 <span style="font-family: monospace;"><nobr>
91
92 path="C:/Parsec/eclipse/plugins/org.eclipse.core.resources_2.0.1/resources.jar"
93 sourcepath="C:/Parsec/eclipse/plugins/org.eclipse.platform.source_2.0.2/src/org.eclipse.core.resources_2.0.1/resourcessrc.zip"/></nobr></span><br
94 style="font-family: monospace;">
95 <span style="font-family: monospace;"><nobr>
96 <classpathentry kind="lib"</nobr></span><br
97 style="font-family: monospace;">
98 <span style="font-family: monospace;"><nobr>
99
100 path="C:/Parsec/eclipse/plugins/org.eclipse.swt.win32_2.0.2/ws/win32/swt.jar"
101 sourcepath="C:/Parsec/eclipse/plugins/org.eclipse.platform.win32.source_2.0.2/src/org.eclipse.swt.win32_2.0.2/ws/win32/swtsrc.zip"/></nobr></span><br
102 style="font-family: monospace;">
103 <span style="font-family: monospace;"><nobr>
104 <classpathentry kind="lib"</nobr></span><br
105 style="font-family: monospace;">
106 <span style="font-family: monospace;"><nobr>
107
108 path="C:/Parsec/eclipse/plugins/org.eclipse.ui_2.0.2/workbench.jar"
109 sourcepath="C:/Parsec/eclipse/plugins/org.eclipse.platform.source_2.0.2/src/org.eclipse.ui_2.0.2/workbenchsrc.zip"/></nobr></span><br
110 style="font-family: monospace;">
111 <span style="font-family: monospace;"><nobr>
112 <classpathentry kind="lib"</nobr></span><br
113 style="font-family: monospace;">
114 <span style="font-family: monospace;"><nobr>
115
116 path="C:/Parsec/eclipse/plugins/org.eclipse.ui.win32_2.0.0/workbenchwin32.jar"</nobr></span><br
117 style="font-family: monospace;">
118 <span style="font-family: monospace;"><nobr>
119 rootpath=""
120 sourcepath="C:/Parsec/eclipse/plugins/org.eclipse.platform.win32.source_2.0.2/src/org.eclipse.ui.win32_2.0.0/workbenchwin32src.zip"/></nobr></span><br
121 style="font-family: monospace;">
122 <span style="font-family: monospace;"><nobr>
123 <classpathentry kind="output" path="bin"/></nobr></span><br
124 style="font-family: monospace;">
125 <span style="font-family: monospace;"><nobr> </classpath></nobr></span><br
126 style="font-family: monospace;">
128 Where, as you can see, my Eclipse home is <span
129 style="font-family: monospace;">C:\Parsec\eclipse</span>. In any case,
130 you need to reference those plug-ins you see below, from org.eclipse:<br>
133 <li> core.runtime</li>
134 <li> core.resources</li>
136 <li> swt.win32 (substitute by your platform)</li>
137 <li> ui.win32 (substitute by your platform)</li>
140 Remember after changing manually the <span style="font-style: italic;">.classpath</span>
141 file that you have to <span style="font-weight: bold;">Refresh</span> the project
142 to take the changes in.<br>
144 If you want to reference those plug-ins using the workspace, select <span
145 style="font-weight: bold;">Properties </span>from the newly created <span
146 style="font-weight: bold;">com.quantum</span> project and go to <span
147 style="font-weight: bold;">Java Build Path</span>, then <span
148 style="font-weight: bold;">Libraries </span>tab, and select the <span
149 style="font-weight: bold;">.jar</span> files the project needs.<br>
151 It should now build without errors.<br>
153 In Eclipse 2.1 that won't work. Dependencies amongs plug-ins have changed and
154 instead of redoing all of them again I chose to use the new "classpath container"
155 facility. When I say that won't work I mean if linking against the 2.1 libraries.
156 If you link against the 2.0 libraries will work all right.<br>
158 <p>The libraries for 2.1 are as follows (I copy my classpath) :</p>
159 <p><font face="Courier New, Courier, mono"><classpath><br>
160 <classpathentry kind="src" path="src"/><br>
161 <classpathentry kind="var"<br>
162 path="ECLIPSE_HOME/plugins/org.eclipse.core.boot_2.1.0/boot.jar" sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.boot_2.1.0/bootsrc.zip"/><br>
163 <classpathentry kind="var"<br>
164 path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime_2.1.0/runtime.jar"
165 sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.runtime_2.1.0/runtimesrc.zip"/><br>
166 <classpathentry kind="var"<br>
167 path="ECLIPSE_HOME/plugins/org.eclipse.core.resources_2.1.0/resources.jar"
168 sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.resources_2.1.0/resourcessrc.zip"/><br>
169 <classpathentry kind="var"<br>
170 path="ECLIPSE_HOME/plugins/org.eclipse.swt.win32_2.1.0/ws/win32/swt.jar"
171 sourcepath="ORG_ECLIPSE_PLATFORM_WIN32_SOURCE_SRC/org.eclipse.swt.win32_2.1.0/ws/win32/swtsrc.zip"/><br>
172 <classpathentry kind="var"<br>
173 path="ECLIPSE_HOME/plugins/org.eclipse.ui_2.1.0/ui.jar" sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui_2.1.0/uisrc.zip"/><br>
174 <classpathentry kind="var"<br>
175 path="ECLIPSE_HOME/plugins/org.eclipse.text_2.1.0/text.jar" sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.text_2.1.0/textsrc.zip"/><br>
176 <classpathentry kind="var"<br>
177 path="ECLIPSE_HOME/plugins/org.eclipse.jface_2.1.0/jface.jar" sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface_2.1.0/jfacesrc.zip"/><br>
178 <classpathentry kind="var"<br>
179 path="ECLIPSE_HOME/plugins/org.eclipse.jface.text_2.1.0/jfacetext.jar"
180 sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface.text_2.1.0/jfacetextsrc.zip"/><br>
181 <classpathentry kind="var"<br>
182 path="ECLIPSE_HOME/plugins/org.eclipse.ui.views_2.1.0/views.jar" sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.views_2.1.0/viewssrc.zip"/><br>
183 <classpathentry kind="var"<br>
184 path="ECLIPSE_HOME/plugins/org.eclipse.ui.workbench_2.1.0/workbench.jar"
185 sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench_2.1.0/workbenchsrc.zip"/><br>
186 <classpathentry kind="var"<br>
187 path="ECLIPSE_HOME/plugins/org.eclipse.ui.win32_2.1.0/workbenchwin32.jar"
188 sourcepath="ORG_ECLIPSE_PLATFORM_WIN32_SOURCE_SRC/org.eclipse.ui.win32_2.1.0/workbenchwin32src.zip"/><br>
189 <classpathentry kind="var"<br>
190 path="ECLIPSE_HOME/plugins/org.eclipse.ui.workbench.texteditor_2.1.0/texteditor.jar"
191 sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench.texteditor_2.1.0/texteditorsrc.zip"/><br>
192 <classpathentry kind="var"<br>
193 path="ECLIPSE_HOME/plugins/org.eclipse.ui.editors_2.1.0/editors.jar"
194 sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.editors_2.1.0/editorssrc.zip"/><br>
195 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/><br>
196 <classpathentry kind="output" path="bin"/><br>
197 </classpath><br>
200 <h3>3. Running the project.<br>
202 First go to <span style="font-weight: bold;">Window -> Preferences
203 -> Plug-in Development -> Target Platform</span> and to select all
204 the plug-ins that should be used when running a platform from the
205 plug-in development. I select all of them not in the workspace because I
206 don't want to resolve all the cross-references.<br>
208 Then go to <span style="font-weight: bold;">Run -> Run As ->
209 Run-time Workbench</span>. If all is well, a new workbench should
210 appear, that has you just-compiled quantum plug-in installed. To check
211 it, open the quantumdb perspective (<span style="font-weight: bold;">Perspective
212 Button -> Others... ->QuantumDb Perspective</span>), and see if
213 it appears. This is not<br>
214 the usual QuantumDb perspective, but the one you are developing. Of
215 course, if you have made no change to the standard source, there is no
218 <h3>4. Making a small change.<br>
220 To check that we are really using our modified QuantumDb, and not the
221 standard, let's make a change. Open the <span
222 style="font-style: italic;">QuantumResources.properties</span> file,
223 (in the <span style="font-weight: bold;">com.quantum</span> package),
224 and modify the line<br>
226 <span style="font-family: monospace;"><nobr> bookmarkview.newBookmark =
227 New Bookmark...</nobr></span><br>
231 <span style="font-family: monospace;"><nobr> bookmarkview.newBookmark =
232 Add New Bookmark...</nobr></span><br>
236 Then Run the testing workbench again, you can now use simply <span
237 style="font-weight: bold;">Ctrl+F11</span> to run the last launched
238 environment. Now, in the bookmark view, when you right-click on it, it
239 should show your modified string. So you are now ready to change the
241 <h3> 5. Creating a .jar file.<br>
243 <p>You may simply want to make a <span style="font-style: italic;">.jar</span>
244 file from some configuration taken from the CVS, so as to have the latest version
245 available to you. You have to follow the same instructions as before for installation.
246 When it's installed and built, select the <span style="font-weight: bold;">com.quantum</span>
247 project, right-click on it and select <span style="font-weight: bold;">Export</span>.<br>
249 In Eclipse 2.0: Select <span style="font-weight: bold;">jar File</span> and
250 then choose a directory. The name of the jar file should be <span
251 style="font-weight: bold;">Quantum.jar</span> as that's the name stated in the
252 <span style="font-style: italic;">plugin.xml</span> file.<br>
254 To install this jar file as a plug-in, create a directory called <span
255 style="font-style: italic;">com.quantum</span> in the directory <span
256 style="font-style: italic;">plugins</span> under your local Eclipse installation
257 directory. Copy the jar file to that directory, and uncompress it (without deleting
258 it) into that same directory. In fact, I think you only need the <span style="font-style: italic;">icons</span>
259 directory and the <span style="font-style: italic;">plugin.xlm</span>, but you
260 can leave the rest of the files so they feel not so alone.<br>
262 You close your Eclipse IDE and open it up again, and the QuantumDB perspective
263 should be available.<br>
265 <h3>6. Uploading the change to CVS.</h3>
266 <p>(I copy directly from the Eclipse Help, so as to have all the info in the same
268 <h4>Synchronizing with a CVS repository</h4>
270 In the CVS team programming environment, there are two distinct processes involved
271 in synchronizing resources: updating with the latest changes from a branch and
272 committing to the branch. </p>
273 <p>When you make changes in the Workbench, the resources are saved locally. Eventually
274 you will want to commit your changes to the branch so others can have access
275 to them. Meanwhile, others may have committed changes to the branch. You will
276 want to update your Workbench resources with their changes.</p>
277 <p>Important!: It is preferable to update before committing, in case there are
278 conflicts with the resources in your Workbench and the resources currently in
280 <p>The synchronize view contains filters to control whether you want to view only
281 incoming changes or outgoing changes. Incoming changes come from the branch.
282 If accepted, they will update the Workbench resource to the latest version currently
283 committed into the branch. Outgoing changes come from the Workbench. If committed,
284 they will change the branch resources to match those currently present in the
286 <p>Regardless of which mode (filter) you select, the Synchronize view always shows
287 you conflicts that arise when you have locally modified a resource for which
288 a more recent version is available in the branch. In this situation you can
289 choose to do one of three things: update the resource from the branch, commit
290 your version of the resource to the branch ,or merge your work with the changes
291 in the branch resource. Typically you will want to merge, as the other two options
292 will result in loss of work. </p>
293 <p>(End of copy from Eclipse Help, there are lots more, just go there and have
294 a look) Basically to get all the changes since the last time you took the sources,
295 then accept all the files that have changed in the CVS and you haven't touched.
296 If there are some that you have touched and are also touched by someone else
297 at CVS then you have to inspect the changes, see if they conflict with yours,
298 and merge both until you have a working set. Then you can upload that "working"
299 set to CVS. That's more or less the idea.</p>