diff src/java/de/intevation/mxd/reader/MXDReader.java @ 40:a1bc7220efe7

Updated the mxd reader.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 14 Apr 2011 11:25:57 +0200
parents 472aa36d0e01
children ef7ca23c4233
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/MXDReader.java	Thu Apr 14 11:09:35 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/MXDReader.java	Thu Apr 14 11:25:57 2011 +0200
@@ -30,6 +30,7 @@
     //Member
     private String filename = "";
     private ArcGISInitializer initializer = null;
+    private MapToXMLUtils util;
     private IMap map;
 
     private static final Logger logger = Logger.getLogger(MXDReader.class);
@@ -38,6 +39,7 @@
     public MXDReader() throws IOException{
         logger.debug("constructor()");
         initializer = new ArcGISInitializer();
+        util = new MapToXMLUtils();
     }
 
 
@@ -93,11 +95,18 @@
             throw new IOException("Please set filename!");
         }
         else{
+            util.addFilename(filename);
             openMapDocument();
-            MapReader mreader = new MapReader (map);
-            MapToXMLUtils util = new MapToXMLUtils();
-            mreader.setUtil(util);
-            mreader.read();
+            MapReader mreader;
+            try {
+                mreader = new MapReader (map);
+                mreader.setUtil(util);
+                mreader.read();
+
+            }
+            catch(Exception e) {
+                e.printStackTrace();
+            }
 
             for(int i = 0; i < map.getLayerCount();i++){
                 ILayer layer = map.getLayer(i);
@@ -176,7 +185,7 @@
 
     public Document getMapDocument(){
         logger.debug("getMapDocument()");
-        return null;
+        return util.getDocument();
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)