1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.remote.controller;
|
11
|
|
12
|
import io.swagger.annotations.Api;
|
13
|
import io.swagger.annotations.ApiOperation;
|
14
|
|
15
|
import java.io.IOException;
|
16
|
import java.util.ArrayList;
|
17
|
import java.util.List;
|
18
|
import java.util.UUID;
|
19
|
|
20
|
import javax.servlet.http.HttpServletRequest;
|
21
|
import javax.servlet.http.HttpServletResponse;
|
22
|
|
23
|
import org.apache.log4j.Logger;
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
25
|
import org.springframework.stereotype.Controller;
|
26
|
import org.springframework.web.bind.annotation.PathVariable;
|
27
|
import org.springframework.web.bind.annotation.RequestMapping;
|
28
|
import org.springframework.web.bind.annotation.RequestMethod;
|
29
|
import org.springframework.web.servlet.ModelAndView;
|
30
|
|
31
|
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
|
32
|
import eu.etaxonomy.cdm.model.description.PolytomousKey;
|
33
|
|
34
|
/**
|
35
|
* @author a.kohlbecker
|
36
|
* @date 24.03.2011
|
37
|
* @Deprecated ONLY FOR TESTING PURPOSES
|
38
|
*/
|
39
|
@Deprecated
|
40
|
@Controller
|
41
|
@Api(value="portal_polytomousKeyNode", description="Deprecated !")
|
42
|
@RequestMapping(value = {"/portal/polytomousKey/{uuid}"})
|
43
|
public class PolytomousKeyPortalController extends BaseController<PolytomousKey, IPolytomousKeyService> {
|
44
|
public static final Logger logger = Logger.getLogger(PolytomousKeyPortalController.class);
|
45
|
|
46
|
@Override
|
47
|
@Autowired
|
48
|
public void setService(IPolytomousKeyService service) {
|
49
|
this.service = service;
|
50
|
}
|
51
|
|
52
|
/**
|
53
|
* @param uuid
|
54
|
* @param request
|
55
|
* @param response
|
56
|
* @return
|
57
|
* @throws IOException
|
58
|
* @Deprecated ONLY FOR TESTING PURPOSES
|
59
|
*/
|
60
|
@Deprecated
|
61
|
@ApiOperation(notes="ONLY FOR TESTING PURPOSES", value = "/portal/polytomousKey/{uuid}/loadWithNodes")
|
62
|
@RequestMapping(value = {"loadWithNodes"}, method = RequestMethod.GET)
|
63
|
public ModelAndView doLoadWithNodes(
|
64
|
@PathVariable("uuid") UUID uuid,
|
65
|
HttpServletRequest request,
|
66
|
HttpServletResponse response) throws IOException {
|
67
|
|
68
|
logger.info("doLoadWithNodes() - " + request.getRequestURI());
|
69
|
|
70
|
ModelAndView mv = new ModelAndView();
|
71
|
|
72
|
List<String> nodePaths = new ArrayList<String>();
|
73
|
nodePaths.add("subkey");
|
74
|
nodePaths.add("taxon.name.nomenclaturalReference");
|
75
|
|
76
|
List<String> propertyPaths = new ArrayList<String>();
|
77
|
propertyPaths.add("sources");
|
78
|
propertyPaths.add("annotations");
|
79
|
|
80
|
PolytomousKey key = service.loadWithNodes(uuid, propertyPaths, nodePaths);
|
81
|
mv.addObject(key);
|
82
|
return mv;
|
83
|
|
84
|
}
|
85
|
|
86
|
}
|
87
|
|