use of org.olat.modules.wiki.WikiToCPResource in project OpenOLAT by OpenOLAT.
the class WikiWebServiceHelper method serve.
/**
* exports the wiki-Resource and serves the zip file. The given
* OLATResourceable can be the repository-entry of the wiki or the
* businessGroup (if it is a group-wiki)
*
* @param wikiResource
* @param request
* @param response
* @return
*/
public static Response serve(OLATResourceable wikiResource, HttpServletRequest request, HttpServletResponse response) {
Identity ident = RestSecurityHelper.getIdentity(request);
Translator translator = Util.createPackageTranslator(WikiMainController.class, new Locale(ident.getUser().getPreferences().getLanguage()));
// make mediaResource
MediaResource cpMediaResource = new WikiToCPResource(wikiResource, ident, translator);
// use servletUtil, so file gets deleted afterwards
ServletUtil.serveResource(request, response, cpMediaResource);
return Response.ok().build();
}
use of org.olat.modules.wiki.WikiToCPResource in project openolat by klemens.
the class WikiWebServiceHelper method serve.
/**
* exports the wiki-Resource and serves the zip file. The given
* OLATResourceable can be the repository-entry of the wiki or the
* businessGroup (if it is a group-wiki)
*
* @param wikiResource
* @param request
* @param response
* @return
*/
public static Response serve(OLATResourceable wikiResource, HttpServletRequest request, HttpServletResponse response) {
Identity ident = RestSecurityHelper.getIdentity(request);
Translator translator = Util.createPackageTranslator(WikiMainController.class, new Locale(ident.getUser().getPreferences().getLanguage()));
// make mediaResource
MediaResource cpMediaResource = new WikiToCPResource(wikiResource, ident, translator);
// use servletUtil, so file gets deleted afterwards
ServletUtil.serveResource(request, response, cpMediaResource);
return Response.ok().build();
}
Aggregations