Project

General

Profile

Download (2.41 KB) Statistics
| Branch: | Tag: | Revision:
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.database.UpdatableRoutingDataSource;
23
import eu.etaxonomy.cdm.model.name.Rank;
24
import eu.etaxonomy.cdm.remote.editor.RankPropertyEditor;
25
import io.swagger.annotations.Api;
26

    
27
/**
28
 * The ClassificationController class is a Spring MVC Controller.
29
 * <p>
30
 * The syntax of the mapped service URIs contains the the {datasource-name} path element.
31
 * The available {datasource-name}s are defined in a configuration file which
32
 * is loaded by the {@link UpdatableRoutingDataSource}. If the
33
 * UpdatableRoutingDataSource is not being used in the actual application
34
 * context any arbitrary {datasource-name} may be used.
35
 * <p>
36
 * @author a.kohlbecker
37
 * @since 20.03.2009
38
 *
39
 * TODO this controller should be a portal controller!!
40
 */
41
@Controller
42
@Api("portal_classification")
43
@RequestMapping(value = {"/portal/classification/{uuid}"})
44
public class ClassificationPortalController extends ClassificationController {
45

    
46
    public static final Logger logger = Logger.getLogger(ClassificationPortalController.class);
47

    
48
    private static final List<String> CLASSIFICATION_INIT_STRATEGY = Arrays.asList(new String[]{
49
            "source.citation.authorship",
50
            "childNodes"
51
    });
52

    
53
    @Override
54
    @Autowired
55
    public void setService(IClassificationService service) {
56
        this.service = service;
57
    }
58

    
59
    @InitBinder
60
    @Override
61
    public void initBinder(WebDataBinder binder) {
62
        super.initBinder(binder);
63
        binder.registerCustomEditor(Rank.class, new RankPropertyEditor());
64
    }
65

    
66
    public ClassificationPortalController() {
67
        super();
68
        setInitializationStrategy(CLASSIFICATION_INIT_STRATEGY);
69
    }
70
}
(14-14/76)