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
.model
.description
.DescriptionBase
;
27 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
30 * TODO write controller documentation
32 * @author a.kohlbecker
37 @RequestMapping(value
= {"/*/feature/", "/*/feature/*"})
38 public class FeatureListController
extends BaseController
<DescriptionBase
, IDescriptionService
>
41 private static final List
<String
> FEATURE_INIT_STRATEGY
= Arrays
.asList(new String
[]{"representations"});
44 public FeatureListController(){
46 setUuidParameterPattern("^/(?:[^/]+)/feature/([^/?#&\\.]+).*");
50 * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
54 public void setService(IDescriptionService service
) {
55 this.service
= service
;
60 public DescriptionBase
doGet(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
66 * TODO write controller method documentation
73 @RequestMapping(method
= RequestMethod
.GET
)
74 public List
<Feature
> doGetFeatures(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
76 List
<Feature
> obj
= service
.getFeaturesAll(FEATURE_INIT_STRATEGY
);