this.registryProvider = registryProvider;
this.configProcessor = configProcessor;
}
public boolean process(JsRequest request, JsResponseBuilder builder) throws JsException {
JsUri jsUri = request.getJsUri();
GadgetContext ctx = new JsGadgetContext(jsUri);
FeatureRegistry registry;
try {
registry = registryProvider.get(jsUri.getRepository());
} catch (GadgetException e) {
throw new JsException(e.getHttpStatusCode(), e.getMessage());
}
// Append gadgets.config initialization if not in standard gadget mode.
if (ctx.getRenderingContext() != RenderingContext.GADGET) {
List<String> allReq = registry.getFeatures(jsUri.getLibs());
Collection<String> loaded = jsUri.getLoadedLibs();
// Only inject config for features not already present and configured.
List<String> newReq = subtractCollection(allReq, loaded);
Map<String, Object> config = configProcessor.getConfig(