Explorar o código

updated Ant url action

Piotr Labudda %!s(int64=9) %!d(string=hai) anos
pai
achega
a6fcbf23ab
Modificáronse 1 ficheiros con 10 adicións e 10 borrados
  1. 10 10
      SE/se-lib/Route/UrlAction/Ant.php

+ 10 - 10
SE/se-lib/Route/UrlAction/Ant.php

@@ -51,14 +51,14 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
       echo UI::h('h1', [], "Ant action");
       $path = V::get('path', '', $_GET);
       if (!$path) throw new Exception("Missing Ant path!");
-      $featureID = V::get('featureID', '', $_GET);
+      $primaryKey = V::get('primaryKey', '', $_GET);
       $typeName = V::get('typeName', '', $_GET);
-      $typeName_dot = explode(':', $typeName);// TODO: get wfs prefix from typeName
+      list($nsPrefix, $objectName) = explode(':', $typeName);// TODO: get wfs prefix from typeName
 
       // TODO: validate missing ...
-      DBG::nicePrint($path, '$path');
-      DBG::nicePrint($featureID, '$featureID');
-      DBG::nicePrint($typeName, '$typeName');
+      DBG::log([ 'msg'=>'$path', '$path'=>$path]);
+      DBG::log([ 'msg'=>'$primaryKey', '$primaryKey'=>$primaryKey]);
+      DBG::log([ 'msg'=>'$typeName', '$typeName'=>$typeName]);
 
       $taskList = $this->getAntUrlActionList();
       if (!array_key_exists($path, $taskList)) throw new Exception("Ant path not exists! '{$path}'");
@@ -67,14 +67,14 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
 
       $webRootUrl = Request::getPathUri() . "schema/ant-url_action/{$path}";// TODO: security - only for test
       $outputFunctionUrl = Request::getPathUri() . "index.php?_route=UrlAction_Ant&_task=output&path={$path}&file=";
-      DBG::nicePrint($webRootUrl, '$webRootUrl');
-      DBG::nicePrint($outputFunctionUrl, '$outputFunctionUrl');
-      $testUrl = Request::getPathUri() . "wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=".$typeName."&SRSNAME=EPSG:3003&featureID=".$typeName_dot[1].".".$featureID ;
+      DBG::log([ 'msg'=>'$webRootUrl', '$webRootUrl'=>$webRootUrl]);
+      DBG::log([ 'msg'=>'$outputFunctionUrl', '$outputFunctionUrl'=>$outputFunctionUrl]);
+      $testUrl = Request::getPathUri() . "wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=".$typeName."&SRSNAME=EPSG:3003&featureID={$objectName}.{$primaryKey}";
       $cryptedPass = base64_encode(User::getLogin() . ":" . Crypt::decrypt($_SESSION['ADM_PASS_HASH']));
       $cmd = "cd {$this->pathUrlActions}{$path} && {$this->antBin} -S  -DoutputFunctionUrl='{$outputFunctionUrl}' -DwebRootUrl='{$webRootUrl}' -Durl='{$testUrl}' -DpasswordBase64Basic='{$cryptedPass}' 2>&1";
-      DBG::nicePrint(str_replace(APP_PATH_ROOT, 'SE', $cmd), 'command');
+      DBG::log([ 'msg'=>"cmd", 'cmd'=>str_replace(APP_PATH_ROOT, 'SE', $cmd) ]);
       V::exec($cmd, $out, $ret);
-      DBG::nicePrint($out, 'output');
+      DBG::log([ 'msg'=>"cmd and returns({$ret})", 'output'=>$out ]);
       $html = []; $startRead = false;
       foreach ($out as $line) {
         if (!$startRead) {