[Mapbender-commits] r4607 - branches/ur_dev/install

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 10 04:06:18 EDT 2009


Author: uli
Date: 2009-09-10 04:06:17 -0400 (Thu, 10 Sep 2009)
New Revision: 4607

Modified:
   branches/ur_dev/install/class_dia.php
   branches/ur_dev/install/update.php
Log:


Modified: branches/ur_dev/install/class_dia.php
===================================================================
--- branches/ur_dev/install/class_dia.php	2009-09-09 15:11:22 UTC (rev 4606)
+++ branches/ur_dev/install/class_dia.php	2009-09-10 08:06:17 UTC (rev 4607)
@@ -18,6 +18,8 @@
 		
 		$this->xp->registerNamespace('dia', 'http://www.lysator.liu.se/~alla/dia/');
 		return true;
+		
+		
 		$tables = $xp->query("//dia:layer[@name='Background']/dia:object[@type='UML - Class']");
 		fwrite(STDOUT, "Found ".$tables->length." composites\n");
 		$i = 0;
@@ -60,13 +62,33 @@
 	
 	public function getTables(){
 		
-		$tables = $xp->query("//dia:layer[@name='Background']/dia:object[@type='UML - Class']");
-		foreach ($tables as $table){
-			
+		$arrayTableNames = array();
+		$tables = $this->getTabeleBasicNode();
+		foreach($tables as $table){
+			array_push($arrayTableNames, $this->removeHash($table->firstChild->nodeValue));
 		}
+		return $arrayTableNames;
 	}
+	private function removeHash($string){
+		//this could be a problem if the columnname contains a #
+		return str_replace("#","",$string);
+		
+	}
+	private function getTabeleBasicNode(){
+		$xpString = "//dia:layer[@name='Background']/dia:object[@type='UML - Class']";
+		$xpString .= "/dia:attribute[@name='name']";		
+		return $this->xp->query($xpString);
+	}
 	public function getColumns($tablename){
 		
+		$arrayTableColumns = array();
+		$tables = $this->getTabeleBasicNode();
+		foreach($tables as $table){
+			if($this->removeHash($table->firstChild->nodeValue) == $tablename){
+				
+			}
+		}
+		return $arrayTableColumns;
 	}
 	public function getColumnType($tablename, $columnname){
 		

Modified: branches/ur_dev/install/update.php
===================================================================
--- branches/ur_dev/install/update.php	2009-09-09 15:11:22 UTC (rev 4606)
+++ branches/ur_dev/install/update.php	2009-09-10 08:06:17 UTC (rev 4607)
@@ -21,7 +21,10 @@
 $dia = new Dia();
 $dia->load($filename);
 //fwrite(STDOUT, "Hello $name");
-
+$tables = $dia->getTables();
+foreach($tables as $table){
+	fwrite(STDOUT, "Found Tables: ".$table."\n");
+}
 // Exit correctly
 exit(0);
 



More information about the Mapbender_commits mailing list