Project

General

Profile

Download (2.38 KB) Statistics
| Branch: | Tag: | Revision:
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.IFeatureTreeService;
27
import eu.etaxonomy.cdm.api.service.ITermService;
28
import eu.etaxonomy.cdm.model.description.DescriptionBase;
29
import eu.etaxonomy.cdm.model.description.Feature;
30

    
31
/**
32
 * TODO write controller documentation
33
 * 
34
 * @author a.kohlbecker
35
 * @date 24.03.2009
36
 */
37

    
38
@Controller
39
@RequestMapping(value = {"/feature/", "/feature/*"})
40
public class FeatureListController extends BaseController<DescriptionBase, IDescriptionService>
41
{
42
	@Autowired
43
	private ITermService termService;
44

    
45
	private static final List<String> FEATURE_INIT_STRATEGY = Arrays.asList(new String[]{"representations"});
46

    
47

    
48
	public FeatureListController(){
49
		super();
50
		setUuidParameterPattern("^/feature/([^/?#&\\.]+).*");
51
	}
52
	
53
	/* (non-Javadoc)
54
	 * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
55
	 */
56
	@Autowired
57
	@Override
58
	public void setService(IDescriptionService service) {
59
		this.service = service;
60
	}
61
	
62
	@RequestMapping()
63
	@Deprecated
64
	public DescriptionBase doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
65
		return null;
66
	}
67
	
68
	
69
	/**
70
	 * TODO write controller method documentation
71
	 * 
72
	 * @param request
73
	 * @param response
74
	 * @return
75
	 * @throws IOException
76
	 */
77
	@RequestMapping(method = RequestMethod.GET)
78
	public List<Feature> doGetFeatures(HttpServletRequest request, HttpServletResponse response) throws IOException {
79
		
80
		List<Feature> obj = (List)termService.list(Feature.class,null,null,null,FEATURE_INIT_STRATEGY);
81
		return obj;
82
	}
83

    
84
}
(15-15/36)