// $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
* Methods mapped at type level, inherited from super classes ({@link BaseController}):\r
* <blockquote>\r
* URI: <b>/{datasource-name}/portal/name/{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
@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
- "typeSpecimen",\r
- "typeStatus.representations",\r
- "typifiedNames",\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>/{datasource-name}/portal/name/{name-uuid}/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>/{datasource-name}/portal/name/{name-uuid}/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>/{datasource-name}/portal/name/{name-uuid}/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>/{datasource-name}/portal/name/{name-uuid}/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