Writes the dates fields for Import entities
FEA: ItEr77S05BasicProjectImport
This commit is contained in:
parent
7bfb52a3ca
commit
317759cd63
1 changed files with 16 additions and 1 deletions
|
|
@ -23,18 +23,21 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import net.sf.mpxj.ProjectFile;
|
||||
import net.sf.mpxj.ProjectHeader;
|
||||
import net.sf.mpxj.Task;
|
||||
|
||||
/**
|
||||
* Class that is a conversor from the MPXJ format File to {@link OrderDTO}.
|
||||
*
|
||||
* At these moment it only converts the tasks and its subtasks.
|
||||
* At these moment it only converts the tasks and its subtasks with the dates.
|
||||
*
|
||||
* @author Alba Carro Pérez <alba.carro@gmail.com>
|
||||
* @todo It last relationships. resources, calendars, hours, etc.
|
||||
*/
|
||||
public class MPXJProjectFileConversor {
|
||||
|
||||
private static ProjectHeader header;
|
||||
|
||||
/**
|
||||
* Converts a ProjectFile into a {@link OrderDTO}.
|
||||
*
|
||||
|
|
@ -81,6 +84,10 @@ public class MPXJProjectFileConversor {
|
|||
importData.name = filename
|
||||
.substring(0, filename.length() - 8/* ".planner" */);
|
||||
|
||||
header = file.getProjectHeader();
|
||||
|
||||
importData.startDate = header.getStartDate();
|
||||
|
||||
importData.tasks = getImportTasks(file.getChildTasks());
|
||||
|
||||
return importData;
|
||||
|
|
@ -101,6 +108,10 @@ public class MPXJProjectFileConversor {
|
|||
|
||||
OrderDTO importData = new OrderDTO();
|
||||
|
||||
header = file.getProjectHeader();
|
||||
|
||||
importData.startDate = header.getStartDate();
|
||||
|
||||
for (Task task : file.getChildTasks()) {
|
||||
// Projects are represented as a level 0 task with all
|
||||
// real task as its children. Ignore all other top level tasks.
|
||||
|
|
@ -170,6 +181,10 @@ public class MPXJProjectFileConversor {
|
|||
|
||||
importTask.name = task.getName();
|
||||
|
||||
importTask.startDate = task.getStart();
|
||||
|
||||
importTask.endDate = task.getFinish();
|
||||
|
||||
return importTask;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue