Skip to content
Browse files

Incremental roll in of code base to google repository. Please note, d…

  • Loading branch information...
1 parent 3432e1b commit dcfd89d574eb6f91545e0571fbfc4a568124d3d6 anthony@gaiaresources.com.au committed Jul 18, 2011
Showing with 13,313 additions and 2,157 deletions.
  1. +104 −0 adds.txt
  2. +7 −0 findbugs-exclude.xml
  3. +81 −0 overlay_war.sh
  4. +22 −4 pom.xml
  5. +29 −10 src/main/css/bdrs/bdrs.css
  6. +320 −1 src/main/css/vanilla/base.css
  7. +22 −22 src/main/data/HelpTextSQL
  8. +2 −2 src/main/data/Installing-BDRS-OpenSUSE-11.3.txt
  9. BIN src/main/images/icons/tree_node.gif
  10. +4 −0 src/main/java/au/com/gaiaresources/bdrs/annotation/CompactAttribute.java
  11. +1 −0 src/main/java/au/com/gaiaresources/bdrs/annotation/MobileField.java
  12. +4 −0 src/main/java/au/com/gaiaresources/bdrs/annotation/Sensitive.java
  13. +30 −0 src/main/java/au/com/gaiaresources/bdrs/controller/AbstractController.java
  14. +0 −2 src/main/java/au/com/gaiaresources/bdrs/controller/DisplayTagHelper.java
  15. +63 −75 src/main/java/au/com/gaiaresources/bdrs/controller/HomePageController.java
  16. +4 −1 src/main/java/au/com/gaiaresources/bdrs/controller/RenderController.java
  17. +14 −3 src/main/java/au/com/gaiaresources/bdrs/controller/admin/AdminEditContentController.java
  18. +6 −1 src/main/java/au/com/gaiaresources/bdrs/controller/admin/AdminHomePageController.java
  19. +10 −3 src/main/java/au/com/gaiaresources/bdrs/controller/admin/AdminUserSearchController.java
  20. +4 −4 src/main/java/au/com/gaiaresources/bdrs/controller/admin/setup/SetupController.java
  21. +213 −0 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/CensusMethodController.java
  22. +19 −1 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/SurveyAttributeBaseController.java
  23. +11 −8 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/FormFieldFactory.java
  24. +11 −11 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/RecordAttributeFormField.java
  25. +13 −2 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/RecordPropertyFormField.java
  26. +4 −4 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/TaxonAttributeFormField.java
  27. +16 −0 ...n/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/TypedAttributeValueFormField.java
  28. +14 −4 src/main/java/au/com/gaiaresources/bdrs/controller/bulkdata/BulkDataController.java
  29. +2 −1 src/main/java/au/com/gaiaresources/bdrs/controller/embedded/EmbeddedFeature.java
  30. +42 −1 src/main/java/au/com/gaiaresources/bdrs/controller/embedded/EmbeddedWidgetController.java
  31. +0 −1 src/main/java/au/com/gaiaresources/bdrs/controller/fieldguide/BDRSFieldGuideController.java
  32. +2 −1 src/main/java/au/com/gaiaresources/bdrs/controller/file/AbstractDownloadFileController.java
  33. +84 −26 src/main/java/au/com/gaiaresources/bdrs/controller/file/ManagedFileController.java
  34. +2 −0 src/main/java/au/com/gaiaresources/bdrs/controller/form/RecordFormEnhancer.java
  35. +11 −0 src/main/java/au/com/gaiaresources/bdrs/controller/insecure/PublicController.java
  36. +89 −8 src/main/java/au/com/gaiaresources/bdrs/controller/location/LocationBaseController.java
  37. +275 −0 src/main/java/au/com/gaiaresources/bdrs/controller/map/GeoMapController.java
  38. +505 −0 src/main/java/au/com/gaiaresources/bdrs/controller/map/GeoMapLayerController.java
  39. +8 −67 src/main/java/au/com/gaiaresources/bdrs/controller/map/RecordMapController.java
  40. +2 −2 src/main/java/au/com/gaiaresources/bdrs/controller/mobile/BdrsCoreOfflineController.java
  41. +42 −0 src/main/java/au/com/gaiaresources/bdrs/controller/mobile/MobileApplicationController.java
  42. +17 −0 src/main/java/au/com/gaiaresources/bdrs/controller/portal/PortalController.java
  43. +4 −7 src/main/java/au/com/gaiaresources/bdrs/controller/preference/PreferenceController.java
  44. +410 −0 src/main/java/au/com/gaiaresources/bdrs/controller/record/AtlasController.java
  45. +71 −64 src/main/java/au/com/gaiaresources/bdrs/controller/record/AttributeParser.java
  46. +72 −0 src/main/java/au/com/gaiaresources/bdrs/controller/record/RecordDeletionController.java
  47. +18 −2 src/main/java/au/com/gaiaresources/bdrs/controller/record/RecordFormValidator.java
  48. +8 −10 src/main/java/au/com/gaiaresources/bdrs/controller/record/SingleSiteMultiTaxaController.java
  49. +199 −37 src/main/java/au/com/gaiaresources/bdrs/controller/record/TrackerController.java
  50. +6 −1 src/main/java/au/com/gaiaresources/bdrs/controller/record/ValidationType.java
  51. +5 −5 src/main/java/au/com/gaiaresources/bdrs/controller/record/YearlySightingsController.java
  52. +3 −1 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/AbstractValidator.java
  53. +34 −18 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DateValidator.java
  54. +3 −2 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DoubleRangeValidator.java
  55. +3 −2 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DoubleValidator.java
  56. +64 −0 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DynamicDateRangeValidator.java
  57. +64 −0 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DynamicIntRangeValidator.java
  58. +11 −5 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/IntRangeValidator.java
  59. +3 −2 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/IntValidator.java
  60. +13 −10 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/TaxonValidator.java
  61. +2 −1 src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/Validator.java
  62. +380 −0 ...java/au/com/gaiaresources/bdrs/controller/review/sightings/AdvancedReviewSightingsController.java
  63. +75 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/AbstractFacet.java
  64. +54 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/CensusMethodTypeFacet.java
  65. +34 −0 ...java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/CensusMethodTypeFacetOption.java
  66. +31 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/Facet.java
  67. +61 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/FacetOption.java
  68. +51 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/MonthFacet.java
  69. +43 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/MonthFacetOption.java
  70. +49 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/MultimediaFacet.java
  71. +27 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/MultimediaFacetOption.java
  72. +48 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/SurveyFacet.java
  73. +24 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/SurveyFacetOption.java
  74. +50 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/TaxonGroupFacet.java
  75. +24 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/TaxonGroupFacetOption.java
  76. +50 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/UserFacet.java
  77. +30 −0 src/main/java/au/com/gaiaresources/bdrs/controller/review/sightings/facet/UserFacetOption.java
  78. +337 −0 src/main/java/au/com/gaiaresources/bdrs/controller/showcase/GalleryController.java
  79. +6 −2 src/main/java/au/com/gaiaresources/bdrs/controller/survey/SurveyBaseController.java
  80. +1 −1 src/main/java/au/com/gaiaresources/bdrs/controller/taxongroup/TaxonGroupManagementController.java
  81. +10 −2 src/main/java/au/com/gaiaresources/bdrs/controller/taxonomy/TaxonomyManagementController.java
  82. +18 −3 src/main/java/au/com/gaiaresources/bdrs/controller/test/TestDataCreator.java
  83. +103 −0 src/main/java/au/com/gaiaresources/bdrs/controller/theme/StaticPageController.java
  84. +132 −31 src/main/java/au/com/gaiaresources/bdrs/controller/theme/ThemeController.java
  85. +3 −1 src/main/java/au/com/gaiaresources/bdrs/controller/user/UserHomePageController.java
  86. +14 −8 src/main/java/au/com/gaiaresources/bdrs/controller/user/UserProfileController.java
  87. +415 −62 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/ApplicationService.java
  88. +21 −2 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/ContentService.java
  89. +85 −1 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/LocationService.java
  90. +52 −0 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/ManagedFileWebService.java
  91. +33 −31 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/RecordService.java
  92. +28 −17 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/SurveyService.java
  93. +55 −31 src/main/java/au/com/gaiaresources/bdrs/controller/webservice/UserService.java
  94. +1 −1 src/main/java/au/com/gaiaresources/bdrs/db/Session.java
  95. +1 −0 src/main/java/au/com/gaiaresources/bdrs/db/TransactionDAO.java
  96. +15 −4 src/main/java/au/com/gaiaresources/bdrs/db/impl/AbstractDAOImpl.java
  97. +0 −2 src/main/java/au/com/gaiaresources/bdrs/db/impl/PersistentImpl.java
  98. +0 −2 src/main/java/au/com/gaiaresources/bdrs/db/impl/PortalPersistentImpl.java
  99. +8 −0 src/main/java/au/com/gaiaresources/bdrs/db/impl/QueryPaginator.java
  100. +14 −2 src/main/java/au/com/gaiaresources/bdrs/email/impl/EmailServiceImpl.java
  101. +28 −18 src/main/java/au/com/gaiaresources/bdrs/file/FileService.java
  102. +0 −1 src/main/java/au/com/gaiaresources/bdrs/model/content/impl/ContentDAOImpl.java
  103. +53 −0 src/main/java/au/com/gaiaresources/bdrs/model/detect/BDRSWurflCapability.java
  104. +68 −0 src/main/java/au/com/gaiaresources/bdrs/model/detect/BDRSWurflCapabilityDAO.java
  105. +88 −0 src/main/java/au/com/gaiaresources/bdrs/model/detect/BDRSWurflDevice.java
  106. +102 −0 src/main/java/au/com/gaiaresources/bdrs/model/detect/BDRSWurflDeviceDAO.java
  107. +163 −0 src/main/java/au/com/gaiaresources/bdrs/model/detect/impl/BDRSWurflCapabilityDAOImpl.java
  108. +196 −0 src/main/java/au/com/gaiaresources/bdrs/model/detect/impl/BDRSWurflDeviceDAOImpl.java
  109. +3 −1 src/main/java/au/com/gaiaresources/bdrs/model/expert/impl/ExpertServiceImpl.java
  110. +0 −2 src/main/java/au/com/gaiaresources/bdrs/model/file/ManagedFile.java
  111. +6 −0 src/main/java/au/com/gaiaresources/bdrs/model/file/ManagedFileDAO.java
  112. +12 −1 src/main/java/au/com/gaiaresources/bdrs/model/file/impl/ManagedFileDAOImpl.java
  113. +5 −0 src/main/java/au/com/gaiaresources/bdrs/model/grid/impl/GridServiceImpl.java
  114. +0 −2 src/main/java/au/com/gaiaresources/bdrs/model/location/Location.java
  115. +7 −0 src/main/java/au/com/gaiaresources/bdrs/model/location/LocationDAO.java
  116. +9 −2 src/main/java/au/com/gaiaresources/bdrs/model/location/impl/LocationDAOImpl.java
  117. +71 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/AssignedGeoMapLayer.java
  118. +105 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMap.java
  119. +14 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMapDAO.java
  120. +78 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMapFeature.java
  121. +29 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMapFeatureDAO.java
  122. +162 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMapLayer.java
  123. +41 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMapLayerDAO.java
  124. +31 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/GeoMapLayerSource.java
  125. +62 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/impl/GeoMapDAOImpl.java
  126. +112 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/impl/GeoMapFeatureDAOImpl.java
  127. +125 −0 src/main/java/au/com/gaiaresources/bdrs/model/map/impl/GeoMapLayerDAOImpl.java
  128. +5 −0 src/main/java/au/com/gaiaresources/bdrs/model/metadata/Metadata.java
  129. +40 −3 src/main/java/au/com/gaiaresources/bdrs/model/method/CensusMethod.java
  130. +13 −0 src/main/java/au/com/gaiaresources/bdrs/model/method/CensusMethodDAO.java
  131. +20 −0 src/main/java/au/com/gaiaresources/bdrs/model/method/Taxonomic.java
  132. +49 −0 src/main/java/au/com/gaiaresources/bdrs/model/method/impl/CensusMethodDAOImpl.java
  133. +1 −1 src/main/java/au/com/gaiaresources/bdrs/model/portal/PortalEntryPoint.java
  134. +74 −21 src/main/java/au/com/gaiaresources/bdrs/model/portal/impl/PortalInitialiser.java
  135. +1 −0 src/main/java/au/com/gaiaresources/bdrs/model/preference/Preference.java
  136. +10 −0 src/main/java/au/com/gaiaresources/bdrs/model/preference/PreferenceDAO.java
  137. +56 −0 src/main/java/au/com/gaiaresources/bdrs/model/preference/impl/PreferenceDAOImpl.java
  138. +118 −22 src/main/java/au/com/gaiaresources/bdrs/model/record/Record.java
  139. +79 −13 src/main/java/au/com/gaiaresources/bdrs/model/record/RecordDAO.java
  140. +2 −2 src/main/java/au/com/gaiaresources/bdrs/model/record/RecordService.java
  141. +234 −23 src/main/java/au/com/gaiaresources/bdrs/model/record/impl/RecordDAOImpl.java
  142. +2 −2 src/main/java/au/com/gaiaresources/bdrs/model/record/impl/RecordServiceImpl.java
  143. +77 −0 src/main/java/au/com/gaiaresources/bdrs/model/showcase/Gallery.java
  144. +14 −0 src/main/java/au/com/gaiaresources/bdrs/model/showcase/GalleryDAO.java
  145. +55 −0 src/main/java/au/com/gaiaresources/bdrs/model/showcase/impl/GalleryDAOImpl.java
  146. +55 −5 src/main/java/au/com/gaiaresources/bdrs/model/survey/Survey.java
  147. +23 −0 src/main/java/au/com/gaiaresources/bdrs/model/survey/SurveyDAO.java
  148. +2 −0 src/main/java/au/com/gaiaresources/bdrs/model/survey/SurveyFormRendererType.java
  149. +7 −0 src/main/java/au/com/gaiaresources/bdrs/model/survey/SurveyService.java
  150. +53 −27 src/main/java/au/com/gaiaresources/bdrs/model/survey/SurveyServiceImpl.java
  151. +34 −1 src/main/java/au/com/gaiaresources/bdrs/model/survey/impl/SurveyDAOImpl.java
  152. +75 −0 src/main/java/au/com/gaiaresources/bdrs/model/taxa/AttributeDAO.java
  153. +1 −0 src/main/java/au/com/gaiaresources/bdrs/model/taxa/AttributeType.java
  154. +158 −54 src/main/java/au/com/gaiaresources/bdrs/model/taxa/AttributeValue.java
  155. +1 −1 src/main/java/au/com/gaiaresources/bdrs/model/taxa/IndicatorSpeciesAttribute.java
  156. +3 −1 src/main/java/au/com/gaiaresources/bdrs/model/taxa/SpeciesProfile.java
  157. +2 −2 src/main/java/au/com/gaiaresources/bdrs/model/taxa/TaxaDAO.java
  158. +2 −2 src/main/java/au/com/gaiaresources/bdrs/model/taxa/TaxaService.java
  159. +20 −0 src/main/java/au/com/gaiaresources/bdrs/model/taxa/TaxonRank.java
  160. +54 −0 src/main/java/au/com/gaiaresources/bdrs/model/taxa/TypedAttributeValue.java
  161. +59 −5 src/main/java/au/com/gaiaresources/bdrs/model/taxa/impl/AttributeDAOImpl.java
  162. +11 −9 src/main/java/au/com/gaiaresources/bdrs/model/taxa/impl/TaxaDAOImpl.java
  163. +3 −3 src/main/java/au/com/gaiaresources/bdrs/model/taxa/impl/TaxaServiceImpl.java
  164. +38 −13 src/main/java/au/com/gaiaresources/bdrs/model/theme/impl/ThemeDAOImpl.java
  165. +3 −2 src/main/java/au/com/gaiaresources/bdrs/model/user/RegistrationService.java
  166. +11 −3 src/main/java/au/com/gaiaresources/bdrs/model/user/User.java
  167. +0 −1 src/main/java/au/com/gaiaresources/bdrs/model/user/impl/UserDAOImpl.java
  168. +0 −1 src/main/java/au/com/gaiaresources/bdrs/security/Role.java
  169. +354 −190 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/AbstractBulkDataService.java
  170. +9 −0 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/BulkDataReadWriteService.java
  171. +41 −0 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/BulkDataReadWriteServiceImpl.java
  172. +1 −1 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/BulkDataService.java
  173. +33 −0 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/DataReferenceException.java
  174. +2 −2 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/RecordRow.java
  175. +61 −1 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/RecordUpload.java
  176. +242 −43 src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/XlsRecordRow.java
  177. +172 −0 src/main/java/au/com/gaiaresources/bdrs/service/detect/BDRSWurflLoadService.java
  178. +127 −0 src/main/java/au/com/gaiaresources/bdrs/service/image/ImageService.java
  179. +61 −0 src/main/java/au/com/gaiaresources/bdrs/service/managedFile/ManagedFileService.java
  180. +2 −2 src/main/java/au/com/gaiaresources/bdrs/service/threshold/RecordAttributeOperator.java
  181. +3 −3 src/main/java/au/com/gaiaresources/bdrs/service/threshold/ThresholdService.java
  182. +6 −5 ...main/java/au/com/gaiaresources/bdrs/service/threshold/operatorhandler/RecordAttributeHandler.java
  183. +56 −0 src/main/java/au/com/gaiaresources/bdrs/service/web/GoogleKeyService.java
  184. +118 −0 src/main/java/au/com/gaiaresources/bdrs/service/web/JsonService.java
  185. +5 −0 src/main/java/au/com/gaiaresources/bdrs/service/web/RedirectionService.java
  186. +27 −3 src/main/java/au/com/gaiaresources/bdrs/servlet/HandlerExceptionResolver.java
  187. +21 −5 src/main/java/au/com/gaiaresources/bdrs/servlet/Interceptor.java
  188. +90 −64 src/main/java/au/com/gaiaresources/bdrs/servlet/filter/PortalSelectionFilter.java
  189. +19 −0 src/main/java/au/com/gaiaresources/bdrs/servlet/jsp/tag/Formatter.java
  190. +1 −1 src/main/java/au/com/gaiaresources/bdrs/servlet/jsp/tag/GetContentTag.java
  191. +32 −31 src/main/java/au/com/gaiaresources/bdrs/servlet/jsp/tag/GetThemeTemplateTag.java
  192. +365 −0 src/main/java/au/com/gaiaresources/bdrs/spatial/ShapeFileReader.java
  193. +18 −1 src/main/java/au/com/gaiaresources/bdrs/util/DateUtils.java
  194. +55 −0 src/main/java/au/com/gaiaresources/bdrs/util/KMLUtils.java
  195. +2 −2 src/main/java/au/com/gaiaresources/bdrs/util/ZipUtils.java
  196. +27 −0 src/main/js-test/bdrs/map/BufferCalcTest.js
  197. +50 −0 src/main/js-test/bdrs/map/MapServerQueryManagerTest.js
  198. +60 −0 src/main/js-test/bdrs/map/SldGeneratorTest.js
  199. +43 −11 src/main/js-test/bdrsTest.html
  200. +181 −0 src/main/js/advancedReviewSightings.js
  201. +903 −846 src/main/js/bdrs.js
  202. +39 −0 src/main/js/bdrs/attribute.js
  203. +12 −0 src/main/js/bdrs/censusMethod.js
  204. +234 −0 src/main/js/bdrs/contribute.js
  205. +38 −0 src/main/js/bdrs/dnd.js
  206. +120 −0 src/main/js/bdrs/location.js
  207. +136 −0 src/main/js/bdrs/map.js
  208. +72 −0 src/main/js/bdrs/map/MapServerQueryManager.js
  209. +72 −0 src/main/js/bdrs/menu.js
  210. +16 −0 src/main/js/bdrs/message.js
  211. +22 −0 src/main/js/bdrs/preferences.js
  212. +62 −0 src/main/js/bdrs/user.js
  213. +184 −0 src/main/js/bdrs/util.js
  214. +65 −67 src/main/js/embedded.js
  215. +18 −0 src/main/js/jquery-1.6.2.min.js
  216. +499 −0 src/main/js/jquery-blockui/jquery.blockUI.js
  217. +17 −0 src/main/js/jquery-tmpl/README.md
