a little bit documentation
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / ClassificationPortalController.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.remote.controller;
11
12 import java.util.Arrays;
13 import java.util.List;
14
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;
21
22 import eu.etaxonomy.cdm.api.service.IClassificationService;
23 import eu.etaxonomy.cdm.model.name.Rank;
24 import eu.etaxonomy.cdm.model.taxon.Classification;
25 import eu.etaxonomy.cdm.remote.editor.RankPropertyEditor;
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 * @date 20.03.2009
38 *
39 * TODO this controller should be a portal controller!!
40 */
41 @Controller
42 @RequestMapping(value = {"/portal/classification/{uuid}"})
43 public class ClassificationPortalController extends BaseController<Classification,IClassificationService> {
44
45
46 private static final List<String> CLASSIFICATION_INIT_STRATEGY = Arrays.asList(new String[]{
47 "reference.authorTeam"
48 });
49
50 public static final Logger logger = Logger.getLogger(ClassificationPortalController.class);
51
52 @Autowired
53 public void setService(IClassificationService service) {
54 this.service = service;
55 }
56
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 /**
67 *
68 */
69 public ClassificationPortalController() {
70 super();
71 setInitializationStrategy(CLASSIFICATION_INIT_STRATEGY);
72 }
73
74
75 }