Parcourir la source

Impromptu und db-run system-unabhängig, Transformer mit hinterlegtem Passwort

Rüschkamp il y a 2 mois
Parent
commit
5e1a23184a

+ 4 - 4
Tasks/scripts/Tools/controllers/ImpromptuController.php

@@ -23,7 +23,7 @@ class ImpromptuController
 		if (is_dir($imr)) {
 			$imrPath = $imr;
 			$newCat = strtolower($export);
-			$impCtrl->OpenCatalog($newCat, str_rot13($user), str_rot13($pw));
+			$impCtrl->OpenCatalog($newCat, str_rot13($user), str_rot13($pw), $imrPath);
 			$impCtrl->RenameCatalog($imrPath, strtolower($cat));
 			$impCtrl->Quit();
 			return;
@@ -58,10 +58,10 @@ class ImpromptuController
 		$this->app = new COM("CognosImpromptu.Application");
 	}
 
-	public function OpenCatalog ($catFile, $user, $pw) 
+	public function OpenCatalog ($catFile, $user, $pw, $imrPath) 
 	{
 		if (strpos($catFile, "\\") <= 0) {
-			$catFile = realpath(dirname(__FILE__)."/../../../../System/LOCOSOFT/Catalogs/"). "\\" . $catFile;
+			$catFile = realpath($imrPath."/../../Catalogs/"). "\\" . $catFile;
 		}
 		$this->app->OpenCatalog($catFile, "Ersteller", "", $user, $pw);
 		$this->catFile = $catFile;
@@ -104,7 +104,7 @@ class ImpromptuController
 		if ($catFile == "") {
 			$catFile = $this->openFileAndExtractCatInfo($imrFile);
 		}
-		$this->OpenCatalog($catFile, $user, $pw);
+		$this->OpenCatalog($catFile, $user, $pw, dirname($imrFile));
 		$this->report = $this->app->OpenReport($imrFile);			
 	}
 	

+ 2 - 1
Tasks/scripts/db_run.py

@@ -1,6 +1,7 @@
 from concurrent.futures import ThreadPoolExecutor
 from pathlib import Path
 import subprocess
+import sys
 
 
 def task(name):
@@ -16,4 +17,4 @@ def main(base_dir):
 
 
 if __name__ == '__main__':
-    main('C:\\GlobalCube\\System\\LOCOSOFT\\SQL\\batch')
+    main(f"C:\\GlobalCube\\System\\{sys.argv[1]}\\SQL\\batch")

+ 1 - 1
Tasks/scripts/transformer11.bat

@@ -7,7 +7,7 @@ echo == Modell "%~n1" ==
 copy /Y %PORTAL%\System\LOCOSOFT\Models\%~n1.pyj  %PORTAL%\System\LOCOSOFT\Models\gefuellt\%~n1.pyj
 
 
-%COGNOS11%\cogtr.exe -n -c -g -p%PORTAL:~0,-1%\System\LOCOSOFT\Models\gefuellt\%~n1.pyj" 
+%COGNOS11%\cogtr.exe -n -c -g -lGlobal1=Global1/Cognos#11 -p%PORTAL:~0,-1%\System\LOCOSOFT\Models\gefuellt\%~n1.pyj" 
 
 copy /Y %PORTAL%\System\LOCOSOFT\Logs\%~n1.log %TASKS%\logs