[jsword-devel] Make AbstractSwordInstaller.downloadSearchIndex configurable
DM Smith
dmsmith at crosswire.org
Wed Apr 10 09:42:29 MST 2013
Yes. And you are right that there's nothing else that uses it. While it was planned for all apps, it actually only makes sense for low-powered devices.
-- DM
On Apr 9, 2013, at 5:15 PM, Martin Denham <mjdenham at gmail.com> wrote:
> Could JSword's AbstractSwordInstaller be enhanced to make the location that pre-built search indexes are downloaded from configurable. I modified the previous JSword to make the indexes be picked up from the correct place.
>
> I think that it is only And Bible that utilises this method which would make the change simpler.
>
> And Bible copied the index storage structures used by PocketSword.
> And Bible's pre-built indexes are stored here: http://www.crosswire.org/and-bible/indices/v1/
> And Bible index zip files are named "MODULE_NAME-VERSION.zip" (eg KJV-1.3.zip)
>
> This is the modified method currently being used by And Bible:
> public void downloadSearchIndex(Book book, URI localDest) throws InstallException {
> // TRANSLATOR: Progress label for downloading one or more files.
> String jobName = JSMsg.gettext("Downloading files");
> Progress job = JobManager.createJob(jobName, Thread.currentThread());
> job.beginJob(jobName);
>
> //MJD START
> //use and-bible index location
> String indexLocation = "/and-bible/indices/v1";
> try {
> Version versionObj = (Version)book.getBookMetaData().getProperty("Version");
> // if a module has no version then default version is blank
> String versionSuffix = "";
> if (versionObj!=null && versionObj.toString()!=null) {
> versionSuffix = "-"+versionObj.toString();
> }
> download(job, indexLocation, book.getInitials()+versionSuffix + ZIP_SUFFIX, localDest);
> //MJD END
> //orig: download(job, packageDirectory + '/' + SEARCH_DIR, book.getInitials() + ZIP_SUFFIX, localDest);
> } catch (InstallException ex) {
> job.cancel();
> throw ex;
> } finally {
> job.done();
> }
> }
>
> Martin
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20130410/632b19a4/attachment.html>
More information about the jsword-devel
mailing list