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()); }
libs, loaded, null, false, false, RenderingContext.getDefault(), null, getFeatureRepositoryId(gadget)); jsUri.setCajoleContent(gadget.requiresCaja());
private Gadget makeGadget() throws GadgetException { Gadget gadget = EasyMock.createNiceMock(Gadget.class); GadgetContext context = EasyMock.createNiceMock(GadgetContext.class); expect(context.getUrl()).andReturn(Uri.parse("http://example.com/gadget.xml")).anyTimes(); expect(context.getContainer()).andReturn("cajaContainer").anyTimes(); expect(context.getDebug()).andReturn(false).anyTimes(); expect(gadget.getContext()).andReturn(context).anyTimes(); expect(gadget.getAllFeatures()).andReturn(ImmutableList.of("caja")).anyTimes(); expect(gadget.requiresCaja()).andReturn(true).anyTimes(); replay(context, gadget); return gadget; }
private Gadget makeGadget() throws GadgetException { Gadget gadget = EasyMock.createNiceMock(Gadget.class); GadgetContext context = EasyMock.createNiceMock(GadgetContext.class); expect(context.getUrl()).andReturn(Uri.parse("http://example.com/gadget.xml")).anyTimes(); expect(context.getContainer()).andReturn("cajaContainer").anyTimes(); expect(context.getDebug()).andReturn(false).anyTimes(); expect(gadget.getContext()).andReturn(context).anyTimes(); expect(gadget.getAllFeatures()).andReturn(ImmutableList.of("caja")).anyTimes(); expect(gadget.requiresCaja()).andReturn(true).anyTimes(); replay(context, gadget); return gadget; }
public void rewrite(Gadget gadget, MutableContent mc) { if (!gadget.requiresCaja()) return;
if (!gadget.requiresCaja()) { injectOnLoadHandlers(body);
if (gadget.requiresCaja()) { return RenderingResults.error("Caja does not support url type gadgets.", HttpServletResponse.SC_BAD_REQUEST);