private static String composeUrl(String servletPath, String... params) { String ret = servletPath; ret = ret.replaceAll("[\\?&]+$", ""); String sep = ret.contains("?") ? "&" : "?"; for (String par : params) { ret += sep + par; sep = "&"; } for (Entry<String, List<String>> e : Window.Location.getParameterMap().entrySet()) { ret += sep + e.getKey() + "=" + e.getValue().get(0); } ret += sep + "random=" + Math.random(); return UriUtils.encode(ret); }
/** * Encodes the specified data-uri string in XML/UTF8 format. */ public static String encodeUtf8(final String dataUriDecoded) { return SVG_DATA_URI_UTF8 + UriUtils.encode(dataUriDecoded).replace("#", "%23"); }
/** * Get a List of Forms * * This endpoint provides access to a hierarchy of Forms that are visible to the authenticated user. * @param parent Fetches children of this parent. */ public Promise<List<CatalogEntry>> getFormCatalog(String parent) { StringBuilder urlBuilder = new StringBuilder(baseUrl); urlBuilder.append("/catalog"); if(parent != null) { urlBuilder.append("?parent=").append(UriUtils.encode(parent)); } return get(urlBuilder.toString(), CatalogEntry::fromJsonArray); }
@PatchMethod static String encodeImpl(String decodedURL) { return UriUtils.encode(decodedURL); }
@PatchMethod static String encodeImpl(String decodedURL) { return UriUtils.encode(decodedURL); }
/** * Get All Records * * Gets all records belonging to a Form. * @param formId Id of the Form containing the Record * @param parentId Limits the records to those which are sub-records of this parent record id. */ public Promise<FormRecordSet> getRecords(String formId, String parentId) { StringBuilder urlBuilder = new StringBuilder(formUrl(formId)); urlBuilder.append("/records"); if(parentId != null) { urlBuilder.append("?parentId=").append(UriUtils.encode(parentId)); } return getRecords(ResourceId.valueOf(formId), urlBuilder.toString()); }