Java Code Examples for com.google.gwt.http.client.URL

The following examples show how to use com.google.gwt.http.client.URL. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
protected void setQueryString(String queryString) {
	this.queryString = queryString;
	paramMap = new HashMap<String, String>();

	if (queryString != null && queryString.length() > 1) {
		String qs = queryString.substring(1);
		String[] kvPairs = qs.split("&");
		for (int i = 0; i < kvPairs.length; i++) {
			String[] kv = kvPairs[i].split("=");
			if (kv.length > 1) {
				paramMap.put(kv[0], URL.decodeComponent(kv[1]));
			} else {
				paramMap.put(kv[0], "");
			}
		}
	}
}
 
Example 2
public static String webstartURL(String appName, Map<String, String> params) {
	StringBuffer url = new StringBuffer(GWT.getHostPageBaseURL());
	url.append("webstart/");
	url.append(appName);
	url.append(".jsp?random=");
	url.append(new Date().getTime());
	url.append("&language=");
	url.append(I18N.getLocale());
	url.append("&docLanguage=");
	url.append(I18N.getDefaultLocaleForDoc());
	url.append("&sid=");
	url.append(Session.get().getSid());
	if (params != null)
		for (String p : params.keySet()) {
			url.append("&");
			url.append(p);
			url.append("=");
			url.append(URL.encode(params.get(p)));
		}
	return url.toString();
}
 
Example 3
/**
 * addDocument
 */
private void addDocumentToWikiEditor() {
	if (selectedRow >= 0) {
		String uuid = documentTable.getText(selectedRow, 2);
		String name = UtilComunicator.getName(documentTable.getText(selectedRow, 1));

		switch (type) {
			case FIND_DOCUMENT:
				Wiki.get().addDocumentTag(uuid, name);
				break;

			case FIND_IMAGE:
				String url = RPCService.DownloadServlet;
				url += "?uuid=" + URL.encodeQueryString(uuid);
				Wiki.get().addImageTag(url, getParameters());
				break;
		}
	}
}
 
Example 4
/**
 * Download files exported as zip
 *
 * @author danilo
 */
