[jsword-svn] r1143 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane bibledesktop/src/main/resources bibledesktop/src/main/resources/xsl/cswing common/src/main/java/org/crosswire/common/util jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/basic jsword/src/main/java/org/crosswire/jsword/book/filter/thml jsword/src/main/java/org/crosswire/jsword/book/install/sword jsword/src/main/java/org/crosswire/jsword/book/sword jsword/src/main/java/org/crosswire/jsword/passage jsword/src/main/java/org/crosswire/jsword/versification jsword/src/test/java/org/crosswire/jsword/passage

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Wed Oct 4 19:08:14 MST 2006


Author: dmsmith
Date: 2006-10-04 19:07:23 -0700 (Wed, 04 Oct 2006)
New Revision: 1143

Added:
   trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/ImgTag.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.properties
   trunk/jsword/src/test/java/org/crosswire/jsword/passage/AccuracyTypeTest.java
Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java
   trunk/bibledesktop/src/main/resources/config.xml
   trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
   trunk/common/src/main/java/org/crosswire/common/util/NetUtil.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/CustomHandler.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/AbstractBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/BookType.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/CompressionType.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GZIPBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/LZSSBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookDriver.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordConstants.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/AccuracyType.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/Msg.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames_de.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java
Log:
Added image support.
Fixed a bug in NetUtils.
Added a bug fix in and junit for AccuracyType from Phillip

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties	2006-10-05 02:07:23 UTC (rev 1143)
@@ -43,15 +43,15 @@
 NewTab.Name=Neue Bible Ansicht
 NewTab.ShortDescription=Neue Bible Ansicht
 NewTab.LongDescription=\u00d6ffnet eine neue Bible Ansicht
-NewTab.MnemonicKey=N
-NewTab.AcceleratorKey=N
+NewTab.MnemonicKey=O
+NewTab.AcceleratorKey=O
 NewTab.AcceleratorKey.Modifiers=ctrl
 
 Open.Name=\u00d6ffnen ...
 Open.ShortDescription=\u00d6ffne Schriftstelle
 Open.LongDescription=\u00d6ffnet eine gespeicherte Schriftstelle.
-Open.MnemonicKey=O
-Open.AcceleratorKey=O
+Open.MnemonicKey=A
+Open.AcceleratorKey=A
 Open.AcceleratorKey.Modifiers=ctrl
 
 CloseView.Name=Schlie\u00dfe die aktuelle Ansicht

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -25,6 +25,7 @@
 import java.awt.ComponentOrientation;
 import java.awt.event.MouseListener;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.text.MessageFormat;
 
 import javax.swing.JTextPane;
@@ -128,6 +129,13 @@
             {
                 XSLTProperty.setProperties(htmlsep);
             }
