Refine search
private void setLevels(Logger l) { // try to pull the log level from the query param String levelParam = Location.getParameter("logLevel"); Level level = levelParam == null ? null : Level.parse(levelParam); if (level != null) { l.setLevel(level); } else { // if it isn't there, then pull it from the gwt.xml file DefaultLevel defaultLevel = GWT.create(DefaultLevel.class); l.setLevel(defaultLevel.getLevel()); } } }
private void redirectToModule(String module) { String path = Window.Location.getPath(); if (!path.endsWith("/")) { if (path.endsWith(".html") || path.endsWith(".htm")) { int index = path.lastIndexOf('/'); path = path.substring(0, index + 1); } else { path += "/"; } } String target = path + module + "/"; Window.Location.assign(Window.Location.createUrlBuilder().setPath(target).buildString()); }
private static String composeUrl(String servletPath, String... params) { String ret = servletPath; ret = ret.replaceAll("[\\?&]+$", ""); String sep = ret.contains("?") ? "&" : "?"; for (String par : params) { ret += sep + par; sep = "&"; } for (Entry<String, List<String>> e : Window.Location.getParameterMap().entrySet()) { ret += sep + e.getKey() + "=" + e.getValue().get(0); } ret += sep + "random=" + Math.random(); return UriUtils.encode(ret); }
@Override public void onLogout() { AsyncQuery<ActionReturnValue> query = new AsyncQuery<>(returnValue -> { // Redirect to SSO Logout after the user has logged out successfully on backend. Window.Location.assign(GWT.getModuleBaseURL() + "sso/logout"); //$NON-NLS-1$ }); query.setHandleFailure(true); frontend.logoffAsync(query); }
@Deprecated protected boolean redirectHack(String text) { if (text != null && text.contains("<!-- ##Login page hack## -->")) { String redirectUrl = GWT.getHostPageBaseURL() + "Login.html?login-reauth"; Window.Location.replace(redirectUrl); return true; } return false; }
/** * Override to change the headers sent in the HTTP request. * * @param builder a {@link RequestBuilder} instance */ protected void configureRequestBuilder(RequestBuilder builder) { builder.setHeader("Content-Type", RequestFactory.JSON_CONTENT_TYPE_UTF8); builder.setHeader("pageurl", Location.getHref()); builder.setHeader(STRONG_NAME_HEADER, GWT.getPermutationStrongName()); }
private static boolean isGwtHostedModeParameterOnly() { Map<String, List<String>> parameters = Window.Location.getParameterMap(); boolean hasGwtCodesrvParameter = parameters.containsKey("gwt.codesvr"); return !GWT.isProdMode() && parameters.size() == 1 && hasGwtCodesrvParameter; }
@Override public boolean openURI (String URI) { if (config.openURLInNewWindow) { Window.open(URI, "_blank", null); } else { Window.Location.assign(URI); } return true; }
@Override public boolean openURI (String URI) { if (config.openURLInNewWindow) { Window.open(URI, "_blank", null); } else { Window.Location.assign(URI); } return true; }
@Override public void onClick(ClickEvent clickEvent) { String url = Window.Location.getHref(); Window.open("/kaaAdmin/servlet/kaaConfigurationDownloadServlet?schemaId=" + Utils.getSchemaIdFromUrl(url) + "&endGroupId=" + Utils.getEndpointGroupIdFromUrl(url), "_blank", "status=0,toolbar=0,menubar=0,location=0"); } });
@Override public void onLogin() { Window.open(Window.Location.getPath(), "_blank", ""); }
/** * Redirect to module. * * @param module the module name. */ public static void redirectToModule(String module) { String path = Window.Location.getPath(); if (!path.endsWith("/")) { if (path.endsWith(".html") || path.endsWith(".htm")) { int index = path.lastIndexOf('/'); path = path.substring(0, index + 1); } else { path += "/"; } } String target = path + module + "/"; Window.Location.assign(Window.Location.createUrlBuilder().setPath(target).buildString()); }
private static String getDecodedHash() { String hashToken = Window.Location.getHash(); if (hashToken == null || hashToken.isEmpty()) { return ""; } return tokenEncoder.decode(hashToken.substring(1)); }
public void replaceToken(String historyToken) { Window.Location.replace("#" + historyToken); } }
builder.setProtocol(getProtocol()); builder.setHost(getHost()); String path = getPath(); if (path != null && path.length() > 0) { builder.setPath(path); String hash = getHash(); if (hash != null && hash.length() > 0) { String port = getPort(); if (port != null && port.length() > 0) { builder.setPort(Integer.parseInt(port)); Map<String, List<String>> params = getParameterMap(); for (Map.Entry<String, List<String>> entry : params.entrySet()) { List<String> values = new ArrayList<String>(entry.getValue());
@Override public void replaceState(String data, String title, String url) { UrlBuilder builder = Window.Location.createUrlBuilder(); builder.setHash(data); Window.Location.replace(builder.buildString()); }
@Override public void onChange(ChangeEvent event) { String selectedLanguage = display.getSelectedLanguage().getFirst(); display.setSelectedLanguage(selectedLanguage); Cookies.setCookie(LoginConstants.LANGUAGE_COOKIE_NAME, selectedLanguage); unbind(); RootPanel.get().clear(); Location.assign(URLUtils.transformURLToRequiredLocale(Location.getHref(), Location.getHostName(), null, LocaleInfo.getCurrentLocale().getLocaleName(), selectedLanguage)); } }));
/** * Add the parameters from the request on the context. * @param context */ private static void setAttributes(ViewContext context){ for (String key : Window.Location.getParameterMap().keySet()){ if ((!key.equals(VIEW_ATR)) && (!key.equals(ViewContext.ID_ATR)) && (!key.equals(ViewContext.ID_TYPE_ATR))){ context.setAttribute(key, Window.Location.getParameter(key)); } } }
private String createClientUrl() { return Window.Location.getProtocol() + "//" + Window.Location.getHost() + //$NON-NLS-1$ "/" + clientPage + //$NON-NLS-1$ "?host=" + proxyConfig.getProxyHost() + //$NON-NLS-1$ "&port=" + proxyConfig.getProxyPort() + //$NON-NLS-1$ "&title=" + consoleTitle; //$NON-NLS-1$ }