/** * MailArchiver is an application that provides services for storing and managing e-mail messages through a Web Services SOAP interface. * Copyright (C) 2012 Marcio Andre Scholl Levien and Fernando Alberto Reuter Wendt and Jose Ronaldo Nogueira Fonseca Junior * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ /******************************************************************************\ * * This product was developed by * * SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), * * a government company established under Brazilian law (5.615/70), * at Department of Development of Porto Alegre. * \******************************************************************************/ package serpro.mailarchiver.view.admin; import com.eventrouter.annotation.Subscribe; import static com.eventrouter.MessagePublisher.*; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Window.Notification; import org.springframework.beans.factory.annotation.Autowired; import serpro.mailarchiver.service.web.ArchiveServices; import serpro.mailarchiver.service.web.ServiceFault; import serpro.mailarchiver.util.Logger; import serpro.mailarchiver.view.BaseController; class ToolbarController extends BaseController { private static final Logger log = Logger.getLocalLogger(); @Autowired private ArchiveServices archiveServices; ToolbarController(String displayId) { super(displayId); } @Override public ToolbarController init() { return this; } @Subscribe({"/mailarchiver/action/config_selected"}) public void config(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Config", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_config"); } @Subscribe({"/mailarchiver/action/explore_selected"}) public void explore(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Explore", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_explore"); } @Subscribe({"/mailarchiver/action/search_selected"}) public void search(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Search", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_search"); } @Subscribe({"/mailarchiver/action/help_selected"}) public void help(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Help", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_help"); } @Subscribe({"/mailarchiver/action/upload_selected"}) public void upload(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Upload", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_upload"); } @Subscribe({"/mailarchiver/action/importGears_selected"}) public void importGears(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Import Gears", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_importGears"); } @Subscribe({"/mailarchiver/action/terminal_selected"}) public void terminal(ClickEvent event) { publish("/mailarchiver/notification/humanized", "Terminal", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/action/show_terminal"); } @Subscribe({"/mailarchiver/action/logout_selected"}) public void logout(ClickEvent event) { try { archiveServices.logout(AdminConsoleApp.getInstance().getSession().getSessionId()); } catch (ServiceFault ex) { log.error(ex); } publish("/mailarchiver/notification/humanized", "Logout", Notification.POSITION_CENTERED_TOP); publish("/mailarchiver/logout"); } }