3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.remote
.controller
;
13 import java
.io
.IOException
;
14 import java
.util
.Arrays
;
15 import java
.util
.List
;
17 import javax
.servlet
.http
.HttpServletRequest
;
18 import javax
.servlet
.http
.HttpServletResponse
;
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
;
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
;
32 * TODO write controller documentation
34 * @author a.kohlbecker
39 @RequestMapping(value
= {"/feature/", "/feature/*"})
40 public class FeatureListController
extends BaseController
<DescriptionBase
, IDescriptionService
>
43 private ITermService termService
;
45 private static final List
<String
> FEATURE_INIT_STRATEGY
= Arrays
.asList(new String
[]{"representations"});
48 public FeatureListController(){
50 setUuidParameterPattern("^/feature/([^/?#&\\.]+).*");
54 * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
58 public void setService(IDescriptionService service
) {
59 this.service
= service
;
64 public DescriptionBase
doGet(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
70 * TODO write controller method documentation
77 @RequestMapping(method
= RequestMethod
.GET
)
78 public List
<Feature
> doGetFeatures(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
80 List
<Feature
> obj
= (List
)termService
.list(Feature
.class,null,null,null,FEATURE_INIT_STRATEGY
);