solving problems with homonyms renderization at the portal
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / DescriptionPortalController.java
index f1b7ce8ccd17641fdeda163cc128994093e0ab0f..09d60e78a4cdcb3f65ac0776f1132630ac34cf11 100644 (file)
@@ -58,7 +58,7 @@ import eu.etaxonomy.cdm.remote.editor.UuidList;
  */\r
 \r
 @Controller\r
  */\r
 \r
 @Controller\r
-@RequestMapping(value = {"/portal/description/{uuid}", "/portal/description/{uuid_list}", "/portal/descriptionelement/{descriptionelement_uuid}", "/portal/featuretree/{featuretree_uuid}"})\r
+@RequestMapping(value = {"/portal/description/{uuid}", "/portal/description/{uuid_list}", "/portal/descriptionElement/{descriptionelement_uuid}", "/portal/featureTree/{featuretree_uuid}"})\r
 public class DescriptionPortalController extends AnnotatableController<DescriptionBase, IDescriptionService>\r
 {\r
        @Autowired\r
 public class DescriptionPortalController extends AnnotatableController<DescriptionBase, IDescriptionService>\r
 {\r
        @Autowired\r
@@ -71,25 +71,14 @@ public class DescriptionPortalController extends AnnotatableController<Descripti
                                "root.children.feature.representations",\r
                        });\r
        private static final List<String> DESCRIPTIONS_DISTRIBUTION_INIT_STRATEGY = Arrays.asList(new String []{\r
                                "root.children.feature.representations",\r
                        });\r
        private static final List<String> DESCRIPTIONS_DISTRIBUTION_INIT_STRATEGY = Arrays.asList(new String []{\r
-                       // taxon descriptions\r
-                       //"$",\r
-                       //"elements.$",\r
-                       "elements.sources.citation",\r
                        "elements.sources.citation.$",\r
                        "elements.sources.citation.$",\r
-                       "elements.area",\r
                        "elements.area.$",\r
                        "elements.area.$",\r
-                       //"elements.area.level",\r
                        });\r
        protected static final List<String> TAXONDESCRIPTION_INIT_STRATEGY = Arrays.asList(new String []{\r
                        "$",\r
                        "elements.$",\r
                        });\r
        protected static final List<String> TAXONDESCRIPTION_INIT_STRATEGY = Arrays.asList(new String []{\r
                        "$",\r
                        "elements.$",\r
-                       "elements.sources.citation.",\r
-                       "elements.sources.citation.authorTeam.$",               \r
-//                     "elements.sources.citation.authorTeam.titleCache",\r
-//                     "elements.sources.citation.authorTeam.nomenclaturalTitleCache",\r
-                       "elements.sources.nameUsedInSource.titleCache",\r
+                       "elements.sources.citation.authorTeam.$",\r
                        "elements.sources.nameUsedInSource.originalNameString",\r
                        "elements.sources.nameUsedInSource.originalNameString",\r
-//                     "elements.area",\r
                        "elements.area.level",\r
                        "elements.modifyingText",\r
        });\r
                        "elements.area.level",\r
                        "elements.modifyingText",\r
        });\r
