use of com.axelor.apps.base.db.repo.AppRepository in project axelor-open-suite by axelor.
the class AppController method bulkInstall.
public void bulkInstall(ActionRequest request, ActionResponse response) throws AxelorException, IOException {
Context context = request.getContext();
Set<Map<String, Object>> apps = new HashSet<>();
Collection<Map<String, Object>> appsSet = (Collection<Map<String, Object>>) context.get("appsSet");
if (appsSet != null) {
apps.addAll(appsSet);
}
Boolean importDemo = (Boolean) context.get("importDemoData");
String language = (String) context.get("languageSelect");
AppRepository appRepository = Beans.get(AppRepository.class);
List<App> appList = new ArrayList<>();
for (Map<String, Object> appData : apps) {
App app = appRepository.find(Long.parseLong(appData.get("id").toString()));
appList.add(app);
}
Beans.get(AppService.class).bulkInstall(appList, importDemo, language);
response.setFlash(I18n.get(IExceptionMessages.BULK_INSTALL_SUCCESS));
response.setSignal("refresh-app", true);
}
Aggregations