List of usage examples for com.google.gwt.http.client URL encodeQueryString
public static String encodeQueryString(String decodedURLComponent)
From source file:com.openkm.frontend.client.widget.properties.Preview.java
License:Open Source License
/** * showEmbedPDF/*from w w w . ja v a2s.c o m*/ * * @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)); } 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"); } }
From source file:com.openkm.frontend.client.widget.properties.Preview.java
License:Open Source License
/** * previewDocument/*from www . j a v a 2s . c om*/ */ public void previewDocument(boolean refreshing, GWTDocument doc) { if (doc.getMimeType().equals("video/x-flv") || doc.getMimeType().equals("video/mp4") || doc.getMimeType().equals("audio/mpeg")) { if (!refreshing) { showMediaFile(RPCService.DownloadServlet + "?uuid=" + URL.encodeQueryString(doc.getUuid()), doc.getMimeType()); } else { resizeMediaPlayer(width, height); } } else if (HTMLPreview.isPreviewAvailable(doc.getMimeType())) { if (!refreshing) { showHTML(doc); } } else if (doc.isConvertibleToDxf()) { boolean found = false; // There's no preview if (!found) { setPreviewAvailable(false); // Special case autocad when converting from pdf } if (!refreshing) { showEmbedSWF(doc.getUuid()); } else { resizeEmbedSWF(width, height); } } else if (doc.getMimeType().equals("application/dicom")) { boolean found = false; // There's no preview if (!found) { setPreviewAvailable(false); } if (!refreshing) { showEmbedSWF(doc.getUuid()); } else { resizeEmbedSWF(width, height); } } else if (doc.getMimeType().equals("application/x-shockwave-flash")) { setPreviewConversion(false); if (!refreshing) { showEmbedSWF(doc.getUuid()); } else { resizeEmbedSWF(width, height); } } else { if (Main.get().workspaceUserProperties.getWorkspace().isAcrobatPluginPreview() && doc.getMimeType().equals("application/pdf")) { if (!refreshing) { showEmbedPDF(doc.getUuid()); } else { Util.resizeEmbededPDF("" + width, "" + height, pdfID); } } else { setPreviewConversion(true); if (!refreshing) { showEmbedSWF(doc.getUuid()); } else { resizeEmbedSWF(width, height); } } } }
From source file:com.pronoiahealth.olhie.client.utils.Utils.java
License:Open Source License
/** * Build a URI for file download//from w w w . ja v a 2 s.co m * * @param assetId * @param forDownload * @return */ public static String buildRestServiceForAssetDownloadLink(String assetId, String viewType) { StringBuilder urlStr = new StringBuilder(); urlStr.append("rest/book_download/book/"); urlStr.append(getRandom()); urlStr.append("/"); urlStr.append(URL.encodeQueryString(assetId)); urlStr.append("/"); urlStr.append(viewType); return urlStr.toString(); }
From source file:com.pronoiahealth.olhie.client.utils.Utils.java
License:Open Source License
/** * Build a URI for logo download/*ww w . java 2 s . c om*/ * * @param assetId * @param forDownload * @return */ public static String buildRestServiceForLogoDownloadLink(String bookId) { StringBuilder urlStr = new StringBuilder(); urlStr.append("rest/logo_download/logo/"); urlStr.append(getRandom()); urlStr.append("/"); urlStr.append(URL.encodeQueryString(bookId)); return urlStr.toString(); }
From source file:com.pronoiahealth.olhie.client.utils.Utils.java
License:Open Source License
/** * Build a URI for book front cover download * /*from w ww. ja v a2 s . c o m*/ * @param assetId * @param forDownload * @return */ public static String buildRestServiceForBookFrontCoverDownloadLink(String bookId, BookImageSizeEnum size) { StringBuilder urlStr = new StringBuilder(); urlStr.append("rest/book_image_download/front/"); urlStr.append(size.toString()); urlStr.append("/"); urlStr.append(getRandom()); urlStr.append("/"); urlStr.append(URL.encodeQueryString(bookId)); return urlStr.toString(); }
From source file:com.pronoiahealth.olhie.client.utils.Utils.java
License:Open Source License
/** * Build a URI for book back cover download * //from ww w . j a v a 2s . c om * @param assetId * @param forDownload * @return */ public static String buildRestServiceForBookBackCoverDownloadLink(String bookId) { StringBuilder urlStr = new StringBuilder(); urlStr.append("rest/book_image_download/back/"); urlStr.append(getRandom()); urlStr.append("/"); urlStr.append(URL.encodeQueryString(bookId)); return urlStr.toString(); }
From source file:com.pronoiahealth.olhie.client.utils.Utils.java
License:Open Source License
/** * @param programRef//from ww w .j ava2 s.c om * @return */ public static String buildRestServiceForTVDownload(String programRef) { StringBuilder urlStr = new StringBuilder(); urlStr.append("rest/tv_download/tv/"); urlStr.append(getRandom()); urlStr.append("/"); urlStr.append(URL.encodeQueryString(programRef)); return urlStr.toString(); }
From source file:com.risevision.ui.client.common.data.DataAccessController.java
License:Open Source License
public static void getData(String urlToken, String method, String tq, DataResponseBase response) { String action = configController.getConfiguration().getServerURL() + "/v2" + urlToken; String callback = "callback" + (int) (Math.random() * 1000000) + "_" + new Date().getTime(); String tqx = "responseHandler:" + callback; String url = action + "?tq=" + URL.encodeQueryString(tq) + "&tqx=" + tqx + "&access_token=" + OAuth2ServiceWrapper.getAccessToken(); getDataNative(url, callback, response); }
From source file:com.risevision.ui.client.common.data.DataAccessController.java
License:Open Source License
public static void getFinancialData(String urlToken, String tq, DataResponseBase response, boolean customQuery) { String action = configController.getConfiguration().getFinancialServerURL() + urlToken; // String action = "http://contentfinancial2.appspot.com" + urlToken; String callback = "callback" + (int) (Math.random() * 1000000) + "_" + new Date().getTime(); String tqx = "responseHandler:" + callback; String url = action + "?tqx=" + tqx + "&"; if (customQuery) { url += tq;/*from w ww .ja v a 2s .c o m*/ } else { url += "tq=" + URL.encodeQueryString(tq); } getDataNative(url, callback, response); }
From source file:com.risevision.ui.client.common.widgets.mediaLibrary.StorageFrameWidget.java
License:Open Source License
public void show(Command onSave) { this.onSave = onSave; String url = ConfigurationController.getInstance().getConfiguration().getMediaLibraryURL(); url += "/storage-selector.html#/?cid=" + SelectedCompanyController.getInstance().getSelectedCompanyId(); url += "&up_id=" + "if_divEditor"; url += "&parent=" + URL.encodeQueryString(Window.Location.getHref()); url = url.replace("'", "\\'"); show(url);/*from w w w . j a v a2s. c o m*/ }