}
private void processFileImport(List<Map<Object, Object>> importsInfos, JahiaUser user)
throws IOException, ServletException, JahiaException {
ProcessingContext ctx = new ProcessingContext(System.currentTimeMillis(), null,
user, ProcessingContext.EDIT);
for (Map<Object, Object> infos : importsInfos) {
File file = (File) infos.get("importFile");
if (infos.get("importFileName").equals("users.xml")) {
ImportExportBaseService.getInstance().importUsers(file);
break;
}
}
for (Map<Object, Object> infos : importsInfos) {
File file = (File) infos.get("importFile");
if (infos.get("type").equals("files")) {
try {
ImportExportBaseService.getInstance().importSiteZip(file, ctx.getSite(), infos);
} catch (RepositoryException e) {
logger.error(e.getMessage(), e);
}
} else if (infos.get("type").equals("xml") && (infos.get("importFileName").equals(
"serverPermissions.xml") || infos.get("importFileName").equals("users.xml"))) {
} else if (infos.get("type").equals("site")) {
// site import
String tpl = (String) infos.get("templates");
if ("".equals(tpl)) {
tpl = null;
}
try {
sitesService.addSite(user, (String) infos.get(
"sitetitle"), (String) infos.get("siteservername"), (String) infos.get("sitekey"), "",
ctx.getLocale(), tpl,
"fileImport", file,
(String) infos.get(
"importFileName"), true,
false, (String) infos.get("originatingJahiaRelease"));
} catch (Exception e) {