View Javadoc

1   /*
2    * Copyright 2010 James Pether Sörling
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   *	$Id: LogoutPage.java 5436 2011-04-26 18:25:22Z pether $
17   *  $HeadURL: https://cia.svn.sourceforge.net/svnroot/cia/trunk/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/page/user/LogoutPage.java $
18  */
19  package com.hack23.cia.web.impl.ui.page.user;
20  
21  import org.vaadin.navigator7.NavigableApplication;
22  import org.vaadin.navigator7.Page;
23  
24  import com.hack23.cia.web.impl.ui.page.common.MenuState;
25  import com.vaadin.terminal.ExternalResource;
26  import com.vaadin.ui.Link;
27  import com.vaadin.ui.VerticalLayout;
28  
29  /**
30   * The Class LogoutPage.
31   */
32  @Page(uriName = "logout",crawlable=true)
33  @SuppressWarnings("serial")
34  public final class LogoutPage extends AbstractUserPage {
35  
36  	/** The content. */
37  	private final VerticalLayout content = new VerticalLayout();
38  
39  	/** The logout link. */
40  	private final Link logoutLink;
41  
42  	/**
43  	 * Instantiates a new logout page.
44  	 */
45  	public LogoutPage() {
46  		super();
47  		getApplicationManager().logout();
48  		//getUserState().getCurrentRequest().getSession().invalidate();
49  		logoutLink = new Link (translateFromEnglish("Logout"),
50  			      new ExternalResource("/j_spring_security_logout"));
51  		content.addComponent(logoutLink);
52  
53  		final MenuState menu = (MenuState) NavigableApplication.getCurrentNavigableAppLevelWindow();
54  		menu.setupMenu();
55  
56  		content.setSizeFull();
57  		content.setMargin(false);
58  		content.setSpacing(true);
59  		setCompositionRoot(content);
60  		setHeight(getScreenHeight());
61  
62  	}
63  
64  	/* (non-Javadoc)
65  	 * @see com.hack23.cia.web.impl.ui.page.common.AbstractPage#getPageTitle()
66  	 */
67  	@Override
68  	public String getPageTitle() {
69  		return "";
70  	}
71  
72  }