3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.remote
.controller
;
12 import java
.io
.IOException
;
13 import java
.util
.ArrayList
;
14 import java
.util
.List
;
15 import java
.util
.UUID
;
17 import javax
.servlet
.http
.HttpServletRequest
;
18 import javax
.servlet
.http
.HttpServletResponse
;
20 import org
.apache
.log4j
.Logger
;
21 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
22 import org
.springframework
.stereotype
.Controller
;
23 import org
.springframework
.web
.bind
.annotation
.PathVariable
;
24 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
25 import org
.springframework
.web
.servlet
.ModelAndView
;
27 import eu
.etaxonomy
.cdm
.api
.service
.IPolytomousKeyService
;
28 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
31 * @author a.kohlbecker
33 * @Deprecated ONLY FOR TESTING PURPOSES
37 @RequestMapping(value
= {"/portal/polytomousKey/{uuid}"})
38 public class PolytomousKeyPortalController
extends BaseController
<PolytomousKey
, IPolytomousKeyService
> {
39 public static final Logger logger
= Logger
.getLogger(PolytomousKeyPortalController
.class);
42 public void setService(IPolytomousKeyService service
) {
43 this.service
= service
;
52 * @Deprecated ONLY FOR TESTING PURPOSES
55 @RequestMapping(value
= {"loadWithNodes"})
56 public ModelAndView
doLoadWithNodes(
57 @PathVariable("uuid") UUID uuid
,
58 HttpServletRequest request
,
59 HttpServletResponse response
) throws IOException
{
61 logger
.info("doLoadWithNodes() - " + request
.getServletPath());
63 ModelAndView mv
= new ModelAndView();
65 List
<String
> nodePaths
= new ArrayList
<String
>();
66 nodePaths
.add("subkey");
67 nodePaths
.add("taxon.name.nomenclaturalReference");
69 List
<String
> propertyPaths
= new ArrayList
<String
>();
70 propertyPaths
.add("sources");
71 propertyPaths
.add("annotations");
73 PolytomousKey key
= service
.loadWithNodes(uuid
, propertyPaths
, nodePaths
);