3 * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.remote
.controller
;
12 import java
.io
.IOException
;
13 import java
.util
.Arrays
;
14 import java
.util
.List
;
16 import javax
.servlet
.http
.HttpServletRequest
;
17 import javax
.servlet
.http
.HttpServletResponse
;
19 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
20 import org
.springframework
.stereotype
.Controller
;
21 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
22 import org
.springframework
.web
.bind
.annotation
.RequestMethod
;
24 import eu
.etaxonomy
.cdm
.api
.service
.IDescriptionService
;
25 import eu
.etaxonomy
.cdm
.api
.service
.IFeatureTreeService
;
26 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
27 import eu
.etaxonomy
.cdm
.model
.description
.FeatureTree
;
30 * TODO write controller documentation
32 * @author a.kohlbecker
36 @RequestMapping(value
= {"/description", "/featuretree"})
37 public class DescriptionListController
extends BaseListController
<DescriptionBase
, IDescriptionService
> {
40 private IFeatureTreeService featureTreeService
;
42 private static final List
<String
> FEATURETREE_INIT_STRATEGY
= Arrays
.asList(
45 "root.feature.representations",
46 "root.children.feature.representations"
50 * @see eu.etaxonomy.cdm.remote.controller.BaseListController#setService(eu.etaxonomy.cdm.api.service.IService)
54 public void setService(IDescriptionService service
) {
55 this.service
= service
;
58 @RequestMapping(method
= RequestMethod
.GET
, value
="/featuretree")
59 public List
<FeatureTree
> doGetFeatureTrees(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
61 List
<FeatureTree
> obj
= featureTreeService
.list(null,null,null,null,FEATURETREE_INIT_STRATEGY
);