+
+            URL loc = bmd.getLocation();
+            if (loc != null)
+            {
+                htmlsep.setParameter("baseURL", loc.toExternalForm()); //$NON-NLS-1$
+            }
+
             htmlsep.setParameter("direction", direction ? "ltr" : "rtl"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             String text = XMLUtil.writeToString(htmlsep);
 

Modified: trunk/bibledesktop/src/main/resources/config.xml
===================================================================
--- trunk/bibledesktop/src/main/resources/config.xml	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/bibledesktop/src/main/resources/config.xml	2006-10-05 02:07:23 UTC (rev 1143)
@@ -171,7 +171,7 @@
   </option>
 
   <option key="Passages.FullBookName" type="boolean">
-    <introspect class="org.crosswire.jsword.passage.BibleInfo" property="FullBookName"/>
+    <introspect class="org.crosswire.jsword.versification.BibleInfo" property="FullBookName"/>
   </option>
 
   <option key="Passages.BlurringRules" type="int-options">
@@ -182,7 +182,7 @@
   </option>
 
   <option key="Passages.BookCase" type="int-options">
-    <introspect class="org.crosswire.jsword.passage.BibleInfo" property="Case"/>
+    <introspect class="org.crosswire.jsword.versification.BibleInfo" property="Case"/>
     <alternative number="0"/>
     <alternative number="1"/>
     <alternative number="2"/>

Modified: trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
===================================================================
--- trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2006-10-05 02:07:23 UTC (rev 1143)
@@ -54,6 +54,12 @@
   <xsl:param name="greek.morph.protocol" select="'gmorph:'"/>
   <xsl:param name="hebrew.morph.protocol" select="'hmorph:'"/>
 
+  <!-- The absolute base for relative references. -->
+  <xsl:param name="baseURL" select="''"/>
+
+  <!-- Whether to show non-canonical "headings" or not -->
+  <xsl:param name="Headings" select="'true'"/>
+
   <!-- Whether to show Strongs or not -->
   <xsl:param name="Strongs" select="'false'"/>
 
@@ -813,14 +819,14 @@
   
   <xsl:template match="figure">
     <div class="figure">
-      <img src="@src"/>  <!-- FIXME: Not necessarily an image... -->
+      <img src="{concat($baseURL, @src)}"/>  <!-- FIXME: Not necessarily an image... -->
       <xsl:apply-templates/>
     </div>
   </xsl:template>
   
   <xsl:template match="figure" mode="jesus">
     <div class="figure">
-      <img src="@src"/>  <!-- FIXME: Not necessarily an image... -->
+      <img src="{concat($baseURL, @src)}"/>  <!-- FIXME: Not necessarily an image... -->
       <xsl:apply-templates mode="jesus"/>
     </div>
   </xsl:template>

Modified: trunk/common/src/main/java/org/crosswire/common/util/NetUtil.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/NetUtil.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/common/src/main/java/org/crosswire/common/util/NetUtil.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -347,7 +347,7 @@
         String extra = anExtra;
         try
         {
-            char firstChar = extra.charAt(extra.length() - 1);
+            char firstChar = extra.charAt(0);
             if (isSeparator(firstChar))
             {
                 extra = extra.substring(1);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,6 +21,7 @@
  */
 package org.crosswire.jsword.book;
 
+import java.net.URL;
 import java.util.Map;
 
 import org.crosswire.jsword.index.IndexStatus;
@@ -176,6 +177,20 @@
     boolean hasFeature(FeatureType feature);
 
     /**
+     * Get the base URL for library of this module.
+     * 
+     * @return the base URL or null if there is none
+     */
+    URL getLibrary();
+
+    /**
+     * Get the base URL for relative urls in the document.
+     * 
+     * @return the base URL or null if there is none
+     */
+    URL getLocation();
+
+    /**
      * Get a list of all the properties available to do with this Book.
      * The returned Properties will be read-only so any attempts to alter it
      * will fail.
@@ -231,6 +246,16 @@
     String KEY_INITIALS = "Initials"; //$NON-NLS-1$
 
     /**
+     * The key for the URL locating where this book is installed
+     */
+    String KEY_LIBRARY_URL = "LibraryURL"; //$NON-NLS-1$
+
+    /**
+     * The key for the URL locating this book
+     */
+    String KEY_LOCATION_URL = "LocationURL"; //$NON-NLS-1$
+
+    /**
      * The key for the indexed status in the properties map
      */
     String KEY_INDEXSTATUS = "IndexStatus"; //$NON-NLS-1$

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -200,6 +200,7 @@
     public static final String OSIS_ELEMENT_LIST = "list"; //$NON-NLS-1$
     public static final String OSIS_ELEMENT_P = "p"; //$NON-NLS-1$
     public static final String OSIS_ELEMENT_ITEM = "item"; //$NON-NLS-1$
+    public static final String OSIS_ELEMENT_FIGURE = "figure"; //$NON-NLS-1$
     public static final String OSIS_ELEMENT_FOREIGN = "foreign"; //$NON-NLS-1$
     public static final String OSIS_ELEMENT_W = "w"; //$NON-NLS-1$
     public static final String OSIS_ELEMENT_CHAPTER = "chapter"; //$NON-NLS-1$
@@ -222,6 +223,7 @@
     public static final String OSIS_ATTR_SID = "sID"; //$NON-NLS-1$
     public static final String OSIS_ATTR_EID = "eID"; //$NON-NLS-1$
     public static final String ATTRIBUTE_W_LEMMA = "lemma"; //$NON-NLS-1$
+    public static final String ATTRIBUTE_FIGURE_SRC = "src"; //$NON-NLS-1$
     public static final String OSIS_ATTR_TYPE = "type"; //$NON-NLS-1$
     public static final String OSIS_ATTR_SUBTYPE = "subType"; //$NON-NLS-1$
     public static final String OSIS_ATTR_REF = "osisRef"; //$NON-NLS-1$
@@ -343,6 +345,14 @@
         /**
          * 
          */
+        public Element createFigure()
+        {
+            return new Element(OSIS_ELEMENT_FIGURE);
+        }
+
+        /**
+         * 
+         */
         public Element createForeign()
         {
             return new Element(OSIS_ELEMENT_FOREIGN);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,6 +21,8 @@
  */
 package org.crosswire.jsword.book.basic;
 
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -166,6 +168,48 @@
     }
 
     /* (non-Javadoc)
+     * @see org.crosswire.jsword.book.BookMetaData#getLibrary()
+     */
+    public URL getLibrary()
+    {
+        URL url = null;
+        try
+        {
+            String loc = (String) getProperty(KEY_LIBRARY_URL);
+            if (loc != null)
+            {
+                url = new URL(loc);
+            }
+            return url;
+        }
+        catch (MalformedURLException e)
+        {
+            return null;
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.crosswire.jsword.book.BookMetaData#getLocation()
+     */
+    public URL getLocation()
+    {
+        URL url = null;
+        try
+        {
+            String loc = (String) getProperty(KEY_LOCATION_URL);
+            if (loc != null)
+            {
+                url = new URL(loc);
+            }
+            return url;
+        }
+        catch (MalformedURLException e)
+        {
+            return null;
+        }
+    }
+
+    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.BookMetaData#getProperties()
      */
     public Map getProperties()

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/CustomHandler.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/CustomHandler.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/CustomHandler.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -195,6 +195,7 @@
             new ForeignTag(),
             new FontTag(),
             new HrTag(),
+            new ImgTag(),
             new ITag(),
             new LiTag(),
             new NoteTag(),
@@ -225,7 +226,6 @@
             new AliasTag("dl", new UlTag()), //$NON-NLS-1$
             new AliasTag("dd", new LiTag()), //$NON-NLS-1$
             new AliasTag("dt", new LiTag()), //$NON-NLS-1$
-            new IgnoreTag("img"), //$NON-NLS-1$
             new IgnoreTag("span"), //$NON-NLS-1$
             new IgnoreTag("dir"), //$NON-NLS-1$
             new IgnoreTag("pre"), //$NON-NLS-1$

Added: trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/ImgTag.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/ImgTag.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/ImgTag.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -0,0 +1,56 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: BrTag.java 1068 2006-04-08 02:20:41Z dmsmith $
+ */
+package org.crosswire.jsword.book.filter.thml;
+
+import org.crosswire.jsword.book.OSISUtil;
+import org.jdom.Element;
+import org.xml.sax.Attributes;
+
+/**
+ * THML Tag to process the img element.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ */
+public class ImgTag extends AbstractTag
+{
+    /* (non-Javadoc)
+     * @see org.crosswire.jsword.book.filter.thml.Tag#getTagName()
+     */
+    public String getTagName()
+    {
+        return "img"; //$NON-NLS-1$
+    }
+
+    /* (non-Javadoc)
+     * @see org.crosswire.jsword.book.filter.thml.Tag#processTag(org.jdom.Element, org.xml.sax.Attributes)
+     */
+    /* @Override */
+    public Element processTag(Element ele, Attributes attrs)
+    {
+        Element img = OSISUtil.factory().createFigure();
+        img.setAttribute(OSISUtil.ATTRIBUTE_FIGURE_SRC, attrs.getValue("src")); //$NON-NLS-1$
+        ele.addContent(img);
+        return img;
+    }
+}

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -199,7 +199,7 @@
                     {
                         IOUtil.unpackZip(NetUtil.getAsFile(temp), dldir);
                         job.setProgress(Msg.JOB_CONFIG.toString());
-                        SwordBookDriver.registerNewBook(sbmd, dldir);
+                        SwordBookDriver.registerNewBook(sbmd);
                     }
 
                 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/AbstractBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/AbstractBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/AbstractBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -22,9 +22,11 @@
 package org.crosswire.jsword.book.sword;
 
 import java.io.File;
+import java.net.URL;
 
 import org.crosswire.common.activate.Activatable;
 import org.crosswire.common.crypt.Sapphire;
+import org.crosswire.common.util.NetUtil;
 import org.crosswire.jsword.book.BookException;
 import org.crosswire.jsword.passage.Key;
 
@@ -42,21 +44,12 @@
      * @param sbmd
      * @param location
      */
-    public AbstractBackend(SwordBookMetaData sbmd, File location)
+    public AbstractBackend(SwordBookMetaData sbmd)
     {
         bmd = sbmd;
-        rootPath = location;
     }
 
     /**
-     * @return Returns the root path.
-     */
-    public File getRootPath()
-    {
-        return rootPath;
-    }
-
-    /**
      * @return Returns the Sword BookMetaData.
      */
     public SwordBookMetaData getBookMetaData()
@@ -82,6 +75,25 @@
         }
     }
 
+    public String getExpandedDataPath() throws BookException
+    {
+        URL loc = NetUtil.lengthenURL(bmd.getLibrary(), bmd.getProperty(ConfigEntryType.DATA_PATH));
+
+        if (loc == null)
+        {
+            throw new BookException(Msg.MISSING_FILE);
+        }
+
+        try
+        {
+            return new File(loc.getFile()).getAbsolutePath();
+        }
+        catch (Exception e)
+        {
+            throw new BookException(Msg.MISSING_FILE, e);
+        }
+    }
+
     /**
      * Initialise a AbstractBackend before use. This method needs to call addKey() a
      * number of times on SwordDictionary
@@ -103,5 +115,4 @@
     public abstract boolean isSupported();
 
     private SwordBookMetaData bmd;
-    private File rootPath;
 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/BookType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/BookType.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/BookType.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,7 +21,6 @@
  */
 package org.crosswire.jsword.book.sword;
 
-import java.io.File;
 import java.io.Serializable;
 
 import org.crosswire.jsword.book.Book;
@@ -48,9 +47,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new RawBackend(sbmd, rootPath);
+            return new RawBackend(sbmd);
         }
 
         /**
@@ -69,9 +68,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return getCompressedBackend(sbmd, rootPath);
+            return getCompressedBackend(sbmd);
         }
 
         protected boolean isBackendSupported(SwordBookMetaData sbmd)
@@ -95,9 +94,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new RawBackend(sbmd, rootPath);
+            return new RawBackend(sbmd);
         }
 
         /**
@@ -116,9 +115,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return getCompressedBackend(sbmd, rootPath);
+            return getCompressedBackend(sbmd);
         }
 
         protected boolean isBackendSupported(SwordBookMetaData sbmd)
@@ -142,9 +141,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new RawBackend(sbmd, rootPath);
+            return new RawBackend(sbmd);
         }
 
         /**
@@ -163,9 +162,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new RawBackend(sbmd, rootPath);
+            return new RawBackend(sbmd);
         }
 
         /**
@@ -188,9 +187,9 @@
             return new SwordDictionary(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new RawLDBackend(sbmd, rootPath, 2);
+            return new RawLDBackend(sbmd, 2);
         }
 
         /**
@@ -213,9 +212,9 @@
             return new SwordDictionary(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new RawLDBackend(sbmd, rootPath, 4);
+            return new RawLDBackend(sbmd, 4);
         }
 
         /**
@@ -238,9 +237,9 @@
             return new SwordDictionary(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new ZLDBackend(sbmd, rootPath);
+            return new ZLDBackend(sbmd);
         }
 
         /**
@@ -259,9 +258,9 @@
             return new SwordBook(sbmd, backend);
         }
 
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new GenBookBackend(sbmd, rootPath);
+            return new GenBookBackend(sbmd);
         }
 
         protected boolean isBackendSupported(SwordBookMetaData sbmd)
@@ -335,9 +334,9 @@
      * Create a Book appropriate for the BookMetaData
      * @throws BookException
      */
-    public Book createBook(SwordBookMetaData sbmd, File progdir) throws BookException
+    public Book createBook(SwordBookMetaData sbmd) throws BookException
     {
-        AbstractBackend backend = getBackend(sbmd, progdir);
+        AbstractBackend backend = getBackend(sbmd);
         Book book = getBook(sbmd, backend);
         return book;
     }
@@ -350,17 +349,17 @@
     /**
      * Create a the appropriate backend for this type of book
      */
-    protected abstract AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException;
+    protected abstract AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException;
 
     /**
      * 
      */
-    protected static AbstractBackend getCompressedBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+    protected static AbstractBackend getCompressedBackend(SwordBookMetaData sbmd) throws BookException
     {
         String cStr = sbmd.getProperty(ConfigEntryType.COMPRESS_TYPE);
         if (cStr != null)
         {
-            return CompressionType.fromString(cStr).getBackend(sbmd, rootPath);
+            return CompressionType.fromString(cStr).getBackend(sbmd);
         }
         throw new BookException(Msg.COMPRESSION_UNSUPPORTED, new Object[] { cStr });
     }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/CompressionType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/CompressionType.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/CompressionType.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,7 +21,6 @@
  */
 package org.crosswire.jsword.book.sword;
 
-import java.io.File;
 import java.io.Serializable;
 
 import org.crosswire.jsword.book.BookException;
@@ -45,10 +44,10 @@
         {
             return true;
         }
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
             BlockType blockType = BlockType.fromString(sbmd.getProperty(ConfigEntryType.BLOCK_TYPE));
-            return new GZIPBackend(sbmd, rootPath, blockType);
+            return new GZIPBackend(sbmd, blockType);
         }
 
         /**
@@ -66,9 +65,9 @@
         {
             return false;
         }
-        protected AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+        protected AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException
         {
-            return new LZSSBackend(sbmd, rootPath);
+            return new LZSSBackend(sbmd);
         }
 
         /**
@@ -92,7 +91,7 @@
      */
     abstract boolean isSupported();
 
-    abstract AbstractBackend getBackend(SwordBookMetaData sbmd, File rootPath) throws BookException;
+    abstract AbstractBackend getBackend(SwordBookMetaData sbmd) throws BookException;
 
     /**
      * Lookup method to convert from a String

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -91,6 +91,7 @@
             loadContents(in);
             in.close();
         }
+        adjustDataPath();
         adjustLanguage();
         adjustBookType();
         adjustName();
@@ -125,6 +126,7 @@
             loadContents(in);
             in.close();
         }
+        adjustDataPath();
         adjustLanguage();
         adjustBookType();
         adjustName();
@@ -521,11 +523,19 @@
      * @param type
      * @param aValue
      */
-    private void add(ConfigEntryType type, String aValue)
+    public void add(ConfigEntryType type, String aValue)
     {
         table.put(type, new ConfigEntry(internal, type, aValue));
     }
 
+    private void adjustDataPath()
+    {
+        String datapath = (String) getValue(ConfigEntryType.DATA_PATH);
+        if (datapath.startsWith("./")) //$NON-NLS-1$
+        {
+            add(ConfigEntryType.DATA_PATH, datapath.substring(2));
+        }
+    }
     private void adjustLanguage()
     {
         // Java thinks it is LtoR but it is stated to be something else

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryType.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -1231,6 +1231,44 @@
     public static final ConfigEntryType SHORT_COPYRIGHT = new ConfigEntryType("ShortCopyright"); //$NON-NLS-1$
 
     /**
+     * The location of a collection of modules. JSword uses this to install and delete a module.
+     */
+    public static final ConfigEntryType LIBRARY_URL = new ConfigEntryType("LibraryURL") //$NON-NLS-1$
+    {
+        /* (non-Javadoc)
+         * @see org.crosswire.jsword.book.sword.ConfigEntryType#isSynthetic()
+         */
+        public boolean isSynthetic()
+        {
+            return true;
+        }
+
+        /**
+         * Serialization ID
+         */
+        private static final long serialVersionUID = -2468890875139856087L;
+    };
+
+    /**
+     * The location of the module. JSword uses this to access a module.
+     */
+    public static final ConfigEntryType LOCATION_URL = new ConfigEntryType("LocationURL") //$NON-NLS-1$
+    {
+        /* (non-Javadoc)
+         * @see org.crosswire.jsword.book.sword.ConfigEntryType#isSynthetic()
+         */
+        public boolean isSynthetic()
+        {
+            return true;
+        }
+
+        /**
+         * Serialization ID
+         */
+        private static final long serialVersionUID = -2468890875139856087L;
+    };
+
+    /**
      * Simple ctor
      */
     protected ConfigEntryType(String name)
@@ -1470,5 +1508,6 @@
         LANGUAGE_TO,
         SHORT_PROMO,
         SHORT_COPYRIGHT,
+        LOCATION_URL,
     };
 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GZIPBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GZIPBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GZIPBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -101,13 +101,11 @@
     /**
      * Simple ctor
      */
-    public GZIPBackend(SwordBookMetaData sbmd, File rootPath, BlockType blockType) throws BookException
+    public GZIPBackend(SwordBookMetaData sbmd, BlockType blockType) throws BookException
     {
-        super(sbmd, rootPath);
+        super(sbmd);
 
-        String dataPath = sbmd.getProperty(ConfigEntryType.DATA_PATH);
-        File baseurl = new File(rootPath, dataPath);
-        String path = baseurl.getAbsolutePath();
+        String path = getExpandedDataPath();
         String otAllButLast = path + File.separator + SwordConstants.FILE_OT + '.' + blockType.getIndicator() + SUFFIX_PART1;
         idxFile[SwordConstants.TESTAMENT_OLD] = new File(otAllButLast + SUFFIX_INDEX);
         textFile[SwordConstants.TESTAMENT_OLD] = new File(otAllButLast + SUFFIX_TEXT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.jsword.book.sword;
 
-import java.io.File;
-
 import org.crosswire.common.activate.Activator;
 import org.crosswire.common.activate.Lock;
 import org.crosswire.jsword.book.BookException;
@@ -40,9 +38,9 @@
     /**
      * Simple ctor
      */
-    public GenBookBackend(SwordBookMetaData sbmd, File rootPath)
+    public GenBookBackend(SwordBookMetaData sbmd)
     {
-        super(sbmd, rootPath);
+        super(sbmd);
     }
 
     /* (non-Javadoc)

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/LZSSBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/LZSSBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/LZSSBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.jsword.book.sword;
 
-import java.io.File;
-
 import org.crosswire.common.activate.Lock;
 import org.crosswire.jsword.book.BookException;
 import org.crosswire.jsword.passage.Key;
@@ -39,9 +37,9 @@
     /**
      * Simple ctor
      */
-    public LZSSBackend(SwordBookMetaData sbmd, File rootPath)
+    public LZSSBackend(SwordBookMetaData sbmd)
     {
-        super(sbmd, rootPath);
+        super(sbmd);
     }
 
     /* (non-Javadoc)

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -48,13 +48,12 @@
     /**
      * Simple ctor
      */
-    public RawBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+    public RawBackend(SwordBookMetaData sbmd) throws BookException
     {
-        super(sbmd, rootPath);
-        String dataPath = sbmd.getProperty(ConfigEntryType.DATA_PATH);
-        File baseurl = new File(rootPath, dataPath);
-        String path = baseurl.getAbsolutePath();
+        super(sbmd);
 
+        String path = getExpandedDataPath();
+
         idxFile[SwordConstants.TESTAMENT_OLD] = new File(path + File.separator + SwordConstants.FILE_OT + SwordConstants.EXTENSION_VSS);
         txtFile[SwordConstants.TESTAMENT_OLD] = new File(path + File.separator + SwordConstants.FILE_OT);
 

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -56,9 +56,9 @@
      * Simple ctor
      * @param datasize We need to know how many bytes in the size portion of the index
      */
-    public RawLDBackend(SwordBookMetaData sbmd, File rootPath, int datasize) throws BookException
+    public RawLDBackend(SwordBookMetaData sbmd, int datasize) throws BookException
     {
-        super(sbmd, rootPath);
+        super(sbmd);
         this.datasize = datasize;
 
         if (datasize != 2 && datasize != 4)
@@ -66,10 +66,9 @@
             throw new BookException(Msg.TYPE_UNKNOWN);
         }
 
-        String dataPath = sbmd.getProperty(ConfigEntryType.DATA_PATH);
-        File baseurl = new File(rootPath, dataPath);
-        String path = baseurl.getAbsolutePath();
+        String path = getExpandedDataPath();
 
+
         idxFile = new File(path + SwordConstants.EXTENSION_INDEX);
         datFile = new File(path + SwordConstants.EXTENSION_DATA);
 

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookDriver.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookDriver.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookDriver.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -22,11 +22,13 @@
 package org.crosswire.jsword.book.sword;
 
 import java.io.File;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.crosswire.common.util.FileUtil;
 import org.crosswire.common.util.Logger;
+import org.crosswire.common.util.NetUtil;
 import org.crosswire.jsword.book.Book;
 import org.crosswire.jsword.book.BookDriver;
 import org.crosswire.jsword.book.BookException;
@@ -100,11 +102,11 @@
                     {
                         internal = internal.substring(0, internal.length() - 5);
                     }
-                    SwordBookMetaData sbmd = new SwordBookMetaData(configfile, internal);
+                    SwordBookMetaData sbmd = new SwordBookMetaData(configfile, internal, NetUtil.getURL(bookDir));
                     sbmd.setDriver(this);
 
                     // Only take the first "installation" of the Book
-                    Book book = createBook(sbmd, bookDir);
+                    Book book = createBook(sbmd);
                     if (!valid.contains(book))
                     {
                         valid.add(book);
@@ -162,8 +164,6 @@
             throw new BookException(Msg.DELETE_FAILED, new Object [] {confFile});
         }
 
-        File bookDir = new File(dlDir, sbmd.getBookPath());
-
         // Delete the conf
         List failures = FileUtil.delete(confFile);
         if (failures.size() == 0)
@@ -173,8 +173,21 @@
             // But if the conf is present and the book is gone,
             // then we get errors.
             // Delete the download book's dir
-            failures = FileUtil.delete(bookDir);
-            Books.installed().removeBook(dead);
+            try
+            {
+                URL loc = sbmd.getLocation();
+                if (loc == null)
+                {
+                    throw new BookException(Msg.DELETE_FAILED, new Object [] {confFile});
+                }
+                File bookDir = new File(loc.getFile());
+                failures = FileUtil.delete(bookDir);
+                Books.installed().removeBook(dead);
+            }
+            catch (Exception e)
+            {
+            }
+
         }
 
         // TODO(DM): list all that failed
@@ -200,13 +213,13 @@
      * @param bookpath The path that we have installed to
      * @throws BookException
      */
-    public static void registerNewBook(SwordBookMetaData sbmd, File bookpath) throws BookException
+    public static void registerNewBook(SwordBookMetaData sbmd) throws BookException
     {
         BookDriver[] drivers = Books.installed().getDriversByClass(SwordBookDriver.class);
         for (int i = 0; i < drivers.length; i++)
         {
             SwordBookDriver sdriver = (SwordBookDriver) drivers[i];
-            Book book = sdriver.createBook(sbmd, bookpath);
+            Book book = sdriver.createBook(sbmd);
             Books.installed().addBook(book);
         }
     }
@@ -214,7 +227,7 @@
     /**
      * Create a Book appropriate for the BookMetaData
      */
-    private Book createBook(SwordBookMetaData sbmd, File progdir) throws BookException
+    private Book createBook(SwordBookMetaData sbmd) throws BookException
     {
         BookType modtype = sbmd.getBookType();
         if (modtype.getBookCategory() == null)
@@ -224,7 +237,7 @@
             throw new BookException(Msg.TYPE_UNSUPPORTED);
         }
 
-        return modtype.createBook(sbmd, progdir);
+        return modtype.createBook(sbmd);
     }
 
     /**

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -23,11 +23,14 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.crosswire.common.util.NetUtil;
 import org.crosswire.jsword.book.BookCategory;
 import org.crosswire.jsword.book.FeatureType;
 import org.crosswire.jsword.book.basic.AbstractBookMetaData;
@@ -64,9 +67,15 @@
      * @param internal
      * @throws IOException
      */
-    public SwordBookMetaData(File file, String internal) throws IOException
+    public SwordBookMetaData(File file, String internal, URL bookRootPath) throws IOException
     {
         cet = new ConfigEntryTable(file, internal);
+        cet.add(ConfigEntryType.LIBRARY_URL, bookRootPath.toExternalForm());
+        // Currently all DATA_PATH entries end in / to indicate dirs or not to indicate file prefixes
+        String datapath = getProperty(ConfigEntryType.DATA_PATH);
+        datapath = datapath.substring(0, datapath.lastIndexOf('/'));
+        URL location = NetUtil.lengthenURL(bookRootPath, datapath);
+        cet.add(ConfigEntryType.LOCATION_URL, location.toExternalForm());
         buildProperties();
     }
 
@@ -182,24 +191,24 @@
     }
 
     /**
-     * @return the relative path of the book.
+     * @return the absolute path of the book as an URL.
      */
-    public String getBookPath()
+    public URL getLocation()
     {
-        // The path begins with ./
-        String dataPath = getProperty(ConfigEntryType.DATA_PATH).substring(2);
-        // Dictionaries and Daily Devotionals end with the prefix of the data
-        // files name, not a directory name.
-        // Lots of paths end with '/'
-        BookCategory bc = getBookCategory();
-        if (bc == BookCategory.DICTIONARY
-            || bc == BookCategory.GLOSSARY
-            || bc == BookCategory.DAILY_DEVOTIONS
-            || dataPath.charAt(dataPath.length() - 1) == '/')
+        URL url = null;
+        try
         {
-            dataPath = dataPath.substring(0, dataPath.lastIndexOf('/'));
+            String loc = getProperty(ConfigEntryType.LOCATION_URL);
+            if (loc != null)
+            {
+                url = new URL(loc);
+            }
+            return url;
         }
-        return dataPath;
+        catch (MalformedURLException e)
+        {
+            return null;
+        }
     }
 
     /* (non-Javadoc)

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordConstants.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordConstants.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordConstants.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -21,8 +21,8 @@
  */
 package org.crosswire.jsword.book.sword;
 
-import org.crosswire.jsword.passage.BibleInfo;
 import org.crosswire.jsword.passage.Verse;
+import org.crosswire.jsword.versification.BibleNames;
 
 /**
  * A Constants to help the SwordBookDriver to read Sword format data.
@@ -128,7 +128,7 @@
         {
             // This is an NT verse
             testament = SwordConstants.TESTAMENT_NEW;
-            book = book - BibleInfo.Names.MALACHI;
+            book = book - BibleNames.MALACHI;
         }
         else
         {
@@ -145,7 +145,7 @@
     /**
      * The start of the new testament
      */
-    static final int ORDINAL_MAT11 = new Verse(BibleInfo.Names.MATTHEW, 1, 1, true).getOrdinal();
+    static final int ORDINAL_MAT11 = new Verse(BibleNames.MATTHEW, 1, 1, true).getOrdinal();
 
     /**
      * array containing LUT of offsets in the chapter table.

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -101,13 +101,11 @@
      * Simple ctor
      * @throws BookException 
      */
-    public ZLDBackend(SwordBookMetaData sbmd, File rootPath) throws BookException
+    public ZLDBackend(SwordBookMetaData sbmd) throws BookException
     {
-        super(sbmd, rootPath);
+        super(sbmd);
 
-        String dataPath = sbmd.getProperty(ConfigEntryType.DATA_PATH);
-        File baseurl = new File(rootPath, dataPath);
-        String path = baseurl.getAbsolutePath();
+        String path = getExpandedDataPath();
 
         idxFile = new File(path + EXTENSION_INDEX);
         datFile = new File(path + EXTENSION_DATA);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/AccuracyType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/AccuracyType.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/AccuracyType.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -481,7 +481,6 @@
      */
     public static AccuracyType fromText(String original, String[] parts, AccuracyType verseAccuracy, VerseRange basis) throws NoSuchVerseException
     {
-        String msg = original;
         switch (parts.length)
         {
         case 1:
@@ -517,14 +516,8 @@
                 return VERSE_ONLY;
             }
 
-            for (int i = 0; i < parts.length; i++)
-            {
-                msg += ", "; //$NON-NLS-1$
-                msg += parts[1];
-            }
+            throw buildVersePartsException(original, parts);
 
-            throw new NoSuchVerseException(Msg.VERSE_PARTS, new Object[] { msg }); // AccuracyType.VERSE_ALLOWED_DELIMS });
-
         case 2:
             // Does it start with a book?
             int pbook = BibleInfo.getBookNumber(parts[0]);
@@ -550,23 +543,21 @@
                 return BOOK_VERSE;
             }
 
-            for (int i = 0; i < parts.length; i++)
-            {
-                msg += ", "; //$NON-NLS-1$
-                msg += parts[1];
-            }
+            throw buildVersePartsException(original, parts);
 
-            throw new NoSuchVerseException(Msg.VERSE_PARTS, new Object[] { msg }); // AccuracyType.VERSE_ALLOWED_DELIMS });
-
         default:
-            for (int i = 0; i < parts.length; i++)
-            {
-                msg += ", "; //$NON-NLS-1$
-                msg += parts[1];
-            }
+            throw buildVersePartsException(original, parts);
+        }
+    }
 
