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