@Deprecated
public static void downloadFiles(List<String> path, String params) {
	if (!params.equals("")) {
		params = "&" + params;
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?export" + params;

	for (String p : path) {
		url += "&pathList=" + URL.encodeQueryString(p);
	}

	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example 5
protected void setQueryString(String queryString) {
	this.queryString = queryString;
	paramMap = new HashMap<String, String>();

	if (queryString != null && queryString.length() > 1) {
		String qs = queryString.substring(1);
		String[] kvPairs = qs.split("&");
		for (int i = 0; i < kvPairs.length; i++) {
			String[] kv = kvPairs[i].split("=");
			if (kv.length > 1) {
				paramMap.put(kv[0], URL.decodeQueryString(kv[1]));
			} else {
				paramMap.put(kv[0], "");
			}
		}
	}
}
 
Example 6
/**
 * showEmbedPDF
 *
 * @param uuid Unique document ID to be previewed.
 */
public void showEmbedPDF(String uuid) {
	hideWidgetExtension();
	vPanel.clear();

	if (previewEvent != null) {
		vPanel.add(hReturnPanel);
		vPanel.setCellHeight(hReturnPanel, String.valueOf(TURN_BACK_HEIGHT) + "px");
	}

	vPanel.add(pdf);
	vPanel.setCellHorizontalAlignment(pdf, HasAlignment.ALIGN_CENTER);
	vPanel.setCellVerticalAlignment(pdf, HasAlignment.ALIGN_MIDDLE);

	if (previewAvailable) {
		String url = RPCService.DownloadServlet + "?inline=true&uuid=" + URL.encodeQueryString(uuid);
		pdf.setHTML("<div id=\"pdfembededcontainer\">" +
				"<object id=\"" + pdfID + "\" name=\"" + pdfID + "\" width=\"" + width + "\" height=\"" + height + "\" type=\"application/pdf\" data=\"" + url + "\"&#zoom=85&scrollbar=1&toolbar=1&navpanes=1&view=FitH\">" +
				"<p>Browser plugin suppport error, PDF can not be displayed</p>" +
				"</object>" +
				"</div>\n"); // needed for rewriting  purpose
	} else {
		swf.setHTML("<div id=\"pdfembededcontainer\" align=\"center\"><br><br>" + Main.i18n("preview.unavailable") + "</div>\n");
	}
}
 
Example 7
Source Project: geowe-core   Source File: OpenProjectDialog.java    License: GNU General Public License v3.0 6 votes vote down vote up
private SelectHandler createUrlToShare(final VerticalPanel geoDataContainer) {
	return new SelectHandler() {
		@Override
		public void onSelect(SelectEvent event) {
			urlToShareAnchor.setHref(getHref());
			urlToShareAnchor.setText(
					UIMessages.INSTANCE.seeOtherWindow("GeoWE Project"),
					Direction.LTR);

			urlShared.setText(getHref());
			urlPanel.setVisible(true);
			urlShared.setVisible(true);
		}

		private String getHref() {
			String baseUrl = GWT.getHostPageBaseURL();

			baseUrl += "?projectUrl="
					+ URL.encodeQueryString(urlTextField.getValue());

			return baseUrl;
		}
	};
}
 
Example 8
Source Project: geowe-core   Source File: WfsVectorLayerDef.java    License: GNU General Public License v3.0 6 votes vote down vote up
private String createWfsUrl() {
	StringBuffer url = new StringBuffer(serviceUrl);
	url.append("?request=GetFeature");
	url.append("&service=WFS");
	url.append("&version=" + version);
	url.append("&typeName=" + nameSpaceFeatureType);
	if (maxFeatures != 0) {
		url.append(getMaxFeaturesLimit());
	}
	if (!getFormat().isEmpty()) {
		url.append(getOutputFormat());
	}
	if (queryBbox) {
		url.append("&srsName=" + getEpsg());
		url.append("&bbox=" + bbox.getLowerLeftX() + ","
				+ bbox.getLowerLeftY() + "," + bbox.getUpperRightX() + ","
				+ bbox.getUpperRightY());
	} else {
		url.append("&CQL_FILTER=" + URL.encodeQueryString(cql));
	}
	return url.toString();
}
 
Example 9
Source Project: unitime   Source File: UserAuthentication.java    License: Apache License 2.0 6 votes vote down vote up
public void authenticate() {
	if (!CONSTANTS.allowUserLogin()) {
		if (isAllowLookup())
			doLookup();
		else
			ToolBox.open(GWT.getHostPageBaseURL() + "login.do?target=" + URL.encodeQueryString(Window.Location.getHref()));
		return;
	}
	AriaStatus.getInstance().setText(ARIA.authenticationDialogOpened());
	iError.setVisible(false);
	iDialog.center();
	Scheduler.get().scheduleDeferred(new ScheduledCommand() {
		@Override
		public void execute() {
			iUserName.selectAll();
			iUserName.setFocus(true);
		}
	});
}
 
Example 10
Source Project: swellrt   Source File: UrlParameters.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Build a query string out of a map of key/value pairs.
 * @param queryEntries
 */
public static String buildQueryString(Map<String, String> queryEntries) {
  StringBuffer sb = new StringBuffer();
  boolean firstIteration = true;
  for (Entry<String, String> e : queryEntries.entrySet()) {
    if (firstIteration) {
      sb.append('?');
    } else {
      sb.append('&');
    }
    String encodedName = URL.encodeComponent(e.getKey());
    sb.append(encodedName);

    sb.append('=');

    String encodedValue = URL.encodeComponent(e.getValue());
    sb.append(encodedValue);
    firstIteration = false;
  }
  return sb.toString();
}
 
Example 11
Source Project: swellrt   Source File: Scrub.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Scrub a url if scrubbing is turned on
 *
 * Does not scrub urls with leading hashes
 *
 * @param url
 * @return The scrubbed version of the url, if it's not already scrubbed
 */
public static String scrub(String url) {
  if (enableScrubbing) {
    if (url.startsWith("#") || url.startsWith(REFERRER_SCRUBBING_URL)) {
      // NOTE(user): The caller should be responsible for url encoding if
      // neccessary. There is no XSS risk here as it is a fragment.
      return url;
    } else {
      String x = REFERRER_SCRUBBING_URL + URL.encodeComponent(url);
      return x;
    }
  } else {
    // If we are not scrubbing the url, then we still need to sanitize it,
    // to protect against e.g. javascript.
    String sanitizedUri = EscapeUtils.sanitizeUri(url);
    return sanitizedUri;
  }
}
 
Example 12
@Override
public List<PlaceRequest> toPlaceRequestHierarchy(String historyToken) throws TokenFormatException {
	historyToken = URL.decodeQueryString(historyToken);

	int split = historyToken.indexOf(hierarchySeparator);
	if (split == 0) {
		throw new TokenFormatException("Place history token is missing.");
	} else {
		List<PlaceRequest> result = new ArrayList<PlaceRequest>();
		if (split == -1) {
			result.add(unescapedToPlaceRequest(historyToken)); // History token consists of a single place token
		} else {
			String[] placeTokens = historyToken.split(hierarchySeparator);
			for (String placeToken : placeTokens) {
				if (placeToken.isEmpty()) {
					throw new TokenFormatException("Bad parameter: Successive place tokens require a single '" + hierarchySeparator + "' between them.");
				}
				result.add(unescapedToPlaceRequest(placeToken));
			}
		}
		return result;
	}
}
 
Example 13
Source Project: incubator-retired-wave   Source File: Scrub.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Scrub a url if scrubbing is turned on
 *
 * Does not scrub urls with leading hashes
 *
 * @param url
 * @return The scrubbed version of the url, if it's not already scrubbed
 */
public static String scrub(String url) {
  if (enableScrubbing) {
    if (url.startsWith("#") || url.startsWith(REFERRER_SCRUBBING_URL)) {
      // NOTE(user): The caller should be responsible for url encoding if
      // neccessary. There is no XSS risk here as it is a fragment.
      return url;
    } else {
      String x = REFERRER_SCRUBBING_URL + URL.encodeComponent(url);
      return x;
    }
  } else {
    // If we are not scrubbing the url, then we still need to sanitize it,
    // to protect against e.g. javascript.
    String sanitizedUri = EscapeUtils.sanitizeUri(url);
    return sanitizedUri;
  }
}
 
Example 14
public String getUrl(boolean document, Long[] ids, String[] titles) {
	String url = getBaseUrl();
	url += "?type=" + (document ? "document" : "folder");
	url += "&id=";
	for (Long id : ids) {
		if (!url.endsWith("="))
			url += ",";
		url += id.toString();
	}

	for (String param : getParameters()) {
		if ("user".equals(param.trim()))
			url += "&user=" + Session.get().getUser().getUsername();
		else if ("filename".equals(param.trim())) {
			url += "&filename=";
			for (String title : titles) {
				if (!url.endsWith("="))
					url += ",";
				url += title;
			}
		}
	}

	if (getSuffix() != null && !"".equals(getSuffix()))
		url += "&" + getSuffix();

	return URL.encode(url);
}
 
Example 15
/**
 * Reloads a preview for DICOM documents.
 */
private void reloadDICOM() {
	if (dicom != null)
		removeMember(dicom);

	dicom = new HTMLFlow();
	String url = Util.contextPath() + "dicom/index.html?input=" + URL.encodeQueryString(
			Util.downloadURL(docId, document.getFileVersion()) + "&sid=" + Session.get().getSid());
	dicom.setContents(
			"<iframe src='" + url + "' style='border:0px solid white; width:" + (getWidth() - 1) + "px; height:"
					+ (getHeight() - 1) + "px; overflow:hidden;' scrolling='no' seamless='seamless'></iframe>");
	setWidth100();
	addMember(dicom);
}
 
Example 16
public static String downloadAttachmentURL(long docId, String fileVersion, String attachmentFileName) {
	String url = contextPath() + "download-attachment?docId=" + docId;
	if (fileVersion != null)
		url += "&fileVersion=" + fileVersion;
	if (attachmentFileName != null)
		url += "&attachmentFileName=" + URL.encode(attachmentFileName);
	return url;
}
 
Example 17
@Override
public String decode(String encodedValue) throws URIEncoderDecoder.EncodingException {
  String ret = URL.decodePathSegment(encodedValue);
  if (ret.indexOf(0xFFFD) != -1) {
    throw new URIEncoderDecoder.EncodingException("Unable to decode value " + encodedValue
        + " it contains invalid UTF-8");
  }
  return ret;
}
 
Example 18
/**
 * toJson
 *
 */
public static JSONObject toJson(Object obj) {
	JSONObject json = new JSONObject();
	if (obj instanceof GWTQueryParams) {
		GWTQueryParams params = (GWTQueryParams) obj;
		json.put("author", new JSONString(params.getAuthor()));
		json.put("keywords", new JSONString(params.getKeywords()));
		json.put("content", new JSONString(params.getContent()));
		json.put("name", new JSONString(params.getName()));
		json.put("path", new JSONString(URL.encodeQueryString(params.getPath())));
		json.put("mimeType", new JSONString(params.getMimeType()));
		json.put("domain", new JSONNumber(params.getDomain()));
		json.put("mailFrom", new JSONString(params.getMailFrom()));
		json.put("mailTo", new JSONString(params.getMailTo()));
		json.put("mailSubject", new JSONString(params.getMailSubject()));
		json.put("categoryUuid", new JSONString(params.getCategoryUuid()));
		json.put("categoryPath", new JSONString(URL.encodeQueryString(params.getCategoryPath())));
		json.put("operator", new JSONString(params.getOperator()));
		if (params.getLastModifiedFrom() != null) {
			json.put("lastModifiedFrom", new JSONString(ISO8601.formatBasic(params.getLastModifiedFrom())));
		}
		if (params.getLastModifiedTo() != null) {
			json.put("lastModifiedTo", new JSONString(ISO8601.formatBasic(params.getLastModifiedTo())));
		}
		if (!params.getProperties().isEmpty()) {
			JSONObject properties = new JSONObject();
			for (String key : params.getProperties().keySet()) {
				GWTPropertyParams propertyParam = params.getProperties().get(key);
				JSONObject property = new JSONObject();
				// Only is necessary groupName and value
				property.put("grpName", new JSONString(propertyParam.getGrpName()));
				property.put("value", new JSONString(propertyParam.getValue()));
				properties.put(key, property);
			}
			json.put("properties", properties);
		}
	}
	return json;
}
 
Example 19
/**
 * Download file by UUID
 */
public static void downloadFileByUUID(String uuid, String params) {
	if (!params.equals("") && !params.endsWith("&")) {
		params += "&";
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?" + params + "uuid=" + URL.encodeQueryString(uuid);
	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example 20
/**
 * Download file by path
 */
@Deprecated
public static void downloadFile(String path, String params) {
	if (!params.equals("") && !params.endsWith("&")) {
		params += "&";
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?" + params + "path=" + URL.encodeQueryString(path);
	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example 21
/**
 * downloadFilesByUUID
 */
public static void downloadFilesByUUID(List<String> uuidList, String params) {
	if (!params.equals("")) {
		params = "&" + params;
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?export" + params;

	for (String uuid : uuidList) {
		url += "&uuidList=" + URL.encodeQueryString(uuid);
	}

	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example 22
/**
 * Download file
 */
public static void downloadFilePdf(String uuid) {
	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.ConverterServlet + "?inline=false&toPdf=true&uuid=" + URL.encodeQueryString(uuid);
	DOM.setElementAttribute(downloadIframe, "src", url);
	Main.get().conversionStatus.getStatus();
}
 
Example 23
/**
 * GWTFileUploadResponse
 *
 * @param text json encoded parameters.
 */
public GWTFileUploadResponse(String text) {
	text = text.substring(text.indexOf("{"));
	text = text.substring(0, text.lastIndexOf("}") + 1);
	JSONValue responseValue = JSONParser.parseStrict(text);
	JSONObject response = responseValue.isObject();

	// Deserialize information
	hasAutomation = response.get("hasAutomation").isBoolean().booleanValue();
	path = URL.decodeQueryString(response.get("path").isString().stringValue());
	error = response.get("error").isString().stringValue();
	showWizardCategories = response.get("showWizardCategories").isBoolean().booleanValue();
	showWizardKeywords = response.get("showWizardKeywords").isBoolean().booleanValue();
	digitalSignature = response.get("digitalSignature").isBoolean().booleanValue();

	// Getting property groups
	JSONArray groupsArray = response.get("groupsList").isArray();

	if (groupsArray != null) {
		for (int i = 0; i <= groupsArray.size() - 1; i++) {
			groupsList.add(groupsArray.get(i).isString().stringValue());
		}
	}

	// Getting workflows
	JSONArray workflowArray = response.get("workflowList").isArray();

	if (workflowArray != null) {
		for (int i = 0; i <= workflowArray.size() - 1; i++) {
			workflowList.add(workflowArray.get(i).isString().stringValue());
		}
	}
}
 
Example 24
private String paramValueEscape(String value) {

		StringBuffer sbuf = new StringBuffer();
		int len = value.length();

		char escapeChar = escapeCharacter.charAt(0);
		char hierarchyChar = hierarchySeparator.charAt(0);
		char paramChar = paramSeparator.charAt(0);
		char valueChar = valueSeparator.charAt(0);

		for (int i = 0; i < len; i++) {
			char ch = value.charAt(i);

			if (ch == escapeChar) {
				sbuf.append(ESCAPED_ESCAPE_CHAR);
			} else if (ch == hierarchyChar) {
				sbuf.append(ESCAPED_HIERARCHY_SEPARATOR);
			} else if (ch == paramChar) {
				sbuf.append(ESCAPED_PARAM_SEPARATOR);
			} else if (ch == valueChar) {
				sbuf.append(ESCAPED_VALUE_SEPARATOR);
			} else {
				sbuf.append(ch);
			}
		}

		return URL.encodeQueryString(sbuf.toString());
	}
 
Example 25
private String paramValueUnescape(String value) {
	value = URL.decodeQueryString(value);
	
	StringBuffer sbuf = new StringBuffer();
	int len = value.length();

	char escapeChar = escapeCharacter.charAt(0);

	char hierarchyNum = ESCAPED_HIERARCHY_SEPARATOR.charAt(1);
	char paramNum = ESCAPED_PARAM_SEPARATOR.charAt(1);
	char valueNum = ESCAPED_VALUE_SEPARATOR.charAt(1);
	char escapeNum = ESCAPED_ESCAPE_CHAR.charAt(1);

	for (int i = 0; i < len; i++) {
		char ch = value.charAt(i);

		if (ch == escapeChar) {
			i++;
			char ch2 = value.charAt(i);
			if (ch2 == hierarchyNum) {
				sbuf.append(hierarchySeparator);
			} else if (ch2 == paramNum) {
				sbuf.append(paramSeparator);
			} else if (ch2 == valueNum) {
				sbuf.append(valueSeparator);
			} else if (ch2 == escapeNum) {
				sbuf.append('\\');
			}
		} else {
			sbuf.append(ch);
		}
	} 	

	return sbuf.toString();
}
 
Example 26
/**
 * Tests the IFrame URI generator of Gadget class.
 */
public void testIframeUri() {
  String xmlSource = "http://test.com/gadget.xml";
  String href = "http://" + Location.getHost();
  String hrefEscaped = href.replace("?", "%3F");
  if (hrefEscaped.endsWith("/")) {
    hrefEscaped = hrefEscaped.substring(0, hrefEscaped.length() - 1);
  }
  int clientInstanceId = 1234;
  GadgetUserPrefs userPrefs = GadgetUserPrefs.create();
  userPrefs.put("pref1", "value1");
  userPrefs.put("pref2", "value2");
  GadgetMetadata metadata = getTestMetadata(xmlSource);
  WaveId waveId = WaveId.of("wave.google.com", "123");
  WaveletId waveletId = WaveletId.of("wave.google.com", "conv+root");
  WaveletName name = WaveletName.of(waveId, waveletId);
  String securityToken = "SECURITY";
  GadgetWidget gadget = GadgetWidget.createForTesting(
      clientInstanceId, userPrefs, name, securityToken, new FakeLocale());
  int gadgetInstanceId = -12345;
  String url = gadget.buildIframeUrl(gadgetInstanceId, metadata.getIframeUrl(VIEW_NAME));
  String expectedValue =
      "//0" + GADGET_SERVER + "/gadgets"
          + "/ifr?url=http://test.com/gadget.xml&view=canvas&nocache=1&mid=" + gadgetInstanceId
          + "&lang=wizard&country=OZ&parent=" + hrefEscaped + "&wave=1&waveId="
          + URL.encodeQueryString(ModernIdSerialiser.INSTANCE.serialiseWaveId(waveId))
          + "#rpctoken=" + gadget.getRpcToken() + "&st=" + securityToken
          + "&up_pref1=value1&up_pref2=value2";
  assertEquals(expectedValue, url);
}
 
Example 27
Source Project: unitime   Source File: TeachingRequestsPage.java    License: Apache License 2.0 5 votes vote down vote up
void export(String type) {
	RoomCookie cookie = RoomCookie.getInstance();
	String query = "output=" + type;
	FilterRpcRequest requests = iFilterBox.getElementsRequest();
	if (requests.hasOptions()) {
		for (Map.Entry<String, Set<String>> option: requests.getOptions().entrySet()) {
			for (String value: option.getValue()) {
				query += "&r:" + option.getKey() + "=" + URL.encodeQueryString(value);
			}
		}
	}
	if (requests.getText() != null && !requests.getText().isEmpty()) {
		query += "&r:text=" + URL.encodeQueryString(requests.getText());
	}
	query += "&sort=" + InstructorCookie.getInstance().getSortTeachingRequestsBy(iAssigned) +
			"&columns=" + InstructorCookie.getInstance().getTeachingRequestsColumns(iAssigned) + 
			"&grid=" + (cookie.isGridAsText() ? "0" : "1") +
			"&vertical=" + (cookie.areRoomsHorizontal() ? "0" : "1") +
			(cookie.hasMode() ? "&mode=" + cookie.getMode() : "");
	RPC.execute(EncodeQueryRpcRequest.encode(query), new AsyncCallback<EncodeQueryRpcResponse>() {
		@Override
		public void onFailure(Throwable caught) {
		}
		@Override
		public void onSuccess(EncodeQueryRpcResponse result) {
			ToolBox.open(GWT.getHostPageBaseURL() + "export?q=" + result.getQuery());
		}
	});
}
 
Example 28
Source Project: unitime   Source File: TeachingAssignmentsPage.java    License: Apache License 2.0 5 votes vote down vote up
void export(String type) {
	RoomCookie cookie = RoomCookie.getInstance();
	String query = "output=" + type;
	FilterRpcRequest requests = iFilterBox.getElementsRequest();
	if (requests.hasOptions()) {
		for (Map.Entry<String, Set<String>> option: requests.getOptions().entrySet()) {
			for (String value: option.getValue()) {
				query += "&r:" + option.getKey() + "=" + URL.encodeQueryString(value);
			}
		}
	}
	if (requests.getText() != null && !requests.getText().isEmpty()) {
		query += "&r:text=" + URL.encodeQueryString(requests.getText());
	}
	query += "&sort=" + InstructorCookie.getInstance().getSortTeachingAssignmentsBy() +
			"&columns=" + InstructorCookie.getInstance().getTeachingAssignmentsColumns() + 
			"&grid=" + (cookie.isGridAsText() ? "0" : "1") +
			"&vertical=" + (cookie.areRoomsHorizontal() ? "0" : "1") +
			(cookie.hasMode() ? "&mode=" + cookie.getMode() : "");
	RPC.execute(EncodeQueryRpcRequest.encode(query), new AsyncCallback<EncodeQueryRpcResponse>() {
		@Override
		public void onFailure(Throwable caught) {
		}
		@Override
		public void onSuccess(EncodeQueryRpcResponse result) {
			ToolBox.open(GWT.getHostPageBaseURL() + "export?q=" + result.getQuery());
		}
	});
}
 
Example 29
Source Project: unitime   Source File: RoomsPage.java    License: Apache License 2.0 5 votes vote down vote up
public void parse(String token) {
	if (token != null && !token.isEmpty())
		for (String pair: token.split("\\&")) {
			int idx = pair.indexOf('=');
			if (idx >= 0)
				iParams.put(pair.substring(0, idx), URL.decodeQueryString(pair.substring(idx + 1)));
		}
}
 
Example 30
Source Project: unitime   Source File: RoomsPage.java    License: Apache License 2.0 5 votes vote down vote up
public String toString(String skip) {
	String ret = "";
	for (String key: new TreeSet<String>(iParams.keySet())) {
		if (key.equals(skip)) continue;
		if (!ret.isEmpty()) ret += "&";
		ret += key + "=" + URL.encodeQueryString(iParams.get(key));
	}
	return ret;
}