ref #5285 replacing VaadinServlet by SpringVaadinServlet
[cdm-vaadin.git] / src / main / java / eu / etaxonomy / cdm / vaadin / ui / StatusEditorUI.java
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 * @author cmathew
13 * @date 11 Mar 2015
14 *
15 */
16
17
18 import java.util.logging.Logger;
19
20 import javax.servlet.annotation.WebServlet;
21
22 import com.vaadin.annotations.Theme;
23 import com.vaadin.annotations.Widgetset;
24 import com.vaadin.navigator.Navigator;
25 import com.vaadin.server.VaadinRequest;
26 import com.vaadin.spring.server.SpringVaadinServlet;
27 import com.vaadin.ui.UI;
28
29 import eu.etaxonomy.cdm.vaadin.component.StatusComposite;
30
31
32 @Theme("edit")
33 @Widgetset("eu.etaxonomy.cdm.vaadin.AppWidgetSet")
34 public class StatusEditorUI extends AbstractAuthenticatedUI {
35
36 Navigator navigator;
37
38 private static final String FIRST_VIEW = "editstatus";
39
40 private final static Logger logger =
41 Logger.getLogger(StatusEditorUI.class.getName());
42 /*
43 * NOTE: I it necessary to map the URLs starting with /VAADIN/* since none of the
44 * @WebServlets is mapped to the root path. It is sufficient to configure one of the
45 * servlets with this path see BookOfVaadin 5.9.5. Servlet Mapping with URL Patterns
46 */
47 @WebServlet(value = {"/app/editstatus/*", "/VAADIN/*"}, asyncSupported = true)
48 public static class Servlet extends SpringVaadinServlet {
49 }
50
51 @Override
52 protected void doInit(VaadinRequest request) {
53 // FIXME: remove this when testing is done
54 //setIgnoreAuthentication(true);
55
56 getPage().setTitle("Status Editor");
57 StatusComposite statusEditor = new StatusComposite();
58 UI.getCurrent().getNavigator().addView(FIRST_VIEW, statusEditor);
59
60 }
61
62 @Override
63 public String getFirstViewName() {
64 return FIRST_VIEW;
65 }
66
67 }