-            throw new NoSuchVerseException(Msg.VERSE_PARTS, new Object[] { msg }); // AccuracyType.VERSE_ALLOWED_DELIMS });
+    private static NoSuchVerseException buildVersePartsException(String original, String[] parts)
+    {
+        StringBuffer buffer = new StringBuffer(original);
+        for (int i = 0; i < parts.length; i++)
+        {
+            buffer.append(", ").append(parts[i]);//$NON-NLS-1$
         }
+        return new NoSuchVerseException(Msg.VERSE_PARTS, new Object[] { buffer.toString() });        
     }
 
     /**

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/Msg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/Msg.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/Msg.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -42,16 +42,6 @@
     static final Msg ABSTRACT_BOOK_SINGULAR = new Msg("AbstractPassage.BookSingular"); //$NON-NLS-1$
     static final Msg ABSTRACT_BOOK_PLURAL = new Msg("AbstractPassage.BookPlural"); //$NON-NLS-1$
 
-    static final Msg BOOKS_BOOK = new Msg("BibleInfo.Book"); //$NON-NLS-1$
-    static final Msg BOOKS_SECTION = new Msg("BibleInfo.Section"); //$NON-NLS-1$
-    static final Msg BOOKS_NUMBER = new Msg("BibleInfo.Number"); //$NON-NLS-1$
-    static final Msg BOOKS_FIND = new Msg("BibleInfo.Find"); //$NON-NLS-1$
-    static final Msg BOOKS_BOOKCHAP = new Msg("BibleInfo.BookChap"); //$NON-NLS-1$
-    static final Msg BOOKS_ORDINAL = new Msg("BibleInfo.Ordinal"); //$NON-NLS-1$
-    static final Msg BOOKS_DECODE = new Msg("BibleInfo.Decode"); //$NON-NLS-1$
-    static final Msg BOOKS_CHAPTER = new Msg("BibleInfo.Chapter"); //$NON-NLS-1$
-    static final Msg BOOKS_VERSE = new Msg("BibleInfo.Verse"); //$NON-NLS-1$
-
     static final Msg RANGE_BLURBOOK = new Msg("VerseRange.BlurBook"); //$NON-NLS-1$
     static final Msg RANGE_BLURNONE = new Msg("VerseRange.BlurNone"); //$NON-NLS-1$
     static final Msg RANGE_HICOUNT = new Msg("VerseRange.HiCount"); //$NON-NLS-1$

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -281,9 +281,9 @@
         return null;
     }
 
-    private static final String FULL_KEY       = "BibleNames.Full.";     //$NON-NLS-1$
-    private static final String SHORT_KEY      = "BibleNames.Short.";    //$NON-NLS-1$
-    private static final String ALT_KEY        = "BibleNames.Alt.";      //$NON-NLS-1$
+    private static final String FULL_KEY       = "Full.";     //$NON-NLS-1$
+    private static final String SHORT_KEY      = "Short.";    //$NON-NLS-1$
+    private static final String ALT_KEY        = "Alt.";      //$NON-NLS-1$
 
     /**
      * Handy book finder
@@ -355,6 +355,9 @@
     public static final byte    JUDE           = 65;
     public static final byte    REVELATION     = 66;
 
+    /** remove spaces and punctuation in Bible Names */
+    private static Pattern      normPattern    = Pattern.compile("[. ]"); //$NON-NLS-1$
+
     /** The locale for the Bible Names */
     private Locale              locale;
 
