[Tynstep-svn] r101 - in trunk/step-web-app: . eclipse src/main/java/com/tyndalehouse/step/web/client/event src/main/java/com/tyndalehouse/step/web/client/service/refdata src/main/java/com/tyndalehouse/step/web/client/toolkit src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline src/main/java/com/tyndalehouse/step/web/client/view src/main/java/com/tyndalehouse/step/web/server/db src/main/java/com/tyndalehouse/step/web/server/db/framework src/main/java/com/tyndalehouse/step/web/server/db/timeline src/main/java/com/tyndalehouse/step/web/server/handler src/main/java/com/tyndalehouse/step/web/server/handler/util/passage src/main/java/com/tyndalehouse/step/web/server/jsword src/main/java/com/tyndalehouse/step/web/shared/beans src/main/java/com/tyndalehouse/step/web/shared/command src/main/java/com/tyndalehouse/step/web/shared/result src/main/java/com/tyndalehouse/step/web/shared/scripture src/main/java/com/tyndalehouse/step/web/shared/timeline src/test/java/com/tyndalehouse/step src/test/java/com/tyndalehouse/step/db/queries src/test/java/com/tyndalehouse/step/tests src/test/java/com/tyndalehouse/step/web src/test/java/com/tyndalehouse/step/web/client src/test/java/com/tyndalehouse/step/web/client/service
ChrisBurrell at crosswire.org
ChrisBurrell at crosswire.org
Wed Mar 10 13:00:46 MST 2010
Author: ChrisBurrell
Date: 2010-03-10 13:00:45 -0700 (Wed, 10 Mar 2010)
New Revision: 101
Added:
trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/
trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/
trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java
Removed:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/reference/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/ScriptureElement.java
trunk/step-web-app/src/test/java/com/tyndalehouse/step/db/queries/tests/
trunk/step-web-app/src/test/java/com/tyndalehouse/step/server/
trunk/step-web-app/src/test/java/com/tyndalehouse/step/tests/server/
Modified:
trunk/step-web-app/.checkstyle
trunk/step-web-app/eclipse/step-checks.xml
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/DictionaryDefinitionFoundEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/LemmaClickedEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimebandListUpdateRequiredEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/UserInterestInBandEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/service/refdata/ModuleName.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SourceListBox.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeband.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQuery.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQueryRunnerImpl.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/UnableToRunQueryException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/timeline/TimelineSetupDataProcessor.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetDictionaryDefinitionHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetEventsForDateRangeHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/InstallJswordModuleHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/util/passage/StrongMorphMap.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/jsword/XSLTProperty.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimeBandVisibleDate.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineBean.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineEventBean.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetCurrentBibleTextCommand.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetEventsForDateRangeCommand.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetAvailableBibleVersionsResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetBibleBooksCommandResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetDictionaryDefinitionResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetEventsForDateRangeResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineUISetupResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/InstallJswordModuleResult.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Milestone.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Note.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/OSISConstants.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TextualElement.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TransChange.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Word.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/timeline/Unit.java
Log:
Modified: trunk/step-web-app/.checkstyle
===================================================================
--- trunk/step-web-app/.checkstyle 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/.checkstyle 2010-03-10 20:00:45 UTC (rev 101)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JSword checks" location="eclipse/JSwordChecks.xml" type="project" description="">
+ <local-check-config name="step-checks-local" location="eclipse/step-checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="false"/>
</local-check-config>
- <fileset name="all" enabled="true" check-config-name="step-checks" local="false">
+ <fileset name="all" enabled="true" check-config-name="step-checks-local" local="true">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
</fileset-config>
Modified: trunk/step-web-app/eclipse/step-checks.xml
===================================================================
--- trunk/step-web-app/eclipse/step-checks.xml 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/eclipse/step-checks.xml 2010-03-10 20:00:45 UTC (rev 101)
@@ -49,7 +49,9 @@
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
- <module name="ParenPad"/>
+ <module name="ParenPad">
+ <property name="severity" value="ignore"/>
+ </module>
<module name="TypecastParenPad"/>
<module name="TabCharacter">
<property name="severity" value="ignore"/>
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -6,26 +6,27 @@
/**
* The user has selected a book on the UI, and this is being fired to the
* DefaultEventBus
+ *
* @author CJBurrell
- *
+ *
*/
public class BookSelectedEvent extends GwtEvent<BookSelectedEventHandler> {
-
+
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
public static Type<BookSelectedEventHandler> TYPE = new Type<BookSelectedEventHandler>();
@Override
- protected void dispatch(BookSelectedEventHandler handler) {
- handler.onBookSelected(this);
-
+ public Type<BookSelectedEventHandler> getAssociatedType() {
+ return TYPE;
}
@Override
- public Type<BookSelectedEventHandler> getAssociatedType() {
- return TYPE;
+ protected void dispatch(final BookSelectedEventHandler handler) {
+ handler.onBookSelected(this);
+
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/DictionaryDefinitionFoundEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/DictionaryDefinitionFoundEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/DictionaryDefinitionFoundEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -3,21 +3,39 @@
import com.google.gwt.event.shared.GwtEvent;
import com.tyndalehouse.step.web.client.eventhandler.DictionaryDefinitionFoundHandler;
+/**
+ * The dictionary definition found event. This is fired when the server has
+ * responded with a dictionary definition and different parts of the system may
+ * require notification of it.
+ *
+ * @author cjburrell
+ *
+ */
public class DictionaryDefinitionFoundEvent extends GwtEvent<DictionaryDefinitionFoundHandler> {
+ /**
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
+ */
+ public static Type<DictionaryDefinitionFoundHandler> TYPE = new Type<DictionaryDefinitionFoundHandler>();
+
+ /**
+ * the definition that was retrieved
+ */
private String definition;
+
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * default constructor
+ *
+ * @param defintion this is the definition that was retrieved from the
+ * server
*/
-public static Type<DictionaryDefinitionFoundHandler> TYPE = new Type<DictionaryDefinitionFoundHandler>();
-
public DictionaryDefinitionFoundEvent(final String defintion) {
this.definition = defintion;
}
@Override
- protected void dispatch(DictionaryDefinitionFoundHandler handler) {
- handler.onDefinitionFound(this);
+ public Type<DictionaryDefinitionFoundHandler> getAssociatedType() {
+ return TYPE;
}
/**
@@ -28,15 +46,14 @@
}
/**
- * @param definition
- * the definition to set
+ * @param definition the definition to set
*/
- public void setDefinition(String definition) {
+ public void setDefinition(final String definition) {
this.definition = definition;
}
@Override
- public Type<DictionaryDefinitionFoundHandler> getAssociatedType() {
- return TYPE;
+ protected void dispatch(final DictionaryDefinitionFoundHandler handler) {
+ handler.onDefinitionFound(this);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/LemmaClickedEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/LemmaClickedEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/LemmaClickedEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -5,24 +5,32 @@
import com.google.gwt.event.shared.GwtEvent;
import com.tyndalehouse.step.web.client.eventhandler.LemmaClickedEventHandler;
+/**
+ * This event is fired when a portion of scripture tagged with 1 or more lemma
+ * (strong number for e.g.) has been clicked. The event contains details of the
+ * lemmas references.
+ *
+ * @author cjburrell
+ *
+ */
public class LemmaClickedEvent extends GwtEvent<LemmaClickedEventHandler> {
public static Type<LemmaClickedEventHandler> TYPE = new Type<LemmaClickedEventHandler>();
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
-private List<String> lemma;
+ private List<String> lemma;
+ /**
+ * constructing the event with a list of lemmas
+ *
+ * @param lemmas the list of lemmas that were clicked upon
+ */
public LemmaClickedEvent(final List<String> lemmas) {
this.lemma = lemmas;
}
@Override
- protected void dispatch(LemmaClickedEventHandler handler) {
- handler.onLemmaClicked(this);
- }
-
- @Override
public Type<LemmaClickedEventHandler> getAssociatedType() {
return TYPE;
}
@@ -35,11 +43,15 @@
}
/**
- * @param lemma
- * the lemma to set
+ * @param lemma the lemma to set
*/
- public void setLemma(List<String> lemma) {
+ public void setLemma(final List<String> lemma) {
this.lemma = lemma;
}
+ @Override
+ protected void dispatch(final LemmaClickedEventHandler handler) {
+ handler.onLemmaClicked(this);
+ }
+
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -3,42 +3,72 @@
import com.google.gwt.event.shared.GwtEvent;
import com.tyndalehouse.step.web.client.eventhandler.ModuleChangeEventHandler;
+/**
+ * Event is fired when part of the module definition (module, sub module, depth)
+ * has been changed
+ *
+ * @author cjburrell
+ *
+ */
public class ModuleChangeEvent extends GwtEvent<ModuleChangeEventHandler> {
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
-public static Type<ModuleChangeEventHandler> TYPE = new Type<ModuleChangeEventHandler>();
+ public static Type<ModuleChangeEventHandler> TYPE = new Type<ModuleChangeEventHandler>();
+
+ /** newly selected depth of stud */
+ private final String newDepth;
+ /** newly selected module */
private final String newModule;
- private final String newDepth;
+ /** newly selected submodule */
private final String newSubModule;
+ /**
+ * creates an event alerting of the new chosen combination of
+ * module/sub-module/depth
+ *
+ * @param newModule new module
+ * @param newSubModule new sub module
+ * @param newDepth new depth of study
+ */
public ModuleChangeEvent(final String newModule, final String newSubModule, final String newDepth) {
this.newModule = newModule;
this.newSubModule = newSubModule;
this.newDepth = newDepth;
}
+ @Override
+ public Type<ModuleChangeEventHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ /**
+ *
+ * @return the depth
+ */
public String getNewDepth() {
return newDepth;
}
- public String getNewSubModule() {
- return newSubModule;
- }
-
+ /**
+ * @return the new module
+ */
public String getNewModule() {
return newModule;
}
- @Override
- protected void dispatch(ModuleChangeEventHandler handler) {
- handler.onModuleChange(this);
+ /**
+ *
+ * @return the new sub module
+ */
+ public String getNewSubModule() {
+ return newSubModule;
}
@Override
- public Type<ModuleChangeEventHandler> getAssociatedType() {
- return TYPE;
+ protected void dispatch(final ModuleChangeEventHandler handler) {
+ handler.onModuleChange(this);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -3,35 +3,51 @@
import com.google.gwt.event.shared.GwtEvent;
import com.tyndalehouse.step.web.client.eventhandler.ScriptureChangeEventHandler;
+/**
+ * Scripture change is fired when the scripture viewed on the screen is
+ * requested to be different
+ *
+ * @author cjburrell
+ *
+ */
public class ScriptureChangeEvent extends GwtEvent<ScriptureChangeEventHandler> {
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
-public static Type<ScriptureChangeEventHandler> TYPE = new Type<ScriptureChangeEventHandler>();
+ // TODO: remove this type into an abstract layer
+ public static Type<ScriptureChangeEventHandler> TYPE = new Type<ScriptureChangeEventHandler>();
/**
* This is the new reference that is being fired.
*/
private final String newReference;
+ /**
+ * Constructor to create a scripture change even with a biblical reference
+ *
+ * @param newReference the new reference that has been chosen by the user
+ */
public ScriptureChangeEvent(final String newReference) {
this.newReference = newReference;
}
@Override
- protected void dispatch(ScriptureChangeEventHandler handler) {
- handler.onScriptureChange(this);
-
- }
-
- @Override
public Type<ScriptureChangeEventHandler> getAssociatedType() {
return TYPE;
}
+ /**
+ * @return the new biblical reference that has been selected
+ */
public String getNewReference() {
return newReference;
}
+ @Override
+ protected void dispatch(final ScriptureChangeEventHandler handler) {
+ handler.onScriptureChange(this);
+
+ }
+
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimebandListUpdateRequiredEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimebandListUpdateRequiredEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimebandListUpdateRequiredEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -6,44 +6,54 @@
import com.tyndalehouse.step.web.client.eventhandler.TimebandListUpdateRequiredEventHandler;
import com.tyndalehouse.step.web.client.toolkit.timeline.helpers.CurrentBandStats;
+/**
+ * Event signalling that the timebands have been changed and an update is
+ * required from any component keeping track of counts
+ *
+ * @author cjburrell
+ *
+ */
public class TimebandListUpdateRequiredEvent extends GwtEvent<TimebandListUpdateRequiredEventHandler> {
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
-public static Type<TimebandListUpdateRequiredEventHandler> TYPE = new Type<TimebandListUpdateRequiredEventHandler>();
- private final List<CurrentBandStats> stats;
+ public static Type<TimebandListUpdateRequiredEventHandler> TYPE = new Type<TimebandListUpdateRequiredEventHandler>();
/**
- * @return the stats
+ * List of new statistics, one for each band
*/
- public List<CurrentBandStats> getTimelineStats() {
- return stats;
- }
+ private final List<CurrentBandStats> stats;
/**
* The timeline is passed in, so that the timeband list can know what the
* new values are
*
- * @param stats
- * timeline to be passed in
+ * @param stats timeline to be passed in
*/
- public TimebandListUpdateRequiredEvent(List<CurrentBandStats> stats) {
+ public TimebandListUpdateRequiredEvent(final List<CurrentBandStats> stats) {
this.stats = stats;
}
@Override
- protected void dispatch(TimebandListUpdateRequiredEventHandler handler) {
- handler.onTimebandListRequiringUpdate(this);
+ public Type<TimebandListUpdateRequiredEventHandler> getAssociatedType() {
+ // TODO Auto-generated method stub
+ return TYPE;
+ }
+ /**
+ * @return the stats
+ */
+ public List<CurrentBandStats> getTimelineStats() {
+ return stats;
}
@Override
- public Type<TimebandListUpdateRequiredEventHandler> getAssociatedType() {
- // TODO Auto-generated method stub
- return TYPE;
+ protected void dispatch(final TimebandListUpdateRequiredEventHandler handler) {
+ handler.onTimebandListRequiringUpdate(this);
+
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -7,35 +7,60 @@
import com.tyndalehouse.step.web.client.eventhandler.TimelineScrollEventHandler;
import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
+/**
+ * Event signalling the timeline has been scrolled. This event contains the list
+ * of timebands, and the portions of those that need updating
+ *
+ * @author cjburrell
+ *
+ */
public class TimelineScrollEvent extends GwtEvent<TimelineScrollEventHandler> {
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
-public static Type<TimelineScrollEventHandler> TYPE = new Type<TimelineScrollEventHandler>();
+ public static Type<TimelineScrollEventHandler> TYPE = new Type<TimelineScrollEventHandler>();
+
+ /**
+ * list of requests to the server on which portions of which bands need to
+ * be updated
+ */
private List<TimeBandVisibleDate> timebandVisibleDates;
+ /**
+ * default constructor
+ */
public TimelineScrollEvent() {
timebandVisibleDates = new ArrayList<TimeBandVisibleDate>();
}
- public void addTimebandVisibleDate(int timebandId, long minDate, long maxDate) {
- TimeBandVisibleDate visibleDate = new TimeBandVisibleDate(timebandId, minDate, maxDate);
+ /**
+ * adds a timeband and the portion of time that needs updating
+ *
+ * @param timebandId the timeband id
+ * @param minDate the minimum date
+ * @param maxDate the maximum date
+ */
+ public void addTimebandVisibleDate(final int timebandId, final long minDate, final long maxDate) {
+ final TimeBandVisibleDate visibleDate = new TimeBandVisibleDate(timebandId, minDate, maxDate);
addTimebandVisibleDate(visibleDate);
}
+ /**
+ * adds a @see {@link TimeBandVisibleDate} to the event
+ *
+ * @param visibleDate the TimeBandVisibleDate object containing details of
+ * which parts of the timeband (min, max) need updating.
+ */
public void addTimebandVisibleDate(final TimeBandVisibleDate visibleDate) {
if (!visibleDate.isNoRequest()) {
timebandVisibleDates.add(visibleDate);
}
}
- /**
- * @param timebandVisibleDates
- * the timebandVisibleDates to set
- */
- public void setTimebandVisibleDates(List<TimeBandVisibleDate> timebandVisibleDates) {
- this.timebandVisibleDates = timebandVisibleDates;
+ @Override
+ public Type<TimelineScrollEventHandler> getAssociatedType() {
+ return TYPE;
}
/**
@@ -45,13 +70,15 @@
return timebandVisibleDates;
}
- @Override
- protected void dispatch(TimelineScrollEventHandler handler) {
- handler.onScroll(this);
+ /**
+ * @param timebandVisibleDates the timebandVisibleDates to set
+ */
+ public void setTimebandVisibleDates(final List<TimeBandVisibleDate> timebandVisibleDates) {
+ this.timebandVisibleDates = timebandVisibleDates;
}
@Override
- public Type<TimelineScrollEventHandler> getAssociatedType() {
- return TYPE;
+ protected void dispatch(final TimelineScrollEventHandler handler) {
+ handler.onScroll(this);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/UserInterestInBandEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/UserInterestInBandEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/UserInterestInBandEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -3,27 +3,52 @@
import com.google.gwt.event.shared.GwtEvent;
import com.tyndalehouse.step.web.client.eventhandler.UserInterestInBandEventHandler;
+/**
+ * Event signalling the user is interested or not interested in a new timeband
+ *
+ * @author cjburrell
+ *
+ */
public class UserInterestInBandEvent extends GwtEvent<UserInterestInBandEventHandler> {
/**
- * The default Type Handler
- * Type is parameterized by the handler type in order to make the addHandler method type safe.
+ * The default Type Handler Type is parameterized by the handler type in
+ * order to make the addHandler method type safe.
*/
-public static Type<UserInterestInBandEventHandler> TYPE = new Type<UserInterestInBandEventHandler>();
+ public static Type<UserInterestInBandEventHandler> TYPE = new Type<UserInterestInBandEventHandler>();
+
+ /**
+ * the band the user has selected to choose or dismiss
+ */
private final int bandId;
+
+ /**
+ * whether the user wants to see the band or not
+ */
private final Boolean isOfInterest;
/**
+ * creates the event
+ *
+ * @param bandId the band that the user selected
+ * @param isOfInterest whether the user is interested in it or not
+ */
+ public UserInterestInBandEvent(final int bandId, final Boolean isOfInterest) {
+ this.bandId = bandId;
+ this.isOfInterest = isOfInterest;
+ }
+
+ @Override
+ public Type<UserInterestInBandEventHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ /**
* @return the bandId
*/
public int getBandId() {
return bandId;
}
- public UserInterestInBandEvent(int bandId, Boolean isOfInterest) {
- this.bandId = bandId;
- this.isOfInterest = isOfInterest;
- }
-
/**
* @return the isOfInterest
*/
@@ -32,13 +57,8 @@
}
@Override
- protected void dispatch(UserInterestInBandEventHandler handler) {
+ protected void dispatch(final UserInterestInBandEventHandler handler) {
handler.onUserInterestedInBand(this);
}
- @Override
- public Type<UserInterestInBandEventHandler> getAssociatedType() {
- return TYPE;
- }
-
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -3,6 +3,12 @@
import com.google.gwt.event.shared.GwtEvent;
import com.tyndalehouse.step.web.client.eventhandler.VersionChangeEventHandler;
+/**
+ * Event signalling a change of bible version of the UI
+ *
+ * @author cjburrell
+ *
+ */
public class VersionChangeEvent extends GwtEvent<VersionChangeEventHandler> {
/**
* The default Type Handler Type is parameterized by the handler type in
@@ -11,13 +17,13 @@
public static Type<VersionChangeEventHandler> TYPE = new Type<VersionChangeEventHandler>();
@Override
- protected void dispatch(final VersionChangeEventHandler handler) {
- handler.onVersionChange(this);
+ public Type<VersionChangeEventHandler> getAssociatedType() {
+ return TYPE;
}
@Override
- public Type<VersionChangeEventHandler> getAssociatedType() {
- return TYPE;
+ protected void dispatch(final VersionChangeEventHandler handler) {
+ handler.onVersionChange(this);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/service/refdata/ModuleName.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/service/refdata/ModuleName.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/service/refdata/ModuleName.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -28,6 +28,8 @@
if (parent == null) {
this.parent = "Module";
+ } else {
+ this.parent = parent;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SourceListBox.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SourceListBox.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SourceListBox.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -1,6 +1,7 @@
package com.tyndalehouse.step.web.client.toolkit;
import java.util.SortedMap;
+import java.util.Map.Entry;
import com.google.gwt.user.client.ui.ListBox;
@@ -21,8 +22,9 @@
@Override
public void setSource(final SortedMap<String, String> source) {
clearSource();
- for (final String key : source.keySet()) {
- addItem(source.get(key), key);
+ for (final Entry<String, String> entry : source.entrySet()) {
+ addItem(entry.getValue(), entry.getKey());
}
+
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -232,7 +232,7 @@
*
* @param track the track on which the event will be painted
*/
- public synchronized void paint(final TapeTrack track) {
+ public void paint(final TapeTrack track) {
// all we do is attach it to the parent if need be.
if (!isRendered) {
setupDivProperties();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -103,9 +103,9 @@
// Log.debug("Drawing segments");
for (long ii = 0; ii < numberOfVisibleSegments + 1; ii++) {
// check segment not already drawn...
- final Integer key = new Integer(relativeLeft);
- final Integer keyMinus1 = new Integer(relativeLeft - 1);
- final Integer keyPlus1 = new Integer(relativeLeft + 1);
+ final Integer key = Integer.valueOf(relativeLeft);
+ final Integer keyMinus1 = Integer.valueOf(relativeLeft - 1);
+ final Integer keyPlus1 = Integer.valueOf(relativeLeft + 1);
// due to rounding errors, we need to check 1 below key and 1 above
// too
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeband.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeband.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeband.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -435,7 +435,8 @@
* @return the TimeEvent
*/
public TimeEvent getSingleEvent(final String eventId) {
- return events.get(eventId);
+ final Integer key = Integer.parseInt(eventId);
+ return events.get(key);
}
/**
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -414,15 +414,6 @@
}
/**
- * removes a band from the timeline
- *
- * @param bandId band id of the timeband to be removed
- */
- public void removeBand(final String bandId) {
- timebands.remove(bandId);
- }
-
- /**
* Repaints a particular timeband
*
* @param originDate date at which to start
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -124,7 +124,7 @@
public void highlight(final List<String> lemmaList) {
for (final VerseLabel vl : lemmaWords) {
for (final String l : lemmaList) {
- if (vl.getLemma().equals(l)) {
+ if (vl.getLemma().contains(l)) {
vl.setStyleName(ScriptureDisplayConstants.EMPHASISE);
} else {
vl.removeStyleName(ScriptureDisplayConstants.EMPHASISE);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQuery.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQuery.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQuery.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -8,8 +8,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.collections.functors.ForClosure;
-
/**
* Step Query to be executed against the database. This this is then given to
* the StepQueryRunner and executed It contains the list of arguments, the types
@@ -43,8 +41,7 @@
}
/**
- * adding an argument as found in the query definition: {@link ForClosure}
- * e.g. <code>
+ * adding an argument as found in the query definition: e.g. <code>
* select 1 from table where value = #paramName#
* </code>
*
@@ -127,8 +124,8 @@
* the prepared statement
* @throws SQLException an exception thrown in case something goes wrong
*/
- private void setArgument(final PreparedStatement ps, final int sqlType, final Object value, final int argIndex)
- throws SQLException {
+ private void setArgument(final PreparedStatement ps, final int sqlType, final Object value,
+ final int argIndex) throws SQLException {
// check for null first
if (value == null) {
ps.setNull(argIndex, sqlType);
@@ -153,8 +150,8 @@
ps.setString(argIndex, (String) value);
break;
default:
- throw new SQLException(String
- .format("The STEP query framework does not yet support this type/value (%d, %s)", sqlType, value
+ throw new SQLException(String.format(
+ "The STEP query framework does not yet support this type/value (%d, %s)", sqlType, value
.toString()));
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQueryRunnerImpl.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQueryRunnerImpl.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/StepQueryRunnerImpl.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -114,7 +114,7 @@
}
final long tInit = System.currentTimeMillis();
- StepQuery stepQuery;
+ StepQuery stepQuery = null;
try {
stepQuery = prepareStepQuery(processor.getQuery());
@@ -136,21 +136,21 @@
final long tAfterParseResults = System.currentTimeMillis();
if (log.isInfoEnabled()) {
- log.info(String.format("StepQueryRunner (load, parse, execute, return) = (%d, %d, %d, %d)", tAfterLoad
- - tInit, tAfterParse - tAfterLoad, tAfterExecute - tAfterLog, tAfterParseResults
- - tAfterExecute));
+ log.info(String.format("StepQueryRunner (load, parse, execute, return) = (%d, %d, %d, %d)",
+ tAfterLoad - tInit, tAfterParse - tAfterLoad, tAfterExecute - tAfterLog,
+ tAfterParseResults - tAfterExecute));
}
return results;
} catch (final ConfigNotLoadedException e) {
log.error("Unable to load the configuration file to set up datasource.");
- throw new UnableToRunQueryException(e);
+ throw new UnableToRunQueryException(e, stepQuery);
} catch (final MalformedStepQueryException e) {
log.error("An exception occured during the execution of the sql query");
- throw new UnableToRunQueryException(e);
+ throw new UnableToRunQueryException(e, stepQuery);
} catch (final SQLException e) {
log.error("An exception occured file trying to locate the file.");
- throw new UnableToRunQueryException(e);
+ throw new UnableToRunQueryException(e, stepQuery);
} finally {
// close the statement
if (ps != null) {
@@ -246,13 +246,17 @@
final Integer type = Types.class.getField(paramType.toUpperCase()).getInt(null);
q.addParamTypeMapping(paramName, type);
} catch (final IllegalArgumentException e) {
- throw new MalformedStepQueryException(String.format("Could not parse argument type: %s", paramType), e);
+ throw new MalformedStepQueryException(String.format("Could not parse argument type: %s",
+ paramType), e);
} catch (final SecurityException e) {
- throw new MalformedStepQueryException(String.format("Could not parse argument type: %s", paramType), e);
+ throw new MalformedStepQueryException(String.format("Could not parse argument type: %s",
+ paramType), e);
} catch (final IllegalAccessException e) {
- throw new MalformedStepQueryException(String.format("Could not parse argument type: %s", paramType), e);
+ throw new MalformedStepQueryException(String.format("Could not parse argument type: %s",
+ paramType), e);
} catch (final NoSuchFieldException e) {
- throw new MalformedStepQueryException(String.format("Could not parse argument type: %s", paramType), e);
+ throw new MalformedStepQueryException(String.format("Could not parse argument type: %s",
+ paramType), e);
}
}
@@ -269,7 +273,8 @@
* @throws MalformedStepQueryException an exception is thrown to indicate an
* issue with the sql file that could not be parsed
*/
- private StepQuery prepareStepQuery(final Query query) throws ConfigNotLoadedException, MalformedStepQueryException {
+ private StepQuery prepareStepQuery(final Query query) throws ConfigNotLoadedException,
+ MalformedStepQueryException {
StepQuery stepQuery = queries.get(query);
// check whether query is in cache
if (stepQuery == null) {
@@ -301,7 +306,8 @@
// read query from file
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
- final String filename = String.format("%s%s/%s.sql", basePath, baseComponent, filenameBase.toLowerCase());
+ final String filename = String.format("%s%s/%s.sql", basePath, baseComponent, filenameBase
+ .toLowerCase());
final URL fileLocation = loader.getResource(filename);
StepQuery stepQuery = null;
StringBuffer q;
@@ -321,7 +327,8 @@
queries.put(query, stepQuery);
}
} catch (final IOException e) {
- throw new MalformedStepQueryException(String.format("Error reading query file: ", filenameBase), e);
+ throw new MalformedStepQueryException(
+ String.format("Error reading query file: %s", filenameBase), e);
}
return stepQuery;
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/UnableToRunQueryException.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/UnableToRunQueryException.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/framework/UnableToRunQueryException.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -1,18 +1,57 @@
package com.tyndalehouse.step.web.server.db.framework;
+
+/**
+ * An issue occured during the parsing or running of a query
+ *
+ * @author CJBurrell
+ *
+ */
public class UnableToRunQueryException extends Exception {
- public UnableToRunQueryException(Throwable t) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7810594097160119720L;
+
+ /**
+ * The StepQuery at the origin of the exception
+ */
+ private StepQuery stepQuery;
+
+ /**
+ * Pass in the root cause of the exception
+ *
+ * @param t
+ */
+ public UnableToRunQueryException(final Throwable t) {
super(t);
}
- public UnableToRunQueryException() {
- // TODO Auto-generated constructor stub
+ /**
+ * Unable to run a query exception, with the stepQuery itself, and the root
+ * exception
+ *
+ * @param e
+ * @param stepQuery
+ */
+ public UnableToRunQueryException(final Throwable t, final StepQuery stepQuery) {
+ this(t);
+ this.stepQuery = stepQuery;
}
/**
- *
+ * @return the stepQuery
*/
- private static final long serialVersionUID = -7810594097160119720L;
+ public final StepQuery getStepQuery() {
+ return stepQuery;
+ }
+ /**
+ * @param stepQuery the stepQuery to set
+ */
+ public final void setStepQuery(final StepQuery stepQuery) {
+ this.stepQuery = stepQuery;
+ }
+
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/timeline/TimelineSetupDataProcessor.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/timeline/TimelineSetupDataProcessor.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/timeline/TimelineSetupDataProcessor.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -15,11 +15,11 @@
import com.tyndalehouse.step.web.shared.beans.TimelineBean;
public class TimelineSetupDataProcessor implements ResultSetProcessor<TimelineBean> {
+ private static final String TIMEBAND_DESCRIPTION = "timeband_description";
private static final String TIMEBAND_ID = "timeband_id";
- private static final String TIMEBAND_DESCRIPTION = "timeband_description";
private static final String TIMEBAND_UNIT = "timeband_unit";
- private Map<String, Object> params;
+ private final Map<String, Object> params;
/**
* Given a scripture range, it
@@ -32,11 +32,23 @@
}
@Override
- public List<TimelineBean> process(final ResultSet rs) throws MalformedStepQueryException, ConfigNotLoadedException, SQLException {
- List<TimelineBean> timelines = new ArrayList<TimelineBean>();
+ public Map<String, Object> getParameters() {
+ return params;
+ }
+
+ @Override
+ public Query getQuery() {
+ return QueryImpl.GET_TIMELINE_SETUP_DATA;
+ }
+
+ @Override
+ public List<TimelineBean> process(final ResultSet rs) throws MalformedStepQueryException,
+ ConfigNotLoadedException, SQLException {
+ final List<TimelineBean> timelines = new ArrayList<TimelineBean>();
+
while (rs.next()) {
- TimelineBean bean = new TimelineBean();
+ final TimelineBean bean = new TimelineBean();
bean.setTimelineId(rs.getInt(TIMEBAND_ID));
bean.setTimelineDescription(rs.getString(TIMEBAND_DESCRIPTION));
bean.setUnit(rs.getString(TIMEBAND_UNIT));
@@ -45,15 +57,4 @@
return timelines;
}
- @Override
- public Map<String, Object> getParameters() {
- return params;
-
- }
-
- @Override
- public Query getQuery() {
- return QueryImpl.GET_TIMELINE_SETUP_DATA;
- }
-
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -19,6 +19,9 @@
public class GetAvailableBibleVersionsHandler extends
StepHandler<GetAvailableBibleVersionsCommand, GetAvailableBibleVersionsResult> {
+ /**
+ * Default logger
+ */
private final Log logger;
@Inject
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -18,6 +18,9 @@
import com.tyndalehouse.step.web.shared.result.GetBibleBooksCommandResult;
public class GetBibleBooksHandler implements ActionHandler<GetBibleBooksCommand, GetBibleBooksCommandResult> {
+ /**
+ * Default logger
+ */
private final Log logger;
@Inject
@@ -87,7 +90,8 @@
// TODO: ensure we base this on a lookup of user's preferences
@Override
- public GetBibleBooksCommandResult execute(final GetBibleBooksCommand arg0, final ExecutionContext arg1) throws ActionException {
+ public GetBibleBooksCommandResult execute(final GetBibleBooksCommand arg0, final ExecutionContext arg1)
+ throws ActionException {
logger.info("GetBibleBooksCommandResult has been called...");
logger.info("========= We don't actually need to do this - this is simply a test");
@@ -129,8 +133,8 @@
}
@Override
- public void rollback(final GetBibleBooksCommand arg0, final GetBibleBooksCommandResult arg1, final ExecutionContext context)
- throws ActionException {
+ public void rollback(final GetBibleBooksCommand arg0, final GetBibleBooksCommandResult arg1,
+ final ExecutionContext context) throws ActionException {
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -48,6 +48,9 @@
public class GetCurrentBibleTextHandler implements
ActionHandler<GetCurrentBibleTextCommand, GetCurrentBibleTextResult> {
+ /**
+ * Default logger
+ */
private final Log logger;
@Inject
@@ -123,7 +126,7 @@
private void doMilestone(final Element verseContent, final Verse v) {
final Milestone m = new Milestone();
m.setMarker(verseContent.getAttributeValue(OSISConstants.MARKER));
- m.setType(verseContent.getAttributeValue(OSISConstants.TYPE));
+ m.setType(verseContent.getAttributeValue(OSISUtil.OSIS_ATTR_TYPE));
v.addTextualElement(m);
}
@@ -135,7 +138,7 @@
*/
private void doNote(final Element verseContent, final Verse v) {
final Note n = new Note();
- n.setType(verseContent.getAttributeValue(OSISConstants.TYPE));
+ n.setType(verseContent.getAttributeValue(OSISUtil.OSIS_ATTR_TYPE));
n.setText(verseContent.getText());
v.addTextualElement(n);
}
@@ -183,7 +186,7 @@
*/
private void doTitle(final Element titleElement, final Passage passage) {
final Title title = new Title();
- title.setType(titleElement.getAttributeValue(OSISConstants.TYPE));
+ title.setType(titleElement.getAttributeValue(OSISUtil.OSIS_ATTR_TYPE));
title.setText(titleElement.getText());
passage.addPassageElement(title);
}
@@ -196,7 +199,7 @@
*/
private void doTransChange(final Element verseContent, final Verse v) {
final TransChange t = new TransChange();
- t.setType(verseContent.getAttributeValue(OSISConstants.TYPE));
+ t.setType(verseContent.getAttributeValue(OSISUtil.OSIS_ATTR_TYPE));
t.setText(verseContent.getText());
v.addTextualElement(t);
}
@@ -210,16 +213,16 @@
private void doVerse(final Element e, final Passage passage) {
final List<Content> verseWords = e.getContent();
final Verse v = new Verse();
- v.setOsisID(e.getAttributeValue(OSISConstants.OSISID));
+ v.setOsisID(e.getAttributeValue(OSISUtil.OSIS_ATTR_OSISID));
passage.addPassageElement(v);
for (final Content c : verseWords) {
if (c instanceof Element) {
final Element verseContent = (Element) c;
final String tagName = verseContent.getName();
- if (tagName.equals(OSISConstants.WORD)) {
+ if (tagName.equals(OSISUtil.OSIS_ELEMENT_W)) {
doWord(verseContent, v);
- } else if (tagName.equals(OSISConstants.NOTE)) {
+ } else if (tagName.equals(OSISUtil.OSIS_ELEMENT_NOTE)) {
doNote(verseContent, v);
} else if (tagName.equals(OSISConstants.MILESTONE)) {
doMilestone(verseContent, v);
@@ -249,8 +252,8 @@
private void doWord(final Element verseContent, final Verse v) {
final Word w = new Word();
- final String lemmas = verseContent.getAttributeValue(OSISConstants.LEMMA);
- final String morphs = verseContent.getAttributeValue(OSISConstants.MORPH);
+ final String lemmas = verseContent.getAttributeValue(OSISUtil.ATTRIBUTE_W_LEMMA);
+ final String morphs = verseContent.getAttributeValue(OSISUtil.ATTRIBUTE_W_MORPH);
// TODO: make a constant
if (lemmas != null) {
@@ -435,9 +438,9 @@
if (el instanceof Element) {
final Element e = (Element) el;
- if (e.getName().equals(OSISConstants.TITLE)) {
+ if (e.getName().equals(OSISUtil.OSIS_ELEMENT_TITLE)) {
doTitle(e, passage);
- } else if (e.getName().equals(OSISConstants.VERSE)) {
+ } else if (e.getName().equals(OSISUtil.OSIS_ELEMENT_VERSE)) {
doVerse(e, passage);
}
} else {
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetDictionaryDefinitionHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetDictionaryDefinitionHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetDictionaryDefinitionHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -28,24 +28,29 @@
import com.tyndalehouse.step.web.shared.command.GetDictionaryDefinitionCommand;
import com.tyndalehouse.step.web.shared.result.GetDictionaryDefinitionResult;
-public class GetDictionaryDefinitionHandler implements ActionHandler<GetDictionaryDefinitionCommand, GetDictionaryDefinitionResult> {
+public class GetDictionaryDefinitionHandler implements
+ ActionHandler<GetDictionaryDefinitionCommand, GetDictionaryDefinitionResult> {
+ /**
+ * Default logger
+ */
private final Log logger;
@Inject
- public GetDictionaryDefinitionHandler(Log logger) {
+ public GetDictionaryDefinitionHandler(final Log logger) {
this.logger = logger;
}
@Override
- public GetDictionaryDefinitionResult execute(GetDictionaryDefinitionCommand command, ExecutionContext arg1) throws ActionException {
- List<String> referenceList = command.getLookupReferencce();
- GetDictionaryDefinitionResult result = new GetDictionaryDefinitionResult();
+ public GetDictionaryDefinitionResult execute(final GetDictionaryDefinitionCommand command,
+ final ExecutionContext arg1) throws ActionException {
+ final List<String> referenceList = command.getLookupReferencce();
+ final GetDictionaryDefinitionResult result = new GetDictionaryDefinitionResult();
- StringBuffer definitions = new StringBuffer(300);
+ final StringBuffer definitions = new StringBuffer(300);
// for each definition: TODO : probably want to pass back a list of
// definitions, and tab them
// on the popup!
- for (String reference : referenceList) {
+ for (final String reference : referenceList) {
definitions.append(lookUpDefinition(reference));
definitions.append("<hr />");
@@ -54,62 +59,43 @@
return result;
}
- private String lookUpDefinition(final String reference) throws ActionException {
- if (StringUtils.isEmpty(reference)) {
- throw new ActionException("Reference was not provided");
- }
- logger.error("definition lookup command");
- String initials = getInitialsFromReference(reference);
- String lookupKey = getLookupKeyFromReference(reference);
+ @Override
+ public Class<GetDictionaryDefinitionCommand> getActionType() {
+ return GetDictionaryDefinitionCommand.class;
+ }
- try {
- // TODO: ensure a lookup key exists!
- // TODO: make a common adapter api to access JSword
- Book currentBook = Books.installed().getBook(initials);
- BookData data = new BookData(currentBook, currentBook.getKey(lookupKey));
- String xsltedDefinition = doXslt(data, data.getOsisFragment());
- return xsltedDefinition;
- } catch (NoSuchKeyException e) {
- logger.error("An error occurred looking up the passage", e);
- throw new ActionException(e);
- } catch (BookException e) {
- logger.error("A book exception has occurred whilte looking up the passage", e);
- throw new ActionException(e);
- }
+ @Override
+ public void rollback(final GetDictionaryDefinitionCommand arg0, final GetDictionaryDefinitionResult arg1,
+ final ExecutionContext arg2) throws ActionException {
+ logger.error("Get Dictionary definition Text rolling back");
+
}
- private String doXslt(BookData data, Element osisFragment) {
+ private String doXslt(final BookData data, final Element osisFragment) {
if (data == null) {
return "";
}
try {
- SAXEventProvider osissep = data.getSAXEventProvider();
+ final SAXEventProvider osissep = data.getSAXEventProvider();
- TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) new ConfigurableHTMLConverter().convert(osissep);
- String text = XMLUtil.writeToString(htmlsep);
+ final TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) new ConfigurableHTMLConverter()
+ .convert(osissep);
+ final String text = XMLUtil.writeToString(htmlsep);
return text;
- } catch (SAXException e) {
+ } catch (final SAXException e) {
Reporter.informUser(this, e);
- } catch (BookException e) {
+ } catch (final BookException e) {
Reporter.informUser(this, e);
- } catch (TransformerException e) {
+ } catch (final TransformerException e) {
Reporter.informUser(this, e);
}
return "";
}
- private String getLookupKeyFromReference(final String reference) throws ActionException {
- if (reference.toLowerCase().startsWith(JSwordConstants.STRONG_PATTERN_START)) {
- // remove strong:H or strong:G
- return reference.substring(JSwordConstants.STRONG_PATTERN_START.length() + 1);
- }
- throw new ActionException(String.format("Lookup key not recognised: %", reference));
- }
-
private String getInitialsFromReference(final String reference) throws ActionException {
if (reference.toLowerCase().startsWith(JSwordConstants.STRONG_PATTERN_START)) {
- int charPosition = JSwordConstants.STRONG_PATTERN_START.length();
+ final int charPosition = JSwordConstants.STRONG_PATTERN_START.length();
if (reference.charAt(charPosition) == JSwordConstants.STRONG_HEBREW_MARKER) {
return JSwordConstants.STRONG_HEBREW_DICTIONARY_INITIALS;
} else if (reference.charAt(charPosition) == JSwordConstants.STRONG_GREEK_MARKER) {
@@ -120,14 +106,43 @@
throw new ActionException(String.format("Dictionary reference not recognised: %s", reference));
}
- @Override
- public void rollback(GetDictionaryDefinitionCommand arg0, GetDictionaryDefinitionResult arg1, ExecutionContext arg2) throws ActionException {
- logger.error("Get Dictionary definition Text rolling back");
-
+ private String getLookupKeyFromReference(final String reference) throws ActionException {
+ if (reference.toLowerCase().startsWith(JSwordConstants.STRONG_PATTERN_START)) {
+ // remove strong:H or strong:G
+ return reference.substring(JSwordConstants.STRONG_PATTERN_START.length() + 1);
+ }
+ throw new ActionException(String.format("Lookup key not recognised: %s", reference));
}
- @Override
- public Class<GetDictionaryDefinitionCommand> getActionType() {
- return GetDictionaryDefinitionCommand.class;
+ /**
+ * Looks up a definition given a reference in the default JSword module
+ *
+ * @param reference reference, for e.g. a Strong number
+ * @return the definition
+ * @throws ActionException an exception occurring if the reference is
+ * invalid
+ */
+ private String lookUpDefinition(final String reference) throws ActionException {
+ if (StringUtils.isEmpty(reference)) {
+ throw new ActionException("Reference was not provided");
+ }
+ logger.error("definition lookup command");
+ final String initials = getInitialsFromReference(reference);
+ final String lookupKey = getLookupKeyFromReference(reference);
+
+ try {
+ // TODO: ensure a lookup key exists!
+ // TODO: make a common adapter api to access JSword
+ final Book currentBook = Books.installed().getBook(initials);
+ final BookData data = new BookData(currentBook, currentBook.getKey(lookupKey));
+ final String xsltedDefinition = doXslt(data, data.getOsisFragment());
+ return xsltedDefinition;
+ } catch (final NoSuchKeyException e) {
+ logger.error("An error occurred looking up the passage", e);
+ throw new ActionException(e);
+ } catch (final BookException e) {
+ logger.error("A book exception has occurred whilte looking up the passage", e);
+ throw new ActionException(e);
+ }
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetEventsForDateRangeHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetEventsForDateRangeHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetEventsForDateRangeHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -19,8 +19,23 @@
import com.tyndalehouse.step.web.shared.command.GetEventsForDateRangeCommand;
import com.tyndalehouse.step.web.shared.result.GetEventsForDateRangeResult;
-public class GetEventsForDateRangeHandler implements ActionHandler<GetEventsForDateRangeCommand, GetEventsForDateRangeResult> {
+/**
+ * Command that gets relevant events on a date range. Currently this executes
+ * multiple queries against the database
+ *
+ * @author CJBurrell
+ *
+ */
+public class GetEventsForDateRangeHandler implements
+ ActionHandler<GetEventsForDateRangeCommand, GetEventsForDateRangeResult> {
+ /**
+ * Default logger
+ */
private final Log logger;
+
+ /**
+ * The step query runner to run queries against the database
+ */
private final StepQueryRunner queryRunner;
@Inject
@@ -33,13 +48,15 @@
// TODO: this needs to change to take into account the three different types
// of date precision but for now,
// let's get something working
- public GetEventsForDateRangeResult execute(final GetEventsForDateRangeCommand event, final ExecutionContext arg1) throws ActionException {
+ public GetEventsForDateRangeResult execute(final GetEventsForDateRangeCommand event,
+ final ExecutionContext arg1) throws ActionException {
final GetEventsForDateRangeResult result = new GetEventsForDateRangeResult();
final List<TimeBandVisibleDate> timebands = event.getVisbleDates();
try {
for (final TimeBandVisibleDate tvd : timebands) {
List<TimelineEventBean> events;
- events = queryRunner.run(new TimeBandVisibleDateProcessor(tvd.getMinDate(), tvd.getMaxDate(), tvd.getTimebandId()));
+ events = queryRunner.run(new TimeBandVisibleDateProcessor(tvd.getMinDate(), tvd.getMaxDate(),
+ tvd.getTimebandId()));
result.getEvents().addAll(events);
}
} catch (final UnableToRunQueryException e) {
@@ -51,11 +68,21 @@
return result;
}
+ @Override
+ public Class<GetEventsForDateRangeCommand> getActionType() {
+ return GetEventsForDateRangeCommand.class;
+ }
+
+ @Override
+ public void rollback(final GetEventsForDateRangeCommand arg0, final GetEventsForDateRangeResult arg1,
+ final ExecutionContext arg2) throws ActionException {
+
+ }
+
/**
* Logs which events have been retrieved in trace mode
*
- * @param events
- * events to be traced
+ * @param events events to be traced
*/
private void logEventsRetrieved(final List<TimelineEventBean> events) {
final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy G");
@@ -63,27 +90,19 @@
if (logger.isTraceEnabled()) {
for (final TimelineEventBean teb : events) {
if (teb.getFromDate() != null && teb.getToDate() != null) {
- logger.trace(String.format("returning: %s %s-%s (tb_id: %d)", teb.getName(), sdf.format(new Date(teb.getFromDate())), sdf
- .format(new Date(teb.getToDate())), teb.getTimelineId()));
+ logger.trace(String.format("returning: %s %s-%s (tb_id: %d)", teb.getName(), sdf
+ .format(new Date(teb.getFromDate())), sdf.format(new Date(teb.getToDate())), teb
+ .getTimelineId()));
} else if (teb.getFromDate() != null) {
- logger.trace(String.format("returning: %s %s (tb_id: %d)", teb.getName(), sdf.format(new Date(teb.getFromDate())), teb
+ logger.trace(String.format("returning: %s %s (tb_id: %d)", teb.getName(), sdf
+ .format(new Date(teb.getFromDate())), teb.getTimelineId()));
+ } else {
+ logger.trace(String.format("returning: %s (tb_id: %d)", teb.getName(), teb
.getTimelineId()));
- } else {
- logger.trace(String.format("returning: %s (tb_id: %d)", teb.getName(), teb.getTimelineId()));
}
}
}
logger.trace(String.format("Returning %d events to the client", events.size()));
}
-
- @Override
- public Class<GetEventsForDateRangeCommand> getActionType() {
- return GetEventsForDateRangeCommand.class;
- }
-
- @Override
- public void rollback(final GetEventsForDateRangeCommand arg0, final GetEventsForDateRangeResult arg1, final ExecutionContext arg2) throws ActionException {
-
- }
-}
\ No newline at end of file
+}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -26,7 +26,13 @@
public class GetTimelineOriginForScriptureHandler implements
ActionHandler<GetTimelineOriginForScriptureCommand, GetTimelineOriginForScriptureResult> {
+ /**
+ * Default logger
+ */
private final Log log;
+ /**
+ * The step query runner to run queries against the database
+ */
private final StepQueryRunner queryRunner;
@Inject
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -18,7 +18,13 @@
public class GetTimelineUISetupHandler implements
ActionHandler<GetTimelineUISetupCommand, GetTimelineUISetupResult> {
+ /**
+ * Default logger
+ */
private final Log logger;
+ /**
+ * The step query runner to run queries against the database
+ */
private final StepQueryRunner queryRunner;
@Inject
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/InstallJswordModuleHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/InstallJswordModuleHandler.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/InstallJswordModuleHandler.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -24,6 +24,9 @@
private final static String proxyHostProperty = "step.proxy.host";
private final static String proxyPortProperty = "step.proxy.port";
+ /**
+ * Default logger
+ */
private final Log logger;
@Inject
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/util/passage/StrongMorphMap.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/util/passage/StrongMorphMap.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/util/passage/StrongMorphMap.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -1,6 +1,8 @@
package com.tyndalehouse.step.web.server.handler.util.passage;
+import java.util.Collection;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
/**
@@ -89,20 +91,21 @@
*/
// TODO: check for nulls on lemma
public final String get(final String lemma, final String morph) {
- Map<String, String> morphToWord = strongToMorph.get(lemma);
+ final Map<String, String> morphToWord = strongToMorph.get(lemma);
if (morphToWord != null) {
if (morph != null) {
// use the chain from morphs to word
- String word = morphToWord.get(morph);
+ final String word = morphToWord.get(morph);
if (word != null) {
return word;
} else {
// well we didn't find our morph, so the best option is to
// return another morph for the same strong number
- String[] values = (String[]) morphToWord.values().toArray();
- if (values.length != 0) {
- return values[0];
+ final Collection<String> words = morphToWord.values();
+ final Iterator<String> wordsIterator = words.iterator();
+ if (wordsIterator.hasNext()) {
+ return wordsIterator.next();
}
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/jsword/XSLTProperty.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/jsword/XSLTProperty.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/jsword/XSLTProperty.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -120,7 +120,10 @@
*/
public static final XSLTProperty XREF = new XSLTProperty("XRef", true); //$NON-NLS-1$
- // Support for serialization
+ /**
+ * Support for serialization
+ *
+ */
private static int nextObj;
/**
@@ -128,37 +131,14 @@
*/
private static final long serialVersionUID = 3257567325749326905L;
- private static final XSLTProperty[] VALUES = { STRONGS_NUMBERS, MORPH, START_VERSE_ON_NEWLINE, VERSE_NUMBERS, CV,
- BCV, NO_VERSE_NUMBERS, TINY_VERSE_NUMBERS, HEADINGS, NOTES, XREF, BASE_URL, DIRECTION, FONT, CSS, };
-
/**
- * Lookup method to convert from an integer
+ * list of xslt properties
*/
- public static XSLTProperty fromInteger(final int i) {
- return VALUES[i];
- }
+ private static final XSLTProperty[] VALUES = { STRONGS_NUMBERS, MORPH, START_VERSE_ON_NEWLINE,
+ VERSE_NUMBERS, CV, BCV, NO_VERSE_NUMBERS, TINY_VERSE_NUMBERS, HEADINGS, NOTES, XREF, BASE_URL,
+ DIRECTION, FONT, CSS, };
/**
- * Lookup method to convert from a String
- */
- public static XSLTProperty fromString(final String name) {
- for (int i = 0; i < VALUES.length; i++) {
- final XSLTProperty o = VALUES[i];
- if (o.name.equalsIgnoreCase(name)) {
- return o;
- }
- }
- assert false;
- return null;
- }
-
- public static void setProperties(final TransformingSAXEventProvider provider) {
- for (int i = 0; i < VALUES.length; i++) {
- VALUES[i].setProperty(provider);
- }
- }
-
- /**
* Whether the string state should be converted to an URL when setting the
* property.
*/
@@ -174,6 +154,10 @@
*/
private final String name;
+ /**
+ * TODO: don't know what this does, this class is a copy from JSword which
+ * needs revamping
+ */
private final int obj = nextObj++;
/**
@@ -200,6 +184,7 @@
/**
* @param name The name of this property
* @param defaultState The initial state of the property.
+ * @param asURL whether it is a uRl?
*/
private XSLTProperty(final String name, final String defaultState, final boolean asURL) {
this.name = name;
@@ -208,10 +193,55 @@
this.asURL = asURL;
}
+ /**
+ * Lookup method to convert from an integer
+ *
+ * @param i gets a particular xslt property
+ * @return the XSLT property matching the index
+ */
+ public static XSLTProperty fromInteger(final int i) {
+ return VALUES[i];
+ }
+
+ /**
+ * Lookup method to convert from a String
+ *
+ * @param name a linear search for a property and returns the XSLT property
+ * @return a XSLT property
+ */
+ public static XSLTProperty fromString(final String name) {
+ for (int i = 0; i < VALUES.length; i++) {
+ final XSLTProperty o = VALUES[i];
+ if (o.name.equalsIgnoreCase(name)) {
+ return o;
+ }
+ }
+ assert false;
+ return null;
+ }
+
+ /**
+ *
+ * @param provider sets the SAX provider
+ */
+ public static void setProperties(final TransformingSAXEventProvider provider) {
+ for (int i = 0; i < VALUES.length; i++) {
+ VALUES[i].setProperty(provider);
+ }
+ }
+
+ /**
+ *
+ * @return default state
+ */
public boolean getDefaultState() {
return Boolean.valueOf(defaultState).booleanValue();
}
+ /**
+ *
+ * @return default state as a string
+ */
public String getDefaultStringState() {
return defaultState;
}
@@ -223,14 +253,25 @@
return name;
}
+ /**
+ * @return the state
+ */
public boolean getState() {
return Boolean.valueOf(state).booleanValue();
}
+ /**
+ *
+ * @return state as a string
+ */
public String getStringState() {
return state;
}
+ /**
+ *
+ * @param provider a SAX provider
+ */
public void setProperty(final TransformingSAXEventProvider provider) {
if (state != null && state.length() > 0) {
String theState = state;
@@ -245,10 +286,16 @@
}
}
+ /**
+ * @param newState sets the state to newState
+ */
public void setState(final boolean newState) {
state = Boolean.toString(newState);
}
+ /**
+ * @param newState sets the state to newState
+ */
public void setState(final String newState) {
state = newState;
}
@@ -263,6 +310,11 @@
return name;
}
+ /**
+ * TODO: redo this whole class
+ *
+ * @return an object
+ */
Object readResolve() {
return VALUES[obj];
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimeBandVisibleDate.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimeBandVisibleDate.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimeBandVisibleDate.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -7,6 +7,8 @@
* timebandId identifies the timeband and is associated with a minimum and a
* maximum date which are generally used to request things off the database.
*
+ * TODO: harmonize capital letters to be TimebandVisibleDate
+ *
* @author cjburrell
*
*/
@@ -18,9 +20,9 @@
private static final long serialVersionUID = -7384255321830177509L;
/**
- * time band id
+ * max date visible on the timeband
*/
- private int timebandId;
+ private long maxDate;
/**
* min date visible on the time band
@@ -28,27 +30,21 @@
private long minDate;
/**
- * max date visible on the timeband
+ * true indicates no request is required on the server
*/
- private long maxDate;
-
private boolean noRequest;
- private TimeBandVisibleDate() {
- }
+ /**
+ * time band id
+ */
+ private int timebandId;
- public static TimeBandVisibleDate getNoRequest() {
- TimeBandVisibleDate tvd = new TimeBandVisibleDate();
- tvd.setNoRequest(true);
- return tvd;
- }
-
/**
* so that
*
- * @param timebandId
- * @param minDate
- * @param maxDate
+ * @param timebandId the timebandId referred to in the module
+ * @param minDate minDate in the range of dates to ask the server
+ * @param maxDate maxDate in the range of dates to the ask the server
*/
public TimeBandVisibleDate(final int timebandId, final long minDate, final long maxDate) {
this.timebandId = timebandId;
@@ -58,17 +54,23 @@
}
/**
- * @return the timebandId
+ * removing default constructor from view of other callers. Only accessible
+ * through reflection, and therefore GWT
*/
- public int getTimebandId() {
- return timebandId;
+ private TimeBandVisibleDate() {
}
/**
- * @return the minDate
+ * returns a TimeBandVisibleDate object tagged to indicate no request is
+ * required on the server
+ *
+ * @return a marked TimeBandVisibleDate object, marked with a flag saying no
+ * request is required
*/
- public long getMinDate() {
- return minDate;
+ public static TimeBandVisibleDate getNoRequest() {
+ final TimeBandVisibleDate tvd = new TimeBandVisibleDate();
+ tvd.setNoRequest(true);
+ return tvd;
}
/**
@@ -79,30 +81,20 @@
}
/**
- * @param timebandId
- * the timebandId to set
+ * @return the minDate
*/
- public void setTimebandId(final int timebandId) {
- this.timebandId = timebandId;
+ public long getMinDate() {
+ return minDate;
}
/**
- * @param minDate
- * the minDate to set
+ * @return the timebandId
*/
- public void setMinDate(long minDate) {
- this.minDate = minDate;
+ public int getTimebandId() {
+ return timebandId;
}
/**
- * @param maxDate
- * the maxDate to set
- */
- public void setMaxDate(long maxDate) {
- this.maxDate = maxDate;
- }
-
- /**
* NoRequest determines whether the values in here should be sent back.
* Perhaps we've got everything we need already, so we don't need to send
* anything back to the server
@@ -114,11 +106,31 @@
}
/**
- * @param noRequest
- * the noRequest to set
+ * @param maxDate the maxDate to set
*/
- public void setNoRequest(boolean noRequest) {
+ public void setMaxDate(final long maxDate) {
+ this.maxDate = maxDate;
+ }
+
+ /**
+ * @param minDate the minDate to set
+ */
+ public void setMinDate(final long minDate) {
+ this.minDate = minDate;
+ }
+
+ /**
+ * @param noRequest the noRequest to set
+ */
+ public void setNoRequest(final boolean noRequest) {
this.noRequest = noRequest;
}
+ /**
+ * @param timebandId the timebandId to set
+ */
+ public void setTimebandId(final int timebandId) {
+ this.timebandId = timebandId;
+ }
+
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineBean.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineBean.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineBean.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -4,7 +4,7 @@
/**
* Timeline bean represents the different timelines on which events can be
- * found...
+ * found... TODO: should this be renamed timeband?
*
* @author CJBurrell
*
@@ -14,32 +14,37 @@
*
*/
private static final long serialVersionUID = -1734142151232501392L;
- private int timelineId;
/**
- * @param timelineId
- * the timelineId to set
+ * Timeline description from the server layer
*/
- public void setTimelineId(int timelineId) {
- this.timelineId = timelineId;
- }
+ private String timelineDescription;
/**
- * @param timelineDescription
- * the timelineDescription to set
+ * timeline id sent across the wire
*/
- public void setTimelineDescription(String timelineDescription) {
- this.timelineDescription = timelineDescription;
- }
+ private int timelineId;
- private String timelineDescription;
+ /**
+ * unit to be used when first display the timeband
+ */
private String unit;
+ /**
+ * default constructor made public
+ */
public TimelineBean() {
}
/**
+ * @return the timelineDescription
+ */
+ public String getTimelineDescription() {
+ return timelineDescription;
+ }
+
+ /**
* @return the timelineId
*/
public int getTimelineId() {
@@ -47,22 +52,34 @@
}
/**
- * @return the timelineDescription
+ * @return the unit
*/
- public String getTimelineDescription() {
- return timelineDescription;
+ public String getUnit() {
+ return unit;
}
- public void setUnit(String unit) {
- this.unit = unit;
+ /**
+ * @param timelineDescription the timelineDescription to set
+ */
+ public void setTimelineDescription(final String timelineDescription) {
+ this.timelineDescription = timelineDescription;
+ }
+ /**
+ * @param timelineId the timelineId to set
+ */
+ public void setTimelineId(final int timelineId) {
+ this.timelineId = timelineId;
}
/**
- * @return the unit
+ * sets the unit field
+ *
+ * @param unit the unit to be set
*/
- public String getUnit() {
- return unit;
+ public void setUnit(final String unit) {
+ this.unit = unit;
+
}
// /**
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineEventBean.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineEventBean.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/beans/TimelineEventBean.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -2,43 +2,98 @@
import java.io.Serializable;
+/**
+ * An Time Event bean, containing all the relevant fields passed from the server
+ * to the client. For e.g. the description of the event, its id, the dates, etc.
+ *
+ * @author cjburrell
+ *
+ */
public class TimelineEventBean implements Serializable {
/**
- *
+ * serial id
*/
private static final long serialVersionUID = -7664806988001700477L;
+
+ /**
+ * The certainty of dating, as provided in input CSV files
+ */
+ private String certainty;
+
+ /**
+ * the event id
+ */
private int eventId;
+
+ /**
+ * the type of the event, where we distinguish battles, from births, etc.
+ * (TODO: still to be done)
+ */
+ private int eventTypeId;
+
+ /**
+ * the from date
+ */
private Long fromDate;
- private Long toDate;
+
+ /**
+ * how precise the date is, whether to the day, month, etc. see schema
+ * definition for details
+ */
private String fromPrecision;
- private String toPrecision;
- private String certainty;
- private int eventTypeId;
+ /**
+ * Name/Description of the event
+ */
private String name;
+
+ /**
+ * The timeband/timeline on which the event should be displayed
+ */
private int timelineId;
- // for serialization
+ /**
+ * the to-date in the case of a duration
+ */
+ private Long toDate;
+
+ /**
+ * the precision of the "to-date", whether to the day, month, etc. see
+ * schema definition for details
+ */
+ private String toPrecision;
+
+ /**
+ * making public
+ */
public TimelineEventBean() {
}
/**
+ * a constructor to set up everything in one go
*
- * @param eventId
- * @param fromDate
- * @param toDate
- * @param fromPrecision
- * @param toPrecision
- * @param name
- * @param timelineId
- * @param importanceId
- * @param certainty
- * @param eventTypeId
+ * @param eventId the event id from the database
+ * @param fromDate the from date, at which the event starts/is
+ * @param toDate the to date, if the date is a duratio
+ * @param fromPrecision how precise the from date is (see schema for more
+ * details)
+ * @param toPrecision how precise the to date is (see schema for more
+ * details)
+ * @param name the description of the event
+ * @param timelineId the timeband on which to be located
+ * @param importanceId the importance id as defined in the input files
+ * @param certainty the certainty as defined in the input files
+ * @param eventTypeId the event type, describing different types, and
+ * therefore different representations of the event on the UI
+ *
*/
- public TimelineEventBean(int eventId, Long fromDate, Long toDate, String fromPrecision, String toPrecision, String name, int timelineId,
- int importanceId, String certainty, int eventTypeId) {
+ // CHECKSTYLE:OFF
+ public TimelineEventBean(final int eventId, final Long fromDate, final Long toDate,
+ final String fromPrecision, final String toPrecision, final String name, final int timelineId,
+ final int importanceId, final String certainty, final int eventTypeId) {
+ // CHECKSTYLE:ON
this.eventId = eventId;
this.fromDate = fromDate;
this.toDate = toDate;
@@ -51,6 +106,13 @@
}
/**
+ * @return the certainty
+ */
+ public String getCertainty() {
+ return certainty;
+ }
+
+ /**
* @return the eventId
*/
public int getEventId() {
@@ -58,11 +120,10 @@
}
/**
- * @param eventId
- * the eventId to set
+ * @return the eventTypeId
*/
- public void setEventId(int eventId) {
- this.eventId = eventId;
+ public int getEventTypeId() {
+ return eventTypeId;
}
/**
@@ -73,44 +134,36 @@
}
/**
- * @param fromDate
- * the fromDate to set
+ * @return the fromPrecision
*/
- public void setFromDate(Long fromDate) {
- this.fromDate = fromDate;
+ public String getFromPrecision() {
+ return fromPrecision;
}
/**
- * @return the toDate
+ * returns the name/description of the event
+ *
+ * @return the description of the event
*/
- public Long getToDate() {
- return toDate;
+ public String getName() {
+ return name;
}
/**
- * @param toDate
- * the toDate to set
+ * @return the timelineId
*/
- public void setToDate(Long toDate) {
- this.toDate = toDate;
+ public int getTimelineId() {
+ return timelineId;
}
/**
- * @return the fromPrecision
+ * @return the toDate
*/
- public String getFromPrecision() {
- return fromPrecision;
+ public Long getToDate() {
+ return toDate;
}
/**
- * @param fromPrecision
- * the fromPrecision to set
- */
- public void setFromPrecision(String fromPrecision) {
- this.fromPrecision = fromPrecision;
- }
-
- /**
* @return the toPrecision
*/
public String getToPrecision() {
@@ -118,67 +171,65 @@
}
/**
- * @param toPrecision
- * the toPrecision to set
+ * @param certainty the certainty to set
*/
- public void setToPrecision(String toPrecision) {
- this.toPrecision = toPrecision;
+ public void setCertainty(final String certainty) {
+ this.certainty = certainty;
}
/**
- * @return the certainty
+ * @param eventId the eventId to set
*/
- public String getCertainty() {
- return certainty;
+ public void setEventId(final int eventId) {
+ this.eventId = eventId;
}
/**
- * @param certainty
- * the certainty to set
+ * @param eventTypeId the eventTypeId to set
*/
- public void setCertainty(String certainty) {
- this.certainty = certainty;
+ public void setEventTypeId(final int eventTypeId) {
+ this.eventTypeId = eventTypeId;
}
/**
- * @return the eventTypeId
+ * @param fromDate the fromDate to set
*/
- public int getEventTypeId() {
- return eventTypeId;
+ public void setFromDate(final Long fromDate) {
+ this.fromDate = fromDate;
}
/**
- * @param eventTypeId
- * the eventTypeId to set
+ * @param fromPrecision the fromPrecision to set
*/
- public void setEventTypeId(int eventTypeId) {
- this.eventTypeId = eventTypeId;
+ public void setFromPrecision(final String fromPrecision) {
+ this.fromPrecision = fromPrecision;
}
/**
- * @param name
- * the name to set
+ * @param name the name to set
*/
- public void setName(String name) {
+ public void setName(final String name) {
this.name = name;
}
- public String getName() {
- return name;
+ /**
+ * @param timelineId the timelineId to set
+ */
+ public void setTimelineId(final int timelineId) {
+ this.timelineId = timelineId;
}
/**
- * @return the timelineId
+ * @param toDate the toDate to set
*/
- public int getTimelineId() {
- return timelineId;
+ public void setToDate(final Long toDate) {
+ this.toDate = toDate;
}
/**
- * @param timelineId
- * the timelineId to set
+ * @param toPrecision the toPrecision to set
*/
- public void setTimelineId(int timelineId) {
- this.timelineId = timelineId;
+ public void setToPrecision(final String toPrecision) {
+ this.toPrecision = toPrecision;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetCurrentBibleTextCommand.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetCurrentBibleTextCommand.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetCurrentBibleTextCommand.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -4,110 +4,187 @@
import com.tyndalehouse.step.web.shared.result.GetCurrentBibleTextResult;
+/**
+ * Contains the details of a request for biblical text. Such details include
+ * whether to use a plain text, a standard XSLT, or a logical form
+ * <p>
+ * For logical form (represented in Bean form) we allow the use of interlinears
+ * as well.
+ * <p>
+ * A classic interlinear is where the original text is the master copy of the
+ * text, and the translated (English, French, etc.) text is lined up underneath
+ * <p>
+ * A reverse interlinear is where the the English/French text is on top, and the
+ * original (Hebrew or Greek) is lined up underneath.
+ *
+ * @author cjburrell
+ *
+ */
public class GetCurrentBibleTextCommand implements Action<GetCurrentBibleTextResult> {
- // TODO: use enum instead of series of booleans
- private String version;
- private String reference;
- private boolean isXsltRequired = false;
+ /**
+ * serial id
+ */
+ private static final long serialVersionUID = -6828956918275592036L;
+
+ /**
+ * whether the request is for an interlinear
+ */
private boolean isInterlinear = false;
+
+ /**
+ * whether the request for an interlinear is a classic interlinear
+ */
private boolean isInterlinearClassic = false;
- private boolean logicalForm = false;
+
+ /**
+ * whether plain text is required
+ */
private boolean isSimpleTextRequired;
/**
- * serial id
+ * the xslted form is required
*/
- private static final long serialVersionUID = -6828956918275592036L;
+ private boolean isXsltRequired = false;
- public GetCurrentBibleTextCommand(final String version, final String reference) {
- this.version = version;
- this.reference = reference;
- }
+ /**
+ * the logical form is required
+ */
+ private boolean logicalForm = false;
+ /**
+ * the biblical reference, for e.g. Gen 1:1
+ */
+ private String reference;
+
+ // TODO: use enum instead of series of booleans
+ // TODO: add validation to the handler/client to ensure that
+ // version/interlinear matches correctly
+ /**
+ * the version of the bible to use.
+ */
+ private String version;
+
+ /**
+ * default constructor TODO: can this be made private? I think so
+ */
@SuppressWarnings("unused")
public GetCurrentBibleTextCommand() {
}
/**
- * @param version
- * the version to set
+ * constructor for a version,reference combo
+ *
+ * @param version version to be used in the lookup (intials)
+ * @param reference reference to be used in the lookup (for e.g. Gen 1:1)
*/
- public void setVersion(String version) {
+ public GetCurrentBibleTextCommand(final String version, final String reference) {
this.version = version;
+ this.reference = reference;
}
/**
- * @param reference
- * the reference to set
+ * @return the biblical reference (Gen 1:1-5 for example)
*/
- public void setReference(String reference) {
- this.reference = reference;
+ public String getReference() {
+ return reference;
}
- public boolean isLogicalFormRequired() {
- return this.logicalForm;
+ /**
+ * @return the initials of the version to be used in the lookup
+ */
+ public String getVersion() {
+ return version;
}
- public void setLogicalFormRequired(boolean logicalForm) {
- this.logicalForm = logicalForm;
+ /**
+ * @return the isInterlinear
+ */
+ public boolean isInterlinear() {
+ return isInterlinear;
}
- public void setXsltRequired(boolean isXsltRequired) {
- this.isXsltRequired = isXsltRequired;
+ /**
+ * @return the isInterlinearClassic
+ */
+ public boolean isInterlinearClassic() {
+ return isInterlinearClassic;
}
- public boolean isXsltRequired() {
- return isXsltRequired;
+ /**
+ * @return true if bean/logical-form is required
+ */
+ public boolean isLogicalFormRequired() {
+ return this.logicalForm;
}
+ /**
+ * @return true if plain text is required
+ */
public boolean isSimpleTextRequired() {
return isSimpleTextRequired;
}
- public void setSimpleTextRequired(boolean simpleTextRequired) {
- this.isSimpleTextRequired = simpleTextRequired;
+ /**
+ * @return true if the portion of scripture is to be xslt-ed after lookup
+ */
+ public boolean isXsltRequired() {
+ return isXsltRequired;
+ }
+ /**
+ * @param isInterlinear the isInterlinear to set
+ */
+ public void setInterlinear(final boolean isInterlinear) {
+ this.isInterlinear = isInterlinear;
}
- public String getVersion() {
- return version;
+ /**
+ * @param isInterlinearClassic the isInterlinearClassic to set; if true,
+ * then the interlinear is based on the original word order if
+ * false, then interlinear is a reverse interlinear and based on
+ * the English/other language
+ */
+ public void setInterlinearClassic(final boolean isInterlinearClassic) {
+ this.isInterlinearClassic = isInterlinearClassic;
}
- public String getReference() {
- return reference;
+ /**
+ * @param logicalForm set to true to require a logical/bean-form back from
+ * the server
+ */
+ public void setLogicalFormRequired(final boolean logicalForm) {
+ this.logicalForm = logicalForm;
}
/**
- * @return the isInterlinear
+ * @param reference the reference to set
*/
- public boolean isInterlinear() {
- return isInterlinear;
+ public void setReference(final String reference) {
+ this.reference = reference;
}
/**
- * @param isInterlinear
- * the isInterlinear to set
+ * @param simpleTextRequired set to true to require plain text
*/
- public void setInterlinear(boolean isInterlinear) {
- this.isInterlinear = isInterlinear;
+ public void setSimpleTextRequired(final boolean simpleTextRequired) {
+ this.isSimpleTextRequired = simpleTextRequired;
+
}
/**
- * @return the isInterlinearClassic
+ * @param version the version to set
*/
- public boolean isInterlinearClassic() {
- return isInterlinearClassic;
+ public void setVersion(final String version) {
+ this.version = version;
}
/**
- * @param isInterlinearClassic
- * the isInterlinearClassic to set; if true, then the interlinear
- * is based on the original word order if false, then interlinear
- * is a reverse interlinear and based on the English/other
- * language
+ *
+ * @param isXsltRequired set to true to require xslt transformation before
+ * the end of the server call
*/
- public void setInterlinearClassic(boolean isInterlinearClassic) {
- this.isInterlinearClassic = isInterlinearClassic;
+ public void setXsltRequired(final boolean isXsltRequired) {
+ this.isXsltRequired = isXsltRequired;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetEventsForDateRangeCommand.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetEventsForDateRangeCommand.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetEventsForDateRangeCommand.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -7,6 +7,14 @@
import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
import com.tyndalehouse.step.web.shared.result.GetEventsForDateRangeResult;
+/**
+ * Contains the details of a request for events within a particular date range.
+ * This contains a list of @see {@link TimeBandVisibleDate}, which records the
+ * portion of time to be requested from the server
+ *
+ * @author cjburrell
+ *
+ */
public class GetEventsForDateRangeCommand implements Action<GetEventsForDateRangeResult> {
/**
* default uid
@@ -24,19 +32,27 @@
private List<TimeBandVisibleDate> visbleDates;
/**
+ * Used for serialization
+ */
+ public GetEventsForDateRangeCommand() {
+
+ }
+
+ /**
* default constructor that should be used
*
- * @param visbleDates
+ * @param visbleDates list of date ranges encapsulated in a
+ * TimeBandVisibleDate object
*/
- public GetEventsForDateRangeCommand(List<TimeBandVisibleDate> visbleDates) {
+ public GetEventsForDateRangeCommand(final List<TimeBandVisibleDate> visbleDates) {
this.visbleDates = visbleDates;
}
/**
- * Used for serialization
+ * @return the visbleDates
*/
- public GetEventsForDateRangeCommand() {
-
+ public List<TimeBandVisibleDate> getVisbleDates() {
+ return visbleDates;
}
/**
@@ -47,25 +63,16 @@
}
/**
- * @param showDuration
- * the showDuration to set
+ * @param showDuration the showDuration to set
*/
- public void setShowDuration(boolean showDuration) {
+ public void setShowDuration(final boolean showDuration) {
this.showDuration = showDuration;
}
/**
- * @return the visbleDates
+ * @param visbleDates the visbleDates to set
*/
- public List<TimeBandVisibleDate> getVisbleDates() {
- return visbleDates;
- }
-
- /**
- * @param visbleDates
- * the visbleDates to set
- */
- public void setVisbleDates(List<TimeBandVisibleDate> visbleDates) {
+ public void setVisbleDates(final List<TimeBandVisibleDate> visbleDates) {
this.visbleDates = visbleDates;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetAvailableBibleVersionsResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetAvailableBibleVersionsResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetAvailableBibleVersionsResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -5,24 +5,50 @@
import net.customware.gwt.dispatch.shared.Result;
+/**
+ * This is in response to a @see
+ * {@link com.tyndalehouse.step.web.share.command.GetAvailableBibleVersionsCommand}
+ * In essence, this contains a sorted map of books to be displayed on the UI.
+ * The intials are the key into JSword and should be used at all times when sent
+ * back to the server.
+ *
+ * @author cjburrell
+ *
+ */
public class GetAvailableBibleVersionsResult implements Result {
/**
- *
+ * serial id
*/
private static final long serialVersionUID = 1441380470741483969L;
+
+ /**
+ * a map keyed from the initials (link into JSword) to the name of the book
+ */
private SortedMap<String, String> books;
- public SortedMap<String, String> getBooks() {
- return Collections.unmodifiableSortedMap(books);
+ /**
+ * constructor passing in the map of available bible versions
+ *
+ * @param map map containing combinations of (key, book name)
+ */
+ public GetAvailableBibleVersionsResult(final SortedMap<String, String> map) {
+ this.books = map;
}
- // this constructor is used for reflection and must be present
+ /**
+ * used for reflection
+ */
@SuppressWarnings("unused")
private GetAvailableBibleVersionsResult() {
}
- public GetAvailableBibleVersionsResult(SortedMap<String, String> map) {
- this.books = map;
+ /**
+ * the map of available books
+ *
+ * @return the map of available books
+ */
+ public SortedMap<String, String> getBooks() {
+ return Collections.unmodifiableSortedMap(books);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetBibleBooksCommandResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetBibleBooksCommandResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetBibleBooksCommandResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -14,8 +14,8 @@
private static final long serialVersionUID = -26170538247007172L;
private List<String> books;
- public Collection<String> getBooks() {
- return Collections.unmodifiableList(books);
+ public GetBibleBooksCommandResult(final List<String> books) {
+ this.books = books;
}
// this constructor is used for reflection and must be present
@@ -24,7 +24,7 @@
}
- public GetBibleBooksCommandResult(List<String> books) {
- this.books = books;
+ public Collection<String> getBooks() {
+ return Collections.unmodifiableList(books);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetDictionaryDefinitionResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetDictionaryDefinitionResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetDictionaryDefinitionResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -21,17 +21,16 @@
return xsltedDefinition;
}
- /**
- * @param xsltedDefinition
- * the xsltedDefinition to set
- */
- public void setXsltedDefinition(String xsltedDefinition) {
+ public void setDefinition(final String xsltedDefinition) {
this.xsltedDefinition = xsltedDefinition;
+ // TODO Auto-generated method stub
+
}
- public void setDefinition(String xsltedDefinition) {
+ /**
+ * @param xsltedDefinition the xsltedDefinition to set
+ */
+ public void setXsltedDefinition(final String xsltedDefinition) {
this.xsltedDefinition = xsltedDefinition;
- // TODO Auto-generated method stub
-
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetEventsForDateRangeResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetEventsForDateRangeResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetEventsForDateRangeResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -9,18 +9,18 @@
public class GetEventsForDateRangeResult implements Result {
- private List<TimelineEventBean> events = new ArrayList<TimelineEventBean>();
-
/**
* default serial id
*/
private static final long serialVersionUID = 7118668612721569823L;
+ private List<TimelineEventBean> events = new ArrayList<TimelineEventBean>();
+
public GetEventsForDateRangeResult() {
}
- public void add(TimelineEventBean teb) {
+ public void add(final TimelineEventBean teb) {
getEvents().add(teb);
}
@@ -30,10 +30,9 @@
}
/**
- * @param events
- * the events to set
+ * @param events the events to set
*/
- public void setEvents(List<TimelineEventBean> events) {
+ public void setEvents(final List<TimelineEventBean> events) {
this.events = events;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -9,51 +9,28 @@
* generated serial version id
*/
private static final long serialVersionUID = 4256230588330550554L;
+ private boolean isEmpty;
private Long originDate;
private Unit suggestedTimeScale;
- private boolean isEmpty;
private int timebandId;
- /**
- * @return the isEmpty
- */
- public boolean isEmpty() {
- return isEmpty;
- }
-
- /**
- * @param isEmpty
- * the isEmpty to set
- */
- public void setEmpty(boolean isEmpty) {
+ public GetTimelineOriginForScriptureResult(final boolean isEmpty) {
this.isEmpty = isEmpty;
}
- public GetTimelineOriginForScriptureResult(Long originDate, Unit unit, int timebandId) {
+ public GetTimelineOriginForScriptureResult(final Long originDate, final Unit unit, final int timebandId) {
this.originDate = originDate;
this.suggestedTimeScale = unit;
this.timebandId = timebandId;
isEmpty = false;
}
- public GetTimelineOriginForScriptureResult(boolean isEmpty) {
- this.isEmpty = isEmpty;
- }
-
@SuppressWarnings("unused")
private GetTimelineOriginForScriptureResult() {
}
/**
- * @param originDate
- * the originDate to set
- */
- public void setOriginDate(Long originDate) {
- this.originDate = originDate;
- }
-
- /**
* @return the originDate
*/
public Long getOriginDate() {
@@ -61,14 +38,6 @@
}
/**
- * @param unit
- * the suggestedTimeScale to set
- */
- public void setSuggestedTimeScale(Unit unit) {
- this.suggestedTimeScale = unit;
- }
-
- /**
* @return the suggestedTimeScale
*/
public Unit getSuggestedTimeScale() {
@@ -85,10 +54,37 @@
}
/**
- * @param timebandId
- * the timebandId to set
+ * @return the isEmpty
*/
- public void setTimebandId(int timebandId) {
+ public boolean isEmpty() {
+ return isEmpty;
+ }
+
+ /**
+ * @param isEmpty the isEmpty to set
+ */
+ public void setEmpty(final boolean isEmpty) {
+ this.isEmpty = isEmpty;
+ }
+
+ /**
+ * @param originDate the originDate to set
+ */
+ public void setOriginDate(final Long originDate) {
+ this.originDate = originDate;
+ }
+
+ /**
+ * @param unit the suggestedTimeScale to set
+ */
+ public void setSuggestedTimeScale(final Unit unit) {
+ this.suggestedTimeScale = unit;
+ }
+
+ /**
+ * @param timebandId the timebandId to set
+ */
+ public void setTimebandId(final int timebandId) {
this.timebandId = timebandId;
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineUISetupResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineUISetupResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineUISetupResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -2,27 +2,52 @@
import java.util.List;
+import net.customware.gwt.dispatch.shared.Result;
+
import com.tyndalehouse.step.web.shared.beans.TimelineBean;
-import net.customware.gwt.dispatch.shared.Result;
-
+/**
+ * Response from a @see
+ * {@link com.tyndalehouse.step.web.shared.command.GetTimelineUISetupCommand}
+ * This contains details on how to set up each timeband, their units, etc.
+ *
+ * @author cjburrell
+ *
+ */
public class GetTimelineUISetupResult implements Result {
/**
- *
+ * serial id
*/
private static final long serialVersionUID = -566447989637280143L;
+
+ /**
+ * A list of timebands
+ */
private List<TimelineBean> tlb;
+ /**
+ * Default constructor made public
+ */
public GetTimelineUISetupResult() {
}
- public void setTimelines(List<TimelineBean> tlb) {
- this.tlb = tlb;
- }
-
+ /**
+ * returns a list of timebands
+ *
+ * @return a list of timeband beans
+ */
public List<TimelineBean> getTimelines() {
return tlb;
}
+
+ /**
+ * sets the list. made available for reflection
+ *
+ * @param tlb the list of timeline beans
+ */
+ public void setTimelines(final List<TimelineBean> tlb) {
+ this.tlb = tlb;
+ }
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/InstallJswordModuleResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/InstallJswordModuleResult.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/InstallJswordModuleResult.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -2,28 +2,40 @@
import net.customware.gwt.dispatch.shared.Result;
+/**
+ * Response from a @see
+ * {@link com.tyndalehouse.step.web.shared.command.InstallJswordModuleCommand}
+ * indicating whether the installation was succesful
+ *
+ * @author cjburrell
+ *
+ */
public class InstallJswordModuleResult implements Result {
/**
* generated serial id
*/
private static final long serialVersionUID = -5063510082176727310L;
+
+ /**
+ * true if installation was successful
+ */
private boolean successful;
+ /**
+ * Default constructor made public
+ */
public InstallJswordModuleResult() {
}
- public InstallJswordModuleResult(boolean successful) {
- this.successful = successful;
-
- }
-
/**
- * @param successful
- * the successful to set
+ * Constructor with the success flag passed in
+ *
+ * @param successful true to indicate success
*/
- public void setSuccessful(boolean successful) {
+ public InstallJswordModuleResult(final boolean successful) {
this.successful = successful;
+
}
/**
@@ -32,4 +44,11 @@
public boolean isSuccessful() {
return successful;
}
+
+ /**
+ * @param successful the successful to set
+ */
+ public void setSuccessful(final boolean successful) {
+ this.successful = successful;
+ }
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Milestone.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Milestone.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Milestone.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -2,24 +2,40 @@
import java.io.Serializable;
+/**
+ * A marker in the OSIS xml to indicate a break in the normal flow of text.
+ * Usually editors layouts, I believe.
+ *
+ * @author cjburrell
+ *
+ */
public class Milestone extends Text implements TextualElement, Serializable {
/**
* serial id
*/
private static final long serialVersionUID = 6444472622836494795L;
- private String type;
-
/**
* optional marker
*/
private String marker;
+ /**
+ * Type of milestone, see OSIS details for clarifications
+ */
+ private String type;
+
+ /**
+ * Default constructor made public
+ */
public Milestone() {
}
- public Milestone(String type) {
- this.type = type;
+ /**
+ * @return the marker
+ */
+ public String getMarker() {
+ return marker;
}
/**
@@ -30,25 +46,16 @@
}
/**
- * @param type
- * the type to set
+ * @param marker the marker to set
*/
- public void setType(String type) {
- this.type = type;
+ public void setMarker(final String marker) {
+ this.marker = marker;
}
/**
- * @return the marker
+ * @param type the type to set
*/
- public String getMarker() {
- return marker;
+ public void setType(final String type) {
+ this.type = type;
}
-
- /**
- * @param marker
- * the marker to set
- */
- public void setMarker(String marker) {
- this.marker = marker;
- }
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Note.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Note.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Note.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -2,13 +2,27 @@
import java.io.Serializable;
+/**
+ * A logical representation of some OSIS xml. This bean is serialised and passed
+ * over the wire
+ *
+ * @author cjburrell
+ *
+ */
public class Note extends Text implements TextualElement, Serializable {
/**
* serial id
*/
private static final long serialVersionUID = 4592986819523938392L;
+
+ /**
+ * The type of note
+ */
private String type;
+ /**
+ * Default constructor made public
+ */
public Note() {
}
@@ -20,10 +34,9 @@
}
/**
- * @param type
- * the type to set
+ * @param type the type to set
*/
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/OSISConstants.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/OSISConstants.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/OSISConstants.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -1,17 +1,43 @@
package com.tyndalehouse.step.web.shared.scripture;
-//TODO: remove this class and replace with OSISUtil from JSword package
-public class OSISConstants {
- public static final String OSISID = "osisID";
- public static final Object NOTE = "note";
+/**
+ * Some constants not defined in JSword
+ *
+ * @author cjburrell
+ *
+ */
+public final class OSISConstants {
+ /**
+ * A marker in the text, for formatting purposes: TODO: check this and the
+ * other two with online people
+ */
public static final String MARKER = "marker";
- public static final String MORPH = "morph";
- public static final String LEMMA = "lemma";
- public static final String TITLE = "title";
- public static final String VERSE = "verse";
- public static final String WORD = "w";
- public static final String TRANS_CHANGE = "transChange";
+
+ /**
+ * A milestone, between two portions of scripture
+ */
public static final String MILESTONE = "milestone";
- public static final String TYPE = "type";
+ /**
+ * A decision by the translator to make a change?
+ */
+ public static final String TRANS_CHANGE = "transChange";
+
+ // public static final String LEMMA = "lemma";
+ // public static final String MORPH = "morph";
+ // public static final Object NOTE = "note";
+ // public static final String OSISID = "osisID";
+ // public static final String TITLE = "title";
+
+ // public static final String TYPE = "type";
+ // public static final String VERSE = "verse";
+ // public static final String WORD = "w";
+
+ /**
+ * Making the constructor private
+ */
+ private OSISConstants() {
+
+ }
+
}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/ScriptureElement.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/ScriptureElement.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/ScriptureElement.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -1,5 +0,0 @@
-package com.tyndalehouse.step.web.shared.scripture;
-
-public interface ScriptureElement {
-
-}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TextualElement.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TextualElement.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TextualElement.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -7,7 +7,7 @@
* @author CJBurrell
*
*/
-public interface TextualElement extends ScriptureElement {
+public interface TextualElement {
/**
* returns the text
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TransChange.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TransChange.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/TransChange.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -2,13 +2,26 @@
import java.io.Serializable;
+/**
+ * TODO: check OSIS details and update documentation
+ *
+ * @author cjburrell
+ *
+ */
public class TransChange extends Text implements TextualElement, Serializable {
/**
* serial id
*/
private static final long serialVersionUID = 4557607388014222750L;
+
+ /**
+ * Type of trans change
+ */
private String type;
+ /**
+ * Default constructor made public
+ */
public TransChange() {
}
@@ -20,10 +33,9 @@
}
/**
- * @param type
- * the type to set
+ * @param type the type to set
*/
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Word.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Word.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/scripture/Word.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -4,56 +4,96 @@
import java.util.ArrayList;
import java.util.List;
+/**
+ * A Word is a portion of a verse from the Bible. It can be several words or
+ * just one. In some versions it is associated with a list of lemmas (strong
+ * numbers which link to the Strong Hebrew or Greek Dictionary), as well as a
+ * morphological code (morph) which is a coded form of the morphology of the
+ * word/set of words (i.e. grammar form and usage in the sentence)
+ *
+ * @author cjburrell
+ *
+ */
public class Word extends Text implements TextualElement, Serializable {
/**
* serial id
*/
private static final long serialVersionUID = -5750252359953024623L;
+ /**
+ * An alternative word, such as a different language
+ */
+ private String alternativeWord;
+
// TODO: FIX: this is a bug, we can have several lemmas or morphologies for
// one translated word
+ /**
+ * a list of lemmas referring to a portion of text
+ */
private List<String> lemma;
+
+ /**
+ * A list of morphs referring to a portion of text. A morph is a coded
+ * string indicating the grammar and form of the original word
+ */
private List<String> morph;
- private String alternativeWord;
-
+ /**
+ * default constructor initialises internal lists
+ */
public Word() {
lemma = new ArrayList<String>();
morph = new ArrayList<String>();
}
/**
- * @return the lemma
+ * Adds a new lemma to the Word
+ *
+ * @param newLemma the lemma to set
*/
- public List<String> getLemma() {
- return lemma;
+ public void addLemma(final String newLemma) {
+ lemma.add(newLemma);
}
/**
- * @param lemma
- * the lemma to set
+ * Adds an array of lemmas to the Word
+ *
+ * @param lemmas a list of lemmas
*/
- public void setLemma(List<String> lemma) {
- this.lemma = lemma;
+ public void addLemmas(final String[] lemmas) {
+ for (final String l : lemmas) {
+ this.lemma.add(l);
+ }
}
/**
- * @param morph
- * the morph to set
+ * Adds an array of morphs to the Word
+ *
+ * @param morphs array of morphs to be associated with the Word (portion of
+ * a verse)
*/
- public void setMorph(List<String> morph) {
- this.morph = morph;
+ public void addMorphs(final String[] morphs) {
+ for (final String m : morphs) {
+ this.morph.add(m);
+ }
+
}
/**
- * @param lemma
- * the lemma to set
+ * @return the alternativeWord
*/
- public void addLemma(final String newLemma) {
- lemma.add(newLemma);
+ public String getAlternativeWord() {
+ return alternativeWord;
}
/**
+ * @return the lemma
+ */
+ public List<String> getLemma() {
+ return lemma;
+ }
+
+ /**
* @return the morph
*/
public List<String> getMorph() {
@@ -61,35 +101,37 @@
}
/**
- * @param morph
- * the morph to set
+ * sets an alternative word (such as a hebrew original word)
+ *
+ * @param alternativeWord a word equivalent, different language. For e.g.
+ * Hebrew word
+ *
*/
- public void setMorph(final String newMorph) {
- morph.add(newMorph);
- }
-
public void setAlternativeWord(final String alternativeWord) {
this.alternativeWord = alternativeWord;
}
/**
- * @return the alternativeWord
+ * @param lemma the lemma to set
*/
- public String getAlternativeWord() {
- return alternativeWord;
+ public void setLemma(final List<String> lemma) {
+ this.lemma = lemma;
}
- public void addLemmas(String[] lemmas) {
- for (String l : lemmas) {
- this.lemma.add(l);
- }
+ /**
+ * @param morph the morph to set
+ */
+ public void setMorph(final List<String> morph) {
+ this.morph = morph;
}
- public void addMorphs(String[] morphs) {
- for (String m : morphs) {
- this.morph.add(m);
- }
-
+ /**
+ * Adding a morph to the Word
+ *
+ * @param newMorph the morph to set
+ */
+ public void setMorph(final String newMorph) {
+ morph.add(newMorph);
}
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/timeline/Unit.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/timeline/Unit.java 2010-03-09 20:32:51 UTC (rev 100)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/timeline/Unit.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -9,8 +9,12 @@
*/
public enum Unit {
/**
- * century CENTURY(10L * 10L * 365L * 24 * 3600 * 1000L, "yyyy G"), /** day
+ * century
*/
+ CENTURY(10L * 10L * 365L * 24 * 3600 * 1000L, "yyyy G"),
+ /**
+ * day
+ */
DAY(24L * 3600L * 1000L, "dd MMM yyyy G"),
/**
* decade
Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java 2010-03-10 20:00:45 UTC (rev 101)
@@ -0,0 +1,22 @@
+package com.tyndalehouse.step.web.client.service;
+
+import org.junit.Test;
+
+import com.tyndalehouse.step.web.client.service.refdata.ModuleName;
+import com.tyndalehouse.step.web.client.service.refdata.ModuleRefData;
+
+/**
+ * Tests the Module Reference Data client side service
+ *
+ * @author cjburrell
+ *
+ */
+public class ModuleRefDataServiceTest {
+ @Test
+ public void testModuleHierarchy() {
+ new ModuleName("test module", null);
+ ModuleRefData.getInstance().getListOfModules("Module");
+
+ // Assert.assertTrue(modules.contains(module.getModuleName()));
+ }
+}
More information about the Tynstep-svn
mailing list