renderContext.setServletPath(Render.getRenderServletPath());
}
if (permission != null) {
if (!node.hasPermission(permission)) {
throw new GWTJahiaServiceException("Access denied");
}
}
if (contextParams != null) {
for (Map.Entry<String, List<String>> entry : contextParams.entrySet()) {
r.getModuleParams().put(entry.getKey(), entry.getValue().get(0));
}
}
JCRSiteNode site = node.getResolveSite();
renderContext.setSite(site);
String res = renderService.render(r, renderContext);
Map<String, Set<String>> map = (Map<String, Set<String>>) renderContext.getRequest().getAttribute("staticAssets");
String constraints = ConstraintsHelper.getConstraints(node);
if (constraints == null) {
constraints = "";
}
Map<String, List<String>> m = new HashMap<String, List<String>>();
if (map != null) {
for (Map.Entry<String, Set<String>> entry : map.entrySet()) {
m.put(entry.getKey(), new ArrayList<String>(entry.getValue()));
}
}
result = new GWTRenderResult(res, m, constraints, node.getDisplayableName());
} catch (PathNotFoundException e) {
throw new GWTJahiaServiceException(path + " not found for user " + currentUserSession.getUser().getName());
} catch (RepositoryException e) {
logger.error(e.getMessage(), e);
throw new GWTJahiaServiceException("Repository exception on path " + path);
} catch (RenderException e) {
logger.error(e.getMessage(), e);
throw new GWTJahiaServiceException("Render exception "+e.getMessage());
}
return result;
}