[Tynstep-svn] r262 - in trunk/step: step-core/src/main/java/com/tyndalehouse/step/core/data/create step-core/src/main/java/com/tyndalehouse/step/core/data/entities step-core/src/main/java/com/tyndalehouse/step/core/data/entities/aggregations step-core/src/main/java/com/tyndalehouse/step/core/models step-core/src/main/java/com/tyndalehouse/step/core/service step-core/src/main/java/com/tyndalehouse/step/core/service/impl step-core/src/test/java/com/tyndalehouse/step/core/data/create step-core/src/test/java/com/tyndalehouse/step/core/service/impl step-web/src/main/java/com/tyndalehouse/step/rest/controllers step-web/src/main/java/com/tyndalehouse/step/rest/framework step-web/src/main/java/com/tyndalehouse/step/rest/wrappers step-web/src/main/webapp step-web/src/main/webapp/css step-web/src/main/webapp/js step-web/src/main/webapp/js_mobile step-web/src/main/webapp/libs

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Thu Apr 26 06:30:01 MST 2012


Author: ChrisBurrell
Date: 2012-04-26 06:30:01 -0700 (Thu, 26 Apr 2012)
New Revision: 262

Added:
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/OsisWrapper.java
Removed:
   trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/wrappers/HtmlWrapper.java
   trunk/step/step-web/src/main/webapp/libs/bubble/
   trunk/step/step-web/src/main/webapp/libs/jit/
Modified:
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/GeographyModuleLoader.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/TimelineModuleLoader.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/StrongDefinition.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/aggregations/TimelineEventsAndDate.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/BibleInformationService.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/GeographyServiceImpl.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImpl.java
   trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/data/create/DataTest.java
   trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java
   trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImplTest.java
   trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/BibleController.java
   trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/framework/FrontController.java
   trunk/step/step-web/src/main/webapp/css/passage.css
   trunk/step/step-web/src/main/webapp/index.html
   trunk/step/step-web/src/main/webapp/js/bookmark.js
   trunk/step/step-web/src/main/webapp/js/init.js
   trunk/step/step-web/src/main/webapp/js/interlinear_popup.js
   trunk/step/step-web/src/main/webapp/js/lexicon_definition.js
   trunk/step/step-web/src/main/webapp/js/login.js
   trunk/step/step-web/src/main/webapp/js/passage.js
   trunk/step/step-web/src/main/webapp/js/setup.js
   trunk/step/step-web/src/main/webapp/js/timeline.js
   trunk/step/step-web/src/main/webapp/js/toolbar_menu.js
   trunk/step/step-web/src/main/webapp/js/top_menu.js
   trunk/step/step-web/src/main/webapp/js/ui_hooks.js
   trunk/step/step-web/src/main/webapp/js_mobile/init.js
Log:


Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/GeographyModuleLoader.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/GeographyModuleLoader.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/GeographyModuleLoader.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,6 +32,7 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.data.create;
 
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.GEO_PLACE;
 import static org.apache.commons.lang.StringUtils.isEmpty;
 import static org.apache.commons.lang.StringUtils.isNotEmpty;
 
@@ -129,9 +130,8 @@
                 gp.setEsvName(geoFields[PLACE_NAME_FIELD]);
                 gp.setRoot(geoFields[ROOT_FIELD]);
                 setCoordinates(gp, geoFields[LATITUDE_FIELD], geoFields[LONGITUDE_FIELD]);
-                final List<ScriptureReference> passageReferences = this.jsword
-                        .getPassageReferences(geoFields[SCRIPTURE_FIELD].replace(',', ';').replace("Sng",
-                                "Song"));
+                final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(
+                        geoFields[SCRIPTURE_FIELD].replace(',', ';').replace("Sng", "Song"), GEO_PLACE);
 
                 gp.setReferences(passageReferences);
                 gp.setComment(geoFields[COMMENT_FIELD]);
@@ -177,6 +177,33 @@
             return;
         }
 
+        final String coordinateSuffix = getCoordinateFromString(coordinate, gp);
+        try {
+
+            if (isNotEmpty(coordinateSuffix)) {
+                final Double coordValue = Double.parseDouble(coordinateSuffix);
+                if (isLatitude) {
+                    gp.setLatitude(coordValue);
+                } else {
+                    gp.setLongitude(coordValue);
+                }
+            } else {
+                // set to unknown
+                gp.setPrecision(GeoPrecision.UNKNOWN);
+            }
+        } catch (final NumberFormatException e) {
+            LOG.error("Unable to parse number: " + coordinate, e);
+        }
+    }
+
+    /**
+     * Gets the right part of the string for further conversion into a decimal value
+     * 
+     * @param coordinate the coordinate string
+     * @param gp the geo place, in case we need to set the approximation
+     * @return the coordinate
+     */
+    private String getCoordinateFromString(final String coordinate, final GeoPlace gp) {
         // advance to first digit
         int ii = 0;
         final int coordLength = coordinate.length();
@@ -198,27 +225,10 @@
 
         if (jj <= ii) {
             // then we have only dodgy characters indicating unknown
-            gp.setPrecision(GeoPrecision.UNKNOWN);
-            return;
+            return null;
         }
 
-        try {
-            LOG.trace("Substring of [{}] and [{}]", ii, jj);
-            final String coordinateSuffix = coordinate.substring(ii, jj + 1);
-
-            if (isNotEmpty(coordinateSuffix)) {
-                final Double coordValue = Double.parseDouble(coordinateSuffix);
-                if (isLatitude) {
-                    gp.setLatitude(coordValue);
-                } else {
-                    gp.setLongitude(coordValue);
-                }
-            } else {
-                // set to unknown
-                gp.setPrecision(GeoPrecision.UNKNOWN);
-            }
-        } catch (final NumberFormatException e) {
-            LOG.error("Unable to parse number: " + coordinate, e);
-        }
+        LOG.trace("Substring of [{}] and [{}]", ii, jj);
+        return coordinate.substring(ii, jj + 1);
     }
 }

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/TimelineModuleLoader.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/TimelineModuleLoader.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/create/TimelineModuleLoader.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -33,6 +33,7 @@
 package com.tyndalehouse.step.core.data.create;
 
 import static com.tyndalehouse.step.core.data.common.PartialDate.parseDate;
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.TIMELINE_EVENT;
 import static com.tyndalehouse.step.core.utils.StepIOUtils.closeQuietly;
 
 import java.io.IOException;
@@ -127,8 +128,8 @@
 
                 }
                 // finally add any scripture reference required
-                final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(data
-                        .getData(ii, "Refs"));
+                final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(
+                        data.getData(ii, "Refs"), TIMELINE_EVENT);
 
                 event.setReferences(passageReferences);
 

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/StrongDefinition.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/StrongDefinition.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/StrongDefinition.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,6 +32,8 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.data.entities;
 
