Philip,<br><br>I am very interested with your jsword plugin. How can share it? It seems all of sudden, BD has three GUI now!<br><br>Maybe we can provide users different GUI to choose. Yeah!<br><br><div><span class="gmail_quote">
On 12/8/06, <b class="gmail_sendername">P. R. B.</b> &lt;<a href="mailto:dysbiote@yahoo.com">dysbiote@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Hi gang,<br><br>I ran into the same problem with RCP. I ultimately turned the core JSword libraries (common and jsword -- the parts I was after) into an RCP plug-in that could accommodate the RCP Job class and use plug-ins to extend the installer, filter, and driver (RCP needs to manage class loaders itself, so the class utilities and property files were removed). The key to changing the job code, for me, was to replace JSword-Job calls&nbsp; with IProgressMonitor calls, and making all calls run in the caller's thread. The IProgressMonitor interface serves essentially the same purpose and the JSword Job class, so the change was fairly straight-forward.
<br><br>I have an example of the changes that I made at the bottom of this
 e-mail.<br><br>
Off-topic: I hit project burn-out with this endeavor a few weeks back
and the fate of the code is undecided (I take project burn-out pretty
hard). The JSword plug-in is functional and the RCP application is 100% working. If anyone wants to play with it or is interested in helping me resurrect
the thing back to life, please let me know.<br><br>Thanks,<br>-Phillip<br><br>-- <br><br>Example changes to convert JSword Job code to use IProgressMonitor  (for non-RCP'rs, IProgressMonitor and IStatus are part of the Eclipse/RCP core API):
<br><br>Installer interface:<br>&nbsp;&nbsp;&nbsp; IStatus install(IProgressMonitor monitor, Book book);<br><br>HttpSwordInstaller class:<br>&nbsp;&nbsp;&nbsp; public IStatus install(IProgressMonitor monitor, Book book){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Is the book already installed? Then nothing to do.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (Books.installed().getBook(book.getName()) != null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; monitor.beginTask(Msg.INSTALLING.toString(book.getName()), 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; monitor.worked(1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 monitor.done();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Status.OK_STATUS;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final SwordBookMetaData sbmd = (SwordBookMetaData) book.getBookMetaData();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // the task has as many steps to perform as there are parts to the download
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; monitor.beginTask(Msg.INSTALLING.toString(book.getName()), (getSize(book) / 4096) + 1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; monitor.subTask(Msg.JOB_INIT.toString());<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URL temp = NetUtil.getTemporaryURL(&quot;swd&quot;, ZIP_SUFFIX); //$NON-NLS-1$
<br>&nbsp;&nbsp;&nbsp;
 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // download the book. Each chunk downloaded contributes to the monitor's work.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; download(monitor, directory + '/' + PACKAGE_DIR, sbmd.getInitials() + ZIP_SUFFIX, temp);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Once the unzipping is started, we need to continue
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File dldir = SwordBookPath.getDownloadDir();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!monitor.isCanceled())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; monitor.subTask(Msg.JOB_CONFIG.toString());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 IOUtil.unpackZip(NetUtil.getAsFile(temp), dldir);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SwordBookDriver.registerNewBook(sbmd, dldir);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch (Exception ex)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reporter.informUser
(this, ex);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Status(IStatus.ERROR, JswordActivator.PLUGIN_ID, 0, Msg.UNKNOWN_ERROR.toString(), ex);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; finally<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; monitor.done();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return Status.OK_STATUS;<div><span class="e" id="q_10f6500f745a807f_1"><br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: David &lt;
<a href="mailto:lzj369@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lzj369@gmail.com</a>&gt;<br>To: J-Sword Developers Mailing List &lt;<a href="mailto:jsword-devel@crosswire.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jsword-devel@crosswire.org</a>&gt;<br>Sent: Friday, December 8, 2006 10:26:01 AM<br>Subject: Re: [jsword-devel] feather request: book downloading and index generating api<br><br>Hi, DM,<br>If you just want to migrate to SWT, I personally think it does not worth it. SWT just another set of API, like SWING.&nbsp; However, if you want to migrate to NETBEAN RCP or Eclipse RCP, I will applause your effort. (The application size will be increased by 6-9MB).&nbsp; For Eclipse RCP, the work is just create veiws and call jword api.
<br><br>The work I am doing is based on Eclipse RCP. Jsword is a base part of it. The plan is to build a p2p system that can enable blog , forum sharing, of course file sharing(&nbsp; JXTA.)&nbsp; next year.&nbsp; It will be a set of plugins.
<br><br>Right now, I am rewriting the system to look like exactly what is on web sword interface. After all, people are familar with web interface.&nbsp; I , however did a websword plugin with tomcat embedded(yes, a server on user's desktop).&nbsp; It is cool. However, due to other considerations, I put it on hold.
<br><br>Since you are interest, I will put the source code to Google code next week.&nbsp; I tried sourceforge, still does not get approved.&nbsp; An alternative is I put the code temporily into jwsord SVN, so you can look at it. Again, next week. :)
<br><br><br><br><div><span class="gmail_quote">On 12/8/06, <b class="gmail_sendername">DM Smith</b> &lt;<a rel="nofollow" href="mailto:dmsmith555@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
dmsmith555@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
We hope to migrate the UI to SWT. So I am very interested in your RCP<br>work. Is there a place where I can see what you have done. If possible,<br>I'd like to minimize your pain of re-integrating the JSword as it changes.
<br><br>David wrote:<br>&gt; Eclipse RCP platform has its own threading api. Use can choose the job<br>&gt; run on backgroud or foreground. I maybe need to double check why the<br>&gt; process failed. (I believe it is because of threading)
<br>&gt; For book installation, I added two mirror methods to do downloading<br>&gt; and copying.&nbsp;&nbsp;It works fine. The only issue is the api and package<br>&gt; keep changing and I have to compare every time there is a new release
<br>&gt; and merge the code.<br>&gt;<br>&gt; For indexing, I have not made it to work correctly.&nbsp;&nbsp;I will study the<br>&gt; code next week. The basic idea is kick off a background job and call<br>&gt; jsword api to generate index. No thread for indexing itself is needed.
<br>&gt;<br>&gt; For Web sword, the book installation is on server side. Never mind.<br>&gt; It will not be used for end users. I put it on hold because I have<br>&gt; several othe plugins need to be done soon.<br>&gt;<br>

&gt; Zhaojun<br>&gt;<br>&gt; On 12/8/06, *DM Smith* &lt;<a rel="nofollow" href="mailto:dmsmith555@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dmsmith555@yahoo.com</a><br>&gt; &lt;mailto:
<a rel="nofollow" href="mailto:dmsmith555@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dmsmith555@yahoo.com</a>&gt;&gt; wrote:<br>&gt;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; David wrote:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Hi, DM and fellow developers,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I am developing web sword(90% done, pure j2ee implementation, will<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; help web hosting) and sword on eclipse RCP.&nbsp;&nbsp;Issues were raised up
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; when I try to integrate install book and generate indices. The code<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; now has job api build in and also has the reporter to<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; communicate with<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; user UI.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; In order to accelerate the acceptance of jword library,&nbsp;&nbsp;the api for<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; downloading books and api for index processing need to seperated<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; from<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Job api.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I'm not sure I understand the problem.
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; The index api (org.crosswire.jsword.index) is independent of the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Job and<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Reporter apis. The Lucene implementation is not.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Likewise for the install api ( org.crosswire.jsword.index

) and the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; sword<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; implementation.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Both the Job api and the Reporter api are listener based. If there<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; is no<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; listener for Job events or Reporter events, then those are not heard.
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Any listener of your choosing can be provided or not provided. It<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; is up<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; to you.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; The purpose of the Job and Reporter apis is to provide asynchronous<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; communication of a potentially background task thread. For
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; example, you<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; will notice in BibleDesktop that you can download and/or index<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; more than<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; one Book at a time. Each download and index is on its own thread<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; and it<br>

&gt;&nbsp;&nbsp;&nbsp;&nbsp; communicates back to BibleDesktop asynchronously of its progress<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; or any<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; problems that are encountered.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; In a web environment asynchronous communication of long-lived<br>

&gt;&nbsp;&nbsp;&nbsp;&nbsp; threads on<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; the server may prove to be a challenge, but it should be possible.<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; _______________________________________________<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; jsword-devel mailing list<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
<a rel="nofollow" href="mailto:jsword-devel@crosswire.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jsword-devel@crosswire.org</a> &lt;mailto:<a rel="nofollow" href="mailto:jsword-devel@crosswire.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jsword-devel@crosswire.org</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a rel="nofollow" href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>

&gt; jsword-devel mailing list<br>&gt; <a rel="nofollow" href="mailto:jsword-devel@crosswire.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jsword-devel@crosswire.org</a><br>&gt; <a rel="nofollow" href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.crosswire.org/mailman/listinfo/jsword-devel
</a><br>&gt;<br><br><br>_______________________________________________<br>jsword-devel mailing list<br><a rel="nofollow" href="mailto:jsword-devel@crosswire.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jsword-devel@crosswire.org</a><br><a rel="nofollow" href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br></blockquote></div><br>
<div>_______________________________________________<br>jsword-devel mailing list<br><a href="mailto:jsword-devel@crosswire.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jsword-devel@crosswire.org
</a><br><a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br></div></div><br>
</span></div></div></div><span class="ad"><br>

<hr size="1">Check out <a href="http://us.rd.yahoo.com/evt=43257/*http://advision.webevents.yahoo.com/mailbeta" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">the all-new Yahoo! Mail beta</a> - Fire up a more powerful email and get things done faster.
</span></div><span class="ad">
</span><br>_______________________________________________<br>jsword-devel mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a>
<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br><br><br></blockquote>
</div><br>