/** * Navigates this page to the given URI. The contents of this page in the * browser is replaced with whatever is returned for the given URI. * <p> * This method should not be used to start downloads, as the client side * will assume the browser will navigate away when opening the URI. Use one * of the {@code Page.open} methods or {@code FileDownloader} instead. * * @see #open(String, String) * @see FileDownloader * * @param uri * the URI to show */ public void setLocation(URI uri) { setLocation(uri.toString()); }
eventActionDestinationMap.put(actionKey, name); eventActionValueMap.put(actionKey, value); uI.getPage().setLocation(actionUrl.toString()); } else {
sharedParameterActionNameMap.put(actionKey, name); sharedParameterActionValueMap.put(actionKey, value); uI.getPage().setLocation(actionUrl.toString()); } else {
public void close() { isRunning = false; Collection<LegacyWindow> windows = getWindows(); for (LegacyWindow legacyWindow : windows) { String logoutUrl = getLogoutURL(); if (logoutUrl == null) { URL url = getURL(); if (url != null) { logoutUrl = url.toString(); } } if (logoutUrl != null) { legacyWindow.getPage().setLocation(logoutUrl); } legacyWindow.close(); } }
@Override public void sendRedirect(String url) { final String redirectUrl = calculateRedirectUrl(servletContext.getContextPath(), url); LOGGER.debug("Redirecting to [" + redirectUrl + "]"); UI.getCurrent().getPage().setLocation(redirectUrl); }
@Override public void sendRedirect(String url) { final String redirectUrl = calculateRedirectUrl(servletContext.getContextPath(), url); LOGGER.debug("Redirecting to [" + redirectUrl + "]"); UI.getCurrent().getPage().setLocation(redirectUrl); }
@Override public void sendRedirect(String url) { HttpServletRequest request = http.getCurrentRequest(); HttpServletResponse response = http.getCurrentResponse(); String redirectUrl = calculateRedirectUrl(request.getContextPath(), url); redirectUrl = response.encodeRedirectURL(redirectUrl); if (logger.isDebugEnabled()) { logger.debug("Redirecting to '" + redirectUrl + "'"); } // Change to Vaadin Redirect UI.getCurrent().getPage().setLocation(redirectUrl); }
@Override public void logout(String logoutUrl) { VaadinSession.getCurrent().close(); Page.getCurrent().setLocation(logoutUrl); }
@Override public void logout(String logoutUrl) { VaadinSession.getCurrent().close(); Page.getCurrent().setLocation(logoutUrl); }
/** * Called when the user clicks on the 'forgot password' button.<p> */ public void onClickForgotPassword() { A_CmsUI.get().getPage().setLocation(getResetPasswordLink()); }
public void run() { A_CmsUI.get().getPage().setLocation( OpenCms.getLinkManager().substituteLinkForUnknownTarget( CmsLoginUI.m_adminCms, CmsWorkplaceLoginHandler.LOGIN_HANDLER, false)); } });
public void run() { A_CmsUI.get().getPage().setLocation( OpenCms.getLinkManager().substituteLinkForUnknownTarget( CmsLoginUI.m_adminCms, CmsWorkplaceLoginHandler.LOGIN_HANDLER, false)); }
public void windowClose(CloseEvent e) { if((IkasanAuthentication)VaadinService.getCurrentRequest().getWrappedSession() .getAttribute(DashboardSessionValueConstants.USER) == null) { Notification.show("You cannot access this page!", Type.ERROR_MESSAGE); //Redirect the user to the login/default Page Page.getCurrent().setLocation("/ikasan-dashboard"); } } });
/** * Cancels the dialog.<p> */ public void cancel() { CmsObject cms = A_CmsUI.getCmsObject(); String link = OpenCms.getLinkManager().substituteLinkForUnknownTarget( cms, CmsWorkplaceLoginHandler.LOGIN_HANDLER, false); A_CmsUI.get().getPage().setLocation(link); }
/** * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#executeAction(java.lang.Object) */ public void executeAction(MenuContext context) { String link = CmsCoreService.getVaadinWorkplaceLink( A_CmsUI.getCmsObject(), context.getData().getResource().getStructureId()); A_CmsUI.get().getPage().setLocation(link); }
public void logout(UI ui) { close(); VaadinService.getCurrentRequest().getWrappedSession().invalidate(); ui.close(); String contextPath = VaadinService.getCurrentRequest().getContextPath(); ui.getPage().setLocation(contextPath); }
@Override public void detach() { Broadcaster.unregister(this); VaadinSession vSession = VaadinSession.getCurrent(); WrappedSession httpSession = vSession.getSession(); this.navigationPanel.reset(); //Invalidate HttpSession if(httpSession != null) { httpSession.invalidate(); } vSession.close(); //Redirect the user to the login/default Page Page.getCurrent().setLocation("/ikasan-dashboard"); }
/** * @see org.opencms.ui.actions.I_CmsWorkplaceAction#executeAction(org.opencms.ui.I_CmsDialogContext) */ public void executeAction(I_CmsDialogContext context) { if (context.getResources().size() == 1) { HttpServletRequest req = CmsVaadinUtils.getRequest(); CmsJspTagEnableAde.removeDirectEditFlagFromSession(req.getSession()); if (context.getCms().getRequestContext().getCurrentProject().isOnlineProject()) { String link = OpenCms.getLinkManager().getOnlineLink( context.getCms(), context.getCms().getSitePath(context.getResources().get(0))); A_CmsUI.get().openPageOrWarn(link, ONLINE_WINDOW_NAME); } else { String link = OpenCms.getLinkManager().substituteLink(context.getCms(), context.getResources().get(0)); A_CmsUI.get().getPage().setLocation(link); } } }
private Component buildUserMenu(final UiProperties uiProperties) { final MenuBar settings = new MenuBar(); settings.addStyleName("user-menu"); settings.setHtmlContentAllowed(true); final MenuItem settingsItem = settings.addItem("", getImage(uiProperties.isGravatar()), null); final String formattedTenant = UserDetailsFormatter.formatCurrentTenant(); if (!StringUtils.isEmpty(formattedTenant)) { settingsItem.setText(formattedTenant); UserDetailsFormatter.getCurrentTenant().ifPresent(tenant -> settingsItem.setDescription(i18n .getMessage("menu.user.description", tenant, UserDetailsFormatter.getCurrentUser().getUsername()))); } else { settingsItem.setText("..."); } settingsItem.setStyleName("user-menuitem"); final String logoutUrl = generateLogoutUrl(); settingsItem.addItem(i18n.getMessage("label.sign.out"), selectedItem -> Page.getCurrent().setLocation(logoutUrl)); return settings; }
private Component buildUserMenu(final UiProperties uiProperties) { final MenuBar settings = new MenuBar(); settings.addStyleName("user-menu"); settings.setHtmlContentAllowed(true); final MenuItem settingsItem = settings.addItem("", getImage(uiProperties.isGravatar()), null); final String formattedTenant = UserDetailsFormatter.formatCurrentTenant(); if (!StringUtils.isEmpty(formattedTenant)) { settingsItem.setText(formattedTenant); UserDetailsFormatter.getCurrentTenant().ifPresent(tenant -> settingsItem.setDescription(i18n .getMessage("menu.user.description", tenant, UserDetailsFormatter.getCurrentUser().getUsername()))); } else { settingsItem.setText("..."); } settingsItem.setStyleName("user-menuitem"); final String logoutUrl = generateLogoutUrl(); settingsItem.addItem(i18n.getMessage("label.sign.out"), selectedItem -> Page.getCurrent().setLocation(logoutUrl)); return settings; }