return "ok";
}
public ActionResult callAction(HttpServletRequest request, String actionName) {
try {
Action action = ServicesRegistry.getInstance().getJahiaTemplateManagerService().getActions().get(actionName);
RenderContext renderContext = (RenderContext) request.getAttribute("renderContext");
Map<String,List<String>> formDatas = (Map<String, List<String>>) request.getSession().getAttribute("formDatas");
Resource mainResource = (Resource) request.getAttribute("currentResource");
Resource resource = new Resource(mainResource.getNode().getNode("responses"), mainResource.getTemplateType(), actionName, Resource.CONFIGURATION_PAGE);
URLResolver mainResolver = (URLResolver) request.getAttribute("urlResolver");
String urlPathInfo = StringUtils.substringBefore(mainResolver.getUrlPathInfo(), mainResolver.getPath()) + resource.getNode().getPath();
if (!actionName.equals("default")) {
urlPathInfo += "."+ actionName + ".do";
} else {
urlPathInfo += "/*";
}
URLResolverFactory f = (URLResolverFactory) SpringContextSingleton.getBean("urlResolverFactory");
URLResolver resolver = f.createURLResolver(urlPathInfo, request.getServerName(), request);
return action.doExecute(request, renderContext, resource, JCRSessionFactory.getInstance().getCurrentUserSession(workspace, locale), formDatas, resolver);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}