/** * @return Whether the gadget output should be sanitized. */ public boolean getSanitize() { return delegate == null ? false : delegate.getSanitize(); }
expect(context.getIgnoreCache()).andReturn(ignoreCache).anyTimes(); expect(context.getToken()).andReturn(null).anyTimes(); expect(context.getSanitize()).andReturn(sanitize).anyTimes(); expect(context.getCajoled()).andReturn(cajoled).anyTimes();
expect(context.getIgnoreCache()).andReturn(ignoreCache).anyTimes(); expect(context.getToken()).andReturn(null).anyTimes(); expect(context.getSanitize()).andReturn(sanitize).anyTimes(); expect(context.getCajoled()).andReturn(cajoled).anyTimes();
protected void addDefaultUriParameters(UriBuilder uri, Gadget gadget, View view, boolean useTpl) { GadgetContext context = gadget.getContext(); String container = context.getContainer(); // Add container, whose input derived other components of the URI. uri.addQueryParameter(Param.CONTAINER.getKey(), container); // Add remaining non-url standard parameters, in templated or filled form. addParam(uri, Param.VIEW.getKey(), view.getName(), useTpl, false); addParam(uri, Param.LANG.getKey(), context.getLocale().getLanguage(), useTpl, false); addParam(uri, Param.COUNTRY.getKey(), context.getLocale().getCountry(), useTpl, false); addParam(uri, Param.DEBUG.getKey(), context.getDebug() ? "1" : "0", useTpl, false); addParam(uri, Param.NO_CACHE.getKey(), context.getIgnoreCache() ? "1" : "0", useTpl, false); addParam(uri, Param.SANITIZE.getKey(), context.getSanitize() ? "1" : "0", useTpl, false); if (context.getCajoled()) { addParam(uri, Param.CAJOLE.getKey(), "1", useTpl, false); } }
spec = substituter.substitute(context, spec); if (context.getSanitize()) { spec = spec.removeUrlViews();