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
.util
.Arrays
;
13 import java
.util
.List
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
17 import org
.springframework
.stereotype
.Controller
;
18 import org
.springframework
.web
.bind
.WebDataBinder
;
19 import org
.springframework
.web
.bind
.annotation
.InitBinder
;
20 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
22 import eu
.etaxonomy
.cdm
.api
.service
.IClassificationService
;
23 import eu
.etaxonomy
.cdm
.database
.UpdatableRoutingDataSource
;
24 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
25 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
26 import eu
.etaxonomy
.cdm
.remote
.editor
.RankPropertyEditor
;
29 * The ClassificationController class is a Spring MVC Controller.
31 * The syntax of the mapped service URIs contains the the {datasource-name} path element.
32 * The available {datasource-name}s are defined in a configuration file which
33 * is loaded by the {@link UpdatableRoutingDataSource}. If the
34 * UpdatableRoutingDataSource is not being used in the actual application
35 * context any arbitrary {datasource-name} may be used.
37 * @author a.kohlbecker
40 * TODO this controller should be a portal controller!!
43 @RequestMapping(value
= {"/portal/classification/{uuid}"})
44 public class ClassificationPortalController
extends BaseController
<Classification
,IClassificationService
> {
47 private static final List
<String
> CLASSIFICATION_INIT_STRATEGY
= Arrays
.asList(new String
[]{
48 "reference.authorship",
52 public static final Logger logger
= Logger
.getLogger(ClassificationPortalController
.class);
56 public void setService(IClassificationService service
) {
57 this.service
= service
;
64 public void initBinder(WebDataBinder binder
) {
65 super.initBinder(binder
);
66 binder
.registerCustomEditor(Rank
.class, new RankPropertyEditor());
72 public ClassificationPortalController() {
74 setInitializationStrategy(CLASSIFICATION_INIT_STRATEGY
);