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
.Collection
;
16 import java
.util
.List
;
18 import java
.util
.UUID
;
20 import javax
.servlet
.http
.HttpServletRequest
;
21 import javax
.servlet
.http
.HttpServletResponse
;
23 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
24 import org
.springframework
.stereotype
.Controller
;
25 import org
.springframework
.util
.Assert
;
26 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
27 import org
.springframework
.web
.bind
.annotation
.RequestMethod
;
29 import eu
.etaxonomy
.cdm
.api
.service
.AnnotatableServiceBase
;
30 import eu
.etaxonomy
.cdm
.api
.service
.IDescriptionService
;
31 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
32 import eu
.etaxonomy
.cdm
.model
.description
.FeatureNode
;
33 import eu
.etaxonomy
.cdm
.model
.description
.FeatureTree
;
34 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
35 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.IAnnotatableDao
;
38 * @author a.kohlbecker
43 @RequestMapping(value
= {"/*/featuretree/", "/*/featuretree/*"})
44 public class FeatureTreeListController
extends BaseController
<DescriptionBase
, IDescriptionService
>
47 private static final List
<String
> FEATURETREE_INIT_STRATEGY
= Arrays
.asList(
50 "root.feature.representations",
51 "root.children.feature.representations",
54 public FeatureTreeListController(){
56 setUuidParameterPattern("^/(?:[^/]+)/featuretree/([^/?#&\\.]+).*");
60 * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
64 public void setService(IDescriptionService service
) {
65 this.service
= service
;
70 public DescriptionBase
doGet(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
74 // public List<FeatureTree> getFeatureTreesAll();
75 // public List<FeatureNode> getFeatureNodesAll();
77 @RequestMapping(method
= RequestMethod
.GET
)
78 public List
<FeatureTree
> doGetFeatureTrees(HttpServletRequest request
, HttpServletResponse response
) throws IOException
{
80 List
<FeatureTree
> obj
= service
.getFeatureTreesAll(FEATURETREE_INIT_STRATEGY
);