Skip to content

Commit 6c091ee

Browse files
authored
Prx (#42)
Added support for PRX files.
1 parent 46930ef commit 6c091ee

21 files changed

+1366
-172
lines changed

eclipse/findbugs-exclude.xml

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -128,55 +128,13 @@
128128
<Method name="mapTextFields" />
129129
</Match>
130130

131-
<!-- Don't care if the file is not deleted -->
132-
<Match>
133-
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
134-
<Class name="~.*\.AstaDatabaseFileReader" />
135-
<Method name="read" />
136-
</Match>
137-
138-
<!-- Don't care if the file is not deleted -->
139-
<Match>
140-
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
141-
<Class name="~.*\.UniversalProjectReader" />
142-
<Method name="handleMDBFile" />
143-
</Match>
144-
145-
<!-- Don't care if the file is not deleted -->
146-
<Match>
147-
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
148-
<Class name="~.*\.UniversalProjectReader" />
149-
<Method name="handleSQLiteFile" />
150-
</Match>
151-
152131
<!-- Oh yes it is! -->
153132
<Match>
154133
<Bug pattern="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH" />
155134
<Class name="~.*\.UniversalProjectReader" />
156135
<Method name="populateTableNames" />
157136
</Match>
158-
159-
<!-- Don't care if the file is not deleted -->
160-
<Match>
161-
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
162-
<Class name="~.*\.CustomerDataTest" />
163-
<Method name="testFiles" />
164-
</Match>
165-
166-
<!-- Don't care if the file is not deleted -->
167-
<Match>
168-
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
169-
<Class name="~.*\.MerlinReader" />
170-
<Method name="read" />
171-
</Match>
172-
173-
<!-- Don't care if the file is not deleted -->
174-
<Match>
175-
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
176-
<Class name="~.*\.FastTrackReader" />
177-
<Method name="read" />
178-
</Match>
179-
137+
180138
<!-- This field is written by subclasses -->
181139
<Match>
182140
<Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD" />
@@ -193,15 +151,15 @@
193151
<!-- Don't care if the file is not deleted -->
194152
<Match>
195153
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
196-
<Class name="~.*\.UniversalProjectReader" />
197-
<Method name="handleZipFile" />
154+
<Class name="~.*\.FileHelper" />
155+
<Method name="deleteQuietly" />
198156
</Match>
199-
200-
<!-- Don't care if the file is not deleted -->
157+
158+
<!-- Don't care if the directories aren't created -->
201159
<Match>
202160
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
203-
<Class name="~.*\.InputStreamHelper" />
204-
<Method name="writeZipStreamToTempDir" />
205-
</Match>
161+
<Class name="~.*\.FileHelper" />
162+
<Method name="mkdirsQuietly" />
163+
</Match>
206164

207165
</FindBugsFilter>

maven/src/changes/changes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</properties>
77
<body>
88
<release date="git master" version="7.3.0">
9-
<action dev="joniles" type="add">Added support for reading Primavera P3 databases from directories or zip files</action>
9+
<action dev="joniles" type="add">Added support for reading Primavera P3 databases from directories, zip files, or PRX files.</action>
1010
<action dev="joniles" type="update">Improve robustness when reading MPP files containing apparently invalid custom field data.</action>
1111
<action dev="joniles" type="update">Improve UniversalProjectReader byte order mark handling.</action>
1212
<action dev="joniles" issue="324" type="fix">Fields with lookup unreadable when a field has custom name.</action>

maven/src/site/xdoc/index.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,17 @@ same approach - but I haven't tried this!</li>
6868
an XML file format to store project data. MPXJ read and write the Planner
6969
file format.</li>
7070

71-
<li><b>PRIMAVERA:</b> Primavera is a high end project planning tool favoured
71+
<li><b>PRIMAVERA P6:</b> Primavera P6 is a high end project planning tool favoured
7272
by users with complex planning requirements. It can export project data in the
7373
form of an XER or PM XML files, both of which MPXJ can read. It is also possible for MPXJ to connect
7474
directly to the Primavera database via JDBC to read project data. MPXJ can also write PM XML files
7575
to allow data to be exported in a form which can be consumed by Primavera.</li>
7676

77+
<li><b>PRIMAVERA P3:</b> Primavera P3 (Primavera Project Planner) is the forerunner of P6.
78+
It holds projects in Btrieve database files which MPXJ can read from a directory or from a zip archive.
79+
MPXJ can also read P3 data from PRX backup files.
80+
</li>
81+
7782
<li><b>POWERPROJECT:</b> Asta Powerproject is a planning tool used in a number of industries,
7883
particularly construction. Powerproject can save data to PP files or to MDB database files,
7984
and MPXJ can read both of these formats.</li>
@@ -248,6 +253,8 @@ be found in the legal directory of the distribution.</p>
248253
<p>This product includes functionality provided by IKVM.NET (<a href="http://www.ikvm.net/" target="_blank">http://www.ikvm.net</a>)</p>
249254
<p>This product includes functionality provided by RTF Parser Kit (<a href="https://github.com/joniles/rtfparserkit" target="_blank">https://github.com/joniles/rtfparserkit</a>)</p>
250255
<p>This product includes functionality provided by SQLITE-JDBC (<a href="https://github.com/xerial/sqlite-jdbc" target="_blank">https://github.com/xerial/sqlite-jdbc</a>)</p>
256+
<p>This product includes functionality provided by ZLIB/CONTRIB (<a href="https://github.com/madler/zlib" target="_blank">https://github.com/madler/zlib</a>)</p>
257+
<p>This product includes functionality provided by JWAT (<a href="http://jwat.org/" target="_blank">http://jwat.org/</a>)</p>
251258
</section>
252259

253260
</body>

src.test/net/sf/mpxj/junit/CustomerDataTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.junit.Test;
3434

3535
import net.sf.mpxj.ProjectFile;
36+
import net.sf.mpxj.common.FileHelper;
3637
import net.sf.mpxj.json.JsonWriter;
3738
import net.sf.mpxj.mpx.MPXReader;
3839
import net.sf.mpxj.mpx.MPXWriter;
@@ -276,7 +277,7 @@ private void testFiles(List<File> files)
276277
outputFile.deleteOnExit();
277278
ProjectWriter p = c.newInstance();
278279
p.write(mpxj, outputFile);
279-
outputFile.delete();
280+
FileHelper.deleteQuietly(outputFile);
280281
}
281282
}
282283

src/net/sf/mpxj/asta/AstaDatabaseFileReader.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import net.sf.mpxj.DayType;
4444
import net.sf.mpxj.MPXJException;
4545
import net.sf.mpxj.ProjectFile;
46+
import net.sf.mpxj.common.FileHelper;
4647
import net.sf.mpxj.common.InputStreamHelper;
4748
import net.sf.mpxj.common.NumberHelper;
4849
import net.sf.mpxj.listener.ProjectListener;
@@ -131,10 +132,7 @@ public final class AstaDatabaseFileReader implements ProjectReader
131132

132133
finally
133134
{
134-
if (tempFile != null)
135-
{
136-
tempFile.delete();
137-
}
135+
FileHelper.deleteQuietly(tempFile);
138136
}
139137
}
140138

0 commit comments

Comments
 (0)