@@ -393,6 +396,4 @@
      * generated at runtime
      */
     private Map                 altBooksMap;
-
-    private static Pattern      normPattern    = Pattern.compile("[. ]"); //$NON-NLS-1$
 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.properties	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.properties	2006-10-05 02:07:23 UTC (rev 1143)
@@ -1,206 +1,198 @@
-BibleInfo.Full.1=Genesis
-BibleInfo.Short.1=Gen
-BibleInfo.Alt.1=
-BibleInfo.Full.2=Exodus
-BibleInfo.Short.2=Exo
-BibleInfo.Alt.2=
-BibleInfo.Full.3=Leviticus
-BibleInfo.Short.3=Lev
-BibleInfo.Alt.3=
-BibleInfo.Full.4=Numbers
-BibleInfo.Short.4=Num
-BibleInfo.Alt.4=
-BibleInfo.Full.5=Deuteronomy
-BibleInfo.Short.5=Deu
-BibleInfo.Alt.5=dt
-BibleInfo.Full.6=Joshua
-BibleInfo.Short.6=Jos
-BibleInfo.Alt.6=
-BibleInfo.Full.7=Judges
-BibleInfo.Short.7=Judg
-BibleInfo.Alt.7=jdg
-BibleInfo.Full.8=Ruth
-BibleInfo.Short.8=Rut
-BibleInfo.Alt.8=rth
-BibleInfo.Full.9=1 Samuel
-BibleInfo.Short.9=1Sa
-BibleInfo.Alt.9=
-BibleInfo.Full.10=2 Samuel
-BibleInfo.Short.10=2Sa
-BibleInfo.Alt.10=
-BibleInfo.Full.11=1 Kings
-BibleInfo.Short.11=1Ki
-BibleInfo.Alt.11=
-BibleInfo.Full.12=2 Kings
-BibleInfo.Short.12=2Ki
-BibleInfo.Alt.12=
-BibleInfo.Full.13=1 Chronicles
-BibleInfo.Short.13=1Ch
-BibleInfo.Alt.13=
-BibleInfo.Full.14=2 Chronicles
-BibleInfo.Short.14=2Ch
-BibleInfo.Alt.14=
-BibleInfo.Full.15=Ezra
-BibleInfo.Short.15=Ezr
-BibleInfo.Alt.15=
-BibleInfo.Full.16=Nehemiah
-BibleInfo.Short.16=Neh
-BibleInfo.Alt.16=
-BibleInfo.Full.17=Esther
-BibleInfo.Short.17=Est
-BibleInfo.Alt.17=
-BibleInfo.Full.18=Job
-BibleInfo.Short.18=Job
-BibleInfo.Alt.18=
-BibleInfo.Full.19=Psalms
-BibleInfo.Short.19=Psa
-BibleInfo.Alt.19=pss
-BibleInfo.Full.20=Proverbs
-BibleInfo.Short.20=Pro
-BibleInfo.Alt.20=
-BibleInfo.Full.21=Ecclesiastes
-BibleInfo.Short.21=Ecc
-BibleInfo.Alt.21=qoh
-BibleInfo.Full.22=Song of Solomon
-BibleInfo.Short.22=Song
-BibleInfo.Alt.22=ss,canticle,can
-BibleInfo.Full.23=Isaiah
-BibleInfo.Short.23=Isa
-BibleInfo.Alt.23=
-BibleInfo.Full.24=Jeremiah
-BibleInfo.Short.24=Jer
-BibleInfo.Alt.24=
-BibleInfo.Full.25=Lamentations
-BibleInfo.Short.25=Lam
-BibleInfo.Alt.25=
-BibleInfo.Full.26=Ezekiel
-BibleInfo.Short.26=Eze
-BibleInfo.Alt.26=
-BibleInfo.Full.27=Daniel
-BibleInfo.Short.27=Dan
-BibleInfo.Alt.27=
-BibleInfo.Full.28=Hosea
-BibleInfo.Short.28=Hos
-BibleInfo.Alt.28=
-BibleInfo.Full.29=Joel
-BibleInfo.Short.29=Joe
-BibleInfo.Alt.29=
-BibleInfo.Full.30=Amos
-BibleInfo.Short.30=Amo
-BibleInfo.Alt.30=
-BibleInfo.Full.31=Obadiah
-BibleInfo.Short.31=Obd
-BibleInfo.Alt.31=
-BibleInfo.Full.32=Jonah
-BibleInfo.Short.32=Jon
-BibleInfo.Alt.32=jnh
-BibleInfo.Full.33=Micah
-BibleInfo.Short.33=Mic
-BibleInfo.Alt.33=
-BibleInfo.Full.34=Nahum
-BibleInfo.Short.34=Nah
-BibleInfo.Alt.34=
-BibleInfo.Full.35=Habakuk
-BibleInfo.Short.35=Hab
-BibleInfo.Alt.35=
-BibleInfo.Full.36=Zephaniah
-BibleInfo.Short.36=Zep
-BibleInfo.Alt.36=
-BibleInfo.Full.37=Haggai
-BibleInfo.Short.37=Hag
-BibleInfo.Alt.37=
-BibleInfo.Full.38=Zechariah
-BibleInfo.Short.38=Zec
-BibleInfo.Alt.38=
-BibleInfo.Full.39=Malachi
-BibleInfo.Short.39=Mal
-BibleInfo.Alt.39=
-BibleInfo.Full.40=Matthew
-BibleInfo.Short.40=Mat
-BibleInfo.Alt.40=mt
-BibleInfo.Full.41=Mark
-BibleInfo.Short.41=Mar
-BibleInfo.Alt.41=mk,mrk
-BibleInfo.Full.42=Luke
-BibleInfo.Short.42=Luk
-BibleInfo.Alt.42=lk
-BibleInfo.Full.43=John
-BibleInfo.Short.43=Joh
-BibleInfo.Alt.43=jn,jhn
-BibleInfo.Full.44=Acts
-BibleInfo.Short.44=Act
-BibleInfo.Alt.44=
-BibleInfo.Full.45=Romans
-BibleInfo.Short.45=Rom
-BibleInfo.Alt.45=
-BibleInfo.Full.46=1 Corinthians
-BibleInfo.Short.46=1Cor
-BibleInfo.Alt.46=
-BibleInfo.Full.47=2 Corinthians
-BibleInfo.Short.47=2Cor
-BibleInfo.Alt.47=
-BibleInfo.Full.48=Galatians
-BibleInfo.Short.48=Gal
-BibleInfo.Alt.48=
-BibleInfo.Full.49=Ephesians
-BibleInfo.Short.49=Eph
-BibleInfo.Alt.49=
-BibleInfo.Full.50=Philippians
-BibleInfo.Short.50=Phili
-BibleInfo.Alt.50=php
-BibleInfo.Full.51=Colossians
-BibleInfo.Short.51=Col
-BibleInfo.Alt.51=
-BibleInfo.Full.52=1 Thessalonians
-BibleInfo.Short.52=1Th
-BibleInfo.Alt.52=
-BibleInfo.Full.53=2 Thessalonians
-BibleInfo.Short.53=2Th
-BibleInfo.Alt.53=
-BibleInfo.Full.54=1 Timothy
-BibleInfo.Short.54=1Ti
-BibleInfo.Alt.54=1tm
-BibleInfo.Full.55=2 Timothy
-BibleInfo.Short.55=2Ti
-BibleInfo.Alt.55=2tm
-BibleInfo.Full.56=Titus
-BibleInfo.Short.56=Tit
-BibleInfo.Alt.56=
-BibleInfo.Full.57=Philemon
-BibleInfo.Short.57=Phile
-BibleInfo.Alt.57=phm
-BibleInfo.Full.58=Hebrews
-BibleInfo.Short.58=Heb
-BibleInfo.Alt.58=
-BibleInfo.Full.59=James
-BibleInfo.Short.59=Jam
-BibleInfo.Alt.59=jas
-BibleInfo.Full.60=1 Peter
-BibleInfo.Short.60=1Pe
-BibleInfo.Alt.60=1pt
-BibleInfo.Full.61=2 Peter
-BibleInfo.Short.61=2Pe
-BibleInfo.Alt.61=2pt
-BibleInfo.Full.62=1 John
-BibleInfo.Short.62=1Jo
-BibleInfo.Alt.62=1jn,1jhn
-BibleInfo.Full.63=2 John
-BibleInfo.Short.63=2Jo
-BibleInfo.Alt.63=2jn,2jhn
-BibleInfo.Full.64=3 John
-BibleInfo.Short.64=3Jo
-BibleInfo.Alt.64=3jn,3jhn
-BibleInfo.Full.65=Jude
-BibleInfo.Short.65=Jude
-BibleInfo.Alt.65=jud
-BibleInfo.Full.66=Revelation of John
-BibleInfo.Short.66=Rev
-BibleInfo.Alt.66=Rv
-BibleInfo.Sections.1=Pentateuch
-BibleInfo.Sections.2=History
-BibleInfo.Sections.3=Poetry
-BibleInfo.Sections.4=MajorProphets
-BibleInfo.Sections.5=MinorProphets
-BibleInfo.Sections.6=Gospels And Acts
-BibleInfo.Sections.7=Letters
-BibleInfo.Sections.8=Revelation
+Full.1=Genesis
+Short.1=Gen
+Alt.1=
+Full.2=Exodus
+Short.2=Exo
+Alt.2=
+Full.3=Leviticus
+Short.3=Lev
+Alt.3=
+Full.4=Numbers
+Short.4=Num
+Alt.4=
+Full.5=Deuteronomy
+Short.5=Deu
+Alt.5=dt
+Full.6=Joshua
+Short.6=Jos
+Alt.6=
+Full.7=Judges
+Short.7=Judg
+Alt.7=jdg
+Full.8=Ruth
+Short.8=Rut
+Alt.8=rth
+Full.9=1 Samuel
+Short.9=1Sa
+Alt.9=
+Full.10=2 Samuel
+Short.10=2Sa
+Alt.10=
+Full.11=1 Kings
+Short.11=1Ki
+Alt.11=
+Full.12=2 Kings
+Short.12=2Ki
+Alt.12=
+Full.13=1 Chronicles
+Short.13=1Ch
+Alt.13=
+Full.14=2 Chronicles
+Short.14=2Ch
+Alt.14=
+Full.15=Ezra
+Short.15=Ezr
+Alt.15=
+Full.16=Nehemiah
+Short.16=Neh
+Alt.16=
+Full.17=Esther
+Short.17=Est
+Alt.17=
+Full.18=Job
+Short.18=Job
+Alt.18=
+Full.19=Psalms
+Short.19=Psa
+Alt.19=pss
+Full.20=Proverbs
+Short.20=Pro
+Alt.20=
+Full.21=Ecclesiastes
+Short.21=Ecc
+Alt.21=qoh
+Full.22=Song of Solomon
+Short.22=Song
+Alt.22=ss,canticle,can
+Full.23=Isaiah
+Short.23=Isa
+Alt.23=
+Full.24=Jeremiah
+Short.24=Jer
+Alt.24=
+Full.25=Lamentations
+Short.25=Lam
+Alt.25=
+Full.26=Ezekiel
+Short.26=Eze
+Alt.26=
+Full.27=Daniel
+Short.27=Dan
+Alt.27=
+Full.28=Hosea
+Short.28=Hos
+Alt.28=
+Full.29=Joel
+Short.29=Joe
+Alt.29=
+Full.30=Amos
+Short.30=Amo
+Alt.30=
+Full.31=Obadiah
+Short.31=Obd
+Alt.31=
+Full.32=Jonah
+Short.32=Jon
+Alt.32=jnh
+Full.33=Micah
+Short.33=Mic
+Alt.33=
+Full.34=Nahum
+Short.34=Nah
+Alt.34=
+Full.35=Habakuk
+Short.35=Hab
+Alt.35=
+Full.36=Zephaniah
+Short.36=Zep
+Alt.36=
+Full.37=Haggai
+Short.37=Hag
+Alt.37=
+Full.38=Zechariah
+Short.38=Zec
+Alt.38=
+Full.39=Malachi
+Short.39=Mal
+Alt.39=
+Full.40=Matthew
+Short.40=Mat
+Alt.40=mt
+Full.41=Mark
+Short.41=Mar
+Alt.41=mk,mrk
+Full.42=Luke
+Short.42=Luk
+Alt.42=lk
+Full.43=John
+Short.43=Joh
+Alt.43=jn,jhn
+Full.44=Acts
+Short.44=Act
+Alt.44=
+Full.45=Romans
+Short.45=Rom
+Alt.45=
+Full.46=1 Corinthians
+Short.46=1Cor
+Alt.46=
+Full.47=2 Corinthians
+Short.47=2Cor
+Alt.47=
+Full.48=Galatians
+Short.48=Gal
+Alt.48=
+Full.49=Ephesians
+Short.49=Eph
+Alt.49=
+Full.50=Philippians
+Short.50=Phili
+Alt.50=php
+Full.51=Colossians
+Short.51=Col
+Alt.51=
+Full.52=1 Thessalonians
+Short.52=1Th
+Alt.52=
+Full.53=2 Thessalonians
+Short.53=2Th
+Alt.53=
+Full.54=1 Timothy
+Short.54=1Ti
+Alt.54=1tm
+Full.55=2 Timothy
+Short.55=2Ti
+Alt.55=2tm
+Full.56=Titus
+Short.56=Tit
+Alt.56=
+Full.57=Philemon
+Short.57=Phile
+Alt.57=phm
+Full.58=Hebrews
+Short.58=Heb
+Alt.58=
+Full.59=James
+Short.59=Jam
+Alt.59=jas
+Full.60=1 Peter
+Short.60=1Pe
+Alt.60=1pt
+Full.61=2 Peter
+Short.61=2Pe
+Alt.61=2pt
+Full.62=1 John
+Short.62=1Jo
+Alt.62=1jn,1jhn
+Full.63=2 John
+Short.63=2Jo
+Alt.63=2jn,2jhn
+Full.64=3 John
+Short.64=3Jo
+Alt.64=3jn,3jhn
+Full.65=Jude
+Short.65=Jude
+Alt.65=jud
+Full.66=Revelation of John
+Short.66=Rev
+Alt.66=Rv

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames_de.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames_de.properties	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames_de.properties	2006-10-05 02:07:23 UTC (rev 1143)
@@ -1,198 +1,198 @@
-BibleInfo.Full.1=1. Mose
-BibleInfo.Short.1=1Mo
-BibleInfo.Alt.1=
-BibleInfo.Full.2=2. Mose
-BibleInfo.Short.2=2Mo
-BibleInfo.Alt.2=
-BibleInfo.Full.3=3. Mose
-BibleInfo.Short.3=3Mo
-BibleInfo.Alt.3=
-BibleInfo.Full.4=4. Mose
-BibleInfo.Short.4=4Mo
-BibleInfo.Alt.4=
-BibleInfo.Full.5=5. Mose
-BibleInfo.Short.5=5Mo
-BibleInfo.Alt.5=
-BibleInfo.Full.6=Josua
-BibleInfo.Short.6=Jos
-BibleInfo.Alt.6=
-BibleInfo.Full.7=Richter
-BibleInfo.Short.7=Ri
-BibleInfo.Alt.7=
-BibleInfo.Full.8=Rut
-BibleInfo.Short.8=Rut
-BibleInfo.Alt.8=
-BibleInfo.Full.9=1. Samuel
-BibleInfo.Short.9=1Sam
-BibleInfo.Alt.9=
-BibleInfo.Full.10=2. Samuel
-BibleInfo.Short.10=2Sam
-BibleInfo.Alt.10=
-BibleInfo.Full.11=1. K\u00f6nige
-BibleInfo.Short.11=1K\u00f6n
-BibleInfo.Alt.11=
-BibleInfo.Full.12=2. K\u00f6nige
-BibleInfo.Short.12=2K\u00f6n
-BibleInfo.Alt.12=
-BibleInfo.Full.13=1. Chronik
-BibleInfo.Short.13=1Chr
-BibleInfo.Alt.13=
-BibleInfo.Full.14=2. Chronik
-BibleInfo.Short.14=2Chr
-BibleInfo.Alt.14=
-BibleInfo.Full.15=Esra
-BibleInfo.Short.15=Esra
-BibleInfo.Alt.15=
-BibleInfo.Full.16=Nehemia
-BibleInfo.Short.16=Neh
-BibleInfo.Alt.16=
-BibleInfo.Full.17=Ester
-BibleInfo.Short.17=Est
-BibleInfo.Alt.17=
-BibleInfo.Full.18=Hiob
-BibleInfo.Short.18=Hiob
-BibleInfo.Alt.18=
-BibleInfo.Full.19=Psalmen
-BibleInfo.Short.19=Ps
-BibleInfo.Alt.19=
-BibleInfo.Full.20=Spr\u00fcche
-BibleInfo.Short.20=Spr
-BibleInfo.Alt.20=
-BibleInfo.Full.21=Prediger
-BibleInfo.Short.21=Pred
-BibleInfo.Alt.21=
-BibleInfo.Full.22=Hoheslied
-BibleInfo.Short.22=Hld
-BibleInfo.Alt.22=
-BibleInfo.Full.23=Jesaja
-BibleInfo.Short.23=Jes
-BibleInfo.Alt.23=
-BibleInfo.Full.24=Jeremia
-BibleInfo.Short.24=Jer
-BibleInfo.Alt.24=
-BibleInfo.Full.25=Klagelieder
-BibleInfo.Short.25=Klgl
-BibleInfo.Alt.25=
-BibleInfo.Full.26=Hesekiel
-BibleInfo.Short.26=Hes
-BibleInfo.Alt.26=
-BibleInfo.Full.27=Daniel
-BibleInfo.Short.27=Dan
-BibleInfo.Alt.27=
-BibleInfo.Full.28=Hosea
-BibleInfo.Short.28=Hos
-BibleInfo.Alt.28=
-BibleInfo.Full.29=Joel
-BibleInfo.Short.29=Joel
-BibleInfo.Alt.29=
-BibleInfo.Full.30=Amos
-BibleInfo.Short.30=Am
-BibleInfo.Alt.30=
-BibleInfo.Full.31=Obadja
-BibleInfo.Short.31=Obd
-BibleInfo.Alt.31=
-BibleInfo.Full.32=Jona
-BibleInfo.Short.32=Jona
-BibleInfo.Alt.32=
-BibleInfo.Full.33=Micha
-BibleInfo.Short.33=Mi
-BibleInfo.Alt.33=
-BibleInfo.Full.34=Nahum
-BibleInfo.Short.34=Nah
-BibleInfo.Alt.34=
-BibleInfo.Full.35=Habakuk
-BibleInfo.Short.35=Hab
-BibleInfo.Alt.35=
-BibleInfo.Full.36=Zefanja
-BibleInfo.Short.36=Zef
-BibleInfo.Alt.36=
-BibleInfo.Full.37=Haggai
-BibleInfo.Short.37=Hag
-BibleInfo.Alt.37=
-BibleInfo.Full.38=Sacharja
-BibleInfo.Short.38=Sach
-BibleInfo.Alt.38=
-BibleInfo.Full.39=Maleachi
-BibleInfo.Short.39=Mal
-BibleInfo.Alt.39=
-BibleInfo.Full.40=Matth\u00e4us
-BibleInfo.Short.40=Mt
-BibleInfo.Alt.40=
-BibleInfo.Full.41=Markus
-BibleInfo.Short.41=Mk
-BibleInfo.Alt.41=
-BibleInfo.Full.42=Lukas
-BibleInfo.Short.42=Lk
-BibleInfo.Alt.42=
-BibleInfo.Full.43=Johannes
-BibleInfo.Short.43=Joh
-BibleInfo.Alt.43=
-BibleInfo.Full.44=Apostelgeschichte
-BibleInfo.Short.44=Apg
-BibleInfo.Alt.44=
-BibleInfo.Full.45=R\u00f6mer
-BibleInfo.Short.45=R\u00f6m
-BibleInfo.Alt.45=
-BibleInfo.Full.46=1. Korinther
-BibleInfo.Short.46=1Kor
-BibleInfo.Alt.46=
-BibleInfo.Full.47=2. Korinther
-BibleInfo.Short.47=2Kor
-BibleInfo.Alt.47=
-BibleInfo.Full.48=Galater
-BibleInfo.Short.48=Gal
-BibleInfo.Alt.48=
-BibleInfo.Full.49=Epheser
-BibleInfo.Short.49=Eph
-BibleInfo.Alt.49=
-BibleInfo.Full.50=Philipper
-BibleInfo.Short.50=Phil
-BibleInfo.Alt.50=
-BibleInfo.Full.51=Kolosser
-BibleInfo.Short.51=Kol
-BibleInfo.Alt.51=
-BibleInfo.Full.52=1. Thessalonicher
-BibleInfo.Short.52=1Thess
-BibleInfo.Alt.52=
-BibleInfo.Full.53=2. Thessalonicher
-BibleInfo.Short.53=2Thess
-BibleInfo.Alt.53=
-BibleInfo.Full.54=1. Timotheus
-BibleInfo.Short.54=1Tim
-BibleInfo.Alt.54=
-BibleInfo.Full.55=2. Timotheus
-BibleInfo.Short.55=2Tim
-BibleInfo.Alt.55=
-BibleInfo.Full.56=Titus
-BibleInfo.Short.56=Tit
-BibleInfo.Alt.56=
-BibleInfo.Full.57=Philemon
-BibleInfo.Short.57=Phlm
-BibleInfo.Alt.57=
-BibleInfo.Full.58=Hebr\u00e4er
-BibleInfo.Short.58=Heb
-BibleInfo.Alt.58=
-BibleInfo.Full.59=Jakobus
-BibleInfo.Short.59=Jak
-BibleInfo.Alt.59=
-BibleInfo.Full.60=1. Petrus
-BibleInfo.Short.60=1Pet
-BibleInfo.Alt.60=
-BibleInfo.Full.61=2. Petrus
-BibleInfo.Short.61=2Pet
-BibleInfo.Alt.61=
-BibleInfo.Full.62=1. Johannes
-BibleInfo.Short.62=1Joh
-BibleInfo.Alt.62=
-BibleInfo.Full.63=2. Johannes
-BibleInfo.Short.63=2Joh
-BibleInfo.Alt.63=
-BibleInfo.Full.64=3. Johannes
-BibleInfo.Short.64=3Joh
-BibleInfo.Alt.64=
-BibleInfo.Full.65=Judas
-BibleInfo.Short.65=Jud
-BibleInfo.Alt.65=
-BibleInfo.Full.66=Offenbarung
-BibleInfo.Short.66=Offb
-BibleInfo.Alt.66=Apc
+Full.1=1. Mose
+Short.1=1Mo
+Alt.1=
+Full.2=2. Mose
+Short.2=2Mo
+Alt.2=
+Full.3=3. Mose
+Short.3=3Mo
+Alt.3=
+Full.4=4. Mose
+Short.4=4Mo
+Alt.4=
+Full.5=5. Mose
+Short.5=5Mo
+Alt.5=
+Full.6=Josua
+Short.6=Jos
+Alt.6=
+Full.7=Richter
+Short.7=Ri
+Alt.7=
+Full.8=Rut
+Short.8=Rut
+Alt.8=
+Full.9=1. Samuel
+Short.9=1Sam
+Alt.9=
+Full.10=2. Samuel
+Short.10=2Sam
+Alt.10=
+Full.11=1. K\u00f6nige
+Short.11=1K\u00f6n
+Alt.11=
+Full.12=2. K\u00f6nige
+Short.12=2K\u00f6n
+Alt.12=
+Full.13=1. Chronik
+Short.13=1Chr
+Alt.13=
+Full.14=2. Chronik
+Short.14=2Chr
+Alt.14=
+Full.15=Esra
+Short.15=Esra
+Alt.15=
+Full.16=Nehemia
+Short.16=Neh
+Alt.16=
+Full.17=Ester
+Short.17=Est
+Alt.17=
+Full.18=Hiob
+Short.18=Hiob
+Alt.18=
+Full.19=Psalmen
+Short.19=Ps
+Alt.19=
+Full.20=Spr\u00fcche
+Short.20=Spr
+Alt.20=
+Full.21=Prediger
+Short.21=Pred
+Alt.21=
+Full.22=Hoheslied
+Short.22=Hld
+Alt.22=
+Full.23=Jesaja
+Short.23=Jes
+Alt.23=
+Full.24=Jeremia
+Short.24=Jer
+Alt.24=
+Full.25=Klagelieder
+Short.25=Klgl
+Alt.25=
+Full.26=Hesekiel
+Short.26=Hes
+Alt.26=
+Full.27=Daniel
+Short.27=Dan
+Alt.27=
+Full.28=Hosea
+Short.28=Hos
+Alt.28=
+Full.29=Joel
+Short.29=Joel
+Alt.29=
+Full.30=Amos
+Short.30=Am
+Alt.30=
+Full.31=Obadja
+Short.31=Obd
+Alt.31=
+Full.32=Jona
+Short.32=Jona
+Alt.32=
+Full.33=Micha
+Short.33=Mi
+Alt.33=
+Full.34=Nahum
+Short.34=Nah
+Alt.34=
+Full.35=Habakuk
+Short.35=Hab
+Alt.35=
+Full.36=Zefanja
+Short.36=Zef
+Alt.36=
+Full.37=Haggai
+Short.37=Hag
+Alt.37=
+Full.38=Sacharja
+Short.38=Sach
+Alt.38=
+Full.39=Maleachi
+Short.39=Mal
+Alt.39=
+Full.40=Matth\u00e4us
+Short.40=Mt
+Alt.40=
+Full.41=Markus
+Short.41=Mk
+Alt.41=
+Full.42=Lukas
+Short.42=Lk
+Alt.42=
+Full.43=Johannes
+Short.43=Joh
+Alt.43=
+Full.44=Apostelgeschichte
+Short.44=Apg
+Alt.44=
+Full.45=R\u00f6mer
+Short.45=R\u00f6m
+Alt.45=
+Full.46=1. Korinther
+Short.46=1Kor
+Alt.46=
+Full.47=2. Korinther
+Short.47=2Kor
+Alt.47=
+Full.48=Galater
+Short.48=Gal
+Alt.48=
+Full.49=Epheser
+Short.49=Eph
+Alt.49=
+Full.50=Philipper
+Short.50=Phil
+Alt.50=
+Full.51=Kolosser
+Short.51=Kol
+Alt.51=
+Full.52=1. Thessalonicher
+Short.52=1Thess
+Alt.52=
+Full.53=2. Thessalonicher
+Short.53=2Thess
+Alt.53=
+Full.54=1. Timotheus
+Short.54=1Tim
+Alt.54=
+Full.55=2. Timotheus
+Short.55=2Tim
+Alt.55=
+Full.56=Titus
+Short.56=Tit
+Alt.56=
+Full.57=Philemon
+Short.57=Phlm
+Alt.57=
+Full.58=Hebr\u00e4er
+Short.58=Heb
+Alt.58=
+Full.59=Jakobus
+Short.59=Jak
+Alt.59=
+Full.60=1. Petrus
+Short.60=1Pet
+Alt.60=
+Full.61=2. Petrus
+Short.61=2Pet
+Alt.61=
+Full.62=1. Johannes
+Short.62=1Joh
+Alt.62=
+Full.63=2. Johannes
+Short.63=2Joh
+Alt.63=
+Full.64=3. Johannes
+Short.64=3Joh
+Alt.64=
+Full.65=Judas
+Short.65=Jud
+Alt.65=
+Full.66=Offenbarung
+Short.66=Offb
+Alt.66=Apc