@@ -98,6 +87,7 @@ public class DescriptionPortalController extends AnnotatableController<Descripti
        public void initBinder(WebDataBinder binder) {\r
                binder.registerCustomEditor(UuidList.class, new UUIDListPropertyEditor());\r
                binder.registerCustomEditor(NamedAreaLevel.class, new NamedAreaLevelPropertyEditor());\r
        public void initBinder(WebDataBinder binder) {\r
                binder.registerCustomEditor(UuidList.class, new UUIDListPropertyEditor());\r
                binder.registerCustomEditor(NamedAreaLevel.class, new NamedAreaLevelPropertyEditor());\r
+               super.initBinder(binder);\r
        }\r
        \r
        /* (non-Javadoc)\r
        }\r
        \r
        /* (non-Javadoc)\r
@@ -118,7 +108,7 @@ public class DescriptionPortalController extends AnnotatableController<Descripti
         * @throws IOException\r
         */\r
        \r
         * @throws IOException\r
         */\r
        \r
-       @RequestMapping(value = {"/portal/featuretree/{featuretree_uuid}"}, method = RequestMethod.GET)\r
+       @RequestMapping(value = {"/portal/featureTree/{featuretree_uuid}"}, method = RequestMethod.GET)\r
        public FeatureTree doGetFeatureTree(\r
                        @PathVariable("featuretree_uuid") UUID featureUuid,\r
                        HttpServletRequest request, \r
        public FeatureTree doGetFeatureTree(\r
                        @PathVariable("featuretree_uuid") UUID featureUuid,\r
                        HttpServletRequest request, \r
@@ -131,7 +121,7 @@ public class DescriptionPortalController extends AnnotatableController<Descripti
                return featureTree;\r
        }\r
        \r
                return featureTree;\r
        }\r
        \r
-       @RequestMapping(value = "/portal/descriptionelement/{descriptionelement_uuid}/annotation", method = RequestMethod.GET)\r
+       @RequestMapping(value = "/portal/descriptionElement/{descriptionelement_uuid}/annotation", method = RequestMethod.GET)\r
        public Pager<Annotation> getAnnotations(\r
                        @PathVariable("descriptionelement_uuid") UUID uuid,\r
                        HttpServletRequest request,\r
        public Pager<Annotation> getAnnotations(\r
                        @PathVariable("descriptionelement_uuid") UUID uuid,\r
                        HttpServletRequest request,\r
@@ -142,23 +132,6 @@ public class DescriptionPortalController extends AnnotatableController<Descripti
                return annotations;\r
        }\r
        \r
                return annotations;\r
        }\r
        \r
-       @RequestMapping(value = "/portal/description/{uuid_list}/namedAreaTree", method = RequestMethod.GET)\r
-       public NamedAreaTree doGetOrderedDistributions(\r
-                       @PathVariable("uuid_list") UuidList descriptionUuidList,\r
-                       @RequestParam(value = "omitLevels", required = false) Set<NamedAreaLevel> levels,\r
-                       //@ModelAttribute("omitLevels") HashSet<NamedAreaLevel> levels,\r
-                       HttpServletRequest request, HttpServletResponse response) {\r
-               logger.info("getOrderedDistributions(" + ObjectUtils.toString(levels) + ") - " + request.getServletPath());\r
-               Set<TaxonDescription> taxonDescriptions = new HashSet<TaxonDescription>();\r
-               TaxonDescription description;\r
-               for (UUID descriptionUuid : descriptionUuidList) {\r
-                       description = (TaxonDescription) service.load(descriptionUuid);\r
-                       taxonDescriptions.add(description);\r
-               }\r
-               NamedAreaTree areaTree = service.getOrderedDistributions(taxonDescriptions, levels);\r
-               return areaTree;\r
-       }\r
-       \r
        @RequestMapping(value = "/portal/description/{uuid_list}/DistributionTree", method = RequestMethod.GET)\r
        public DistributionTree doGetOrderedDistributionsB(\r
                        @PathVariable("uuid_list") UuidList descriptionUuidList,\r
        @RequestMapping(value = "/portal/description/{uuid_list}/DistributionTree", method = RequestMethod.GET)\r
        public DistributionTree doGetOrderedDistributionsB(\r
                        @PathVariable("uuid_list") UuidList descriptionUuidList,\r
@@ -171,7 +144,7 @@ public class DescriptionPortalController extends AnnotatableController<Descripti
                        description = (TaxonDescription) service.load(descriptionUuid, TAXONDESCRIPTION_INIT_STRATEGY);\r
                        taxonDescriptions.add(description);\r
                }\r
                        description = (TaxonDescription) service.load(descriptionUuid, TAXONDESCRIPTION_INIT_STRATEGY);\r
                        taxonDescriptions.add(description);\r
                }\r
-               DistributionTree distTree = service.getOrderedDistributionsB(taxonDescriptions, levels, TAXONDESCRIPTION_INIT_STRATEGY);\r
+               DistributionTree distTree = service.getOrderedDistributions(taxonDescriptions, levels, TAXONDESCRIPTION_INIT_STRATEGY);\r
                return distTree;\r
        }\r
        \r
                return distTree;\r
        }\r
        \r