ServletContext scontext = webApp.getServletContext();
try {
/* Validate straight away here before creating the PortalContainerPostInitTask */
final Document document = GateInResourcesSchemaValidator.validate(url);
/* Also parse both before creating the PortalContainerPostInitTask */
final ScriptResources scriptResources = new JavascriptConfigParser(scontext, document).parse();
final List<SkinConfigTask> skinTasks = SkinConfigParser.parse(document);
/* No exceptions at this point */
final PortalContainerPostInitTask task = new PortalContainerPostInitTask() {
public void execute(ServletContext scontext, PortalContainer portalContainer) {
try {
if (!scriptResources.isEmpty()) {
javascriptConfigService.add(scriptResources);
scontext.setAttribute(SCRIPT_RESOURCES_ATTR, scriptResources.toImmutable());
}
javascriptConfigService.registerContext(webApp);
if (skinTasks != null && !skinTasks.isEmpty()) {
skinService.addSkins(skinTasks, scontext);