a little bit documentation
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / TaxonController.java
index 635f83ed5cbb3602214d727bc6b1eefaeb204ceb..2b7ffb3f336c46610d4fdefb3e04ffc2649d72c3 100644 (file)
@@ -57,9 +57,9 @@ public class TaxonController extends BaseController<TaxonBase, ITaxonService>
     private IOccurrenceService occurrenceService;\r
     @Autowired\r
     private INameService nameService;\r
-    @Autowired \r
-    private ITaxonService taxonService; \r
-    \r
+    @Autowired\r
+    private ITaxonService taxonService;\r
+\r
 \r
     protected static final List<String> TAXONNODE_INIT_STRATEGY = Arrays.asList(new String []{\r
             "taxonNodes"\r
@@ -123,14 +123,14 @@ public class TaxonController extends BaseController<TaxonBase, ITaxonService>
             return null;\r
         }\r
     }\r
-   \r
 \r
-    @RequestMapping(value = "specimensOrObersvations", method = RequestMethod.GET)\r
-    public ModelAndView doListSpecimensOrObersvations(\r
+\r
+    @RequestMapping(value = "specimensOrObservations", method = RequestMethod.GET)\r
+    public ModelAndView doListSpecimensOrObservations(\r
             @PathVariable("uuid") UUID uuid,\r
             HttpServletRequest request,\r
             HttpServletResponse response) throws IOException {\r
-        logger.info("doListSpecimensOrObersvations() - " + request.getServletPath());\r
+        logger.info("doListSpecimensOrObservations() - " + request.getServletPath());\r
 \r
         ModelAndView mv = new ModelAndView();\r
 \r
@@ -140,8 +140,7 @@ public class TaxonController extends BaseController<TaxonBase, ITaxonService>
         orderHints.add(new OrderHint("titleCache", SortOrder.DESCENDING));\r
 \r
         if(tb instanceof Taxon){\r
-            List<SpecimenOrObservationBase> specimensOrObersvations = occurrenceService.listByAnyAssociation(\r
-                    null, (Taxon)tb, null, 0, orderHints, null);\r
+            List<SpecimenOrObservationBase> specimensOrObersvations = occurrenceService.listByAssociatedTaxon(null, null, (Taxon)tb, null, null, null, orderHints, null);\r
             mv.addObject(specimensOrObersvations);\r
         } else {\r
             HttpStatusMessage.UUID_REFERENCES_WRONG_TYPE.send(response);\r
@@ -164,18 +163,21 @@ public class TaxonController extends BaseController<TaxonBase, ITaxonService>
         mv.addObject(nameService.getTaggedName(tb.getName().getUuid()));\r
         return mv;\r
     }\r
-    \r
+\r
+    /**\r
+     * FIXME change @RequestMapping to /taxon/findBestMatchingTaxon and also move into TaxonListController\r
+     */\r
     @RequestMapping(value = "/bestMatchingTaxon/{taxonName}", method = RequestMethod.GET)\r
     public TaxonBase doFindBestMatchingTaxon(\r
-               @PathVariable("taxonName") String taxonName,\r
-               HttpServletRequest request, \r
-               HttpServletResponse response)throws IOException {\r
-               \r
-       Taxon bestMatchingTaxon =  taxonService.findBestMatchingTaxon(taxonName);\r
-       \r
-       return bestMatchingTaxon;\r
-    \r
-       \r
+             @PathVariable("taxonName") String taxonName,\r
+            HttpServletRequest request,\r
+            HttpServletResponse response)throws IOException {\r
+\r
+        Taxon bestMatchingTaxon =  taxonService.findBestMatchingTaxon(taxonName);\r
+\r
+        return bestMatchingTaxon;\r
+\r
+\r
     }\r
 \r
 }
\ No newline at end of file