exportRoot = session.getNode(request.getParameter("root"));
}
if ("all".equals(exportFormat)) {
if (!getCurrentUser().isRoot()) {
throw new JahiaUnauthorizedException("Only root user can perform export of all content");
}
response.setContentType("application/zip");
//make sure this file is not cached by the client (or a proxy middleman)
WebUtils.setNoCacheHeaders(response);
params.put(ImportExportService.INCLUDE_ALL_FILES, Boolean.TRUE);
params.put(ImportExportService.INCLUDE_TEMPLATES, Boolean.TRUE);
params.put(ImportExportService.INCLUDE_SITE_INFOS, Boolean.TRUE);
params.put(ImportExportService.INCLUDE_DEFINITIONS, Boolean.TRUE);
params.put(ImportExportService.VIEW_WORKFLOW, Boolean.TRUE);
params.put(ImportExportService.XSL_PATH, cleanupXsl);
OutputStream outputStream = response.getOutputStream();
importExportService.exportAll(outputStream, params);
outputStream.close();
} else if ("site".equals(exportFormat)) {
if (!getCurrentUser().isRoot()) {
throw new JahiaUnauthorizedException("Only root user can perform export of a site");
}
List<JahiaSite> sites = new ArrayList<JahiaSite>();
String[] sitekeys = request.getParameterValues("sitebox");
if (sitekeys != null) {