HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-05-17 3c1480dfafaa14c4a1780ad2a70326e7a36a9b65
logout-Link
2 files added
2 files modified
84 ■■■■ changed files
hsarweb/WebContent/VAADIN/themes/hs/layout/header.html 8 ●●●●● patch | view | raw | blame | history
hsarweb/conf/WEB-INF/web.xml 18 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/logout/LogoutServlet.java 32 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/MainApplication.java 26 ●●●●● patch | view | raw | blame | history
hsarweb/WebContent/VAADIN/themes/hs/layout/header.html
New file
@@ -0,0 +1,8 @@
<div style="width:100%; background-image:url(../../hs/icons/bg.png);">
    <div  style="margin: 0px; vertical-align:top; float:left; ">
        <img src="../../hs/icons/logo.png" alt="Hostsharing Logo" / >
    </div>
    <div  style="margin: 0px; height:70px; vertical-align:top; text-align:right; ">
        <a href="/hsarweb/logout" style="margin-right:20px; text-decoration:none; font-family:Arial,Helvetica,sans-serif; color:white; " >logout</a>
    </div>
</div>
hsarweb/conf/WEB-INF/web.xml
@@ -7,7 +7,7 @@
    <context-param>
        <param-name>serverName</param-name>
        <param-value>http://agnes.ostwall195.de:8080</param-value>
        <param-value>https://@ADMIN_HOST@:@ADMIN_PORT@</param-value>
    </context-param>
    <context-param>
        <param-name>backendURL</param-name>
@@ -68,6 +68,15 @@
    </filter-mapping>
    <servlet>
        <servlet-name>Logout Servlet</servlet-name>
        <servlet-class>de.hsadmin.logout.LogoutServlet</servlet-class>
        <init-param>
            <param-name>redirect</param-name>
            <param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/logout</param-value>
        </init-param>
    </servlet>
    <servlet>
        <servlet-name>HSAdmin Web</servlet-name>
        <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
        <init-param>
@@ -76,10 +85,17 @@
            <param-value>de.hsadmin.web.MainApplication</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Logout Servlet</servlet-name>
        <url-pattern>/logout</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>HSAdmin Web</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
hsarweb/src/de/hsadmin/logout/LogoutServlet.java
New file
@@ -0,0 +1,32 @@
package de.hsadmin.logout;
import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class LogoutServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
    private String redirectURL;
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        HttpSession session = req.getSession();
        session.invalidate();
        resp.sendRedirect(redirectURL);
    }
    @Override
    public void init(ServletConfig config) throws ServletException {
        redirectURL = config.getInitParameter("redirect");
    }
}
hsarweb/src/de/hsadmin/web/MainApplication.java
@@ -18,16 +18,20 @@
import com.vaadin.terminal.Terminal;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.gwt.server.HttpServletRequestListener;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Link;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.Window.Notification;
import com.vaadin.ui.themes.BaseTheme;
import de.hsadmin.web.config.LocaleConfig;
import de.hsadmin.web.config.ModuleConfig;
@@ -43,6 +47,8 @@
    private Remote remote;
    private Map<String, Module> modules;
    private Locale requestLocale;
    private CustomLayout header;
    @Override
@@ -68,14 +74,18 @@
        Window mainWindow = new Window(localeConfig.getText("applicationtitle"));
        VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setSizeFull();
        HorizontalLayout banner = new HorizontalLayout();
        Embedded image = new Embedded(null, new ThemeResource("../hs/icons/logo.png"));
        image.setMimeType("image/png");
        Embedded bgImage = new Embedded(null, new ThemeResource("../hs/icons/bg.png"));
        bgImage.setMimeType("image/png");
        banner.addComponent(image);
        banner.addComponent(bgImage);
        banner.setExpandRatio(bgImage, 1.0f);
//        HorizontalLayout banner = new HorizontalLayout();
//        Embedded image = new Embedded(null, new ThemeResource("../hs/icons/logo.png"));
//        image.setMimeType("image/png");
//        Embedded bgImage = new Embedded(null, new ThemeResource("../hs/icons/bg.png"));
//        bgImage.setMimeType("image/png");
//        Link logout = new Link("logout", new ExternalResource(localeConfig.getText("logout.link")));
//        banner.addComponent(image);
//        banner.addComponent(bgImage);
//        banner.addComponent(logout);
//        banner.setExpandRatio(bgImage, 1.0f);
//        verticalLayout.addComponent(banner);
        CustomLayout banner = new CustomLayout("../../hs/layout/header");
        verticalLayout.addComponent(banner);
        TabSheet tabs = new TabSheet();
        tabs.setSizeFull();