@Secured("ROLE_ADMIN") public DataImportStateProxy startImport(List<Integer> entryIdsToImport, String surveyName) throws Exception { dataImportProcess.setEntryIdsToImport(entryIdsToImport); dataImportProcess.setNewSurveyName(surveyName); dataImportProcess.prepareToStartImport(); ExecutorServiceUtil.executeInCachedPool(dataImportProcess); DataImportState state = dataImportProcess.getState(); DataImportStateProxy proxy = new DataImportStateProxy(state); return proxy; }
@Secured("ROLE_ADMIN") public DataImportStateProxy startSummaryCreation(boolean overwriteAll) throws DataImportExeption { if (dataImportProcess == null || !dataImportProcess.isRunning()) { SessionState sessionState = sessionManager.getSessionState(); File userImportFolder = new File(importDirectory, sessionState.getSessionId()); packagedFile = new File(userImportFolder, FILE_NAME); List<User> usersList = userManager.loadAll(); HashMap<String, User> users = new HashMap<String, User>(); for (User user : usersList) { users.put(user.getName(), user); } dataImportProcess = new DataImportProcess( surveyManager, recordManager, recordDao, users, packagedFile, overwriteAll); dataImportProcess.prepareToStartSummaryCreation(); ExecutorServiceUtil.executeInCachedPool(dataImportProcess); } DataImportState state = dataImportProcess.getState(); DataImportStateProxy proxy = new DataImportStateProxy(state); return proxy; }