+import java.io.Serializable;
+
 import javax.persistence.Entity;
 
 import com.avaje.ebean.annotation.CacheStrategy;
@@ -44,12 +46,13 @@
  */
 @CacheStrategy(readOnly = true)
 @Entity
-public class StrongDefinition {
+public class StrongDefinition implements Serializable {
+    private static final long serialVersionUID = 1L;
     private String originalLanguage;
     private String transliteration;
     private String pronunciation;
     private String kjvDefinition;
-    private String strongs_derivation;
-    private String lexicon_summary;
+    private String strongsDerivation;
+    private String lexiconSummary;
 
 }

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/aggregations/TimelineEventsAndDate.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/aggregations/TimelineEventsAndDate.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/data/entities/aggregations/TimelineEventsAndDate.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,6 +32,7 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.data.entities.aggregations;
 
+import java.io.Serializable;
 import java.util.List;
 
 import javax.persistence.Entity;
@@ -47,7 +48,8 @@
  * 
  */
 @Entity
-public class TimelineEventsAndDate {
+public class TimelineEventsAndDate implements Serializable {
+    private static final long serialVersionUID = -7079914843690188557L;
     private List<TimelineEvent> events;
     private LocalDateTime dateTime;
 

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -43,12 +43,10 @@
  * 
  */
 public enum LookupOption {
-    // CHECKSTYLE:OFF TODO: change the values in the XSL file
     /**
      * Showing headings
      */
     HEADINGS("Headings", XslConversionType.DEFAULT, true),
-    // CHECKSTYLE:ON
     /**
      * Showing verse numbers
      */
@@ -66,12 +64,10 @@
 
     /** Morphology */
     MORPHOLOGY("Morph", XslConversionType.INTERLINEAR),
-    // CHECKSTYLE:OFF
     /**
      * Interlinears are available when Strongs are available.
      */
     INTERLINEAR("Interlinear", XslConversionType.INTERLINEAR),
-    // CHECKSTYLE:ON
     /**
      * Showing headings
      */

Copied: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/OsisWrapper.java (from rev 261, trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/wrappers/HtmlWrapper.java)
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/OsisWrapper.java	                        (rev 0)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/OsisWrapper.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2012, Directors of the Tyndale STEP Project
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met:
+ * 
+ * Redistributions of source code must retain the above copyright 
+ * notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright 
+ * notice, this list of conditions and the following disclaimer in 
+ * the documentation and/or other materials provided with the 
+ * distribution.
+ * Neither the name of the Tyndale House, Cambridge (www.TyndaleHouse.com)  
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ******************************************************************************/
+package com.tyndalehouse.step.core.models;
+
+/**
+ * A simple wrapper around a string for returning as a JSON-mapped object
+ * 
+ * @author Chris
+ * 
+ */
+public class OsisWrapper {
+    private final String value;
+    private final String reference;
+
+    /**
+     * the value to be wrapped
+     * 
+     * @param reference reference
+     * @param value the value to be wrapped around
+     */
+    public OsisWrapper(final String value, final String reference) {
+        this.value = value;
+        this.reference = reference;
+    }
+
+    /**
+     * @return the value to be returned
+     */
+    public String getValue() {
+        return this.value;
+    }
+
+    /**
+     * @return the reference
+     */
+    public String getReference() {
+        return this.reference;
+    }
+}

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/BibleInformationService.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/BibleInformationService.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/BibleInformationService.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -37,6 +37,7 @@
 import com.tyndalehouse.step.core.models.BibleVersion;
 import com.tyndalehouse.step.core.models.EnrichedLookupOption;
 import com.tyndalehouse.step.core.models.LookupOption;
+import com.tyndalehouse.step.core.models.OsisWrapper;
 
 /**
  * Interface to the service that gives information about the books of the bible, the different types of bible,
@@ -67,7 +68,7 @@
      * @param interlinearVersion version to use as the interlinear
      * @return the HTML string passed back for consumption
      */
-    String getPassageText(String version, String reference, List<LookupOption> lookupOptions,
+    OsisWrapper getPassageText(String version, String reference, List<LookupOption> lookupOptions,
             String interlinearVersion);
 
     /**

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -38,7 +38,9 @@
 import org.crosswire.jsword.book.BookCategory;
 
 import com.tyndalehouse.step.core.data.entities.ScriptureReference;
+import com.tyndalehouse.step.core.data.entities.reference.TargetType;
 import com.tyndalehouse.step.core.models.LookupOption;
+import com.tyndalehouse.step.core.models.OsisWrapper;
 
 /**
  * The service providing access to JSword. All JSword calls should preferably be placed in this service
@@ -56,7 +58,8 @@
      * @param interlinearVersion the version to add if there is an interlinear request, or blank if not
      * @return the OSIS text in an HTML form
      */
-    String getOsisText(String version, String reference, List<LookupOption> options, String interlinearVersion);
+    OsisWrapper getOsisText(String version, String reference, List<LookupOption> options,
+            String interlinearVersion);
 
     /**
      * returns the biblical text as xml dom
@@ -65,7 +68,7 @@
      * @param reference the reference to lookup
      * @return the OSIS text in an HTML form
      */
-    String getOsisText(String version, String reference);
+    OsisWrapper getOsisText(String version, String reference);
 
     /**
      * looks up any installed module
@@ -127,9 +130,10 @@
     /**
      * 
      * @param references a list of references
+     * @param targetType TODO
      * @return the list of references strongly-typed
      */
-    List<ScriptureReference> getPassageReferences(final String references);
+    List<ScriptureReference> getPassageReferences(final String references, TargetType targetType);
 
     /**
      * returns a list of matching names or references in a particular book

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -50,6 +50,7 @@
 import com.tyndalehouse.step.core.models.BibleVersion;
 import com.tyndalehouse.step.core.models.EnrichedLookupOption;
 import com.tyndalehouse.step.core.models.LookupOption;
+import com.tyndalehouse.step.core.models.OsisWrapper;
 import com.tyndalehouse.step.core.service.BibleInformationService;
 import com.tyndalehouse.step.core.service.JSwordService;
 
@@ -85,7 +86,7 @@
     }
 
     @Override
-    public String getPassageText(final String version, final String reference,
+    public OsisWrapper getPassageText(final String version, final String reference,
             final List<LookupOption> options, final String interlinearVersion) {
         return this.jsword.getOsisText(version, reference, options, interlinearVersion);
     }

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/GeographyServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/GeographyServiceImpl.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/GeographyServiceImpl.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,6 +32,8 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.service.impl;
 
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.GEO_PLACE;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -71,7 +73,8 @@
     @Override
     public List<GeoPlace> getPlaces(final String reference) {
         LOG.debug("Returning places for reference [{}]", reference);
-        final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(reference);
+        final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(reference,
+                GEO_PLACE);
         final List<GeoPlace> placesInScope = new ArrayList<GeoPlace>();
 
         final String rawQuery = "t0.id in (select geo_place_id from scripture_reference "

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -37,6 +37,7 @@
 import static org.apache.commons.lang.StringUtils.isNotBlank;
 import static org.apache.commons.lang.StringUtils.isNotEmpty;
 import static org.apache.commons.lang.Validate.notNull;
+import static org.crosswire.common.xml.XMLUtil.writeToString;
 import static org.crosswire.jsword.book.BookCategory.BIBLE;
 
 import java.net.URI;
@@ -54,7 +55,6 @@
 import org.crosswire.common.xml.Converter;
 import org.crosswire.common.xml.SAXEventProvider;
 import org.crosswire.common.xml.TransformingSAXEventProvider;
-import org.crosswire.common.xml.XMLUtil;
 import org.crosswire.jsword.book.Book;
 import org.crosswire.jsword.book.BookCategory;
 import org.crosswire.jsword.book.BookData;
@@ -85,6 +85,7 @@
 import com.tyndalehouse.step.core.data.entities.reference.TargetType;
 import com.tyndalehouse.step.core.exceptions.StepInternalException;
 import com.tyndalehouse.step.core.models.LookupOption;
+import com.tyndalehouse.step.core.models.OsisWrapper;
 import com.tyndalehouse.step.core.service.JSwordService;
 import com.tyndalehouse.step.core.xsl.XslConversionType;
 
@@ -191,14 +192,14 @@
     }
 
     @Override
-    public String getOsisText(final String version, final String reference) {
+    public OsisWrapper getOsisText(final String version, final String reference) {
         final List<LookupOption> options = new ArrayList<LookupOption>();
         return getOsisText(version, reference, options, null);
     }
 
-    // TODO: remove synchronisation once book is fixed
+    // FIXME TODO: JS-109, email from CJB on 27/02/2011 remove synchronisation once book is fixed
     @Override
-    public synchronized String getOsisText(final String version, final String reference,
+    public synchronized OsisWrapper getOsisText(final String version, final String reference,
             final List<LookupOption> options, final String interlinearVersion) {
         LOGGER.debug("Retrieving text for ({}, {})", version, reference);
 
@@ -213,10 +214,6 @@
             final BookData bookData = new BookData(currentBook, currentBook.getKey(reference));
             final XslConversionType requiredTransformation = identifyStyleSheet(options);
 
-            // TODO: This is a workaround while jsword is being fixed. see JS-109, and email from CJB on
-            // 27/02/2011
-            // synchronized (this) {
-
             final SAXEventProvider osissep = bookData.getSAXEventProvider();
             TransformingSAXEventProvider htmlsep = null;
             htmlsep = (TransformingSAXEventProvider) new Converter() {
@@ -226,9 +223,6 @@
                         final String file = requiredTransformation.getFile();
                         final URI resourceURI = getClass().getResource(file).toURI();
 
-                        // for now, we just assume that we'll only have one option, but this may change
-                        // later
-
                         final TransformingSAXEventProvider tsep = new TransformingSAXEventProvider(
                                 resourceURI, osissep);
 
@@ -241,8 +235,7 @@
                     }
                 }
             }.convert(osissep);
-            return XMLUtil.writeToString(htmlsep);
-            // }
+            return new OsisWrapper(writeToString(htmlsep), bookData.getKey().getName());
         } catch (final NoSuchKeyException e) {
             throw new StepInternalException("The verse specified was not found: " + reference, e);
         } catch (final BookException e) {
@@ -423,7 +416,7 @@
     }
 
     @Override
-    public List<ScriptureReference> getPassageReferences(final String references) {
+    public List<ScriptureReference> getPassageReferences(final String references, final TargetType targetType) {
         final List<ScriptureReference> refs = new ArrayList<ScriptureReference>();
 
         if (isNotBlank(references)) {
@@ -452,8 +445,8 @@
                     sr.setStartVerseId(startVerseId);
                     sr.setEndVerseId(endVerseId);
 
-                    // TODO: bug?
-                    sr.setTargetType(TargetType.TIMELINE_EVENT);
+                    // FIXME: bug?
+                    sr.setTargetType(targetType);
                     refs.add(sr);
                 }
             } catch (final NoSuchVerseException nsve) {

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -86,7 +86,7 @@
         final String lookupModule = getLookupModule(reference);
         if (lookupModule != null) {
             return new Definition(reference, this.jsword.getOsisText(lookupModule,
-                    StringConversionUtils.getAnyKey(reference, false)));
+                    StringConversionUtils.getAnyKey(reference, false)).getReference());
         }
 
         LOGGER.warn("No module could be found for [{}]", reference);

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImpl.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImpl.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,6 +32,8 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.service.impl;
 
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.TIMELINE_EVENT;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -49,7 +51,6 @@
 import com.tyndalehouse.step.core.data.entities.ScriptureReference;
 import com.tyndalehouse.step.core.data.entities.TimelineEvent;
 import com.tyndalehouse.step.core.data.entities.aggregations.TimelineEventsAndDate;
-import com.tyndalehouse.step.core.data.entities.reference.TargetType;
 import com.tyndalehouse.step.core.service.JSwordService;
 import com.tyndalehouse.step.core.service.TimelineService;
 
@@ -129,7 +130,8 @@
      */
     private List<TimelineEvent> lookupEventsMatchingReference(final String reference) {
         // first get the kjv reference
-        final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(reference);
+        final List<ScriptureReference> passageReferences = this.jsword.getPassageReferences(reference,
+                TIMELINE_EVENT);
 
         if (passageReferences.isEmpty()) {
             return new ArrayList<TimelineEvent>();
@@ -152,7 +154,7 @@
         final Query<TimelineEvent> query = this.ebean.createQuery(TimelineEvent.class, queryText).fetch(
                 "references");
 
-        query.setParameter("targetType", TargetType.TIMELINE_EVENT);
+        query.setParameter("targetType", TIMELINE_EVENT);
         query.setParameter("searchStart", searchingReference.getStartVerseId());
         query.setParameter("searchEnd", searchingReference.getEndVerseId());
 

Modified: trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/data/create/DataTest.java
===================================================================
--- trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/data/create/DataTest.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/data/create/DataTest.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -69,29 +69,4 @@
         assertEquals(i, Integer.valueOf(1));
         LOG.debug("Got " + i + "  - DataSource good.");
     }
-
-    /**
-     * testing the loading process
-     * <p />
-     * TODO: don't want to test the whole timeline/geography component every build
-     */
-    // @Test
-    // public void tryLoadingProcess() {
-    // final JSwordServiceImpl jsword = new JSwordServiceImpl(null);
-    // final TimelineModuleLoader timelineLoaderModule = new TimelineModuleLoader(getEbean(), jsword);
-    // final GeographyModuleLoader geoLoaderModule = new GeographyModuleLoader(getEbean(), jsword);
-    // final RelationalPeopleModuleLoader peopleLoader = new RelationalPeopleModuleLoader(getEbean(), jsword);
-    // final Loader l = new Loader(getEbean(), timelineLoaderModule, geoLoaderModule, peopleLoader);
-    // l.init();
-    //
-    // // we check that we entities in all three tables
-    // final Timeband timeband = getEbean().find(Timeband.class).fetch("hotspots.events").where()
-    // .eq("id", 1).findUnique();
-    //
-    // assertNotNull(timeband);
-    // assertNotNull(timeband.getHotspots());
-    // assertNotNull(timeband.getHotspots().get(0));
-    // assertNotNull(timeband.getHotspots().get(0).getEvents());
-    // assertNotNull(timeband.getHotspots().get(0).getEvents().get(0).getSummary());
-    // }
 }

Modified: trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java
===================================================================
--- trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,6 +32,8 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.service.impl;
 
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.GEO_PLACE;
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.TIMELINE_EVENT;
 import static com.tyndalehouse.step.core.models.LookupOption.INTERLINEAR;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -93,7 +95,7 @@
         final List<LookupOption> options = new ArrayList<LookupOption>();
         options.add(INTERLINEAR);
 
-        final String osisText = jsi.getOsisText("KJV", "Romans 1:1-3", options, "KJV");
+        final String osisText = jsi.getOsisText("KJV", "Romans 1:1-3", options, "KJV").getValue();
         final SAXBuilder sb = new SAXBuilder();
         final Document d = sb.build(new StringReader(osisText));
 
@@ -124,7 +126,7 @@
         final List<LookupOption> options = new ArrayList<LookupOption>();
         options.add(LookupOption.STRONG_NUMBERS);
 
-        final String osisText = jsi.getOsisText("KJV", "Romans 1:4", options, "");
+        final String osisText = jsi.getOsisText("KJV", "Romans 1:4", options, "").getValue();
         final SAXBuilder sb = new SAXBuilder();
         final Document d = sb.build(new StringReader(osisText));
 
@@ -138,7 +140,7 @@
     @Test
     public void testSingleReference() {
         final JSwordServiceImpl jsi = new JSwordServiceImpl(null);
-        final List<ScriptureReference> refs = jsi.getPassageReferences("Gen.1.1");
+        final List<ScriptureReference> refs = jsi.getPassageReferences("Gen.1.1", TIMELINE_EVENT);
 
         assertEquals(refs.size(), 1);
         assertEquals(4, refs.get(0).getStartVerseId());
@@ -151,7 +153,7 @@
     @Test
     public void testMultipleReference() {
         final JSwordServiceImpl jsi = new JSwordServiceImpl(null);
-        final List<ScriptureReference> refs = jsi.getPassageReferences("Gen.1.1;Gen.1.3");
+        final List<ScriptureReference> refs = jsi.getPassageReferences("Gen.1.1;Gen.1.3", TIMELINE_EVENT);
 
         assertEquals(2, refs.size());
         assertEquals(4, refs.get(0).getStartVerseId());
@@ -166,7 +168,7 @@
     @Test
     public void testMultiplePassages() {
         final JSwordServiceImpl jsi = new JSwordServiceImpl(null);
-        final List<ScriptureReference> refs = jsi.getPassageReferences("Gen.1.1-2;Gen.1.4-5");
+        final List<ScriptureReference> refs = jsi.getPassageReferences("Gen.1.1-2;Gen.1.4-5", TIMELINE_EVENT);
 
         assertEquals(refs.size(), 2);
         assertEquals(4, refs.get(0).getStartVerseId());
@@ -185,7 +187,7 @@
         // TODO change spaces between 1 and Kgs! This doesn't seem to work...
 
         // final List<ScriptureReference> refs = getPassageReferences(target, "Josh 12:24; Sng 6:4");
-        final List<ScriptureReference> refs = jsi.getPassageReferences("Song 6:4");
+        final List<ScriptureReference> refs = jsi.getPassageReferences("Song 6:4", GEO_PLACE);
         assertEquals(refs.size(), 1);
     }
 
@@ -229,7 +231,7 @@
         final List<LookupOption> options = new ArrayList<LookupOption>();
         // options.add(LookupOption.STRONG_NUMBERS);
 
-        final String osisText = jsi.getOsisText(testVersion, testReference, options, "");
+        final String osisText = jsi.getOsisText(testVersion, testReference, options, "").getValue();
         final SAXBuilder sb = new SAXBuilder();
         final Document d = sb.build(new StringReader(osisText));
 
@@ -237,82 +239,65 @@
         Assert.assertTrue(osisText.contains("span"));
     }
 
-    /**
-     * tries to replicate the issue with bookdata not being able to be read in a concurrent fashion
-     * 
-     * @throws NoSuchKeyException a no such key exception
-     * @throws BookException a book exception
-     * @throws InterruptedException when the thread is interrupted
-     */
-    // TODO: currently disabled
-    @Test
-    public void testConcurrencyIssueOnBookData() throws NoSuchKeyException, BookException,
-            InterruptedException {
-        // final String[] names = { "KJV", "ESV" };
-        // final String ref = "Rom.1.1";
-        //
-        // final Runnable r1 = new Runnable() {
-        // @Override
-        // public void run() {
-        // final Book b0 = Books.installed().getBook(names[0]);
-        // BookData bd1;
-        // try {
-        // bd1 = new BookData(b0, b0.getKey(ref));
-        // bd1.getSAXEventProvider();
-        // } catch (final NoSuchKeyException e) {
-        // LOGGER.error("A jsword error during test", e);
-        // Assert.fail("JSword bug has occured");
-        // } catch (final BookException e) {
-        // LOGGER.error("A jsword error during test", e);
-        // Assert.fail("JSword bug has occured");
-        // }
-        // }
-        // };
-        //
-        // final Runnable r2 = new Runnable() {
-        // @Override
-        // public void run() {
-        // final Book b0 = Books.installed().getBook(names[1]);
-        // BookData bd1;
-        // try {
-        // bd1 = new BookData(b0, b0.getKey(ref));
-        // bd1.getSAXEventProvider();
-        // } catch (final NoSuchKeyException e) {
-        // LOGGER.error("A jsword error during test", e);
-        // Assert.fail("JSword bug has occured");
-        // } catch (final BookException e) {
-        // LOGGER.error("A jsword error during test", e);
-        // Assert.fail("JSword bug has occured");
-        // }
-        // }
-        // };
-        //
-        // int ii = 0;
-        // while (ii++ < 15) {
-        // final Thread t1 = new Thread(r1);
-        // final Thread t2 = new Thread(r2);
-        // t1.start();
-        // t2.start();
-        //
-        // t1.join();
-        // t2.join();
-        // }
-    }
-
     // /**
-    // * Outputs pretty xml
-    // * @throws BookException
-    // * @throws NoSuchKeyException
-    // * @throws JDOMException
-    // * @throws IOException
+    // * tries to replicate the issue with bookdata not being able to be read in a concurrent fashion
+    // *
+    // * @throws NoSuchKeyException a no such key exception
+    // * @throws BookException a book exception
+    // * @throws InterruptedException when the thread is interrupted
     // */
+    // // FIXME: currently disabled
     // @Test
-    // public void testPrettyXml() throws BookException, NoSuchKeyException, JDOMException, IOException {
-    // final Book currentBook = Books.installed().getBook("ESV");
-    // final BookData bookData = new BookData(currentBook, currentBook.getKey("Exodus 3:14"));
-    // final Element osisFragment = bookData.getOsisFragment();
+    // public void testConcurrencyIssueOnBookData() throws NoSuchKeyException, BookException,
+    // InterruptedException {
+    // final String[] names = { "KJV", "ESV" };
+    // final String ref = "Rom.1.1";
     //
-    // final XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat());
-    // LOGGER.debug(xmlOutputter.outputString(osisFragment));
+    // final Runnable r1 = new Runnable() {
+    // @Override
+    // public void run() {
+    // final Book b0 = Books.installed().getBook(names[0]);
+    // BookData bd1;
+    // try {
+    // bd1 = new BookData(b0, b0.getKey(ref));
+    // bd1.getSAXEventProvider();
+    // } catch (final NoSuchKeyException e) {
+    // LOGGER.error("A jsword error during test", e);
+    // Assert.fail("JSword bug has occured");
+    // } catch (final BookException e) {
+    // LOGGER.error("A jsword error during test", e);
+    // Assert.fail("JSword bug has occured");
     // }
+    // }
+    // };
+    //
+    // final Runnable r2 = new Runnable() {
+    // @Override
+    // public void run() {
+    // final Book b0 = Books.installed().getBook(names[1]);
+    // BookData bd1;
+    // try {
+    // bd1 = new BookData(b0, b0.getKey(ref));
+    // bd1.getSAXEventProvider();
+    // } catch (final NoSuchKeyException e) {
+    // LOGGER.error("A jsword error during test", e);
+    // Assert.fail("JSword bug has occured");
+    // } catch (final BookException e) {
+    // LOGGER.error("A jsword error during test", e);
+    // Assert.fail("JSword bug has occured");
+    // }
+    // }
+    // };
+    //
+    // int ii = 0;
+    // while (ii++ < 15) {
+    // final Thread t1 = new Thread(r1);
+    // final Thread t2 = new Thread(r2);
+    // t1.start();
+    // t2.start();
+    //
+    // t1.join();
+    // t2.join();
+    // }
+    // }
 }

Modified: trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImplTest.java
===================================================================
--- trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImplTest.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/TimelineServiceImplTest.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -32,7 +32,9 @@
  ******************************************************************************/
 package com.tyndalehouse.step.core.service.impl;
 
+import static com.tyndalehouse.step.core.data.entities.reference.TargetType.TIMELINE_EVENT;
 import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.when;
 
@@ -83,10 +85,10 @@
      */
     @Test
     public void testGetEventsFromScriptureTimelineEvent() {
-        final List<ScriptureReference> testReferences = saveEventWithVerses(TargetType.TIMELINE_EVENT, 5, 10);
+        final List<ScriptureReference> testReferences = saveEventWithVerses(TIMELINE_EVENT, 5, 10);
 
         // ensure we return the references that we've set up
-        when(this.jsword.getPassageReferences(anyString())).thenReturn(testReferences);
+        when(this.jsword.getPassageReferences(anyString(), any(TargetType.class))).thenReturn(testReferences);
 
         final TimelineEventsAndDate eventsForPassage = this.ts.getEventsFromScripture("");
 
@@ -104,7 +106,7 @@
         saveEventWithVerses(TargetType.TIMELINE_EVENT, 11, 13);
 
         // ensure we return the references that we've set up
-        when(this.jsword.getPassageReferences(anyString())).thenReturn(testReferences);
+        when(this.jsword.getPassageReferences(anyString(), any(TargetType.class))).thenReturn(testReferences);
 
         final TimelineEventsAndDate eventsForPassage = this.ts.getEventsFromScripture("");
 
@@ -120,7 +122,7 @@
         final List<ScriptureReference> testReferences = saveEventWithVerses(TargetType.GEO_PLACE, 5, 10);
 
         // ensure we return the references that we've set up
-        when(this.jsword.getPassageReferences(anyString())).thenReturn(testReferences);
+        when(this.jsword.getPassageReferences(anyString(), any(TargetType.class))).thenReturn(testReferences);
 
         final TimelineEventsAndDate eventsForPassage = this.ts.getEventsFromScripture("");
 

Modified: trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/BibleController.java
===================================================================
--- trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/BibleController.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/BibleController.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -51,9 +51,9 @@
 import com.tyndalehouse.step.core.models.ClientSession;
 import com.tyndalehouse.step.core.models.EnrichedLookupOption;
 import com.tyndalehouse.step.core.models.LookupOption;
+import com.tyndalehouse.step.core.models.OsisWrapper;
 import com.tyndalehouse.step.core.service.BibleInformationService;
 import com.tyndalehouse.step.rest.framework.Cacheable;
-import com.tyndalehouse.step.rest.wrappers.HtmlWrapper;
 
 /**
  * The controller for retrieving information on the bible or texts from the bible
@@ -117,7 +117,7 @@
      * @return the text to be displayed, formatted as HTML
      */
     @Cacheable(true)
-    public HtmlWrapper getBibleText(final String version, final String reference) {
+    public OsisWrapper getBibleText(final String version, final String reference) {
         return getBibleText(version, reference, null, null);
     }
 
@@ -130,7 +130,7 @@
      * @return the text to be displayed, formatted as HTML
      */
     @Cacheable(true)
-    public HtmlWrapper getBibleText(final String version, final String reference, final String options) {
+    public OsisWrapper getBibleText(final String version, final String reference, final String options) {
         return getBibleText(version, reference, options, null);
     }
 
@@ -144,7 +144,7 @@
      * @return the text to be displayed, formatted as HTML
      */
     @Cacheable(true)
-    public HtmlWrapper getBibleText(final String version, final String reference, final String options,
+    public OsisWrapper getBibleText(final String version, final String reference, final String options,
             final String interlinearVersion) {
         notEmpty(version, "You need to provide a version");
         notEmpty(reference, "You need to provide a reference");
@@ -161,8 +161,7 @@
             }
         }
 
-        return new HtmlWrapper(this.bibleInformation.getPassageText(version, reference, lookupOptions,
-                interlinearVersion));
+        return this.bibleInformation.getPassageText(version, reference, lookupOptions, interlinearVersion);
     }
 
     /**

Modified: trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/framework/FrontController.java
===================================================================
--- trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/framework/FrontController.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/framework/FrontController.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -75,12 +75,9 @@
     private static final long serialVersionUID = 7898656504631346047L;
     private static final String CONTROLLER_SUFFIX = "Controller";
     private final transient Injector guiceInjector;
-    // TODO: but also check thread safety and whether we should share this object
     private final transient ObjectMapper jsonMapper = new ObjectMapper();
-    // TODO: check if this is thread safe, and if so, then make private field
     private final transient JsonContext ebeanJson;
 
-    // TODO: investigate EH cache here
     private final Map<String, Method> methodNames = new HashMap<String, Method>();
     private final Map<String, Object> controllers = new HashMap<String, Object>();
     private final boolean isCacheEnabled;

Deleted: trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/wrappers/HtmlWrapper.java
===================================================================
--- trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/wrappers/HtmlWrapper.java	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/wrappers/HtmlWrapper.java	2012-04-26 13:30:01 UTC (rev 262)
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, Directors of the Tyndale STEP Project
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
- * are met:
- * 
- * Redistributions of source code must retain the above copyright 
- * notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in 
- * the documentation and/or other materials provided with the 
- * distribution.
- * Neither the name of the Tyndale House, Cambridge (www.TyndaleHouse.com)  
- * nor the names of its contributors may be used to endorse or promote 
- * products derived from this software without specific prior written 
- * permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
- * THE POSSIBILITY OF SUCH DAMAGE.
- ******************************************************************************/
-package com.tyndalehouse.step.rest.wrappers;
-
-/**
- * A simple wrapper around a string for returning as a JSON-mapped object
- * 
- * @author Chris
- * 
- */
-public class HtmlWrapper {
-    private final String value;
-
-    /**
-     * the value to be wrapped
-     * 
-     * @param value the value to be wrapped around
-     */
-    public HtmlWrapper(final String value) {
-        this.value = value;
-    }
-
-    /**
-     * @return the value to be returned
-     */
-    public String getValue() {
-        return this.value;
-    }
-}

Modified: trunk/step/step-web/src/main/webapp/css/passage.css
===================================================================
--- trunk/step/step-web/src/main/webapp/css/passage.css	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/css/passage.css	2012-04-26 13:30:01 UTC (rev 262)
@@ -290,3 +290,19 @@
 FONT.usg {
 	font-style: plain;
 }
+
+#previewReference {
+	color: white;
+	font-weight: solid;
+	z-index: 9999999;
+	max-width: 280px;
+	max-height: 200px;
+	background-color: #F6A828 ;
+	border: 2px solid #E78F08;
+	overflow: crop;
+	padding: 5px;
+}
+
+.previewReferenceKey {
+	font-style: italic;
+}

Modified: trunk/step/step-web/src/main/webapp/index.html
===================================================================
--- trunk/step/step-web/src/main/webapp/index.html	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/index.html	2012-04-26 13:30:01 UTC (rev 262)
@@ -17,9 +17,7 @@
     <link rel="stylesheet" type="text/css" href="css/passage.css" />
 	<link rel="stylesheet" type="text/css" href="libs/menu/ddsmoothmenu.css" />
 	<link rel="stylesheet" type="text/css" href="libs/menu/ddsmoothmenu-v.css" />
-	<link rel="stylesheet" type="text/css" href="libs/bubble/css/jquery-bubble-popup-v3.css" />
 
-
 	<script src="js/initLib.js" type="text/javascript"></script>   
 
     <script src="libs/timeline_js/timeline-api.js" type="text/javascript"></script>
@@ -28,8 +26,10 @@
     <script src="libs/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script>
        
     <script src="libs/jquery-shout.js" type="text/javascript"></script>
-    <script src="libs/bubble/scripts/jquery-bubble-popup-v3.min.js" type="text/javascript"></script>
+	<script src="libs/tooltip/jquery.simpletip-1.3.1.pack.js"></script>
 
+
+
 	<script src="libs/menu/ddsmoothmenu.js" type="text/javascript"></script>
     <script src="libs/cookies/jquery_cookie.js" type="text/javascript"></script>
     
@@ -152,6 +152,8 @@
 	Please enter a year: <input type="text" id="scrollToYear" />
 </div>
 
+<div id="previewReference" ></div>
+
 </body>
 
 </HTML>

Modified: trunk/step/step-web/src/main/webapp/js/bookmark.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/bookmark.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/bookmark.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -79,7 +79,7 @@
 	
 	//check if we have the reference in the array (starts for example: '1 John@' where @ denotes the time at which it happened
 	var indexInHistory = 0;
-	for(var indexInHistory = 0; indexInHistory < history.length; indexInHistory++) {
+	for(indexInHistory = 0; indexInHistory < history.length; indexInHistory++) {
 		if(history[indexInHistory].match("^" + passageReference + "@")) {
 			break;
 		}
@@ -124,7 +124,7 @@
 	//create the history from the cookie, or - logged-in event will override
 	var self = this;
 	self.createHistoryItemsFromCookies();
-}
+};
 
 /** 
  * we need to work out what our current history is like, and then reset it to be appropriate
@@ -234,5 +234,5 @@
 };
 
 Bookmark.prototype.setHistory = function(history) {
-	$.cookie("history", history.join(Bookmark.historyDelimiter))
+	$.cookie("history", history.join(Bookmark.historyDelimiter));
 };

Modified: trunk/step/step-web/src/main/webapp/js/init.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/init.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/init.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -3,7 +3,7 @@
 init();
 
 //some extensions (perhaps should go in another file)
-String.prototype.startsWith = function(str) { return (this.match("^"+str)==str) }
+String.prototype.startsWith = function(str) { return (this.match("^"+str)==str); };
 
 
 function init() {
@@ -101,7 +101,7 @@
 function initData() {
 	
 	//get all supported versions
-	var options;
+	var options = {};
 	$.getJSON(BIBLE_GET_ALL_FEATURES, function(data) {
 		$.each(data, function() {
 			options = data;
@@ -110,9 +110,6 @@
 	
 	//get data for passages
 	// make call to server first and once, to cache all passages:
-	var strongedVersions = [];
-	var ii = 0;
-	
 	$.getJSON(BIBLE_GET_BIBLE_VERSIONS + "false", function(versionsFromServer) {
 		var passages = initPassages(versionsFromServer, options);
 		initInterlinearPopup(versionsFromServer);
@@ -195,7 +192,7 @@
 	});
 	
 	$("#error").hear("caught-error-message", function(selfElement, data) {
-		raiseError(data)
+		raiseError(data);
 	});
 }
 

Modified: trunk/step/step-web/src/main/webapp/js/interlinear_popup.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/interlinear_popup.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/interlinear_popup.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -52,7 +52,7 @@
 	this.createCheckboxes(strongedVersions);
 	this.addHandlersToCheckboxes();
 	this.addAllOptionsHandler();
-}
+};
 
 /**
  * creates all the checkboxes, one per strong version
@@ -95,7 +95,7 @@
 	  "<label for='il_" + ii + "'>All</label></td><td>&nbsp;</td></tr>";
 	
 	interlinearChoices.append("<table>" + allOptions + allCheckBoxes + "</table>");
-}
+};
 
 /**
  * adds the handlers to all the normal checkboxes to add text into
@@ -126,7 +126,7 @@
 			self.updateInterlinear();
 		}
 	});
-}
+};
 
 /**
  * adds a handler that adds all the options to the textbox
@@ -142,7 +142,7 @@
 			$("label[for = 'il_all']", this.interlinearPopup).val("All");
 		}
 	});
-}
+};
 
 /**
  * sets up the handler to show the popup. This alerts the menu if the state has changed

Modified: trunk/step/step-web/src/main/webapp/js/lexicon_definition.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/lexicon_definition.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/lexicon_definition.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -25,15 +25,15 @@
 		$('#lexiconDefinition').hide();
 	});
 	return this.popup;
-}
+};
 
 LexiconDefinition.prototype.showStrong = function(s) {
 	
-}
+};
 
 LexiconDefinition.prototype.showMorphs = function(s) {
 	
-}
+};
 
 LexiconDefinition.prototype.showAllStrongMorphs = function(s) {
 	var self = this;
@@ -67,7 +67,7 @@
 			collision: "fit flip",
 		});
 	}
-}
+};
 
 LexiconDefinition.prototype.getShortKey = function(k) {
 	var subKey = k.substring(k.indexOf(':') + 1);
@@ -75,4 +75,4 @@
 		return subKey.substring(1);
 	}
 	return subKey;
-}
+};

Modified: trunk/step/step-web/src/main/webapp/js/login.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/login.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/login.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -164,4 +164,4 @@
 	loginLink.click(function() {
 		self.showLogout();
 	});
-}
+};

Modified: trunk/step/step-web/src/main/webapp/js/passage.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/passage.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/passage.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -94,7 +94,7 @@
 			label : showingText,
 			value : item.initials,
 			features: features
-		}
+		};
 	});
 	
 	this.version.autocomplete({source: parsedVersions});
@@ -124,10 +124,10 @@
 		return $( "<li></li>" )
 		.data( "item.autocomplete", item )
 		.append( "<a><span class='features'>" + item.features + "</span>" + item.label + "</a>")
-		.appendTo( ul )
-	}
+		.appendTo( ul );
+	};
 	
-	this.refreshVersionsTextBox(rawServerVersions)
+	this.refreshVersionsTextBox(rawServerVersions);
 };
 
 Passage.prototype.initReferenceTextBox = function() {	
@@ -316,30 +316,24 @@
 	var reference = previewData.reference;
 	var source = previewData.source;
 
-	var position = this.passageId == 0 ? "right" : "left";
+	var myAnchor = this.passageId == 0 ? "left" : "right";
+	var offset = (80 * (this.passageId == 0 ? 1 : -1)) + " 0";
 	
-	$.getSafe(BIBLE_GET_BIBLE_TEXT + this.version.val() + "/" + reference, function(text) {
+	$.getSafe(BIBLE_GET_BIBLE_TEXT + this.version.val() + "/" + reference, function(data) {
+		$("#previewReference").html(data.value + "<span class='previewReferenceKey'>[" + data.reference + "]</span>");
+		$("#previewReference").show().position({
+			of: $(source),
+			my: myAnchor + " center",
+			at: "center " + "center",
+			offset: offset,
+			collision: "fit"
+		});
 		
-		//create a bubble popup for each DOM element with class attribute as "text", "button" or "link" and LI, P, IMG elements.
-
-		$(source).CreateBubblePopup({
-									position : position,
-									align	 : 'top',
-									innerHtml: text.value,
-									width: 350,
-//									height: 100,
-									selectable: true,
-									openingSpeed: -1,
-									closingSpeed: -1,
-									innerHtmlStyle: {
-														color: '#fff !important !important', 
-														'text-align' :'left'
-													},
-									themeName: 	'all-orange',
-									themePath: 	'libs/bubble/jquerybubblepopup-themes'
-								});
+		$(".notesPane").mouseleave(function(s) {
+			$("#previewReference").hide();
+		});
 	});
-}
+};
 
 /**
  * static method that returns strongs that should not be tagged in the UI

Modified: trunk/step/step-web/src/main/webapp/js/setup.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/setup.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/setup.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -16,7 +16,7 @@
 					var toBeInstalled = "<a class='notInstalled' href=\"javascript:installVersion('" + this.initials +  "','" + 
 						this.name.replace(/'/g,"\\'")  + "')\">[" + this.initials + "] " + this.name + "</a><br />";
 					$("#availableModules").append(toBeInstalled);
-				})
+				});
 			});
 		});
 	});
@@ -26,7 +26,7 @@
 		$(data).each(function() {
 			var installed = "<div class=\"installed\">[" + this.initials + "] " + this.name + " - Installed</div>";
 			$("#inProgressModules").append(installed);
-		})
+		});
 	});
 }
 

Modified: trunk/step/step-web/src/main/webapp/js/timeline.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/timeline.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/timeline.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -146,7 +146,7 @@
 		this.eventSource.add(event);
 		this.currentEvents[item.eventId] = true;
 	}
-}
+};
 
 TimelineWidget.prototype.addMultipleEventsAndRefresh = function(data) {
 	var self = this;
@@ -157,7 +157,7 @@
 	});
 	
 	this.tl.layout();
-}
+};
 
 /**
  * Let us load stuff relevant to our passage
@@ -227,7 +227,7 @@
 TimelineWidget.prototype.addToolbarButton = function(toolbar, id, text, iconName) {
 	var html = "<a id='" + id + "'>" + text + "</a>";
 	this.addToolbarIcon(html, toolbar, id, text, iconName);
-}
+};
 
 TimelineWidget.prototype.addToolbarToggle = function(toolbar, id, text, iconName) {
 	var html = "<input type='checkbox' id='" + id + "' /><label for='" + id + "'>" + text + "</label>";
@@ -241,7 +241,7 @@
 TimelineWidget.prototype.initToolbar = function() {
 	var self = this;
 	
-	var toolbar = $("#bottomModuleHeader")
+	var toolbar = $("#bottomModuleHeader");
 	this.addToolbarButton(toolbar, "scrollTimelineLeft", "Scroll left", 'ui-icon-seek-prev');
 	this.addToolbarButton(toolbar, "scrollTimelineRight", "Scroll right", 'ui-icon-seek-next');
 	this.addToolbarButton(toolbar, "zoomInTimeline", "Zoom in", 'ui-icon-zoomin');
@@ -324,7 +324,7 @@
             
         }, 500);
     }
-}
+};
 
 /* Overriding the fill in bubble from the timeline library. */
 Timeline.DefaultEventSource.Event.prototype.fillInfoBubble = function (elmt, theme, labeller) { 
@@ -370,5 +370,5 @@
 	this.fillWikiInfo(divWiki); 
 	theme.event.bubble.wikiStyler(divWiki); 
 	elmt.appendChild(divWiki); 
-} 
+};
 

Modified: trunk/step/step-web/src/main/webapp/js/toolbar_menu.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/toolbar_menu.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/toolbar_menu.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -43,7 +43,7 @@
 	} else {
 		this.untickMenuItem(menuItem);
 	}
-}
+};
 
 
 /**
@@ -62,7 +62,7 @@
 		//fire-off an event indicating that menu options have changed!
 		$.shout("toolbar-menu-options-changed-" + this.passageId);
 	}
-}
+};
 
 
 /**
@@ -71,7 +71,7 @@
  */
 ToolbarMenu.prototype.tickMenuItem = function(selectedItem) {
 	this.getItemSelector(selectedItem).not(":has(img)").append("<img class='selectingTick' src='images/selected.png' />");		
-}
+};
 
 /**
  * removes the tick next to the menu item
@@ -79,7 +79,7 @@
  */
 ToolbarMenu.prototype.untickMenuItem = function(selectedItem) {
 	$("img.selectingTick", this.getItemSelector(selectedItem)).remove();
-}
+};
 
 /**
  * The menu item can be selected
@@ -92,7 +92,7 @@
 		return false;
 	}
 	return true;
-}
+};
 
 /**
  * Refreshes the menu options according to what can currently be displayed
@@ -118,7 +118,7 @@
 		});
 		$.shout("toolbar-menu-options-changed-" + self.passageId);
 	});
-}
+};
 
 /**
  * sets up the default options for the menu
@@ -127,7 +127,7 @@
 	this.toggleMenuItem("HEADINGS");
 	this.toggleMenuItem("VERSE_NUMBERS");
 	this.toggleMenuItem("NOTES");
-}
+};
 
 /**
  * returns all menu items matching the name specified
@@ -135,4 +135,4 @@
  */
 ToolbarMenu.prototype.getItemSelector = function(name) {
 	return $("*[name = '" + name + "']", this.menuRoot);
-}
+};

