Project

General

Profile

Revision 9fe639a8

ID9fe639a81327688268785a5704b91fd4b5918dc2
Parent 5521f23c
Child 5c9f4ef1

Added by Patrick Plitzner about 5 years ago

ref #6131 Redirect for old URLs

  • deleted test ui class

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/ui/CheckUI.java
1
package eu.etaxonomy.cdm.vaadin.ui;
2

  
3
import javax.servlet.annotation.WebServlet;
4

  
5
import com.vaadin.annotations.Theme;
6
import com.vaadin.annotations.VaadinServletConfiguration;
7
import com.vaadin.server.VaadinRequest;
8
import com.vaadin.server.VaadinServlet;
9
import com.vaadin.ui.Button;
10
import com.vaadin.ui.Button.ClickEvent;
11
import com.vaadin.ui.Label;
12
import com.vaadin.ui.UI;
13
import com.vaadin.ui.VerticalLayout;
14

  
15
@Theme("valo")
16
@SuppressWarnings("serial")
17
public class CheckUI extends UI
18
{
19

  
20
//    @WebServlet(value = "/*", asyncSupported = true, initParams = {
21
//			@WebInitParam(name="org.atmosphere.cpr.asyncSupport", value="org.atmosphere.container.Jetty9AsyncSupportWithWebSocket")
22
//	})
23

  
24
    /*
25
     * NOTE: productionMode=true seems not to have any effect here, maybe because we are using multiple Servlets?
26
     * The is therefore set globally in the web.xml
27
     */
28
    @WebServlet(value = {"/app/*"}, asyncSupported = true)
29
    @VaadinServletConfiguration(productionMode = true, ui = CheckUI.class, widgetset = "eu.etaxonomy.cdm.vaadin.AppWidgetSet")
30
    public static class Servlet extends VaadinServlet {
31
    }
32

  
33
    @Override
34
    protected void init(VaadinRequest request) {
35
        final VerticalLayout layout = new VerticalLayout();
36
        layout.setMargin(true);
37
        setContent(layout);
38

  
39
        Button button = new Button("Click Me");
40
        button.addClickListener(new Button.ClickListener() {
41
            @Override
42
            public void buttonClick(ClickEvent event) {
43
                layout.addComponent(new Label("Thank you for clicking"));
44
            }
45
        });
46
        layout.addComponent(button);
47
    }
48

  
49
}
src/main/java/eu/etaxonomy/cdm/vaadin/ui/ConceptRelationshipUIRedirect.java
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 ConceptRelationshipUIRedirect extends AbstractAuthenticatedUI {
33

  
34
    Navigator navigator;
35

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

  
38
    private final static Logger logger = Logger.getLogger(ConceptRelationshipUIRedirect.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/editcr/*"}, asyncSupported = true)
45
    @VaadinServletConfiguration(productionMode = true, ui = ConceptRelationshipUIRedirect.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
}
src/main/java/eu/etaxonomy/cdm/vaadin/ui/DbStatusUIRedirect.java
1
package eu.etaxonomy.cdm.vaadin.ui;
2

  
3
import javax.servlet.annotation.WebServlet;
4

  
5
import com.vaadin.annotations.Theme;
6
import com.vaadin.annotations.Title;
7
import com.vaadin.annotations.VaadinServletConfiguration;
8
import com.vaadin.navigator.Navigator;
9
import com.vaadin.server.VaadinRequest;
10
import com.vaadin.ui.UI;
11

  
12
import eu.etaxonomy.cdm.vaadin.servlet.CdmVaadinConversationalServlet;
13
import eu.etaxonomy.cdm.vaadin.view.dbstatus.RedirectAfterLoginView;
14

  
15
@Theme("macosx")
16
@Title("CDM Board")
17
@SuppressWarnings("serial")
18
public class DbStatusUIRedirect extends AbstractAuthenticatedUI{
19

  
20
	private static final String FIRST_VIEW = "firstView";
21

  
22
    /*
23
     * NOTE: productionMode=true seems not to have any effect here, maybe because we are using multiple Servlets?
24
     * The is therefore set globally in the web.xml
25
     */
26
	@WebServlet(value = {"/app/dbstatus/*"}, asyncSupported = true)
27
	@VaadinServletConfiguration(productionMode = true, ui = DbStatusUIRedirect.class, widgetset = "eu.etaxonomy.cdm.vaadin.AppWidgetSet")
28
	public static class Servlet extends CdmVaadinConversationalServlet {
29
	}
30

  
31

  
32
	@Override
33
	protected void doInit(VaadinRequest request) {
34
		Navigator navigator = UI.getCurrent().getNavigator();
35
		RedirectAfterLoginView view = new RedirectAfterLoginView();
36
		navigator.addView(getFirstViewName(), view);
37
	}
38

  
39
	@Override
40
	public String getFirstViewName() {
41
		return FIRST_VIEW;
42
	}
43

  
44
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)