initial quantum version
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / doc / developers.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4   <meta http-equiv="content-type"
5  content="text/html; charset=ISO-8859-1">
6   <title>Tutorial of developing and changing QuantumDb</title>
7 </head>
8 <body>
9 Author: jparrai<br>
10 Date: 28-03-2003<br>
11 Subject: Tutorial of developing and changing QuantumDb<br>
12 <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>
16 </h3>
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 -&gt; Repository Location...</span><br>
23 The data to access quantum is:<br>
24 <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>
28 Password:<br>
29 <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>
37 <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>
48 <br>
49 <h3> 2. Configuring the project.<br>
50 </h3>
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>
57 <br>
58 My classpath for Eclipse 2.0 is as follows:<br>
59 <br>
60 <span style="font-family: monospace;"><nobr> &lt;?xml version="1.0"
61 encoding="UTF-8"?&gt;</nobr></span><br style="font-family: monospace;">
62 <span style="font-family: monospace;"><nobr> &lt;classpath&gt;</nobr></span><br
63  style="font-family: monospace;">
64 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
65 &lt;classpathentry kind="src" path="src"/&gt;</nobr></span><br
66  style="font-family: monospace;">
67 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
68 &lt;classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT"
69 sourcepath="JRE_SRC"/&gt;</nobr></span><br
70  style="font-family: monospace;">
71 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
72 &lt;classpathentry kind="lib"</nobr></span><br
73  style="font-family: monospace;">
74 <span style="font-family: monospace;"><nobr>
75 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"/&gt;</nobr></span><br
78  style="font-family: monospace;">
79 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
80 &lt;classpathentry kind="lib"</nobr></span><br
81  style="font-family: monospace;">
82 <span style="font-family: monospace;"><nobr>
83 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"/&gt;</nobr></span><br
86  style="font-family: monospace;">
87 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
88 &lt;classpathentry kind="lib"</nobr></span><br
89  style="font-family: monospace;">
90 <span style="font-family: monospace;"><nobr>
91 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"/&gt;</nobr></span><br
94  style="font-family: monospace;">
95 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
96 &lt;classpathentry kind="lib"</nobr></span><br
97  style="font-family: monospace;">
98 <span style="font-family: monospace;"><nobr>
99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"/&gt;</nobr></span><br
102  style="font-family: monospace;">
103 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
104 &lt;classpathentry kind="lib"</nobr></span><br
105  style="font-family: monospace;">
106 <span style="font-family: monospace;"><nobr>
107 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"/&gt;</nobr></span><br
110  style="font-family: monospace;">
111 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
112 &lt;classpathentry kind="lib"</nobr></span><br
113  style="font-family: monospace;">
114 <span style="font-family: monospace;"><nobr>
115 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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"/&gt;</nobr></span><br
121  style="font-family: monospace;">
122 <span style="font-family: monospace;"><nobr> &nbsp;&nbsp;&nbsp;
123 &lt;classpathentry kind="output" path="bin"/&gt;</nobr></span><br
124  style="font-family: monospace;">
125 <span style="font-family: monospace;"><nobr> &lt;/classpath&gt;</nobr></span><br
126  style="font-family: monospace;">
127 <br>
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>
131 <ul>
132   <li> core.boot</li>
133   <li> core.runtime</li>
134   <li> core.resources</li>
135   <li> ui</li>
136   <li> swt.win32 (substitute by your platform)</li>
137   <li> ui.win32 (substitute by your platform)</li>
138 </ul>
139 <p><br>
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>
143   <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>
150   <br>
151   It should now build without errors.<br>
152   <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>
157 </p>
158 <p>The libraries for 2.1 are as follows (I copy my classpath) :</p>
159 <p><font face="Courier New, Courier, mono">&lt;classpath&gt;<br>
160   &lt;classpathentry kind=&quot;src&quot; path=&quot;src&quot;/&gt;<br>
161   &lt;classpathentry kind=&quot;var&quot;<br>
162   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.core.boot_2.1.0/boot.jar&quot; sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.boot_2.1.0/bootsrc.zip&quot;/&gt;<br>
163   &lt;classpathentry kind=&quot;var&quot;<br>
164   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.core.runtime_2.1.0/runtime.jar&quot; 
165   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.runtime_2.1.0/runtimesrc.zip&quot;/&gt;<br>
166   &lt;classpathentry kind=&quot;var&quot;<br>
167   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.core.resources_2.1.0/resources.jar&quot; 
168   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.resources_2.1.0/resourcessrc.zip&quot;/&gt;<br>
169   &lt;classpathentry kind=&quot;var&quot;<br>
170   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.swt.win32_2.1.0/ws/win32/swt.jar&quot; 
171   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_WIN32_SOURCE_SRC/org.eclipse.swt.win32_2.1.0/ws/win32/swtsrc.zip&quot;/&gt;<br>
172   &lt;classpathentry kind=&quot;var&quot;<br>
173   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.ui_2.1.0/ui.jar&quot; sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui_2.1.0/uisrc.zip&quot;/&gt;<br>
174   &lt;classpathentry kind=&quot;var&quot;<br>
175   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.text_2.1.0/text.jar&quot; sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.text_2.1.0/textsrc.zip&quot;/&gt;<br>
176   &lt;classpathentry kind=&quot;var&quot;<br>
177   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.jface_2.1.0/jface.jar&quot; sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface_2.1.0/jfacesrc.zip&quot;/&gt;<br>
178   &lt;classpathentry kind=&quot;var&quot;<br>
179   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.jface.text_2.1.0/jfacetext.jar&quot; 
180   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface.text_2.1.0/jfacetextsrc.zip&quot;/&gt;<br>
181   &lt;classpathentry kind=&quot;var&quot;<br>
182   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.ui.views_2.1.0/views.jar&quot; sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.views_2.1.0/viewssrc.zip&quot;/&gt;<br>
183   &lt;classpathentry kind=&quot;var&quot;<br>
184   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.ui.workbench_2.1.0/workbench.jar&quot; 
185   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench_2.1.0/workbenchsrc.zip&quot;/&gt;<br>
186   &lt;classpathentry kind=&quot;var&quot;<br>
187   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.ui.win32_2.1.0/workbenchwin32.jar&quot; 
188   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_WIN32_SOURCE_SRC/org.eclipse.ui.win32_2.1.0/workbenchwin32src.zip&quot;/&gt;<br>
189   &lt;classpathentry kind=&quot;var&quot;<br>
190   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.ui.workbench.texteditor_2.1.0/texteditor.jar&quot; 
191   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench.texteditor_2.1.0/texteditorsrc.zip&quot;/&gt;<br>
192   &lt;classpathentry kind=&quot;var&quot;<br>
193   path=&quot;ECLIPSE_HOME/plugins/org.eclipse.ui.editors_2.1.0/editors.jar&quot; 
194   sourcepath=&quot;ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.editors_2.1.0/editorssrc.zip&quot;/&gt;<br>
195   &lt;classpathentry kind=&quot;con&quot; path=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot;/&gt;<br>
196   &lt;classpathentry kind=&quot;output&quot; path=&quot;bin&quot;/&gt;<br>
197   &lt;/classpath&gt;<br>
198   <br>
199   </font></p>
200 <h3>3. Running the project.<br>
201 </h3>
202 First go to <span style="font-weight: bold;">Window -&gt; Preferences
203 -&gt; Plug-in Development -&gt; 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>
207 <br>
208 Then go to <span style="font-weight: bold;">Run -&gt; Run As -&gt;
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 -&gt; Others... -&gt;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
216 difference. <br>
217 <br>
218 <h3>4. Making a small change.<br>
219 </h3>
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>
225 <br>
226 <span style="font-family: monospace;"><nobr> bookmarkview.newBookmark =
227 New Bookmark...</nobr></span><br>
228 <br>
229 to <br>
230 <br>
231 <span style="font-family: monospace;"><nobr> bookmarkview.newBookmark =
232 Add New Bookmark...</nobr></span><br>
233 <br>
234 (for example)<br>
235 <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
240 plug-in.<br>
241 <h3> 5. Creating a .jar file.<br>
242 </h3>
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>
248   <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>
253   <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>
261   <br>
262   You close your Eclipse IDE and open it up again, and the QuantumDB perspective 
263   should be available.<br>
264 </p>
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 
267   place) </p>
268 <h4>Synchronizing with a CVS repository</h4>
269 <p><br>
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 
279   the branch. </p>
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 
285   Workbench. </p>
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 &quot;working&quot; 
299   set to CVS. That's more or less the idea.</p>
300 </body>
301 </html>