Modified: trunk/step/step-web/src/main/webapp/js/top_menu.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/top_menu.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/top_menu.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -26,7 +26,7 @@
 
 TopMenu.prototype.setupHearers = function() {
 	this.menuRoot.hear("topmenu-LIMIT_AVAILABLE_MODULES", function(selfElement, enabled) {
-		var versions = $.getSafe(BIBLE_GET_BIBLE_VERSIONS + enabled, function(versions) {
+		$.getSafe(BIBLE_GET_BIBLE_VERSIONS + enabled, function(versions) {
 			// send events to passages and reload - then change init function
 			$.shout("version-list-refresh", versions);
 		});
@@ -57,7 +57,7 @@
 			$.shout("topmenu-" + selectedItem, true);
 		}
 	}
-}
+};
 
 
 /**
@@ -66,7 +66,7 @@
  */
 TopMenu.prototype.tickMenuItem = function(selectedItem) {
 	this.getItemSelector(selectedItem).not(":has(img)").append("<img class='selectingTick' src='images/selected.png' />");		
-}
+};
 
 /**
  * removes the tick next to the menu item
@@ -74,7 +74,7 @@
  */
 TopMenu.prototype.untickMenuItem = function(selectedItem) {
 	$("img.selectingTick", this.getItemSelector(selectedItem)).remove();
-}
+};
 
 /**
  * The menu item can be selected
@@ -87,21 +87,21 @@
 		return false;
 	}
 	return true;
-}
+};
 
 /**
  * sets up the default options for the menu
  */
 TopMenu.prototype.setDefaultOptions = function() {
 //	this.toggleMenuItem("LIMIT_AVAILABLE_MODULES");
-}
+};
 
 /**
  * returns true if item is selected
  */
 TopMenu.prototype.isItemSelected = function(name) {
 	return getItemSelector(name).children("img.selectingTick").length != 0;
-}
+};
 
 /**
  * returns all menu items matching the name specified
@@ -109,4 +109,4 @@
  */
 TopMenu.prototype.getItemSelector = function(name) {
 	return $("*[name = '" + name + "']", this.menuRoot);
-}
+};

