/** * Imports the calendars from a InputStream. * * @param streamData * InputStream with the data that is going to be imported. * @param file * Name of the file that we want to import. */ @Transactional private void importCalendar(InputStream streamData, String file) throws InstanceNotFoundException, ValidationException { List<CalendarDTO> calendarDTOs = calendarImporterMPXJ.getCalendarDTOs( streamData, file); List<BaseCalendar> baseCalendars = calendarImporterMPXJ .getBaseCalendars(calendarDTOs); calendarImporterMPXJ.storeBaseCalendars(baseCalendars); }
/** * Imports calendars, orders, task and dependencies from a InputStream. * * @param streamData * InputStream with the data that is going to be imported. * @param file * Name of the file that we want to import. */ @Transactional private void importAll(InputStream streamData, String file) throws InstanceNotFoundException, ValidationException { List<CalendarDTO> calendarDTOs = calendarImporterMPXJ.getCalendarDTOs( streamData, file); List<BaseCalendar> baseCalendars = calendarImporterMPXJ .getBaseCalendars(calendarDTOs); calendarImporterMPXJ.storeBaseCalendars(baseCalendars); OrderDTO importData = calendarImporterMPXJ.getOrderDTO(file); Order order = orderImporterMPXJ.convertImportDataToOrder(importData, true); TaskGroup taskGroup = orderImporterMPXJ.createTask(importData, true); List<Dependency> dependencies = orderImporterMPXJ.createDependencies(importData); orderImporterMPXJ.storeOrder(order, taskGroup, dependencies); }