Sorry, we could not display the entire diff because too many files (538) changed.
View
104 adds.txt
@@ -0,0 +1,104 @@
+svn add webdefault.xml
+svn add overlay_war.sh
+svn add findbugs-exclude.xml
+svn add adds.txt
+svn add src/test/java/au/com/gaiaresources/bdrs/test
+svn add src/test/java/au/com/gaiaresources/bdrs/spatial
+svn add src/test/java/au/com/gaiaresources/bdrs/model/method
+svn add src/test/java/au/com/gaiaresources/bdrs/model/detect
+svn add src/test/java/au/com/gaiaresources/bdrs/model/showcase
+svn add src/test/java/au/com/gaiaresources/bdrs/model/map
+svn add src/test/java/au/com/gaiaresources/bdrs/model/record
+svn add src/test/java/au/com/gaiaresources/bdrs/model/preference
+svn add src/test/java/au/com/gaiaresources/bdrs/model/survey/SurveyServiceImplTest.java
+svn add src/test/java/au/com/gaiaresources/bdrs/service/detect
+svn add src/test/java/au/com/gaiaresources/bdrs/service/web
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/review
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/showcase
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/map
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/webservice/ApplicationServiceUploadTest.java
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/theme/ThemeControllerAsAdminTest.java
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/attribute/CensusMethodControllerTest.java
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/mobile/MobileApplicationControllerTest.java
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/record/TrackerControllerCensusMethodTest.java
+svn add src/test/java/au/com/gaiaresources/bdrs/controller/record/RecordDeletionControllerTest.java
+svn add src/test/resources/au/com/gaiaresources/bdrs/controller
+svn add src/test/resources/au/com/gaiaresources/bdrs/spatial
+svn add src/test/resources/au/com/gaiaresources/bdrs/service/gis
+svn add src/test/resources/au/com/gaiaresources/bdrs/service/detect
+svn add src/test/resources/au/com/gaiaresources/bdrs/service/web
+svn add src/test/resources/au/com/gaiaresources/bdrs/service/bulkdata/invalid_daterange.xls
+svn add src/main/mobile
+svn add src/main/java/au/com/gaiaresources/bdrs/spatial
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/showcase
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/review
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/webservice/ManagedFileWebService.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/theme/StaticPageController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/attribute/CensusMethodController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/TypedAttributeValueFormField.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/mobile/MobileApplicationController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/map/GeoMapLayerController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/map/GeoMapController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/record/RecordDeletionController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/record/AtlasController.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DynamicIntRangeValidator.java
+svn add src/main/java/au/com/gaiaresources/bdrs/controller/record/validator/DynamicDateRangeValidator.java
+svn add src/main/java/au/com/gaiaresources/bdrs/servlet/jsp/tag/Formatter.java
+svn add src/main/java/au/com/gaiaresources/bdrs/model/detect
+svn add src/main/java/au/com/gaiaresources/bdrs/model/showcase
+svn add src/main/java/au/com/gaiaresources/bdrs/model/map
+svn add src/main/java/au/com/gaiaresources/bdrs/model/method/Taxonomic.java
+svn add src/main/java/au/com/gaiaresources/bdrs/model/method/impl
+svn add src/main/java/au/com/gaiaresources/bdrs/model/method/CensusMethodDAO.java
+svn add src/main/java/au/com/gaiaresources/bdrs/model/taxa/TypedAttributeValue.java
+svn add src/main/java/au/com/gaiaresources/bdrs/service/image
+svn add src/main/java/au/com/gaiaresources/bdrs/service/detect
+svn add src/main/java/au/com/gaiaresources/bdrs/service/managedFile
+svn add src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/BulkDataReadWriteService.java
+svn add src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/BulkDataReadWriteServiceImpl.java
+svn add src/main/java/au/com/gaiaresources/bdrs/service/bulkdata/DataReferenceException.java
+svn add src/main/java/au/com/gaiaresources/bdrs/service/web/GoogleKeyService.java
+svn add src/main/java/au/com/gaiaresources/bdrs/service/web/JsonService.java
+svn add src/main/java/au/com/gaiaresources/bdrs/util/KMLUtils.java
+svn add src/main/images/icons/tree_node.gif
+svn add src/main/js-test/bdrs
+svn add src/main/resources/au/com/gaiaresources/bdrs/model/portal/impl/admin_groupListing.vm
+svn add src/main/resources/au/com/gaiaresources/bdrs/model/portal/impl/admin_censusMethodListing.vm
+svn add src/main/resources/au/com/gaiaresources/bdrs/model/portal/impl/admin_groupEdit.vm
+svn add src/main/resources/au/com/gaiaresources/bdrs/model/portal/impl/admin_censusMethodEdit.vm
+svn add src/main/resources/au/com/gaiaresources/bdrs/service/detect
+svn add src/main/resources/au/com/gaiaresources/bdrs/service/web
+svn add src/main/resources/au/com/gaiaresources/bdrs/controller/mobile
+svn add src/main/js/advancedReviewSightings.js
+svn add src/main/js/jquery-tmpl
+svn add src/main/js/bdrs
+svn add src/main/js/jquery.cj-simple-slideshow.min.js
+svn add src/main/js/jquery-blockui
+svn add src/main/js/jquery-1.6.2.min.js
+svn add src/main/webapp/WEB-INF/bdrs.map
+svn add src/main/webapp/WEB-INF/jsp/vanilla/admin/home_default.jsp
+svn add src/main/webapp/WEB-INF/jsp/vanilla/user/home_default.jsp
+svn add src/main/webapp/WEB-INF/jsp/vanilla/public/index.jsp
+svn add src/main/webapp/WEB-INF/jsp/vanilla/public/userSignUp_default.jsp
+svn add src/main/webapp/WEB-INF/jsp/vanilla/public/home_default.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/widget/userGrid.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/widget/galleryGrid.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/widget/censusMethodGrid.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/widget/geoMapLayerGrid.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/widget/geoMapGrid.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/widget/groupGrid.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/admin/gallery
+svn add src/main/webapp/WEB-INF/jsp/bdrs/admin/censusMethod
+svn add src/main/webapp/WEB-INF/jsp/bdrs/admin/mapLayer
+svn add src/main/webapp/WEB-INF/jsp/bdrs/admin/map
+svn add src/main/webapp/WEB-INF/jsp/bdrs/admin/survey/userLocationRow.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/embedded/image_slideshow.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/map/viewMap.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/user/review
+svn add src/main/webapp/WEB-INF/jsp/bdrs/user/record/render/atlas
+svn add src/main/webapp/WEB-INF/jsp/bdrs/public/fieldguide/taxonView_default.jsp
+svn add src/main/webapp/WEB-INF/jsp/bdrs/public/fieldguide/groupListing_default.jsp
+svn add src/main/webapp/WEB-INF/jsp/template/postMessage.jsp
+svn add src/main/webapp/WEB-INF/jsp/template/jsonDummyView.jsp
+svn add src/main/webapp/WEB-INF/jsp/template/theme/static_public.jsp
+svn add src/main/webapp/WEB-INF/jsp/template/vanilla/dashboard_default.jsp
View
7 findbugs-exclude.xml
@@ -0,0 +1,7 @@
+<FindBugsFilter>
+ <Match>
+ <!-- Exclude unused loggers -->
+ <Field type="org.apache.log4j.Logger"/>
+ <Bug code="UrF"/>
+ </Match>
+</FindBugsFilter>
View
81 overlay_war.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+usage()
+{
+cat << EOF
+usage: $0 options
+
+This script takes a directory with the target data to overlay the war file.
+
+OPTIONS:
+ -t target WAR file (optional, will use /target/bdrs-core.war by default) Absolute or relative path
+ -s source directory. This should be the the base directory of the data to overlay the WAR file with. Absolute or relative path
+
+Example:
+$0 -s ~/workspace/GR205-DIDMS/deployment/external_stage/war_file/
+$0 -t target/bdrs-core.war -s ~/workspace/GR205-DIDMS/deployment/external_stage/war_file/
+EOF
+}
+
+TARGET="target/bdrs-core.war"
+SOURCE=
+
+while getopts “ht::s:” OPTION
+do
+ case $OPTION in
+ h)
+ usage
+ exit 1
+ ;;
+ t)
+ TARGET=$OPTARG
+ ;;
+ s)
+ SOURCE=$OPTARG
+ ;;
+ esac
+done
+
+if [[ -z $TARGET ]] || [[ -z $SOURCE ]]
+then
+ usage
+ exit 1
+fi
+
+if [[ ! $TARGET == \/* ]]
+then
+ # Convert to absolute path
+ TARGET=$PWD"/"$TARGET
+fi
+
+if [[ ! -f $TARGET ]]
+then
+ echo "Target WAR file" \"$TARGET\" "does not exist or is not a file"
+ exit 1
+fi
+
+if [[ ! -d $SOURCE ]]
+then
+ echo "Source directory" \"$SOURCE\" "does not exist"
+ exit 1
+fi
+
+if [[ ! -d $SOURCE"/WEB-INF" ]]
+then
+ echo "Expected to find the WEB-INF directory in the source dir. Are you sure this is the right directory?"
+ read -p "Do you want to continue (y/n)?: " CHOICE
+ if [ "$CHOICE" = "n" ]
+ then
+ echo "WAR file has not been overlayed"
+ exit 0
+ fi
+fi
+
+pushd $SOURCE
+
+zip -r $TARGET . -x \*/.* -x \*.svn*
+
+popd
+
+echo "WAR file" \"$TARGET\" "successfully overlayed with data from" \"$SOURCE\"
+
View
26 pom.xml
@@ -26,6 +26,10 @@
<url>http://nexus.openqa.org/content/repositories/releases</url>
</repository>
<repository>
+ <id>Tartarus</id>
+ <url>http://tartarus:8080/artifactory/repo/</url>
+ </repository>
+ <repository>
<id>ALA</id>
<url>http://maven.ala.org.au/repository</url>
</repository>
@@ -71,7 +75,7 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
- <scope>provided</scope>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -316,6 +320,12 @@
<version>2.5.3</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-jai-tools</artifactId>
+ <version>2.5.5-jai-tools</version>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
@@ -535,6 +545,8 @@
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
+ <nonFilteredFileExtension>zip</nonFilteredFileExtension>
+ <nonFilteredFileExtension>apk</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
@@ -544,6 +556,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <encoding>UTF-8</encoding>
+ <nonFilteredFileExtensions>
+ <nonFilteredFileExtension>xls</nonFilteredFileExtension>
+ <nonFilteredFileExtension>zip</nonFilteredFileExtension>
+ </nonFilteredFileExtensions>
<excludes>
<!--exclude>**/*Client.java</exclude-->
</excludes>
@@ -845,6 +862,7 @@
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<xmlOutput>true</xmlOutput>
+ <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
@@ -860,7 +878,7 @@
<!-- Mail properties -->
<bdrs.default.mail.server>localhost</bdrs.default.mail.server>
<bdrs.default.mail.port>25</bdrs.default.mail.port>
- <bdrs.default.mail.from>Your Email Here</bdrs.default.mail.from>
+ <bdrs.default.mail.from>bdrs-core@gaiaresources.com.au</bdrs.default.mail.from>
<bdrs.error.mail.to></bdrs.error.mail.to>
<bdrs.mail.subject.prefix>[BDRS-Core - Dev]</bdrs.mail.subject.prefix>
<!-- Application address properties -->
@@ -878,8 +896,8 @@
<bdrs.tomcat.manager.username>tomcat</bdrs.tomcat.manager.username>
<bdrs.tomcat.manager.password>tomcat</bdrs.tomcat.manager.password>
<!-- reCAPTCHA properties -->
- <bdrs.recaptcha.public.key>Your Key Here</bdrs.recaptcha.public.key>
- <bdrs.recaptcha.private.key>Your Key Here</bdrs.recaptcha.private.key>
+ <bdrs.recaptcha.public.key>6LfbwwQAAAAAAEiDp_pgbdLzIOgVLpTpA3kqUfXF</bdrs.recaptcha.public.key>
+ <bdrs.recaptcha.private.key>6LfbwwQAAAAAAF5wVuk8nLcOanKCwvA_-rmtvNIL</bdrs.recaptcha.private.key>
<!-- File storage location -->
<bdrs.file.store.location>/tmp</bdrs.file.store.location>
</properties>
View
39 src/main/css/bdrs/bdrs.css
@@ -39,14 +39,19 @@
text-align: right;
}
-#record_base_map {
+.tracker_map {
height: 465px;
}
-.tracker_map {
+.review_map {
height: 465px;
}
+.review_map_fullscreen {
+ height: 100%;
+ width: 100%;
+}
+
.kmlDescriptionTable {
/* margin: 0.5em 0.5em 0.5em 0.5em; */
}
@@ -62,13 +67,27 @@
padding-right: 1em;
}
-/************************************/
-/* Sighting Filter Table */
-/************************************/
-#sightingFilterTable th,
-#sightingFilterTable td {
- padding: 0em 0.5em 0em 0.5em;
- margin: 0em 0em 0em 0em;
- text-align: left;
+/* Styling for the popups in viewMap.jsp */
+.olFramedCloudPopupContent h1 {
+ color: #333333;
+ font-size: 135%;
+ font-weight: bold;
+ padding: 10px 0;
+}
+
+.olFramedCloudPopupContent table {
+
}
+.olFramedCloudPopupContent th,
+.olFramedCloudPopupContent td {
+ padding: 0;
+ margin: 0;
+}
+
+.olFramedCloudPopupContent tbody th {
+ text-align: right;
+ padding-right: 1em;
+}
+
+
View
321 src/main/css/vanilla/base.css
@@ -719,16 +719,42 @@ h3 {
padding: 10px 0;
}
-h3.sep {
+.sep {
border-top: 1px solid #D3D3D3;
}
+.sepBottom {
+ border-bottom: 1px solid #D3D3D3;
+}
+
.wrapper {
padding-top: 0px;
margin: 0px auto;
width: 868px;
}
+/* Dashboard styling */
+.dashboardContainer {
+ width: 100%;
+ background-color: #FFFFFF;
+ -webkit-border-bottom-right-radius: 20px;
+ -webkit-border-bottom-left-radius: 20px;
+ -moz-border-radius-bottomright: 20px;
+ -moz-border-radius-bottomleft: 20px;
+ border-bottom-right-radius: 20px;
+ border-bottom-left-radius: 20px;
+}
+
+.dashboardFooter {
+ clear: both;
+}
+
+.dashboard {
+ width: 0px;
+ float: left;
+ background-color: #8b883c;
+}
+
.contentwrapper {
background-color: #FFFFFF;
background-repeat: repeat;
@@ -800,6 +826,44 @@ input[disabled] {
color: #484848;
}
+.mapLogoMax {
+ position: fixed;
+ bottom: 100px;
+ left: 2px;
+ z-index: 1600;
+}
+
+.mapLogoMin {
+ display:none;
+}
+
+/************************************/
+/* Geocode Styling */
+/************************************/
+.geocode {
+
+ text-align: center;
+ margin: 0px auto;
+ position: relative;
+ z-index: 1500;
+ bottom: 45px;
+ width: 500px;
+ height: 20px;
+}
+
+.geocode input[type=text] {
+ width: 75%;
+ height: 21px;
+ background-color: #e1e1e1;
+ border-color: #000000;
+}
+
+.geocode input[type=submit] {
+ width: 80px;
+ height: 23px;
+ vertical-align: bottom;
+}
+
/************************************/
/* Header Styling */
/************************************/
@@ -1001,6 +1065,92 @@ ul.ui-menu li.ui-menu-item {
}
/************************************/
+/* Atlas Sighting Form */
+/************************************/
+.atlasSighting {
+}
+
+.atlasSighting .leftCol {
+ padding: 8px;
+ width: 462px;
+ position: relative;
+}
+
+.atlasSighting .leftCol h3 {
+ width: 360px;
+}
+
+.atlasSighting .leftCol h3 img {
+ position: absolute;
+ right: 8px;
+}
+
+.atlasSighting .rightCol {
+ background-color: #D3D3D3;
+ padding: 8px;
+ width: 334px;
+}
+
+.atlasSighting .atlasmap {
+ width: 334px;
+ height: 334px;
+}
+
+.atlasSighting .atlasgeocode {
+ bottom: auto;
+ padding: 0px 0px 12px 0px;
+ margin: 0;
+ text-align: left;
+ width: auto;
+}
+
+.atlasSighting .atlasgeocode input[type="text"] {
+ background-color: white;
+}
+
+.atlasSighting .atlasgeocode input[type="submit"] {
+ width: auto;
+ height: auto;
+}
+
+.atlasSighting .atlasSightingRecordLocations {
+ padding-bottom: 8px;
+}
+
+.atlasSighting p.mapHints {
+ padding-top: 1em;
+ margin-botton: 0em;
+}
+
+.atlasSighting #locationName {
+ height: 3em;
+}
+
+.atlasSighting #bookmarkLocation {
+ margin-left: 0px;
+}
+
+.atlasSighting #location {
+ max-width: 100%;
+ min-width: 12.5em;
+}
+
+.atlasSighting #defaultLocation,
+.atlasSighting label[for=defaultLocation] {
+ vertical-align: middle;
+}
+
+/** Left Col Stuff **/
+.atlasSighting .form_table tbody th {
+ text-align: left;
+}
+
+.atlasSighting .form_table tbody td {
+ width: 100%;
+}
+
+
+/************************************/
/* Thresholds */
/************************************/
#conditionContainer fieldset {
@@ -1072,3 +1222,172 @@ h3.field_guide_header {
border-bottom-width: 1px;
border-bottom-style: dotted;
}
+
+/*************************************/
+/* Image Gallery Editing */
+/*************************************/
+.imageGalleryEditImageContainer {
+ width:252px;
+ padding:2px;
+ border-style:dashed;
+ border-width:1px;
+}
+
+.imageGalleryInput {
+ width:252px;
+}
+
+/************************************/
+/* ALA Sightings */
+/************************************/
+.facet {
+ border-width: 1px 1px 0px 1px;
+ border-style: solid;
+ border-color: #2D4977;
+}
+
+.facet:last-child {
+ border-bottom-width: 1px;
+}
+
+.facetOptions {
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+
+ border-top: 1px solid #2D4977;
+}
+
+.facet h4 {
+ line-height: 2em;
+ background-color: #C2D1E0;
+ cursor: pointer;
+}
+
+.facet .tree_node {
+ background-image: url(../../images/icons/tree_node.gif);
+ background-repeat:no-repeat;
+ background-position: bottom left;
+ width: 9px;
+ height: 9px;
+
+ display: block;
+ float: left;
+ position: relative;
+ top: 0.5em;
+ margin: 2px;
+}
+
+.facet .tree_node_expanded {
+ background-position: bottom right;
+}
+
+.facetCol {
+ width: 248px;
+}
+
+.resultCol {
+ width: 580px;
+}
+
+.tabPane {
+ padding-left: 8px;
+}
+
+.alaSightingsContent .map_wrapper {
+}
+
+#atlasSightingsMap {
+ width: 572px;
+ height: 362px;
+}
+
+.alaSightingsContent #searchButton {
+ /* Make the button slightly thinner to fit the space allocated */
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+
+.alaSightingsContent .columnBanner {
+ font-size: 1.5em;
+ background-color: #C2D1E0;
+ border-width: 1px 0px 1px 0px;
+ border-style: solid;
+ border-color: #2D4977;
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ margin-bottom: 0.5em;
+
+}
+
+.alaSightingsContent .controlPanel {
+ border-bottom: 1px solid #2D4977;
+}
+
+.alaSightingsContent .displayTab {
+ padding: 0.0em 1.5em 0.0em 1.5em;
+ line-height: 2em;
+ margin: 0px 0px 0px 4px;
+
+ border-style: solid;
+ border-color: #2D4977;
+ border-width: 1px 1px 0px 1px;
+}
+
+.alaSightingsContent .displayTab:hover {
+ background-color: #D0DCE4;
+}
+
+.alaSightingsContent .displayTabSelected {
+ font-weight: bold;
+ color: #333333;
+}
+
+.alaSightingsTable {
+ width: 100%;
+}
+
+.alaSightingsTable .sighting {
+ border-bottom: 1px solid #D9D9D9;
+ padding: 0.5em 0em 0.5em 0em;
+}
+
+.alaSightingsTable .sighting .recordType,
+.alaSightingsTable .sighting .scientificName,
+.alaSightingsTable .sighting .commonName {
+ font-weight: bold;
+}
+
+.alaSightingsTableViewContent,
+.alaSightingsMapViewContent {
+}
+
+.alaSightingsContent .sortPanel {
+ background-color: #F0F0F0;
+ border-width: 0px 0px 1px 0px;
+ border-style: solid;
+ border-color: #D9D9D9;
+}
+
+/***** My sightings *******/
+#sightingFilter .sightingFilterItem {
+ float: left;
+}
+
+#sightingFilter .sightingFilterSubmit {
+ float: left;
+ padding: 1.1em 0 0 0;
+}
+
+#sightingFilter label {
+ padding: 0em 0.5em 0em 0.5em;
+ font-weight: bolder;
+}
+
+#sightingFilter div {
+ padding: 0 0.5em 0 0;
+}
+
+#sightingFilter div div input[type=text] {
+ margin-top: 0.3em;
+}
+
+
View
44 src/main/data/HelpTextSQL
@@ -1,25 +1,25 @@
BEGIN;
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please enter a name for the class you wish to create. Each class name should be unique and easy for you to identify.' , 'addClass');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please add a unique group name. This name should be easy for you and the students to identify. If you are having only one student per group, you can use the student name here.' , 'addGroup');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please create a unique field trip name. This name must be between 6 and 12 characters, and will be used by you and your students to identify this fieldtrip.' , 'addSurveyName');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Click inside the text box to bring up a calender from which you can select the survey date. Please do not type the date manually.' , 'addSurveyDate');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Type a short description of the Survey' , 'addSurveyDescript');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please select where your field trip will be. You can indicate up to four places by selecting the map or entering latitude and longitude values in the spaces provided. If you select from the map, these coordinates will be entered automatically. By selecting an area on a map, you will limit the species you will observe. This will help students make fewer identification errors. By not selecting any area, the species list for all of Victoria will be available. This is not recommended unless your field trip is intended to encompass all of Victoria. It will also make the program quite large if you download to mobile devices.' , 'addSurveyMap');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'The default is set for you to observe all 8 animal groups. If you wish to restrict the field trip to less than 8 groups, make your selection by using the checkboxes.', 'addSurveyAnimals');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'This section allows you to select which groups you would like to participate in the field trip. If there are no classes listed you should return to the dashboard and select ‘Add New Classes and Groups’.', 'addSurveyGroups');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'The groups on this page are the animals you are able to observe.', 'idToolP1');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'The groups on this page are the animals you are able to observe.', 'fieldGuide');
-INSERT INTO help_item(created_at, updated_at, "value", "key")
- VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please check the boxes for the classes you wish to participate in this survey.', 'addSurveyClass');
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please enter a name for the class you wish to create. Each class name should be unique and easy for you to identify.' , 'addClass', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please add a unique group name. This name should be easy for you and the students to identify. If you are having only one student per group, you can use the student name here.' , 'addGroup', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please create a unique field trip name. This name must be between 6 and 12 characters, and will be used by you and your students to identify this fieldtrip.' , 'addSurveyName', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Click inside the text box to bring up a calender from which you can select the survey date. Please do not type the date manually.' , 'addSurveyDate', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Type a short description of the Survey' , 'addSurveyDescript', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please select where your field trip will be. You can indicate up to four places by selecting the map or entering latitude and longitude values in the spaces provided. If you select from the map, these coordinates will be entered automatically. By selecting an area on a map, you will limit the species you will observe. This will help students make fewer identification errors. By not selecting any area, the species list for all of Victoria will be available. This is not recommended unless your field trip is intended to encompass all of Victoria. It will also make the program quite large if you download to mobile devices.' , 'addSurveyMap', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'The default is set for you to observe all 8 animal groups. If you wish to restrict the field trip to less than 8 groups, make your selection by using the checkboxes.', 'addSurveyAnimals', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'This section allows you to select which groups you would like to participate in the field trip. If there are no classes listed you should return to the dashboard and select ‘Add New Classes and Groups’.', 'addSurveyGroups', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'The groups on this page are the animals you are able to observe.', 'idToolP1', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'The groups on this page are the animals you are able to observe.', 'fieldGuide', 0);
+INSERT INTO help_item(created_at, updated_at, "value", "key", "weight")
+ VALUES (TIMESTAMP 'now', TIMESTAMP 'now', 'Please check the boxes for the classes you wish to participate in this survey.', 'addSurveyClass', 0);
COMMIT;
View
4 src/main/data/Installing-BDRS-OpenSUSE-11.3.txt
@@ -1,5 +1,6 @@
Installing on openSuse
+
Default opensuse install
use yast to enable ssh access (under system->services)
use yast to open up port for SSH (security -> firewall)
@@ -84,7 +85,6 @@ tomcat-users.xml:
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager"/>
- <user username="admin" password="BioSnaps!T0mC4t" roles="tomcat,manager"/>
</tomcat-users>
@@ -174,7 +174,7 @@ WEB-INF/climatewatch-email.xml:
sudo vi WEB-INF/climatewatch-hibernate.xml
WEB-INF/climatewatch-hibernate.xml:
<property name="username" value="biosnaps"/>
- <property name="password" value="biosnaps"/>
+ <property name="password" value=""/>
// Configure postgresql libraries
cd /srv/tomcat6/webapps/BDRS/WEB-INF/
View
BIN src/main/images/icons/tree_node.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 src/main/java/au/com/gaiaresources/bdrs/annotation/CompactAttribute.java
@@ -3,6 +3,10 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+/*
+ * Used to indicate the name of a member is included during
+ * serialization / flattening in PersistentImpl.flatten()
+ */
@Retention(RetentionPolicy.RUNTIME)
public @interface CompactAttribute {
}
View
1 src/main/java/au/com/gaiaresources/bdrs/annotation/MobileField.java
@@ -3,6 +3,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+// used to indicate the name of a member after serialization / flattening in PersistentImpl.flatten()
@Retention(RetentionPolicy.RUNTIME)
public @interface MobileField {
String name();
View
4 src/main/java/au/com/gaiaresources/bdrs/annotation/Sensitive.java
@@ -3,6 +3,10 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+/*
+ * Used to indicate the name of a member is always ignored during
+ * serialization / flattening in PersistentImpl.flatten()
+ */
@Retention(RetentionPolicy.RUNTIME)
public @interface Sensitive {
View
30 src/main/java/au/com/gaiaresources/bdrs/controller/AbstractController.java
@@ -1,5 +1,10 @@
package au.com.gaiaresources.bdrs.controller;
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;
@@ -38,6 +43,31 @@ protected String getControllerRequestMapping(Class<? extends AbstractController>
return "";
}
+ /**
+ * Writes out our json to the http response. Contains support for JSONP
+ *
+ * @param request - the http request object
+ * @param response - the http response object
+ * @param json - the entire json string
+ * @throws IOException
+ */
+ protected void writeJson(HttpServletRequest request, HttpServletResponse response, String json) throws IOException {
+ // support for JSONP
+ if (request.getParameter("callback") != null) {
+ response.setContentType("application/javascript");
+ response.getWriter().write(request.getParameter("callback") + "(");
+ } else {
+ response.setContentType("application/json");
+ }
+
+ // write our content
+ response.getWriter().write(json);
+
+ if (request.getParameter("callback") != null) {
+ response.getWriter().write(");");
+ }
+ }
+
protected String getRedirectHome() {
return "redirect:/home.htm";
}
View
2 src/main/java/au/com/gaiaresources/bdrs/controller/DisplayTagHelper.java
@@ -11,7 +11,6 @@
public class DisplayTagHelper {
- String tableId;
private ParamEncoder paramEncoder;
// "1" and "2" is returned by displaytag for ASC and DESC so...
@@ -21,7 +20,6 @@
public static final Integer DEFAULT_MAX_PER_PAGE = 10;
public DisplayTagHelper(String tableId) {
- this.tableId = tableId;
paramEncoder = new ParamEncoder(tableId);
}
View
138 src/main/java/au/com/gaiaresources/bdrs/controller/HomePageController.java
@@ -1,5 +1,6 @@
package au.com.gaiaresources.bdrs.controller;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -16,13 +17,11 @@
import org.springframework.web.servlet.view.RedirectView;
import au.com.gaiaresources.bdrs.message.Message;
-import au.com.gaiaresources.bdrs.model.group.Group;
-import au.com.gaiaresources.bdrs.model.group.GroupDAO;
-import au.com.gaiaresources.bdrs.model.metadata.Metadata;
+import au.com.gaiaresources.bdrs.model.detect.BDRSWurflDevice;
+import au.com.gaiaresources.bdrs.model.detect.BDRSWurflDeviceDAO;
import au.com.gaiaresources.bdrs.model.record.Record;
import au.com.gaiaresources.bdrs.model.record.RecordDAO;
import au.com.gaiaresources.bdrs.model.survey.SurveyDAO;
-import au.com.gaiaresources.bdrs.model.user.User;
import au.com.gaiaresources.bdrs.model.user.UserDAO;
import au.com.gaiaresources.bdrs.security.Role;
@@ -32,72 +31,74 @@
@Autowired
private RecordDAO recordDAO;
@Autowired
- private GroupDAO groupDAO;
- @Autowired
private UserDAO userDAO;
@Autowired
private SurveyDAO surveyDAO;
+ @Autowired
+ private BDRSWurflDeviceDAO deviceDAO;
Logger log = Logger.getLogger(getClass());
- public static final String[] MOBILE_TAGS = { "android", "iphone", "ipad" };
+ private static final String[] MOBILE_TAGS = { "android", "iphone", "ipad" };
+ private static final String[] DEVICES_WITH_APP = { "Android"};
+
+
@RequestMapping(value = "/home.htm", method = RequestMethod.GET)
public ModelAndView render(HttpServletRequest request,
HttpServletResponse response) {
- log.debug("User Agent is : " + request.getHeader("User-Agent"));
- Integer id = null;
- ModelAndView view = new ModelAndView();
-
- // This method call will set session variables and therefore cannot
- // be invoked in the if statement
- boolean isMobileDevice = mobileHeaderCheck(request);
- log.debug(isMobileDevice);
-
- // Check to see if we are signed into a survey.
- if ((request.getParameter("surveyId") != null)
- && (!request.getParameter("surveyId").isEmpty())) {
- id = new Integer(request.getParameter("surveyId"));
- request.getSession().setAttribute("surveyId", id);
- view.setViewName("surveylogin");
- }
+
+ log.info("User-Agent = " +request.getHeader("User-Agent"));
+
+ ModelAndView view = new ModelAndView();
+ String sessionType = (String) request.getSession().getAttribute("sessionType");
+
+ if ((sessionType != null) && sessionType.equals("mobile")) {
+ // view mobile, forced by user
+ view.setView(new RedirectView(request.getSession().getServletContext().getContextPath() + "/mobile/"));
+ } else if ((sessionType != null) && sessionType.equals("desktop")) {
+
+ // view desktop, forced by user session
+ if (request.getParameter("signin") != null) {
+ view.setViewName("signin");
+ } else {
+ view.setViewName("home");
+ Record latestRecord = recordDAO.getLatestRecord();
+ view.addObject("recordCount", recordDAO.countAllRecords());
+ view.addObject("latestRecord", latestRecord);
+ view.addObject("uniqueSpeciesCount", recordDAO.countUniqueSpecies());
+ view.addObject("userCount", userDAO.countUsers());
+ view.addObject("publicSurveys", surveyDAO.getActivePublicSurveys(true));
+ }
+
+ } else {
+ // view based on device detection
+ BDRSWurflDevice d = deviceDAO.getByUserAgent(request.getHeader("User-Agent"));
+ String capabilityValue = deviceDAO.getCapabilityValue(d,"is_wireless_device");
+ if (!Boolean.parseBoolean(capabilityValue)) {
+ //view desktop
+ if (request.getParameter("signin") != null) {
+ view.setViewName("signin");
+ } else {
+ view.setViewName("home");
+ Record latestRecord = recordDAO.getLatestRecord();
+ view.addObject("recordCount", recordDAO.countAllRecords());
+ view.addObject("latestRecord", latestRecord);
+ view.addObject("uniqueSpeciesCount", recordDAO.countUniqueSpecies());
+ view.addObject("userCount", userDAO.countUsers());
+ view.addObject("publicSurveys", surveyDAO.getActivePublicSurveys(true));
+ }
+ } else {
+ RedirectView redirectView = new RedirectView("/mobile/", true, true, true);
+ String deviceOs = deviceDAO.getCapabilityValue(d, "device_os");
+ if (deviceOs != null){
+ view.addObject("hasApp", deviceOs);
+ }
+ view.setView(redirectView);
+ }
+ }
- if (!isMobileDevice) {
- if (request.getParameter("signin") != null) {
- view.setViewName("signin");
- } else {
- if (id == null) {
- view.setViewName("home");
- Record latestRecord = recordDAO.getLatestRecord();
- view.addObject("recordCount", recordDAO.countAllRecords());
- view.addObject("latestRecord", latestRecord);
- view.addObject("uniqueSpeciesCount", recordDAO.countUniqueSpecies());
- view.addObject("userCount", userDAO.countUsers());
- view.addObject("publicSurveys", surveyDAO.getActivePublicSurveys(true));
- if (latestRecord != null) {
- User u = latestRecord.getUser();
- String schoolName = u.getMetadataValue(Metadata.SCHOOL_NAME_KEY);
- if (schoolName != null && !schoolName.isEmpty()) {
- view.addObject("klassOrSchoolName", schoolName);
- } else {
- Group klass = groupDAO.getClassForUser(u);
- String klassName = klass == null ? null
- : klass.getName();
- view.addObject("klassOrSchoolName", klassName);
- }
- }
- } else {
- view.setViewName("signin");
- }
- }
- } else {
- if (!getRequestContext().isAuthenticated()) {
- view.setViewName("loginmobile");
- } else {
- view.setView(new RedirectView("/bdrs/mobile/home.htm"));
- }
- }
- return view;
+ return view;
}
@RequestMapping(value = "/deviceDataStore.htm", method = RequestMethod.POST)
@@ -153,7 +154,7 @@ public ModelAndView renderLoginFailed(HttpServletRequest request) {
String referer = request.getHeader("Referer");
String urlparams = "";
- if (referer != null) {
+ if (referer != null && referer.contains("?")) {
urlparams = referer.substring(referer.indexOf('?'));
}
@@ -205,7 +206,7 @@ public String redirectForRole(HttpServletRequest req,
* @param res
* @return
*/
- @RequestMapping(value = "/desktopSession.htm", method = RequestMethod.GET)
+ @RequestMapping(value = "/mobile/desktopSession.htm", method = RequestMethod.GET)
public String setDesktopSession(HttpServletRequest req,
HttpServletResponse res) {
req.getSession().setAttribute("sessionType", "desktop");
@@ -224,7 +225,7 @@ public String setDesktopSession(HttpServletRequest req,
public String setMobileSession(HttpServletRequest req,
HttpServletResponse res) {
req.getSession().setAttribute("sessionType", "mobile");
- return "redirect:/home.htm";
+ return "redirect:/mobile/";
}
/**
@@ -256,17 +257,4 @@ public ModelAndView getHome(HttpServletRequest request,
return mv;
}
-
-/* @RequestMapping(value = "/bdrs/mobile/index.htm", method = RequestMethod.GET)
- public ModelAndView getIndex(HttpServletRequest request,
- HttpServletResponse response) {
- log.debug("THIS MOBILE INDEX");
- ModelAndView mv = new ModelAndView("mobileTemplate");
- String ident = getRequestContext().getUser().getRegistrationKey();
- mv.addObject("manifest", "mobile.manifest?ident=" + ident);
- Cookie cookie = new Cookie("regkey", getRequestContext().getUser().getRegistrationKey());
- response.addCookie(cookie);
-
- return mv;
- }*/
}
View
5 src/main/java/au/com/gaiaresources/bdrs/controller/RenderController.java
@@ -69,7 +69,7 @@ public ModelAndView surveyRendererRedirect(HttpServletRequest request,
SurveyFormRendererType renderer = survey.getFormRendererType();
renderer = renderer == null ? SurveyFormRendererType.DEFAULT : renderer;
- String redirectURL;;
+ String redirectURL;
switch(renderer) {
case YEARLY_SIGHTINGS:
redirectURL = "yearlySightings.htm";
@@ -84,6 +84,9 @@ public ModelAndView surveyRendererRedirect(HttpServletRequest request,
redirectURL = "tracker.htm";
}
break;
+ case ATLAS:
+ redirectURL = "atlas.htm";
+ break;
case DEFAULT:
// Fall through
default:
View
17 src/main/java/au/com/gaiaresources/bdrs/controller/admin/AdminEditContentController.java
@@ -1,6 +1,7 @@
package au.com.gaiaresources.bdrs.controller.admin;
import java.util.List;
+import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -9,8 +10,11 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
+import edu.emory.mathcs.backport.java.util.TreeSet;
+
import au.com.gaiaresources.bdrs.controller.AbstractController;
import au.com.gaiaresources.bdrs.model.content.ContentDAO;
import au.com.gaiaresources.bdrs.model.portal.Portal;
@@ -27,22 +31,29 @@ public ModelAndView renderPage(HttpServletRequest request,
HttpServletResponse response) {
ModelAndView mav = new ModelAndView("adminEditContent");
List<String> keys = contentDAO.getAllKeys();
- mav.addObject("keys", keys);
+ // add the default portal initializer keys as well if not present
+ Set<String> uniqueKeys = new TreeSet(keys);
+ uniqueKeys.addAll(PortalInitialiser.CONTENT.keySet());
+ mav.addObject("keys", uniqueKeys);
return mav;
}
// There is no protection when using this URL directly. You will reset
// all of your content!
@RequestMapping(value="/admin/resetContentToDefault.htm", method = RequestMethod.GET)
- public String reset(HttpServletRequest request, HttpServletResponse response)
+ public String reset(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value = "key", required = false) String key)
throws Exception {
PortalInitialiser pi = new PortalInitialiser();
Portal currentPortal = getRequestContext().getPortal();
if (currentPortal == null) {
// something has gone seriously wrong for this to happen...
throw new Exception("The portal cannot be null");
}
- pi.initContent(currentPortal);
+ if (key == null)
+ pi.initContent(currentPortal);
+ else
+ pi.initContent(contentDAO, currentPortal, key);
return "redirect:/admin/editContent.htm";
}
}
View
7 src/main/java/au/com/gaiaresources/bdrs/controller/admin/AdminHomePageController.java
@@ -7,16 +7,21 @@
import org.springframework.web.servlet.ModelAndView;
import au.com.gaiaresources.bdrs.controller.AbstractController;
+import au.com.gaiaresources.bdrs.model.record.Record;
import au.com.gaiaresources.bdrs.model.record.RecordDAO;
@Controller
public class AdminHomePageController extends AbstractController {
@Autowired
private RecordDAO recordDAO;
+
+ public static final String ADMIN_HOME_URL = "/admin/home.htm";
- @RequestMapping(value = "/admin/home.htm", method = RequestMethod.GET)
+ @RequestMapping(value = ADMIN_HOME_URL, method = RequestMethod.GET)
public ModelAndView render() {
ModelAndView view = new ModelAndView("adminHome");
+ Record latestRecord = recordDAO.getLatestRecord();
+ view.addObject("latestRecord", latestRecord);
view.addObject("recordCount", recordDAO.countRecords(null));
return view;
}
View
13 src/main/java/au/com/gaiaresources/bdrs/controller/admin/AdminUserSearchController.java
@@ -27,11 +27,17 @@
@SuppressWarnings("unused")
private Logger log = Logger.getLogger(getClass());
- public static final String USER_NAME = "name";
+ // need to change this from just 'name' as maven filtering was giving us conflicts
+ public static final String OUTPUT_ARG_NAME = "userName";
public static final String EMAIL = "emailAddress";
public static final String FULL_NAME = "FULL_NAME";
//public static final String SORT = "SORT";
public static final String MAX_PER_PAGE = "MAX_PER_PAGE";
+
+
+
+ // this can't change unless the model changes
+ public static final String INPUT_ARG_NAME = "name";
public static final Integer EXPECTED_NUM_SORT_PARAM = 2;
@@ -76,7 +82,8 @@ public ModelAndView searchUsers(HttpServletRequest request,
return mav;
}
- String username = request.getParameter(USER_NAME);
+ // must be "name" as this is the getter/setter for the login in the model.
+ String username = request.getParameter(INPUT_ARG_NAME);
String email = request.getParameter(EMAIL);
String fullname = request.getParameter(FULL_NAME);
@@ -96,7 +103,7 @@ public ModelAndView searchUsers(HttpServletRequest request,
mav.addObject(PAGED_USER_RESULT, queryResult);
// pass back the search parameters...
- mav.addObject(USER_NAME, username);
+ mav.addObject(OUTPUT_ARG_NAME, username);
mav.addObject(EMAIL, email);
mav.addObject(FULL_NAME, fullname);
View
8 src/main/java/au/com/gaiaresources/bdrs/controller/admin/setup/SetupController.java
@@ -183,10 +183,10 @@ public String render() {
userSet.add(getRequestContext().getUser());
Survey s = new Survey();
- s.setDate(new Date(System.currentTimeMillis()));
- s.setDescription("Test Survey Description");
- s.setName("Test Roundtrip Survey");
- s.setLocations(locationSet);
+ s.setStartDate(new Date(System.currentTimeMillis()));
+ s.setDescription("Test Survey Description");
+ s.setName("Test Roundtrip Survey");
+ s.setLocations(locationSet);
s.setUsers(userSet);
s.setSpecies(new HashSet<IndicatorSpecies>(taxaDAO.getIndicatorSpecies()));
s.setGroups(classSet);
View
213 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/CensusMethodController.java
@@ -0,0 +1,213 @@
+package au.com.gaiaresources.bdrs.controller.attribute;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import net.sf.json.JSONArray;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.view.RedirectView;
+
+import au.com.gaiaresources.bdrs.controller.AbstractController;
+import au.com.gaiaresources.bdrs.controller.webservice.JqGridDataBuilder;
+import au.com.gaiaresources.bdrs.controller.webservice.JqGridDataHelper;
+import au.com.gaiaresources.bdrs.controller.webservice.JqGridDataRow;
+import au.com.gaiaresources.bdrs.db.impl.PagedQueryResult;
+import au.com.gaiaresources.bdrs.db.impl.PaginationFilter;
+import au.com.gaiaresources.bdrs.model.method.CensusMethod;
+import au.com.gaiaresources.bdrs.model.method.CensusMethodDAO;
+import au.com.gaiaresources.bdrs.model.method.Taxonomic;
+import au.com.gaiaresources.bdrs.model.taxa.Attribute;
+import au.com.gaiaresources.bdrs.model.taxa.AttributeDAO;
+
+@Controller
+public class CensusMethodController extends AbstractController {
+
+ @Autowired
+ CensusMethodDAO cmDAO;
+ @Autowired
+ AttributeDAO attributeDAO;
+
+ private AttributeFormFieldFactory formFieldFactory = new AttributeFormFieldFactory();
+
+ @RequestMapping(value = "/bdrs/admin/censusMethod/listing.htm", method = RequestMethod.GET)
+ public ModelAndView listing(HttpServletRequest request, HttpServletResponse response) {
+
+ ModelAndView mv = new ModelAndView("censusMethodList");
+ //mv.addObject("censusMethodList", cmDAO.get
+ return mv;
+ }
+
+ @RequestMapping(value = "/bdrs/admin/censusMethod/edit.htm", method = RequestMethod.GET)
+ public ModelAndView openEdit(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value="censusMethodId", defaultValue="0", required=false) Integer pk) {
+ CensusMethod cm;
+ if(pk == 0) {
+ cm = new CensusMethod();
+ } else {
+ cm = cmDAO.get(pk);
+ }
+
+ List<AttributeFormField> attributeFormFieldList = new ArrayList<AttributeFormField>();
+ for(Attribute attr : cm.getAttributes()) {
+ AttributeFormField formField = formFieldFactory.createAttributeFormField(attributeDAO, attr);
+ attributeFormFieldList.add(formField);
+ }
+
+ Collections.sort(attributeFormFieldList);
+
+ ModelAndView mv = new ModelAndView("censusMethodEdit");
+ mv.addObject("censusMethod", cm);
+ mv.addObject("attributeFormFieldList", attributeFormFieldList);
+ return mv;
+ }
+
+ @SuppressWarnings("unchecked")
+ @RequestMapping(value = "/bdrs/admin/censusMethod/edit.htm", method = RequestMethod.POST)
+ public ModelAndView save(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value="censusMethodName", required=true) String name,
+ @RequestParam(value="taxonomic", required=false, defaultValue="NONTAXONOMIC") String taxonomic,
+ @RequestParam(value="type", required=true, defaultValue="") String type,
+ @RequestParam(value="description", required=true, defaultValue="") String description,
+ @RequestParam(value="censusMethodId", defaultValue="0", required=false) Integer pk,
+ @RequestParam(value="attribute", required=false) int[] attributePkArray,
+ @RequestParam(value="add_attribute", required=false) int[] attributeIndexArray,
+ @RequestParam(value="childCensusMethod", required=false) int[] childCensusMethodList) {
+
+ CensusMethod cm;
+ if(pk == 0) {
+ cm = new CensusMethod();
+ } else {
+ cm = cmDAO.get(pk);
+ }
+
+ cm.setName(name);
+ cm.setType(type);
+ cm.setDescription(description);
+ cm.setTaxonomic(Taxonomic.valueOf(taxonomic));
+
+ // -- Attributes --
+ List<Attribute> attributeList = new ArrayList<Attribute>();
+
+ // Attribute Updates
+ // All attributes have a hidden input called 'attribute'
+ Attribute attr;
+ if(attributePkArray != null) {
+ for(int attributePk : attributePkArray) {
+ String attrName = request.getParameter(String.format("name_"+attributePk));
+ if(attrName != null && !attrName.isEmpty()) {
+ attr = attributeDAO.get(attributePk);
+ AttributeFormField formField = formFieldFactory.createAttributeFormField(attributeDAO, attr, request.getParameterMap());
+ attr = (Attribute) formField.save();
+ attributeList.add(attr);
+ }
+ }
+ }
+
+ // Create new Attributes
+ if(attributeIndexArray != null) {
+ for(int index : attributeIndexArray) {
+ String attrName = request.getParameter(String.format("add_name_"+index));
+ if(attrName != null && !attrName.isEmpty()) {
+ AttributeFormField formField = formFieldFactory.createAttributeFormField(attributeDAO, index, request.getParameterMap());
+ attributeList.add((Attribute)formField.save());
+ }
+ }
+ }
+ cm.setAttributes(attributeList);
+
+ // no child protection!
+ List<CensusMethod> childList = new ArrayList<CensusMethod>();
+ if (childCensusMethodList != null) {
+ for (int cmId : childCensusMethodList) {
+ CensusMethod child = cmDAO.get(cmId);
+ childList.add(child);
+ }
+ }
+ cm.setCensusMethods(childList);
+
+ cmDAO.save(cm);
+
+ return new ModelAndView(new RedirectView("/bdrs/admin/censusMethod/listing.htm", true));
+ }
+
+ @RequestMapping(value="/bdrs/admin/censusMethod/search.htm", method = RequestMethod.GET)
+ public void searchService(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value="name", required=false) String name,
+ @RequestParam(value="taxonomic", required=false) Boolean taxonomic,
+ @RequestParam(value="surveyId", required=false) Integer surveyId) throws Exception {
+ JqGridDataHelper jqGridHelper = new JqGridDataHelper(request);
+ PaginationFilter filter = jqGridHelper.createFilter(request);
+
+ PagedQueryResult<CensusMethod> queryResult = cmDAO.search(filter, name, surveyId);
+
+ JqGridDataBuilder builder = new JqGridDataBuilder(jqGridHelper.getMaxPerPage(), queryResult.getCount(), jqGridHelper.getRequestedPage());
+
+ if (queryResult.getCount() > 0) {
+ for (CensusMethod cm : queryResult.getList()) {
+ JqGridDataRow row = new JqGridDataRow(cm.getId());
+ row
+ .addValue("name", cm.getName())
+ .addValue("taxonomic", cm.getTaxonomic().getName());
+ builder.addRow(row);
+ }
+ }
+ response.setContentType("application/json");
+ response.getWriter().write(builder.toJson());
+ }
+
+ @RequestMapping(value="/bdrs/user/censusMethod/getSurveyCensusMethods.htm", method = RequestMethod.GET)
+ public void getSurveyCensusMethods(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value="surveyId", required=true) Integer surveyId) throws Exception {
+ PagedQueryResult<CensusMethod> queryResult = cmDAO.search(null, null, surveyId);
+
+ List<CensusMethod> censusMethodList = queryResult.getList();
+ JSONArray array = new JSONArray();
+
+ // cover the default case...
+ CensusMethod defaultCensusMethod = new CensusMethod();
+ defaultCensusMethod.setId(0);
+ defaultCensusMethod.setName("Standard Taxonomic (Default)");
+ array.add(defaultCensusMethod.flatten());
+
+ if (censusMethodList != null) {
+ for(CensusMethod cm : censusMethodList) {
+ array.add(cm.flatten());
+ }
+ }
+
+ // support for JSONP
+ if (request.getParameter("callback") != null) {
+ response.setContentType("application/javascript");
+ response.getWriter().write(request.getParameter("callback") + "(");
+ } else {
+ response.setContentType("application/json");
+ }
+ response.getWriter().write(array.toString());
+ if (request.getParameter("callback") != null) {
+ response.getWriter().write(");");
+ }
+ }
+
+ // AL - I'm doing it this way to use the tile as a template since we have no javascript templating at the moment and
+ // it keeps it consistent with the rest of the form. Yes I know it's inefficient.
+ @RequestMapping(value="/bdrs/admin/censusMethod/ajaxAddSubCensusMethod.htm", method = RequestMethod.GET)
+ public ModelAndView addSubCensusMethod(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value="id", required=true) Integer id) {
+ CensusMethod cm = cmDAO.get(id);
+ ModelAndView mv = new ModelAndView("censusMethodEditRow");
+ mv.addObject("id", cm.getId());
+ mv.addObject("name", cm.getName());
+ mv.addObject("taxonomic", cm.getTaxonomic());
+ return mv;
+ }
+}
View
20 ...in/java/au/com/gaiaresources/bdrs/controller/attribute/SurveyAttributeBaseController.java
@@ -20,12 +20,15 @@
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
import au.com.gaiaresources.bdrs.controller.AbstractController;
import au.com.gaiaresources.bdrs.model.metadata.Metadata;
import au.com.gaiaresources.bdrs.model.metadata.MetadataDAO;
+import au.com.gaiaresources.bdrs.model.method.CensusMethod;
+import au.com.gaiaresources.bdrs.model.method.CensusMethodDAO;
import au.com.gaiaresources.bdrs.model.record.Record;
import au.com.gaiaresources.bdrs.model.survey.Survey;
import au.com.gaiaresources.bdrs.model.survey.SurveyDAO;
@@ -53,6 +56,9 @@
@Autowired
private AttributeDAO attributeDAO;
+ @Autowired
+ private CensusMethodDAO cmDAO;
+
private AttributeFormFieldFactory formFieldFactory = new AttributeFormFieldFactory();
@RolesAllowed( {Role.USER,Role.POWERUSER,Role.SUPERVISOR,Role.ADMIN} )
@@ -79,7 +85,8 @@ public ModelAndView editSurveyAttributes(HttpServletRequest request, HttpServlet
@RolesAllowed( {Role.USER,Role.POWERUSER,Role.SUPERVISOR,Role.ADMIN} )
@RequestMapping(value = "/bdrs/admin/survey/editAttributes.htm", method = RequestMethod.POST)
- public ModelAndView submitSurveyAttributes(HttpServletRequest request, HttpServletResponse response) {
+ public ModelAndView submitSurveyAttributes(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value="childCensusMethod", required=false) int[] childCensusMethodList) {
Survey survey = getSurvey(request.getParameter("surveyId"));
for (String propertyName : Record.RECORD_PROPERTY_NAMES) {
@@ -126,6 +133,17 @@ public ModelAndView submitSurveyAttributes(HttpServletRequest request, HttpServl
Metadata md = survey.setFormRendererType(SurveyFormRendererType.DEFAULT);
metadataDAO.save(md);
}
+
+ // no child protection!
+ List<CensusMethod> childList = new ArrayList<CensusMethod>();
+ if (childCensusMethodList != null) {
+ for (int cmId : childCensusMethodList) {
+ CensusMethod child = cmDAO.get(cmId);
+ childList.add(child);
+ }
+ }
+ survey.setCensusMethods(childList);
+
surveyDAO.save(survey);
getRequestContext().addMessage("bdrs.survey.attributes.success", new Object[]{survey.getName()});
View
19 src/main/java/au/com/gaiaresources/bdrs/controller/attribute/formfield/FormFieldFactory.java
@@ -1,10 +1,11 @@
package au.com.gaiaresources.bdrs.controller.attribute.formfield;
import au.com.gaiaresources.bdrs.controller.record.AttributeParser;
+import au.com.gaiaresources.bdrs.model.method.Taxonomic;
import au.com.gaiaresources.bdrs.model.record.Record;
import au.com.gaiaresources.bdrs.model.survey.Survey;
import au.com.gaiaresources.bdrs.model.taxa.Attribute;
-import au.com.gaiaresources.bdrs.model.taxa.AttributeValue;
+import au.com.gaiaresources.bdrs.model.taxa.TypedAttributeValue;
import au.com.gaiaresources.bdrs.model.taxa.IndicatorSpecies;
import au.com.gaiaresources.bdrs.model.taxa.IndicatorSpeciesAttribute;
@@ -25,7 +26,7 @@
* @return a <code>RecordFormField</code>
*/
public FormField createRecordFormField(Survey survey, Record record,
- Attribute attribute, AttributeValue recordAttribute, String prefix) {
+ Attribute attribute, TypedAttributeValue recordAttribute, String prefix) {
return new RecordAttributeFormField(survey, record, attribute,
recordAttribute, prefix);
}
@@ -40,7 +41,7 @@ public FormField createRecordFormField(Survey survey, Record record,
* @return a <code>RecordFormField</code>
*/
public FormField createRecordFormField(Survey survey,
- Record record, Attribute attribute, AttributeValue recordAttribute) {
+ Record record, Attribute attribute, TypedAttributeValue recordAttribute) {
return new RecordAttributeFormField(survey, record, attribute,
recordAttribute, AttributeParser.DEFAULT_PREFIX);
}
@@ -81,14 +82,15 @@ public FormField createRecordFormField(Survey survey, Record record,
* @param propertyName the name of the bean property represented by this field.
* @param species the indicator species to be represented by this field, or
* null otherwise.
+ * @param taxonomic determines if the species field is mandatory.
* @param prefix the prefix to be prepended to input names.
* @return a <code>RecordFormField</code>
*/
public FormField createRecordFormField(Survey survey,
Record record, String propertyName, IndicatorSpecies species,
- String prefix) {
+ Taxonomic taxonomic, String prefix) {
return new RecordPropertyFormField(survey, record, propertyName,
- species, prefix);
+ species, taxonomic, prefix);
}
/**
@@ -99,12 +101,13 @@ public FormField createRecordFormField(Survey survey,
* @param propertyName the name of the bean property represented by this field.
* @param species the indicator species to be represented by this field, or
* null otherwise.
+ * @param taxonomic determines if the species field is mandatory.
* @return a <code>RecordFormField</code>
*/
public FormField createRecordFormField(Survey survey,
- Record record, String propertyName, IndicatorSpecies species) {
+ Record record, String propertyName, IndicatorSpecies species, Taxonomic taxonomic) {
return new RecordPropertyFormField(survey, record, propertyName,
- species, AttributeParser.DEFAULT_PREFIX);
+ species, taxonomic, AttributeParser.DEFAULT_PREFIX);
}
/**
@@ -117,7 +120,7 @@ public FormField createRecordFormField(Survey survey,
*/
public FormField createRecordFormField(Survey survey, Record record,
String propertyName) {
- return new RecordPropertyFormField(survey, record, propertyName, null,
+ return new RecordPropertyFormField(survey, record, propertyName, null, null,
AttributeParser.DEFAULT_PREFIX);
}
View
22 ...va/au/com/gaiaresources/bdrs/controller/attribute/formfield/RecordAttributeFormField.java
@@ -3,21 +3,21 @@
import org.apache.log4j.Logger;
import au.com.gaiaresources.bdrs.model.record.Record;
-import au.com.gaiaresources.bdrs.model.record.RecordAttribute;
import au.com.gaiaresources.bdrs.model.survey.Survey;
import au.com.gaiaresources.bdrs.model.taxa.Attribute;
import au.com.gaiaresources.bdrs.model.taxa.AttributeValue;
+import au.com.gaiaresources.bdrs.model.taxa.TypedAttributeValue;
/**
* The <code>RecordAttributeFormField</code> is a representation of a
* configurable field on the record form that stores its value in a
- * {@link RecordAttribute}.
+ * {@link AttributeValue}.
*/
-public class RecordAttributeFormField extends AbstractRecordFormField implements AttributeValueFormField {
+public class RecordAttributeFormField extends AbstractRecordFormField implements TypedAttributeValueFormField {
private Logger log = Logger.getLogger(getClass());
- private AttributeValue recordAttribute;
+ private TypedAttributeValue recordAttribute;
private Attribute attribute;
/**
@@ -36,7 +36,7 @@
* the prefix to be prepended to input names.
*/
RecordAttributeFormField(Survey survey, Record record, Attribute attribute,
- AttributeValue recordAttribute, String prefix) {
+ TypedAttributeValue recordAttribute, String prefix) {
super(survey, record, prefix);
@@ -60,11 +60,11 @@ public boolean isAttributeFormField() {
return true;
}
- public AttributeValue getRecordAttribute() {
+ public TypedAttributeValue getRecordAttribute() {
return recordAttribute;
}
- public void setRecordAttribute(AttributeValue recordAttribute) {
+ public void setRecordAttribute(TypedAttributeValue recordAttribute) {
this.recordAttribute = recordAttribute;
}
@@ -77,15 +77,15 @@ public void setAttribute(Attribute attribute) {
}
@Override
- public AttributeValue getAttributeValue() {
+ public TypedAttributeValue getAttributeValue() {
return this.recordAttribute;
}
@Override
- public void setAttributeValue(AttributeValue attributeValue) {
- if(