Modified: trunk/step/step-web/src/main/webapp/js/ui_hooks.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -19,7 +19,7 @@
 BIBLE_GET_BIBLE_TEXT = 					STEP_SERVER_BASE_URL + "bible/getBibleText/";
 BIBLE_GET_FEATURES = 					STEP_SERVER_BASE_URL + "bible/getFeatures/";
 BIBLE_GET_ALL_FEATURES = 				STEP_SERVER_BASE_URL + "bible/getAllFeatures/";
-BIBLE_GET_BIBLE_BOOK_NAMES = 			STEP_SERVER_BASE_URL + "bible/getBibleBookNames/"
+BIBLE_GET_BIBLE_BOOK_NAMES = 			STEP_SERVER_BASE_URL + "bible/getBibleBookNames/";
 
 MODULE_GET_ALL_MODULES = 				STEP_SERVER_BASE_URL + "module/getAllModules/";
 MODULE_GET_ALL_INSTALLABLE_MODULES = 	STEP_SERVER_BASE_URL + "module/getAllInstallableModules/";
@@ -37,10 +37,10 @@
 
 USER_LOGIN = 							STEP_SERVER_BASE_URL + "user/login/";
 USER_LOGOUT = 							STEP_SERVER_BASE_URL + "user/logout/";
-USER_REGISTER = 						STEP_SERVER_BASE_URL + "user/register/"
+USER_REGISTER = 						STEP_SERVER_BASE_URL + "user/register/";
 USER_GET_LOGGED_IN_USER = 				STEP_SERVER_BASE_URL + "user/getLoggedInUser";
 
-GEOGRAPHY_GET_PLACES = 					STEP_SERVER_BASE_URL + "geography/getPlaces/"
+GEOGRAPHY_GET_PLACES = 					STEP_SERVER_BASE_URL + "geography/getPlaces/";
 	
 //////////////////////////
 // SOME DEFAULTS
@@ -72,6 +72,7 @@
 };
 
 function changePassage(element, passageReference) {
+	$("#previewReference").hide();
 	$.shout("new-passage-" + getPassageId(element), passageReference);
 }
 

Modified: trunk/step/step-web/src/main/webapp/js_mobile/init.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js_mobile/init.js	2012-04-25 21:35:49 UTC (rev 261)
+++ trunk/step/step-web/src/main/webapp/js_mobile/init.js	2012-04-26 13:30:01 UTC (rev 262)
@@ -29,8 +29,6 @@
  */
 function updatePassageView() {
 	var params = getUrlVars();
-
-	var options = "";
 	var version = "KJV";
 	var passage = "Romans 1";
 




More information about the Tynstep-svn mailing list