public String getProxyHost() { String val = configValue.split(":")[0];//$NON-NLS-1$ if (val.equals(ENGINE)) { return Location.getHostName(); //the proxy runs on the engine } else if (val.equals(HOST)) { return this.targetHost; //the proxy runs on the engine } return val; }
private String findServerUrl() { if (Window.Location.getHostName().equals("localhost")) { return "http://localhost:8080/resources"; } else { return "/resources"; } } }
protected void setLocaleFromCookies() { String language = Cookies.getCookie(LoginConstants.LANGUAGE_COOKIE_NAME); String localeName = LocaleInfo.getCurrentLocale().getLocaleName(); if (language != null && !language.isEmpty() && localeName != null && !localeName.isEmpty() && !language.equals(localeName)) { String url = URLUtils.transformURLToRequiredLocale(Location.getHref(), Location.getHostName(), null, localeName, language); if (!Location.getHref().equals(url)) { unbind(); RootPanel.get().clear(); Location.assign(url); } } }
final String host = Window.Location.getHostName();
public static void getSession(final AsyncCallback<RecordingSessionDetailParams> callback) { final RecordingSessionDetailParamsJSO sessionDetail = new RecordingSessionDetailParamsJSO(); sessionDetail.setLanguage(getLanguage()); sessionDetail.setAntialiasingFonts(isFontsAntialiased()); sessionDetail.setBrowserHeight(getScreenHeight()); sessionDetail.setBrowserWidth(getScreenWidth()); sessionDetail.setBrowserName(getBrowserName()); sessionDetail.setBrowserVersion(getBrowserVersion()); sessionDetail.setColorDepth(getColorDepth()); sessionDetail.setHostName(Window.Location.getHostName()); sessionDetail.setInitialUrl(Window.Location.getHref()); sessionDetail.setJavaEnabled(Window.Navigator.isJavaEnabled()); sessionDetail.setOsName(getOsName()); sessionDetail.setReferrer(Document.get().getReferrer()); sessionDetail.setUserAgent(Window.Navigator.getUserAgent()); getIpInfo(new AsyncCallback<IpInfoJSO>() { @Override public void onFailure(Throwable caught) { callback.onFailure(caught); } @Override public void onSuccess(IpInfoJSO result) { sessionDetail.setIpAddress(result.getIp()); sessionDetail.setCity(result.getCity()); sessionDetail.setCountry(result.getRegion()); sessionDetail.setState(result.getCountry()); callback.onSuccess(sessionDetail); } }); }
protected void injectFlash(SwfConfig config) { String flashUrl = url; if (ieFixEnabled) { flashUrl += "?" + new Date().getTime(); } if (expressInstallUrl != null) { config.setExpressInstallUrl(expressInstallUrl); } if (swfHeight != null) { config.setHeight(swfHeight); } if (swfWidth != null) { config.setWidth(swfWidth); } config.addParameter("id", swfId); config.addParameter("allowScriptAccess", "always"); config.addParameter("wmode", wmode.toString().toLowerCase()); config.addFlashVar("id", swfId); config.addFlashVar("allowedDomain", Window.Location.getHostName()); config.addFlashVar("elementID", getId()); config.setVersion(flashVersion); SwfObject.embedSWF(flashUrl, swfId, config); swfElement = el().firstChild().dom; }
@Override public String getHostName() { return Window.Location.getHostName(); }
@Override protected String getServerUrl() { String protocol = Window.Location.getProtocol(); String hostName = Window.Location.getHostName(); return protocol + "//" + hostName + ":9876/"; }
@Override protected String getServerUrl() { String protocol = Window.Location.getProtocol(); String hostName = Window.Location.getHostName(); return protocol + "//" + hostName + ":9876/"; }
@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)); } }));