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
;
16 import java
.util
.UUID
;
18 import javax
.servlet
.http
.HttpServletResponse
;
20 import org
.apache
.log4j
.Logger
;
21 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
22 import org
.springframework
.stereotype
.Controller
;
23 import org
.springframework
.web
.bind
.WebDataBinder
;
24 import org
.springframework
.web
.bind
.annotation
.InitBinder
;
25 import org
.springframework
.web
.bind
.annotation
.PathVariable
;
26 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
27 import org
.springframework
.web
.bind
.annotation
.RequestMethod
;
29 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
30 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
31 import eu
.etaxonomy
.cdm
.remote
.editor
.UUIDPropertyEditor
;
35 * @created Apr 8, 2010
39 public class TaxonNodeListController
extends BaseListController
<TaxonNode
, ITaxonNodeService
> {
40 private static final Logger logger
= Logger
41 .getLogger(TaxonNodeListController
.class);
44 private static final List
<String
> NODE_INIT_STRATEGY
= Arrays
.asList(new String
[]{
50 private ITaxonNodeService service
;
53 * @see eu.etaxonomy.cdm.remote.controller.AbstractListController#setService(eu.etaxonomy.cdm.api.service.IService)
57 public void setService(ITaxonNodeService service
) {
58 this.service
= service
;
68 value
= {"/taxonNode/{taxonNodeUuid}/childNodes"},
69 method
= RequestMethod
.GET
)
70 public List
<TaxonNode
> getChildNodes(
71 @PathVariable("taxonNodeUuid") UUID taxonNodeUuid
,
72 HttpServletResponse response
73 ) throws IOException
{
75 TaxonNode taxonNode
= service
.getTaxonNodeByUuid(taxonNodeUuid
);
77 return service
.loadChildNodesOfTaxonNode(taxonNode
, NODE_INIT_STRATEGY
);