2 * Copyright (C) 2007 EDIT
3 * 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 1.1
7 * 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
;
15 import java
.util
.UUID
;
17 import javax
.servlet
.http
.HttpServletRequest
;
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
.Component
;
24 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
25 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
26 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
29 * This class once was a controller but is no longer needed as such.
30 * The cdmlib-print project however still relies on this class being present to
31 * access its methods directly, but is not using it as controller, though
37 * @deprecated only used by cdmlib-print in an unorthodox way to get cdm entities as xml
41 public class TaxonNodePrintAppController
extends AbstractController
<TaxonNode
, ITaxonNodeService
> {
42 @SuppressWarnings("unused")
43 private static final Logger logger
= Logger
.getLogger(TaxonNodePrintAppController
.class);
46 private static final List
<String
> NODE_INIT_STRATEGY
= Arrays
.asList(new String
[]{
52 private ITaxonNodeService service
;
56 public void setService(ITaxonNodeService service
) {
57 this.service
= service
;
66 * @deprecated use the TaxonNodeController.doPageChildNodes() instead,
67 * has no request mapping to avoid conflicts with that method
70 public List
<TaxonNode
> getChildNodes(
71 UUID taxonNodeUuid
, boolean includeUnpublished
,
72 HttpServletResponse response
73 ) throws IOException
{
75 TaxonNode taxonNode
= service
.find(taxonNodeUuid
);
77 return service
.loadChildNodesOfTaxonNode(taxonNode
, NODE_INIT_STRATEGY
, false, includeUnpublished
, null);
80 public TaxonNode
doGet(UUID taxonNodeUuid
, HttpServletRequest request
, HttpServletResponse response
81 ) throws IOException
{
82 return service
.load(taxonNodeUuid
, getInitializationStrategy());
85 public TaxonBase
doGetTaxon(UUID taxonNodeUuid
) throws IOException
{
86 TaxonNode taxonNode
= service
.load(taxonNodeUuid
, getInitializationStrategy());
87 return taxonNode
.getTaxon();