}
private void writeTaskBaselinesAndTimephased(final Project.Tasks.Task xml, Task mpx){
// baselines
final List baselineList = xml.getBaseline();
NormalTask projityTask = (NormalTask) projityTaskMap.get(mpx);
if (projityTask == null)
return;
for (int s = 0; s < Settings.numBaselines(); s++) {
if (s == Snapshottable.CURRENT.intValue())
continue;
TaskSnapshot snapshot = (TaskSnapshot) projityTask.getSnapshot(new Integer(s));
if (snapshot == null)
continue;
AssociationList snapshotAssignments = snapshot.getHasAssignments().getAssignments();
if (snapshotAssignments.size() > 0) {
for (Iterator j = snapshotAssignments.iterator(); j.hasNext();) {
Assignment assignment = (Assignment) j.next();
ResourceImpl r = (ResourceImpl) assignment.getResource();
if (r.isDefault())
continue;
Project.Assignments.Assignment.Baseline baseline = m_factory
.createProjectAssignmentsAssignmentBaseline();
// For some silly reason, the baseline fields are all
// strings so they need to be converted
// baseline duration is missing :(
baseline.setNumber(s + "");
baseline.setStart(MPXConverter.dateToXMLString(DateTime.fromGmt(projityTask.getBaselineStart(s))));
baseline.setFinish(MPXConverter.dateToXMLString(DateTime.fromGmt(projityTask.getBaselineFinish(s))));
baseline.setWork(DatatypeConverter.printDuration(this, MPXConverter.toMPXDuration((long) projityTask.getBaselineWork(s))));
baselineList.add(baseline);
}
}
}