/** * Logout user after confirmation prompt. */ public void logout() { // Ensure that shell is last context subscriber (should be a better way // to do this). if (logoutConfirm) { setLogoutConfirm(false); setLogoutConfirm(true); } SecurityUtil.getSecurityService().logout(false, null, null); }
@Override protected void onAttach(Page page) { try { CommandUtil.associateCommand("help", this); getPage().addChild(messageWindow = new MessageWindow()); addChild(registeredStyles); desktop = new ElementDesktop(this); setLogoutConfirm(logoutConfirm); String confirmClose = getAppProperty("confirmClose", "CAREWEB.CONFIRM.CLOSE"); if (StringUtils.isEmpty(confirmClose) || BooleanUtils.toBoolean(confirmClose)) { ClientUtil.canClose(false); } String layout = defaultLayoutName != null ? defaultLayoutName : getAppProperty("layout", "CAREWEB.LAYOUT.DEFAULT"); if (!StringUtils.isEmpty(layout)) { loadLayout(layout); } } catch (Exception e) { log.error("Error initializing the shell.", e); throw MiscUtil.toUnchecked(e); } }