Added: trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.properties	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.properties	2006-10-05 02:07:23 UTC (rev 1143)
@@ -0,0 +1,16 @@
+# The naming convention for the keys in the file is ClassName.MessageName
+# Where ClassName is the name of the class using the property.
+# When the resource is used by more than one class it should be the one
+# that the resource is most closely associated.
+# The MessageName should be mixed case, with a leading capital.
+# It should have no spaces or other punctuation (e.g. _, -, ', ...)
+
+BibleInfo.Book=Book must be between 1 and 66. (Given {0,number,integer}).
+BibleInfo.Section=Section must be between 1 and 8. (Given {0,number,integer}).
+BibleInfo.Number=The string "{0}" can''t be a book, because it is a number.
+BibleInfo.Find=Can not understand "{0}" as a book.
+BibleInfo.BookChap=Book must be between 1 and 66. (Given {0,number,integer}), and Chapter must be valid for this book. (Given {1,number,integer}).
+BibleInfo.Ordinal=Must be 3 parts to the reference.
+BibleInfo.Decode=Ordinal must be between 1 and {0,number,integer}. (Given {1,number,integer}).
+BibleInfo.Chapter=Chapter should be between 1 and {0,number,integer} for {1} (given {2,number,integer}).
+BibleInfo.Verse=Verse should be between 1 and {0,number,integer} for {1} {2,number,integer} (given {3,number,integer})

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -118,19 +118,16 @@
     private static void initialize()
     {
         int booksInBible = BibleInfo.booksInBible();
-        if (osisBooks == null)
-        {
-            osisBooks = new String[booksInBible];
-            osisMap   = new HashMap(booksInBible);
+        osisBooks = new String[booksInBible];
+        osisMap = new HashMap(booksInBible);
 
-            // Get all the OSIS standard book names
-            ResourceBundle resources = ResourceBundle.getBundle(OSIS_PROPERTIES, Locale.getDefault(), new CWClassLoader(OSISNames.class));
+        // Get all the OSIS standard book names
+        ResourceBundle resources = ResourceBundle.getBundle(OSISNames.class.getName(), Locale.getDefault(), new CWClassLoader(OSISNames.class));
 
-            for (int i = 0; i < osisBooks.length; i++)
-            {
-                osisBooks[i] = getString(resources, OSIS_KEY + (i + 1));
-                osisMap.put(normalize(osisBooks[i]), new Integer(i + 1));
-            }
+        for (int i = 0; i < osisBooks.length; i++ )
+        {
+            osisBooks[i] = getString(resources, OSIS_KEY + (i + 1));
+            osisMap.put(normalize(osisBooks[i]), new Integer(i + 1));
         }
     }
 
@@ -150,20 +147,19 @@
         return null;
     }
 
