import org.springframework.stereotype.Controller;\r
import org.springframework.web.bind.WebDataBinder;\r
import org.springframework.web.bind.annotation.InitBinder;\r
+import org.springframework.web.bind.annotation.PathVariable;\r
import org.springframework.web.bind.annotation.RequestMapping;\r
import org.springframework.web.bind.annotation.RequestMethod;\r
\r
*/\r
\r
@Controller\r
-@RequestMapping(value = {"/name/*", "/name/{uuid}"})\r
+@RequestMapping(value = {"/name/{uuid}"})\r
public class NameController extends AnnotatableController<TaxonNameBase, INameService>\r
{\r
\r
\r
public NameController(){\r
super();\r
- setUuidParameterPattern("^/name/([^/?#&\\.]+).*");\r
- setInitializationStrategy(Arrays.asList(new String[]{"$"}));\r
+ setInitializationStrategy(Arrays.asList(new String[]{"$"})); //TODO still needed????\r
}\r
\r
/* (non-Javadoc)\r
this.service = service;\r
}\r
\r
- @InitBinder\r
- public void initBinder(WebDataBinder binder) {\r
- binder.registerCustomEditor(UUID.class, new UUIDPropertyEditor());\r
- }\r
\r
/**\r
* Get the list of {@link TypeDesignationBase}s of the \r
* @return a List of {@link TypeDesignationBase} entities which are initialized\r
* using the {@link #TYPEDESIGNATION_INIT_STRATEGY}\r
* @throws IOException\r
- */\r
- @RequestMapping(\r
- value = {"*/typeDesignations"},\r
- method = RequestMethod.GET)\r
- public List<TypeDesignationBase> doGetNameTypeDesignations(HttpServletRequest request, HttpServletResponse response)throws IOException {\r
+ *///TODO obsolete method?\r
+ @RequestMapping(value = { "typeDesignations" }, method = RequestMethod.GET)\r
+ public List<TypeDesignationBase> doGetNameTypeDesignations(\r
+ @PathVariable("uuid") UUID uuid, HttpServletRequest request,\r
+ HttpServletResponse response) throws IOException {\r
+ \r
logger.info("doGetTypeDesignations()" + request.getServletPath());\r
- TaxonNameBase tnb = getCdmBase(request, response, null, TaxonNameBase.class);\r
- Pager<TypeDesignationBase> p = service.getTypeDesignations(tnb, null, null, null, TYPEDESIGNATION_INIT_STRATEGY);\r
+ TaxonNameBase tnb = getCdmBaseInstance(uuid, response,\r
+ (List<String>) null);\r
+ Pager<TypeDesignationBase> p = service.getTypeDesignations(tnb, null,\r
+ null, null, TYPEDESIGNATION_INIT_STRATEGY);\r
return p.getRecords();\r
+ \r
}\r
\r
+ //TODO obsolete method?\r
@RequestMapping(\r
- value = {"*/nameCache"},\r
+ value = {"nameCache"},\r
method = RequestMethod.GET)\r
- public List<String> doGetNameCache(HttpServletRequest request, HttpServletResponse response)throws IOException {\r
- TaxonNameBase tnb = getCdmBase(request, response, NAME_CACHE_INIT_STRATEGY, TaxonNameBase.class);\r
+ public List<String> doGetNameCache(@PathVariable("uuid") UUID uuid, \r
+ HttpServletRequest request, HttpServletResponse response)throws IOException {\r
+ \r
+ logger.info("doGetNameCache()" + request.getServletPath());\r
+ TaxonNameBase tnb = getCdmBaseInstance(uuid, response, NAME_CACHE_INIT_STRATEGY);\r
NonViralName nvn = (NonViralName) tnb;\r
String nameCacheString = nvn.getNameCache();\r
List result = new ArrayList<String>();\r
result.add(nameCacheString);\r
return result;\r
+ \r
}\r
\r
}\r