Java Code Examples for com.google.gwt.user.client.DOM#setElementAttribute()

The following examples show how to use com.google.gwt.user.client.DOM#setElementAttribute() . 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
Source File: Util.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 2
Source File: Util.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 3
Source File: Util.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 4
Source File: Util.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 5
Source File: Util.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 6
Source File: Util.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * executeReport
 */
public static void executeReport(long id, Map<String, String> params) {
	String parameters = "";

	if (!params.isEmpty()) {
		for (String key : params.keySet()) {
			parameters += "&" + key + "=" + params.get(key);
		}
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.ReportServlet + "?" + "id=" + id + parameters;
	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example 7
Source File: GeneralComunicator.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * extensionCallOwnDownload
 */
public static void extensionCallOwnDownload(String url) {
	final Element downloadIframe = RootPanel.get("__download").getElement();
	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example 8
Source File: Util.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * print file
 */
public static void print(String uuid) {
	final Element printIframe = RootPanel.get("__print").getElement();
	String url = RPCService.ConverterServlet + "?inline=true&print=true&toPdf=true&uuid=" + URL.encodeQueryString(uuid);
	DOM.setElementAttribute(printIframe, "src", url);
}
 
Example 9
Source File: Util.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Download CSV file
 */
public static void downloadCSVFile(String params) {
	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.CSVExporterServlet + "?" + params;
	DOM.setElementAttribute(downloadIframe, "src", url);
}