+    /** remove spaces and punctuation in Bible Names */
+    private static Pattern      normPattern    = Pattern.compile("[. ]"); //$NON-NLS-1$
+
     /**
      * A singleton used to do initialization. Could be used to change static methods to non-static
      */
     protected static final OSISNames instance = new OSISNames();
 
-    private static final String OSIS_KEY = "BibleNames.OSIS."; //$NON-NLS-1$
-    private static final String OSIS_PROPERTIES = "OSISNames"; //$NON-NLS-1$
+    private static final String OSIS_KEY = "OSIS."; //$NON-NLS-1$
 
     /** Standard OSIS names for the book of the Bible, in mixed case */
     private static String[] osisBooks;
 
     /** Standard OSIS names for the book of the Bible, in lowercase, generated at runtime  */
     private static Map osisMap;
-
-    private static Pattern normPattern = Pattern.compile("[. ]"); //$NON-NLS-1$
-
 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.properties	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.properties	2006-10-05 02:07:23 UTC (rev 1143)
@@ -1,68 +1,68 @@
 # These book names do not need to be internationalized.
 # They are the internal standard OSIS names for the books of the Bible.
-BibleInfo.OSIS.1=Gen
-BibleInfo.OSIS.2=Exod
-BibleInfo.OSIS.3=Lev
-BibleInfo.OSIS.4=Num
-BibleInfo.OSIS.5=Deut
-BibleInfo.OSIS.6=Josh
-BibleInfo.OSIS.7=Judg
-BibleInfo.OSIS.8=Ruth
-BibleInfo.OSIS.9=1Sam
-BibleInfo.OSIS.10=2Sam
-BibleInfo.OSIS.11=1Kgs
-BibleInfo.OSIS.12=2Kgs
-BibleInfo.OSIS.13=1Chr
-BibleInfo.OSIS.14=2Chr
-BibleInfo.OSIS.15=Ezra
-BibleInfo.OSIS.16=Neh
-BibleInfo.OSIS.17=Esth
-BibleInfo.OSIS.18=Job
-BibleInfo.OSIS.19=Ps
-BibleInfo.OSIS.20=Prov
-BibleInfo.OSIS.21=Eccl
-BibleInfo.OSIS.22=Song
-BibleInfo.OSIS.23=Isa
-BibleInfo.OSIS.24=Jer
-BibleInfo.OSIS.25=Lam
-BibleInfo.OSIS.26=Ezek
-BibleInfo.OSIS.27=Dan
-BibleInfo.OSIS.28=Hos
-BibleInfo.OSIS.29=Joel
-BibleInfo.OSIS.30=Amos
-BibleInfo.OSIS.31=Obad
-BibleInfo.OSIS.32=Jonah
-BibleInfo.OSIS.33=Mic
-BibleInfo.OSIS.34=Nah
-BibleInfo.OSIS.35=Hab
-BibleInfo.OSIS.36=Zeph
-BibleInfo.OSIS.37=Hag
-BibleInfo.OSIS.38=Zech
-BibleInfo.OSIS.39=Mal
-BibleInfo.OSIS.40=Matt
-BibleInfo.OSIS.41=Mark
-BibleInfo.OSIS.42=Luke
-BibleInfo.OSIS.43=John
-BibleInfo.OSIS.44=Acts
-BibleInfo.OSIS.45=Rom
-BibleInfo.OSIS.46=1Cor
-BibleInfo.OSIS.47=2Cor
-BibleInfo.OSIS.48=Gal
-BibleInfo.OSIS.49=Eph
-BibleInfo.OSIS.50=Phil
-BibleInfo.OSIS.51=Col
-BibleInfo.OSIS.52=1Thess
-BibleInfo.OSIS.53=2Thess
-BibleInfo.OSIS.54=1Tim
-BibleInfo.OSIS.55=2Tim
-BibleInfo.OSIS.56=Titus
-BibleInfo.OSIS.57=Phlm
-BibleInfo.OSIS.58=Heb
-BibleInfo.OSIS.59=Jas
-BibleInfo.OSIS.60=1Pet
-BibleInfo.OSIS.61=2Pet
-BibleInfo.OSIS.62=1John
-BibleInfo.OSIS.63=2John
-BibleInfo.OSIS.64=3John
-BibleInfo.OSIS.65=Jude
-BibleInfo.OSIS.66=Rev
+OSIS.1=Gen
+OSIS.2=Exod
+OSIS.3=Lev
+OSIS.4=Num
+OSIS.5=Deut
+OSIS.6=Josh
+OSIS.7=Judg
+OSIS.8=Ruth
+OSIS.9=1Sam
+OSIS.10=2Sam
+OSIS.11=1Kgs
+OSIS.12=2Kgs
+OSIS.13=1Chr
+OSIS.14=2Chr
+OSIS.15=Ezra
+OSIS.16=Neh
+OSIS.17=Esth
+OSIS.18=Job
+OSIS.19=Ps
+OSIS.20=Prov
+OSIS.21=Eccl
+OSIS.22=Song
+OSIS.23=Isa
+OSIS.24=Jer
+OSIS.25=Lam
+OSIS.26=Ezek
+OSIS.27=Dan
+OSIS.28=Hos
+OSIS.29=Joel
+OSIS.30=Amos
+OSIS.31=Obad
+OSIS.32=Jonah
+OSIS.33=Mic
+OSIS.34=Nah
+OSIS.35=Hab
+OSIS.36=Zeph
+OSIS.37=Hag
+OSIS.38=Zech
+OSIS.39=Mal
+OSIS.40=Matt
+OSIS.41=Mark
+OSIS.42=Luke
+OSIS.43=John
+OSIS.44=Acts
+OSIS.45=Rom
+OSIS.46=1Cor
+OSIS.47=2Cor
+OSIS.48=Gal
+OSIS.49=Eph
+OSIS.50=Phil
+OSIS.51=Col
+OSIS.52=1Thess
+OSIS.53=2Thess
+OSIS.54=1Tim
+OSIS.55=2Tim
+OSIS.56=Titus
+OSIS.57=Phlm
+OSIS.58=Heb
+OSIS.59=Jas
+OSIS.60=1Pet
+OSIS.61=2Pet
+OSIS.62=1John
+OSIS.63=2John
+OSIS.64=3John
+OSIS.65=Jude
+OSIS.66=Rev

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -245,7 +245,7 @@
         return null;
     }
 
