1
|
/**
|
2
|
* Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
|
3
|
* http://www.e-taxonomy.eu
|
4
|
*
|
5
|
* The contents of this file are subject to the Mozilla Public License Version
|
6
|
* 1.1 See LICENSE.TXT at the top of this package for the full license terms.
|
7
|
*/
|
8
|
|
9
|
package eu.etaxonomy.cdm.remote.controller;
|
10
|
|
11
|
import java.util.Arrays;
|
12
|
import java.util.List;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
16
|
import org.springframework.stereotype.Controller;
|
17
|
import org.springframework.web.bind.WebDataBinder;
|
18
|
import org.springframework.web.bind.annotation.InitBinder;
|
19
|
import org.springframework.web.bind.annotation.RequestMapping;
|
20
|
|
21
|
import eu.etaxonomy.cdm.api.service.IClassificationService;
|
22
|
import eu.etaxonomy.cdm.model.name.Rank;
|
23
|
import eu.etaxonomy.cdm.remote.editor.RankPropertyEditor;
|
24
|
import io.swagger.annotations.Api;
|
25
|
|
26
|
/**
|
27
|
* The ClassificationController class is a Spring MVC Controller.
|
28
|
* <p>
|
29
|
* The syntax of the mapped service URIs contains the the {datasource-name} path element.
|
30
|
* The available {datasource-name}s are defined in a configuration file which
|
31
|
* is loaded by the {@link UpdatableRoutingDataSource}. If the
|
32
|
* UpdatableRoutingDataSource is not being used in the actual application
|
33
|
* context any arbitrary {datasource-name} may be used.
|
34
|
* <p>
|
35
|
* @author a.kohlbecker
|
36
|
* @since 20.03.2009
|
37
|
*
|
38
|
* TODO this controller should be a portal controller!!
|
39
|
*/
|
40
|
@Controller
|
41
|
@Api("portal_classification")
|
42
|
@RequestMapping(value = {"/portal/classification/{uuid}"})
|
43
|
public class ClassificationPortalController extends ClassificationController {
|
44
|
|
45
|
|
46
|
private static final List<String> CLASSIFICATION_INIT_STRATEGY = Arrays.asList(new String[]{
|
47
|
"reference.authorship",
|
48
|
"childNodes"
|
49
|
});
|
50
|
|
51
|
public static final Logger logger = Logger.getLogger(ClassificationPortalController.class);
|
52
|
|
53
|
@Override
|
54
|
@Autowired
|
55
|
public void setService(IClassificationService service) {
|
56
|
this.service = service;
|
57
|
}
|
58
|
|
59
|
|
60
|
|
61
|
@InitBinder
|
62
|
@Override
|
63
|
public void initBinder(WebDataBinder binder) {
|
64
|
super.initBinder(binder);
|
65
|
binder.registerCustomEditor(Rank.class, new RankPropertyEditor());
|
66
|
}
|
67
|
|
68
|
/**
|
69
|
*
|
70
|
*/
|
71
|
public ClassificationPortalController() {
|
72
|
super();
|
73
|
setInitializationStrategy(CLASSIFICATION_INIT_STRATEGY);
|
74
|
}
|
75
|
|
76
|
|
77
|
|
78
|
|
79
|
}
|