Project

General

Profile

Download (2.79 KB) Statistics
| Branch: | Tag: | Revision:
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 io.swagger.annotations.Api;
12
import io.swagger.annotations.ApiOperation;
13

    
14
import java.io.IOException;
15
import java.util.ArrayList;
16
import java.util.List;
17
import java.util.UUID;
18

    
19
import javax.servlet.http.HttpServletRequest;
20
import javax.servlet.http.HttpServletResponse;
21

    
22
import org.apache.log4j.Logger;
23
import org.springframework.beans.factory.annotation.Autowired;
24
import org.springframework.stereotype.Controller;
25
import org.springframework.web.bind.annotation.PathVariable;
26
import org.springframework.web.bind.annotation.RequestMapping;
27
import org.springframework.web.bind.annotation.RequestMethod;
28
import org.springframework.web.servlet.ModelAndView;
29

    
30
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
31
import eu.etaxonomy.cdm.model.description.PolytomousKey;
32

    
33
/**
34
 * @author a.kohlbecker
35
 * @since 24.03.2011
36
 * @Deprecated ONLY FOR TESTING PURPOSES
37
 */
38
@Deprecated
39
@Controller
40
@Api(value="portal_polytomousKeyNode", description="Deprecated !")
41
@RequestMapping(value = {"/portal/polytomousKey/{uuid}"})
42
public class PolytomousKeyPortalController extends BaseController<PolytomousKey, IPolytomousKeyService> {
43
    public static final Logger logger = Logger.getLogger(PolytomousKeyPortalController.class);
44

    
45
    @Override
46
    @Autowired
47
    public void setService(IPolytomousKeyService service) {
48
        this.service = service;
49
    }
50

    
51
    /**
52
     * @param uuid
53
     * @param request
54
     * @param response
55
     * @return
56
     * @throws IOException
57
     * @Deprecated ONLY FOR TESTING PURPOSES
58
     */
59
    @Deprecated
60
    @ApiOperation(notes="ONLY FOR TESTING PURPOSES", value = "/portal/polytomousKey/{uuid}/loadWithNodes")
61
    @RequestMapping(value = {"loadWithNodes"}, method = RequestMethod.GET)
62
    public ModelAndView doLoadWithNodes(
63
            @PathVariable("uuid") UUID uuid,
64
            HttpServletRequest request,
65
            HttpServletResponse response) throws IOException {
66

    
67
        logger.info("doLoadWithNodes() - " + request.getRequestURI());
68

    
69
        ModelAndView mv = new ModelAndView();
70

    
71
        List<String> nodePaths = new ArrayList<String>();
72
        nodePaths.add("subkey");
73
        nodePaths.add("taxon.name.nomenclaturalReference");
74

    
75
        List<String> propertyPaths = new ArrayList<String>();
76
        propertyPaths.add("sources");
77
        propertyPaths.add("annotations");
78

    
79
        PolytomousKey key = service.loadWithNodes(uuid, propertyPaths, nodePaths);
80
        mv.addObject(key);
81
        return mv;
82

    
83
    }
84

    
85
}
86

    
(48-48/75)