1
|
/**
|
2
|
* Copyright (C) 2015 EDIT
|
3
|
* 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 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.vaadin.ui;
|
10
|
|
11
|
|
12
|
import javax.servlet.annotation.WebServlet;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
|
16
|
import com.vaadin.annotations.Theme;
|
17
|
import com.vaadin.annotations.VaadinServletConfiguration;
|
18
|
import com.vaadin.navigator.Navigator;
|
19
|
import com.vaadin.server.VaadinRequest;
|
20
|
import com.vaadin.server.VaadinServlet;
|
21
|
import com.vaadin.ui.UI;
|
22
|
|
23
|
import eu.etaxonomy.cdm.vaadin.view.ConceptRelationshipView;
|
24
|
|
25
|
/**
|
26
|
* @author cmathew
|
27
|
* @date 9 Apr 2015
|
28
|
*
|
29
|
*/
|
30
|
@Theme("edit")
|
31
|
public class ConceptRelationshipUIRedirect extends AbstractAuthenticatedUI {
|
32
|
|
33
|
Navigator navigator;
|
34
|
|
35
|
private static final String FIRST_VIEW = "editcr";
|
36
|
|
37
|
private final static Logger logger = Logger.getLogger(ConceptRelationshipUIRedirect.class);
|
38
|
|
39
|
/*
|
40
|
* NOTE: productionMode=true seems not to have any effect here, maybe because we are using multiple Servlets?
|
41
|
* The is therefore set globally in the web.xml
|
42
|
*/
|
43
|
@WebServlet(value = {"/app/editcr/*"}, asyncSupported = true)
|
44
|
@VaadinServletConfiguration(productionMode = true, ui = ConceptRelationshipUIRedirect.class, widgetset = "eu.etaxonomy.cdm.vaadin.AppWidgetSet")
|
45
|
public static class Servlet extends VaadinServlet {
|
46
|
}
|
47
|
|
48
|
@Override
|
49
|
protected void doInit(VaadinRequest request) {
|
50
|
// FIXME: remove this when testing is done
|
51
|
//setIgnoreAuthentication(true);
|
52
|
|
53
|
getPage().setTitle("Concept Relationship Editor");
|
54
|
logger.warn("original classification : " + request.getParameter("oc"));
|
55
|
logger.warn("copy classification : " + request.getParameter("cc"));
|
56
|
String oc = request.getParameter("oc");
|
57
|
String cc = request.getParameter("cc");
|
58
|
|
59
|
ConceptRelationshipView crEditor = new ConceptRelationshipView(oc,cc);
|
60
|
UI.getCurrent().getNavigator().addView(FIRST_VIEW, crEditor);
|
61
|
|
62
|
}
|
63
|
|
64
|
@Override
|
65
|
public String getFirstViewName() {
|
66
|
return FIRST_VIEW;
|
67
|
}
|
68
|
|
69
|
}
|