/** * @param name The parameter to get data for. * @return The parameter set under the given name, or null. */ public String getParameter(String name) { return delegate == null ? null : delegate.getParameter(name); }
/** * @param name The parameter to get data for. * @return The parameter set under the given name, or null. */ public String getParameter(String name) { return delegate == null ? null : delegate.getParameter(name); }
/** * @param name The parameter to get data for. * @return The parameter set under the given name, or null. */ public String getParameter(String name) { return delegate == null ? null : delegate.getParameter(name); }
/** * Is the Gadget to be rendered sanitized? * @return true if sanitization will be enabled */ public static boolean isSanitizedRenderingRequest(Gadget gadget) { return "1".equals(gadget.getContext().getParameter("sanitize")); }
/** * Is the Gadget to be rendered sanitized? * @return true if sanitization will be enabled */ public static boolean isSanitizedRenderingRequest(Gadget gadget) { return "1".equals(gadget.getContext().getParameter("sanitize")); }
/** * Is the Gadget to be rendered sanitized? * @return true if sanitization will be enabled */ public static boolean isSanitizedRenderingRequest(Gadget gadget) { return "1".equals(gadget.getContext().getParameter("sanitize")); }
public Uri getGadgetUri(GadgetContext context) throws GadgetException { String rawxml = context.getParameter(RAW_GADGETSPEC_XML_PARAM_NAME); if (rawxml != null) { // Set URI to a fixed, safe value (localhost), preventing a gadget rendered // via raw XML (eg. via POST) to be rendered on a locked domain of any other // gadget whose spec is hosted non-locally. return RAW_GADGET_URI; } return context.getUrl(); }
private boolean cajaEnabled(Gadget gadget) { return (gadget.getAllFeatures().contains("caja") || "1".equals(gadget.getContext().getParameter("caja"))); }
private boolean cajaEnabled(Gadget gadget) { return (gadget.getAllFeatures().contains("caja") || "1".equals(gadget.getContext().getParameter("caja"))); }
/** * Returns true iff the gadget opts into the caja or the container forces caja by flag */ private boolean requiresCaja(Gadget gadget) { return gadget.getSpec().getModulePrefs().getFeatures().containsKey("caja") || "1".equals(gadget.getContext().getParameter("caja")); }
/** * Returns true iff the gadget opts into the caja or the container forces caja by flag */ private boolean requiresCaja(Gadget gadget) { return gadget.getSpec().getModulePrefs().getFeatures().containsKey("caja") || "1".equals(gadget.getContext().getParameter("caja")); }
/** * Should the gadget content be sanitized on output * @return */ public boolean sanitizeOutput() { return (getCurrentView() != null && getCurrentView().getType() == View.ContentType.HTML_SANITIZED) || "1".equals(getContext().getParameter(UriCommon.Param.SANITIZE.getKey())); } }
/** * Should the gadget content be sanitized on output * @return */ public boolean sanitizeOutput() { return (getCurrentView() != null && getCurrentView().getType() == View.ContentType.HTML_SANITIZED) || "1".equals(getContext().getParameter(UriCommon.Param.SANITIZE.getKey())); }
/** * Should the gadget content be sanitized on output * @return */ public boolean sanitizeOutput() { return (getCurrentView() != null && getCurrentView().getType() == View.ContentType.HTML_SANITIZED) || "1".equals(getContext().getParameter(UriCommon.Param.SANITIZE.getKey())); } }
@Test public void testGetParameter() { expect(request.getParameter("foo")).andReturn("bar"); replay(); GadgetContext context = new HttpGadgetContext(request); assertEquals("bar", context.getParameter("foo")); }
@Test public void testGetParameter() { expect(request.getParameter("foo")).andReturn("bar"); replay(); GadgetContext context = new HttpGadgetContext(request); assertEquals("bar", context.getParameter("foo")); }
@Test public void testGetParameter() { expect(request.getParameter("foo")).andReturn("bar"); replay(); GadgetContext context = new HttpGadgetContext(request); assertEquals("bar", context.getParameter("foo")); }
protected ProxyUriBase(Gadget gadget) { this(null, // Meaningless in "context" mode. translateStatusRefresh invalid here. getIntegerValue(gadget.getContext().getParameter(Param.REFRESH.getKey())), gadget.getContext().getDebug(), gadget.getContext().getIgnoreCache(), gadget.getContext().getContainer(), gadget.getSpec().getUrl().toString()); }
protected ProxyUriBase(Gadget gadget) { this(null, // Meaningless in "context" mode. translateStatusRefresh invalid here. getIntegerValue(gadget.getContext().getParameter(Param.REFRESH.getKey())), gadget.getContext().getDebug(), gadget.getContext().getIgnoreCache(), gadget.getContext().getContainer(), gadget.getSpec().getUrl().toString()); }
protected ProxyUriBase(Gadget gadget) { this(null, // Meaningless in "context" mode. translateStatusRefresh invalid here. getIntegerValue(gadget.getContext().getParameter(Param.REFRESH.getKey())), gadget.getContext().getDebug(), gadget.getContext().getIgnoreCache(), gadget.getContext().getContainer(), setAuthorityAsGadgetParam ? gadget.getSpec().getUrl().getAuthority() : gadget.getSpec().getUrl().toString()); }