Example usage for com.google.gwt.http.client URL encodeQueryString

List of usage examples for com.google.gwt.http.client URL encodeQueryString

Introduction

In this page you can find the example usage for com.google.gwt.http.client URL encodeQueryString.

Prototype

public static String encodeQueryString(String decodedURLComponent) 

Source Link

Document

Returns a string where all characters that are not valid for a URL component have been escaped.

Usage

From source file:com.gwtplatform.mvp.client.proxy.ParameterTokenFormatterOld.java

License:Apache License

private String escape(String value) {
    return URL.encodeQueryString(value);
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * Download file by UUID//from ww  w.j  a va  2  s.c  o  m
 */
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);
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * Download file by path//from   ww  w . ja v a2 s. c  o  m
 */
@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);
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * Document List to Excel//from w  w  w. j  a v  a 2  s  . c o  m
 */
public static void exportToExcel(String path, String params) {
    if (!params.equals("") && !params.endsWith("&")) {
        params += "&";
    }

    final Element downloadIframe = RootPanel.get("__download").getElement();
    String url = RPCService.ExportToExcelServlet + "?" + params + "id=" + URL.encodeQueryString(path);
    DOM.setElementAttribute(downloadIframe, "src", url);
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * downloadFilesByUUID/*w  w  w .j  a  v a2s  .  co  m*/
 */
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);
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * Download files exported as zip//from  w  ww .j  a v a  2s.c o m
 * 
 * @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);
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * Download file/*ww w  .  j  a v  a  2s  .co  m*/
 */
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();
}

From source file:com.ikon.frontend.client.util.Util.java

License:Open Source License

/**
 * Encode path elements/*www . j  av  a 2  s  .co  m*/
 */
public static String encodePathElements(String path) {
    String[] eltos = path.split("\\/");
    String ret = "";

    for (int i = 1; i < eltos.length; i++) {
        ret = ret.concat("/").concat(URL.encodeQueryString(URL.encodeQueryString(eltos[i])));
    }

    return ret;
}

From source file:com.ikon.frontend.client.widget.properties.Preview.java

License:Open Source License

/**
 * showEmbedSWF/*from www .j av  a  2 s  .  c om*/
 * 
 * @param Uuid Unique document ID to be previewed.
 */
public void showEmbedSWF(String Uuid) {
    hideWidgetExtension();
    text.setVisible(true);
    space.setVisible(false);
    video.setVisible(false);

    boolean printEnabled = Main.get().workspaceUserProperties.getWorkspace().isPrintPreview();

    if (previewAvailable) {
        String url = RPCService.ConverterServlet + "?inline=true&toSwf=true&uuid="
                + URL.encodeQueryString(Uuid);
        text.setHTML("<div id=\"pdfviewercontainer\"></div>\n"); // needed for rewriting purpose

        if (Main.get().workspaceUserProperties.getWorkspace().getPreviewer().equals("flexpaper")) {
            Util.createPDFViewerFlexPaper(url, "" + width, "" + height, printEnabled);
        } else {
            Util.createPDFViewerZviewer(url, "" + width, "" + height);
        }
        Main.get().conversionStatus.getStatus();
    } else {
        text.setHTML("<div id=\"pdfviewercontainer\" align=\"center\"><br><br>"
                + Main.i18n("preview.unavailable") + "</div>\n"); // needed for rewriting purpose
    }
}

From source file:com.ikon.frontend.client.widget.properties.TabDocument.java

License:Open Source License

/**
 * previewDocument/*from w  ww. ja va2  s  . com*/
 */
private void previewDocument(boolean refreshing) {
    if (doc.getMimeType().equals("video/x-flv") || doc.getMimeType().equals("video/mp4")
            || doc.getMimeType().equals("application/x-shockwave-flash")
            || doc.getMimeType().equals("audio/mpeg")) {
        if (!refreshing) {
            preview.showMediaFile(
                    RPCService.DownloadServlet + "?uuid=" + URL.encodeQueryString(getDocument().getUuid()),
                    getDocument().getMimeType());
        } else {
            preview.resizeMediaFile(width, height - TAB_HEIGHT);
        }
    } else {
        if (!refreshing) {
            preview.showEmbedSWF(doc.getUuid());
        } else {
            preview.resizeEmbedSWF(width, height - TAB_HEIGHT);
        }
    }
}