making the FeatureListController more generic
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / DescriptionListController.java
index 1cbe0473daa5020d1228b911b3874d923cf36d32..7eeeed2b66daa3d0299b8e235ff961ff64836b27 100644 (file)
@@ -22,22 +22,28 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;\r
 \r
 import eu.etaxonomy.cdm.api.service.IDescriptionService;\r
+import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
 import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
 import eu.etaxonomy.cdm.model.description.FeatureTree;\r
 \r
 /**\r
+ * TODO write controller documentation\r
+ * \r
  * @author a.kohlbecker\r
  * @date 24.03.2009\r
  */\r
 @Controller\r
-@RequestMapping(value = {"/*/description", "/*/featuretree"})\r
+@RequestMapping(value = {"/description"})\r
 public class DescriptionListController extends BaseListController<DescriptionBase, IDescriptionService> {\r
        \r
+       @Autowired\r
+       private IFeatureTreeService featureTreeService;\r
+       \r
        private static final List<String> FEATURETREE_INIT_STRATEGY = Arrays.asList(\r
                        new String[]{\r
                                "representations",\r
                                "root.feature.representations",\r
-                               "root.children.feature.representations",\r
+                               "root.children.feature.representations"\r
                        });\r
 \r
        /* (non-Javadoc)\r
@@ -49,10 +55,10 @@ public class DescriptionListController extends BaseListController<DescriptionBas
                this.service = service;\r
        }\r
        \r
-       @RequestMapping(method = RequestMethod.GET, value="/*/featuretree")\r
+       @RequestMapping(method = RequestMethod.GET, value="/featureTree")\r
        public List<FeatureTree> doGetFeatureTrees(HttpServletRequest request, HttpServletResponse response) throws IOException {\r
                \r
-               List<FeatureTree> obj = service.getFeatureTreesAll(FEATURETREE_INIT_STRATEGY);\r
+               List<FeatureTree> obj = featureTreeService.list(null,null,null,null,FEATURETREE_INIT_STRATEGY);\r
                return obj;\r
        }\r
 }
\ No newline at end of file