private String reportAsConsoleError(String responseAsString, HttpServletRequest request) { StringBuilder alertMessage = new StringBuilder(BASE_MSG_CONSOLE); alertMessage.append(UrlUtils.getCurrentUri(request)); alertMessage.append("?ddl-debug&ddl-debug-page=alerts"); StringBuilder console = new StringBuilder(); console.append("<script type=\"text/javascript\">"); console.append("throw new Error('").append(alertMessage).append("');"); console.append("</script>"); console.append('\n'); console.append(CLOSING_HEAD_TAG); responseAsString = responseAsString.replace(CLOSING_HEAD_TAG, console); return responseAsString; } }
private String reportAsConsoleError(String responseAsString, HttpServletRequest request) { StringBuilder alertMessage = new StringBuilder(BASE_MSG_CONSOLE); alertMessage.append(UrlUtils.getCurrentUri(request)); alertMessage.append("?ddl-debug&ddl-debug-page=alerts"); StringBuilder console = new StringBuilder(); console.append("<script type=\"text/javascript\">"); console.append("throw new Error('").append(alertMessage).append("');"); console.append("</script>"); console.append('\n'); console.append(CLOSING_HEAD_TAG); responseAsString = responseAsString.replace(CLOSING_HEAD_TAG, console); return responseAsString; } }
public String generateRequestCacheKey(HttpServletRequest request) { StringBuilder cacheKey = new StringBuilder(UrlUtils.getCurrentUri(request)); return DigestUtils.md5Digest(cacheKey.toString()); }
public String generateRequestCacheKey(HttpServletRequest request) { StringBuilder cacheKey = new StringBuilder(UrlUtils.getCurrentUri(request)); return DigestUtils.md5Digest(cacheKey.toString()); }
public Set<Alert> alerts() { Set<Alert> errors = new HashSet<Alert>(); String currentUri = UrlUtils.getCurrentUri(request).toString(); LOG.debug("Checking for alerts for the request \"{}\"", currentUri); String[] bundleNames = AssetRequestContext.get(this.request).getBundles(true); errors.addAll(this.context.getBundleStorage().alertsFor(bundleNames)); LOG.debug("-> Errors found: {}", errors.size()); return errors; }
public Set<Alert> alerts() { Set<Alert> errors = new HashSet<Alert>(); String currentUri = UrlUtils.getCurrentUri(request).toString(); LOG.debug("Checking for alerts for the request \"{}\"", currentUri); String[] bundleNames = AssetRequestContext.get(this.request).getBundles(true); errors.addAll(this.context.getBundleStorage().alertsFor(bundleNames)); LOG.debug("-> Errors found: {}", errors.size()); return errors; }
alertMessage.append(UrlUtils.getCurrentUri(request)); alertMessage.append("?ddl-debug&ddl-debug-page=alerts"); alertMessage.append("\">");
alertMessage.append(UrlUtils.getCurrentUri(request)); alertMessage.append("?ddl-debug&ddl-debug-page=alerts"); alertMessage.append("\">");
/** * <p> * Generates a MD5 hash using information of the provided {@link Asset}. * </p> * <p> * The set of information used to generate the hash depends on the location * key. * </p> * <ul> * <li>{@code webapp}, {@code jar}, {@code webjar}, {@code classpath} and * {@code remote}: bundle name + asset name + asset type</li> * <li>{@code api}: bundle name + asset name + asset type + current URI</li> * </ul> * * @param asset * The asset holding information used to generate the hash. * @return a MD5 hash. */ public static String generateStorageKey(Asset asset, HttpServletRequest request) { Validate.notNull(asset.getConfigLocationKey(), "The location key of the provided asset cannot be null"); StringBuilder keyContext = new StringBuilder(); keyContext.append(asset.getBundle()); keyContext.append(asset.getName()); keyContext.append(asset.getType().name()); if (asset.getConfigLocationKey().equalsIgnoreCase(ApiLocator.LOCATION_KEY)) { keyContext.append(UrlUtils.getCurrentUri(request)); } return DigestUtils.md5Digest(keyContext.toString()); }
/** * <p> * Generates a MD5 hash using information of the provided {@link Asset}. * </p> * <p> * The set of information used to generate the hash depends on the location * key. * </p> * <ul> * <li>{@code webapp}, {@code jar}, {@code webjar}, {@code classpath} and * {@code remote}: bundle name + asset name + asset type</li> * <li>{@code api}: bundle name + asset name + asset type + current URI</li> * </ul> * * @param asset * The asset holding information used to generate the hash. * @return a MD5 hash. */ public static String generateStorageKey(Asset asset, HttpServletRequest request) { Validate.notNull(asset.getConfigLocationKey(), "The location key of the provided asset cannot be null"); StringBuilder keyContext = new StringBuilder(); keyContext.append(asset.getBundle()); keyContext.append(asset.getName()); keyContext.append(asset.getType().name()); if (asset.getConfigLocationKey().equalsIgnoreCase(ApiLocator.LOCATION_KEY)) { keyContext.append(UrlUtils.getCurrentUri(request)); } return DigestUtils.md5Digest(keyContext.toString()); }
String currentUri = UrlUtils.getCurrentUri(context.getRequest()).toString(); String appUri = currentUri.substring(0, currentUri.indexOf(WebConstants.DANDELION_DEBUGGER) - 1); commonCtx.put("currentUri", appUri);
String currentUri = UrlUtils.getCurrentUri(context.getRequest()).toString(); String appUri = currentUri.substring(0, currentUri.indexOf(WebConstants.DANDELION_DEBUGGER) - 1); commonCtx.put("currentUri", appUri);
StringBuilder exportUrl = UrlUtils.getCurrentUri(tableConfiguration.getRequest()); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_TYPE, "f"); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_FORMAT, enabledFormat);
StringBuilder exportUrl = UrlUtils.getCurrentUri(tableConfiguration.getRequest()); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_TYPE, "f"); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_FORMAT, enabledFormat);
exportUrl = UrlUtils.getCurrentUri(request); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_TYPE, "f"); conf.setHasCustomUrl(false);
exportUrl = UrlUtils.getCurrentUri(request); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_TYPE, "f"); conf.setHasCustomUrl(false);
String currentUri = UrlUtils.getCurrentUri(request).toString();
exportUrl = UrlUtils.getCurrentUri(request); UrlUtils.addParameter(exportUrl, ExportUtils.DDL_DT_REQUESTPARAM_EXPORT_TYPE, "f"); conf.setHasCustomUrl(false);
String currentUri = UrlUtils.getCurrentUri(request).toString();