removing init strategies which are replaces by MediaAutoInitializer
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / NamePortalController.java
index 632c493977e86b4351996fd5de63ea150076780d..8fb4af30bbb0bfe2d8c0c27fdb7d204cdf8c8261 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -44,12 +44,12 @@ import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
  * Methods mapped at type level, inherited from super classes ({@link BaseController}):\r
  * <blockquote>\r
  * URI: <b>&#x002F;{datasource-name}&#x002F;portal&#x002F;name&#x002F;{name-uuid}</b>\r
- * \r
+ *\r
  * Get the {@link TaxonNameBase} instance identified by the <code>{name-uuid}</code>.\r
  * The returned TaxonNameBase is initialized by\r
  * the following strategy: -- NONE --\r
  * </blockquote>\r
- * \r
+ *\r
  * @author a.kohlbecker\r
  * @date 24.03.2009\r
  */\r
@@ -58,96 +58,92 @@ import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
 @RequestMapping(value = {"/portal/name/{uuid}"})\r
 public class NamePortalController extends BaseController<TaxonNameBase, INameService>\r
 {\r
-       \r
-       private static final List<String> TYPEDESIGNATION_INIT_STRATEGY = Arrays.asList(new String []{                  \r
-                       "typeName.$",\r
-                       "typeName.titleCache",\r
-                       "typeSpecimen.titleCache",\r
-                       "typeStatus.representations",\r
-                       "typeStatus.representations",\r
-                       "typifiedNames.titleCache",\r
-                       "citation",\r
-                       "citation.authorTeam.$",\r
-                       "typeSpecimen.media.representations.parts"\r
-       });\r
-\r
-       \r
-       private static final List<String> NAMEDESCRIPTION_INIT_STRATEGY = Arrays.asList(new String []{\r
-                       "uuid",\r
-                       "feature",\r
-                       "elements.$",\r
-                       "elements.multilanguageText",\r
-                       "elements.media.representations.parts",\r
-                       "elements.media.title",\r
-       });\r
-       \r
-       \r
-       public NamePortalController(){\r
-               super();\r
-               setInitializationStrategy(Arrays.asList(new String[]{"$"})); //TODO required???\r
-       }\r
-       \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)\r
-        */\r
-       @Autowired\r
-       @Override\r
-       public void setService(INameService service) {\r
-               this.service = service;\r
-       }\r
-       \r
-       @Autowired\r
-       private IDescriptionService descriptionService;\r
-\r
-       /**\r
-     * Get the list of {@link TypeDesignationBase}s of the \r
-        * {@link TaxonNameBase} instance identified by the <code>{name-uuid}</code>.\r
-        * <p>\r
-        * URI: <b>&#x002F;{datasource-name}&#x002F;portal&#x002F;name&#x002F;{name-uuid}&#x002F;typeDesignations</b>\r
-        * \r
-        * @param request\r
-        * @param response\r
-        * @return a List of {@link TypeDesignationBase} entities which are initialized\r
-        *         using the following initialization strategy:\r
-        *         {@link #TYPEDESIGNATION_INIT_STRATEGY}\r
-        * @throws IOException\r
-        */\r
-       @SuppressWarnings("unchecked")\r
-       @RequestMapping(\r
-                       value = {"typeDesignations"},\r
-                       method = RequestMethod.GET)\r
-       public ModelAndView doGetTypeDesignations(@PathVariable("uuid") UUID uuid,\r
-                       HttpServletRequest request, HttpServletResponse response)throws IOException {\r
-               ModelAndView mv = new ModelAndView();\r
-               TaxonNameBase tnb = getCdmBaseInstance(uuid, response, (List<String>)null);\r
-               Pager<TypeDesignationBase> p = service.getTypeDesignations(tnb,  null, null, null, TYPEDESIGNATION_INIT_STRATEGY);\r
-               mv.addObject(p.getRecords());\r
-               return mv;\r
-       }\r
-       \r
-       /**\r
-     * Get the list of {@link TaxonNameDescription}s of the Name associated with the \r
-        * {@link TaxonNameBase} instance identified by the <code>{name-uuid}</code>.\r
-        * <p>\r
-        * URI: <b>&#x002F;{datasource-name}&#x002F;portal&#x002F;name&#x002F;{name-uuid}&#x002F;descriptions</b>\r
-        * \r
-        * @param request\r
-        * @param response\r
-        * @return a List of {@link TaxonNameDescription} entities which are initialized\r
-        *         using the following initialization strategy:\r
-        *         {@link #NAMEDESCRIPTION_INIT_STRATEGY}\r
-        * @throws IOException\r
-        */\r
-       @RequestMapping(\r
-                       value = {"taxonNameDescriptions"},\r
-                       method = RequestMethod.GET)\r
-       public List<TaxonNameDescription> doGetNameDescriptions(@PathVariable("uuid") UUID uuid,\r
-                       HttpServletRequest request, HttpServletResponse response)throws IOException {\r
-               logger.info("doGetNameDescriptions()" + request.getServletPath());\r
-               TaxonNameBase tnb = service.load(uuid, null);\r
-               Pager<TaxonNameDescription> p = descriptionService.getTaxonNameDescriptions(tnb, null, null, NAMEDESCRIPTION_INIT_STRATEGY);\r
-               return p.getRecords();\r
-       }\r
+\r
+    private static final List<String> TYPEDESIGNATION_INIT_STRATEGY = Arrays.asList(new String []{\r
+            "typeName.$",\r
+            "typeSpecimen",\r
+            "typeStatus.representations",\r
+            "typifiedNames",\r
+            "citation.authorTeam.$",\r
+            "typeSpecimen.media"\r
+    });\r
+\r
+\r
+    private static final List<String> NAMEDESCRIPTION_INIT_STRATEGY = Arrays.asList(new String []{\r
+            "uuid",\r
+            "feature",\r
+            "elements.$",\r
+            "elements.multilanguageText",\r
+            "elements.media",\r
+    });\r
+\r
+\r
+//     public NamePortalController(){\r
+//             super();\r
+//             setInitializationStrategy(Arrays.asList(new String[]{"$"})); //TODO required???\r
+//     }\r
+\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)\r
+     */\r
+    @Autowired\r
+    @Override\r
+    public void setService(INameService service) {\r
+        this.service = service;\r
+    }\r
+\r
+    @Autowired\r
+    private IDescriptionService descriptionService;\r
+\r
+    /**\r
+     * Get the list of {@link TypeDesignationBase}s of the\r
+     * {@link TaxonNameBase} instance identified by the <code>{name-uuid}</code>.\r
+     * <p>\r
+     * URI: <b>&#x002F;{datasource-name}&#x002F;portal&#x002F;name&#x002F;{name-uuid}&#x002F;typeDesignations</b>\r
+     *\r
+     * @param request\r
+     * @param response\r
+     * @return a List of {@link TypeDesignationBase} entities which are initialized\r
+     *         using the following initialization strategy:\r
+     *         {@link #TYPEDESIGNATION_INIT_STRATEGY}\r
+     * @throws IOException\r
+     */\r
+    @SuppressWarnings("unchecked")\r
+    @RequestMapping(\r
+            value = {"typeDesignations"},\r
+            method = RequestMethod.GET)\r
+    public ModelAndView doGetTypeDesignations(@PathVariable("uuid") UUID uuid,\r
+            HttpServletRequest request, HttpServletResponse response)throws IOException {\r
+        ModelAndView mv = new ModelAndView();\r
+        TaxonNameBase tnb = getCdmBaseInstance(uuid, response, (List<String>)null);\r
+        Pager<TypeDesignationBase> p = service.getTypeDesignations(tnb,  null, null, null, TYPEDESIGNATION_INIT_STRATEGY);\r
+        mv.addObject(p.getRecords());\r
+        return mv;\r
+    }\r
+\r
+    /**\r
+     * Get the list of {@link TaxonNameDescription}s of the Name associated with the\r
+     * {@link TaxonNameBase} instance identified by the <code>{name-uuid}</code>.\r
+     * <p>\r
+     * URI: <b>&#x002F;{datasource-name}&#x002F;portal&#x002F;name&#x002F;{name-uuid}&#x002F;descriptions</b>\r
+     *\r
+     * @param request\r
+     * @param response\r
+     * @return a List of {@link TaxonNameDescription} entities which are initialized\r
+     *         using the following initialization strategy:\r
+     *         {@link #NAMEDESCRIPTION_INIT_STRATEGY}\r
+     * @throws IOException\r
+     */\r
+    @RequestMapping(\r
+            value = {"taxonNameDescriptions"},\r
+            method = RequestMethod.GET)\r
+    public List<TaxonNameDescription> doGetNameDescriptions(@PathVariable("uuid") UUID uuid,\r
+            HttpServletRequest request, HttpServletResponse response)throws IOException {\r
+        logger.info("doGetNameDescriptions()" + request.getServletPath());\r
+        TaxonNameBase tnb = service.load(uuid, null);\r
+        Pager<TaxonNameDescription> p = descriptionService.getTaxonNameDescriptions(tnb, null, null, NAMEDESCRIPTION_INIT_STRATEGY);\r
+        return p.getRecords();\r
+    }\r
 \r
 \r
 }\r