Mercurial > mxd2map
changeset 28:0e71a1f71ec0
Added parameter for MXD filename.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 08 Apr 2011 17:33:04 +0200 (2011-04-08) |
parents | e5fdc37f8f94 |
children | 77cfa8092611 |
files | ChangeLog build.xml src/java/de/intevation/mxd/Converter.java |
diffstat | 3 files changed, 17 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Apr 08 14:21:45 2011 +0200 +++ b/ChangeLog Fri Apr 08 17:33:04 2011 +0200 @@ -1,3 +1,10 @@ +2011-04-08 Raimund Renkert <raimund.renkert@intevation.de> + + * build.xml: Added parameter for MXD filename. + + * src/java/de/intevation/mxd/Converter.java: Read MXD filename from + properties. + 2011-04-08 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/reader/IReader.java: Added XML document to
--- a/build.xml Fri Apr 08 14:21:45 2011 +0200 +++ b/build.xml Fri Apr 08 17:33:04 2011 +0200 @@ -70,6 +70,7 @@ <java classname="Converter" failonerror="true" fork="true"> <jvmarg value="-Xss2m"/> <classpath refid="run.classpath"/> + <sysproperty key="mxd.file" value="${MXDFILE}"/> </java> </target>
--- a/src/java/de/intevation/mxd/Converter.java Fri Apr 08 14:21:45 2011 +0200 +++ b/src/java/de/intevation/mxd/Converter.java Fri Apr 08 17:33:04 2011 +0200 @@ -65,13 +65,17 @@ */ public static void main(String[] args) { try{ + IReader reader = new MXDReader(); reader.init(); -// reader.setFilename("testdata/SubsurfaceSediments-Internet.mxd"); -// reader.setFilename("testdata/p_single_4pt_c255-0-0.mxd"); -// reader.setFilename("testdata/Facilities-Internet.mxd"); -// reader.setFilename("testdata/fernerkundung_albedo.mxd"); - reader.setFilename("testdata/gevu.mxd"); + + String path = System.getProperty("mxd.file"); + if (path.equals("${MXDFILE}")) { + System.out.println("No valid MXD file. Use ant parameter" + + " \"-DMXDFILE=path/to/file.mxd\"."); + System.exit(-1); + } + reader.setFilename(path); reader.read(); reader.shutdown();