1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 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
|
|
11
|
package eu.etaxonomy.cdm.remote.controller;
|
12
|
|
13
|
import java.io.IOException;
|
14
|
import java.util.Arrays;
|
15
|
import java.util.List;
|
16
|
|
17
|
import javax.servlet.http.HttpServletRequest;
|
18
|
import javax.servlet.http.HttpServletResponse;
|
19
|
|
20
|
import org.springframework.beans.factory.annotation.Autowired;
|
21
|
import org.springframework.stereotype.Controller;
|
22
|
import org.springframework.web.bind.annotation.RequestMapping;
|
23
|
import org.springframework.web.bind.annotation.RequestMethod;
|
24
|
|
25
|
import eu.etaxonomy.cdm.api.service.IDescriptionService;
|
26
|
import eu.etaxonomy.cdm.api.service.ITermService;
|
27
|
import eu.etaxonomy.cdm.model.description.DescriptionBase;
|
28
|
import eu.etaxonomy.cdm.model.description.Feature;
|
29
|
|
30
|
/**
|
31
|
* TODO write controller documentation
|
32
|
*
|
33
|
* @author a.kohlbecker
|
34
|
* @date 24.03.2009
|
35
|
*/
|
36
|
|
37
|
@Controller
|
38
|
@RequestMapping(value = {"/feature", "/feature/{uuid}"}) //FIXME refactor type mappings
|
39
|
public class FeatureListController extends BaseController<DescriptionBase, IDescriptionService>
|
40
|
{
|
41
|
@Autowired
|
42
|
private ITermService termService;
|
43
|
|
44
|
private static final List<String> FEATURE_INIT_STRATEGY = Arrays.asList(new String[]{"representations"});
|
45
|
|
46
|
/* (non-Javadoc)
|
47
|
* @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
|
48
|
*/
|
49
|
@Autowired
|
50
|
@Override
|
51
|
public void setService(IDescriptionService service) {
|
52
|
this.service = service;
|
53
|
}
|
54
|
|
55
|
@RequestMapping()
|
56
|
@Deprecated
|
57
|
public DescriptionBase doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
58
|
return null;
|
59
|
}
|
60
|
|
61
|
|
62
|
/**
|
63
|
* TODO write controller method documentation
|
64
|
*
|
65
|
* @param request
|
66
|
* @param response
|
67
|
* @return
|
68
|
* @throws IOException
|
69
|
*/
|
70
|
@RequestMapping(method = RequestMethod.GET)
|
71
|
public List<Feature> doGetFeatures(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
72
|
|
73
|
List<Feature> obj = (List)termService.list(Feature.class,null,null,null,FEATURE_INIT_STRATEGY);
|
74
|
return obj;
|
75
|
}
|
76
|
|
77
|
}
|