Skip to content

Commit

Permalink
PMXML: handle files with more than 11 baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
joniles committed Nov 5, 2024
1 parent 75683b2 commit 920605e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<author email="jon@timephased.com">Jon Iles</author>
</properties>
<body>
<release date="unreleased" version="13.5.2">
<release date="unreleased" version="13.6.0">
<action dev="joniles" type="update">Added the `Task.getBaselineTask()` methods. For applications where a separate baseline schedule is present or a baseline has been manually added to the `ProjectFile` instance, these methods will allow you to access the underlying baseline task instance from the current task instance.</action>
<action dev="joniles" type="update">Added the Activity Percent Complete attribute to the `Task` class. The value of this attribute will be the Duration, Physical or Units percent complete value, based on the Percent Complete Type setting. This attribute is provided as a convenience to match the Activity Percent Complete type value shown in P6.</action>
<action dev="joniles" type="update">Improve retrieval of custom field values for certain MPP files.</action>
<action dev="joniles" type="update">Improve handling of PMXML files with more than 11 baselines.</action>
</release>
<release date="2024-10-28" version="13.5.1">
<action dev="joniles" type="update">Fix CVE-2024-49771: Potential Path Traversal Vulnerability (Contributed by yyjLF and sprinkle).</action>
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private void populateBaselines(APIBusinessObjects apibo, List<ProjectFile> proje
if (apibo.getProjectList() != null && apibo.getProjectList().getProject().stream().anyMatch(p -> !p.getBaselineProject().isEmpty()))
{
// We have baselines in the project list
populateBaselinesbyProjectList(apibo, projects);
populateBaselinesByProjectList(apibo, projects);
}
}
}
Expand All @@ -343,7 +343,7 @@ private void populateBaselinesByUniqueID(List<ProjectFile> projects)
}
}

private void populateBaselinesbyProjectList(APIBusinessObjects apibo, List<ProjectFile> projects)
private void populateBaselinesByProjectList(APIBusinessObjects apibo, List<ProjectFile> projects)
{
Map<Integer, ProjectFile> map = projects.stream().collect(Collectors.toMap(p -> p.getProjectProperties().getUniqueID(), p -> p));
for (ProjectListType.Project project : apibo.getProjectList().getProject())
Expand All @@ -368,7 +368,14 @@ private void populateBaselinesbyProjectList(APIBusinessObjects apibo, List<Proje
{
continue;
}

parentProject.setBaseline(baselineProject, baselineIndex++);

// TODO: allow an arbitrary number of baselines to be captured
if (baselineIndex > 10)
{
break;
}
}
}
}
Expand Down

0 comments on commit 920605e

Please sign in to comment.