if (!validateParent(context)) {
return RenderingResults.error("Unsupported parent parameter. Check your container code.");
}
try {
Gadget gadget = processor.process(context);
if (gadget.getCurrentView() == null) {
return RenderingResults.error("Unable to locate an appropriate view in this gadget. " +
"Requested: '" + gadget.getContext().getView() +
"' Available: " + gadget.getSpec().getViews().keySet());
}
if (gadget.getCurrentView().getType() == View.ContentType.URL) {
return RenderingResults.mustRedirect(gadget.getCurrentView().getHref());
}
if (!lockedDomainService.gadgetCanRender(context.getHost(), gadget, context.getContainer())) {
return RenderingResults.error("Invalid domain");
}