public JsUri(UriStatus status, Collection<String> libs, RenderingContext context, String onload, boolean jsload, boolean nohint, String repository) { super(status, null); this.compileMode = JsCompileMode.getDefault(); this.onload = onload; this.jsload = jsload; this.nohint = nohint; this.context = context; this.libs = nonNullLibs(libs); this.loadedLibs = EMPTY_COLL; this.origUri = null; this.repository = repository; }
public static JsCompileMode valueOfParam(String param) { for (JsCompileMode mode : JsCompileMode.values()) { String modeParam = mode.getParamValue(); if (modeParam.equals(param)) { return mode; } } return getDefault(); }
public JsUri(Integer refresh, boolean debug, boolean noCache, String container, String gadget, Collection<String> libs, Collection<String> loadedLibs, String onload, boolean jsload, boolean nohint, RenderingContext context, Uri origUri, String repository) { super(null, refresh, debug, noCache, container, gadget); this.compileMode = JsCompileMode.getDefault(); this.onload = onload; this.jsload = jsload; this.nohint = nohint; this.context = context; this.libs = nonNullLibs(libs); this.loadedLibs = nonNullLibs(loadedLibs); this.origUri = origUri; this.repository = repository; }
public JsUri(Gadget gadget, Collection<String> libs) { super(gadget); this.compileMode = JsCompileMode.getDefault(); this.onload = null; this.jsload = false; this.nohint = false; this.context = RenderingContext.getDefault(); this.libs = nonNullLibs(libs); this.loadedLibs = EMPTY_COLL; this.origUri = null; this.setCajoleContent(gadget.requiresCaja()); }
public JsUri(UriStatus status, Uri origUri, Collection<String> libs, Collection<String> have) { super(status, origUri); if (origUri != null) { String contextParam = origUri.getQueryParameter(Param.CONTAINER_MODE.getKey()); this.context = RenderingContext.valueOfParam(contextParam); String compileParam = origUri.getQueryParameter(Param.COMPILE_MODE.getKey()); this.compileMode = JsCompileMode.valueOfParam(compileParam); this.jsload = "1".equals(origUri.getQueryParameter(Param.JSLOAD.getKey())); this.onload = origUri.getQueryParameter(Param.ONLOAD.getKey()); this.nohint = "1".equals(origUri.getQueryParameter(Param.NO_HINT.getKey())); this.repository = origUri.getQueryParameter(Param.REPOSITORY_ID.getKey()); } else { this.context = RenderingContext.getDefault(); this.compileMode = JsCompileMode.getDefault(); this.jsload = false; this.onload = null; this.nohint = false; this.repository = null; } this.libs = nonNullLibs(libs); this.loadedLibs = nonNullLibs(have); this.origUri = origUri; }
if (mode != null && mode != JsCompileMode.getDefault()) { uri.addQueryParameter(Param.COMPILE_MODE.getKey(), mode.getParamValue());