Project

General

Profile

Download (2.11 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2015 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.cdm.vaadin.ui;
11

    
12

    
13
import javax.servlet.annotation.WebServlet;
14

    
15
import org.apache.log4j.Logger;
16

    
17
import com.vaadin.annotations.Theme;
18
import com.vaadin.annotations.VaadinServletConfiguration;
19
import com.vaadin.navigator.Navigator;
20
import com.vaadin.server.VaadinRequest;
21
import com.vaadin.server.VaadinServlet;
22
import com.vaadin.ui.UI;
23

    
24
import eu.etaxonomy.cdm.vaadin.view.ConceptRelationshipView;
25

    
26
/**
27
 * @author cmathew
28
 * @date 9 Apr 2015
29
 *
30
 */
31
@Theme("edit")
32
public class ConceptRelationshipUI extends AbstractAuthenticatedUI {
33

    
34
    Navigator navigator;
35

    
36
    private static final String FIRST_VIEW = "editcr";
37

    
38
    private final static Logger logger = Logger.getLogger(ConceptRelationshipUI.class);
39

    
40
    /*
41
     * NOTE: productionMode=true seems not to have any effect here, maybe because we are using multiple Servlets?
42
     * The is therefore set globally in the web.xml
43
     */
44
    @WebServlet(value = {"/app/concept/*"}, asyncSupported = true)
45
    @VaadinServletConfiguration(productionMode = true, ui = ConceptRelationshipUI.class, widgetset = "eu.etaxonomy.cdm.vaadin.AppWidgetSet")
46
    public static class Servlet extends VaadinServlet {
47
    }
48

    
49
    @Override
50
    protected void doInit(VaadinRequest request) {
51
        // FIXME: remove this when testing is done
52
        //setIgnoreAuthentication(true);
53

    
54
        getPage().setTitle("Concept Relationship Editor");
55
        logger.warn("original classification : " + request.getParameter("oc"));
56
        logger.warn("copy classification : " + request.getParameter("cc"));
57
        String oc = request.getParameter("oc");
58
        String cc = request.getParameter("cc");
59

    
60
        ConceptRelationshipView crEditor = new ConceptRelationshipView(oc,cc);
61
        UI.getCurrent().getNavigator().addView(FIRST_VIEW, crEditor);
62

    
63
    }
64

    
65
    @Override
66
    public String getFirstViewName() {
67
        return FIRST_VIEW;
68
    }
69

    
70
}
(4-4/6)