-    private static final String SECTION_KEY = "BibleNames.Sections."; //$NON-NLS-1$
+    private static final String SECTION_KEY = "Sections."; //$NON-NLS-1$
 
     /**
      * Handy section finder. There is a bit of moderately bad programming

Added: trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.properties	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.properties	2006-10-05 02:07:23 UTC (rev 1143)
@@ -0,0 +1,8 @@
+Sections.1=Pentateuch
+Sections.2=History
+Sections.3=Poetry
+Sections.4=Major Prophets
+Sections.5=Minor Prophets
+Sections.6=Gospels And Acts
+Sections.7=Letters
+Sections.8=Revelation
\ No newline at end of file

Added: trunk/jsword/src/test/java/org/crosswire/jsword/passage/AccuracyTypeTest.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/jsword/passage/AccuracyTypeTest.java	2006-10-01 03:31:40 UTC (rev 1142)
+++ trunk/jsword/src/test/java/org/crosswire/jsword/passage/AccuracyTypeTest.java	2006-10-05 02:07:23 UTC (rev 1143)
@@ -0,0 +1,76 @@
+package org.crosswire.jsword.passage;
+
+import junit.framework.TestCase;
+
+public class AccuracyTypeTest extends TestCase
+{
+
+    public AccuracyTypeTest(String s)
+    {
+        super(s);
+    }
+
+    public void testFromText_onePartInvalidBook() throws Exception
+    {
+        try
+        {
+            AccuracyType.fromText("10", new String[] {"10"}, null, null); //$NON-NLS-1$//$NON-NLS-2$
+        }
+        catch (NoSuchVerseException nsve)
+        {
+            // expected
+        }
+        catch (ArrayIndexOutOfBoundsException aioobe)
+        {
+            fail("ArrayIndexOutOfBoundsException caught, expecting NoSuchVerseException"); //$NON-NLS-1$
+        }
+
+    }
+
+    public void testFromText_TooManyParts()
+    {
+        boolean caught = false;
+        try
+        {
+            AccuracyType.fromText("1:2:3:4", new String[] {"1", "2", "3", "4"}, null, null); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+        }
+        catch (NoSuchVerseException nsve)
+        {
+            NoSuchVerseException correctException = new NoSuchVerseException(Msg.VERSE_PARTS, new Object[] {"1:2:3:4, 1, 2, 3, 4"});  //$NON-NLS-1$
+            assertEquals("Unexpected exception message", correctException.getMessage(), nsve.getMessage()); //$NON-NLS-1$
+            caught = true;
+        }
+        catch (ArrayIndexOutOfBoundsException aioobe)
+        {
+            fail("ArrayIndexOutOfBoundsException caught, expecting NoSuchVerseException"); //$NON-NLS-1$
+        }
+        
+        if (!caught){
+            fail("Expected fromText to throw an exception when passed too many parts"); //$NON-NLS-1$
+        }
+    }
+
+    public void testFromText_ThreePartsInvalidBook()
+    {
+        boolean caught = false;
+        try
+        {
+            AccuracyType.fromText("-1:2:3", new String[] {"-1", "2", "3"}, null, null); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+        }
+        catch (NoSuchVerseException nsve)
+        {
+            NoSuchVerseException correctException = new NoSuchVerseException(Msg.VERSE_PARTS, new Object[] {"-1:2:3, -1, 2, 3"});  //$NON-NLS-1$
+            assertEquals("Unexpected exception message", correctException.getMessage(), nsve.getMessage()); //$NON-NLS-1$
+            caught = true;
+        }
+        catch (ArrayIndexOutOfBoundsException aioobe)
+        {
+            fail("ArrayIndexOutOfBoundsException caught, expecting NoSuchVerseException"); //$NON-NLS-1$
+        }
+
+        if (!caught){
+            fail("Expected fromText to throw an exception when passed three parts with an invalid book"); //$NON-NLS-1$
+        }
+}
+    
+}




More information about the jsword-svn mailing list