|
|
@@ -37,6 +37,7 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
foreach ($taskList as $path => $label) {
|
|
|
echo UI::h('li', [], [
|
|
|
UI::h('a', [
|
|
|
+ 'class' => 'btn btn-md btn-link',
|
|
|
'href' => $this->getLink('ant', [
|
|
|
'path' => $path,
|
|
|
'typeName' => $typeName,
|
|
|
@@ -45,6 +46,23 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
])
|
|
|
], "Uruchom '{$label}'")
|
|
|
]);
|
|
|
+ $tmpls = $this->getAntUrlActionTemplates($path);
|
|
|
+ if (!empty($tmpls)) {
|
|
|
+ foreach ($tmpls as $tmpl => $labelTmpl) {
|
|
|
+ echo UI::h('div', [ 'style' => "padding-left: 50px" ], [
|
|
|
+ UI::h('a', [
|
|
|
+ 'href' => $this->getLink('ant', [
|
|
|
+ 'path' => $path,
|
|
|
+ 'template' => $tmpl,
|
|
|
+ 'typeName' => $typeName,
|
|
|
+ 'primaryKey' => $primaryKey,
|
|
|
+ 'primaryKeyField' => $pkField
|
|
|
+ ]),
|
|
|
+ 'class' => 'btn btn-sm btn-link',
|
|
|
+ ], '<i class="glyphicon glyphicon-arrow-right"></i> ' . $labelTmpl)
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
UI::endTag('ul');
|
|
|
} catch (Exception $e) {
|
|
|
@@ -82,6 +100,7 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
DBG::log($parsedInfo, '', "Ant parseTypeName({$typeName})");
|
|
|
$nsPrefix = $parsedInfo['prefix'];
|
|
|
$objectName = $parsedInfo['name'];
|
|
|
+ $template = V::get('template', '', $_GET);
|
|
|
|
|
|
// TODO: validate missing ...
|
|
|
DBG::log($_GET, 'array', '$_GET');
|
|
|
@@ -103,7 +122,7 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
$outputFunctionUrl = $this->getLink('output') . "&path={$path}&file=";
|
|
|
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}";
|
|
|
+ $testUrl = Request::getPathUri() . "wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&TYPENAME={$typeName}&SRSNAME=EPSG:3003&featureID={$objectName}.{$primaryKey}";// &REQUEST=GetFeature
|
|
|
$cryptedPass = base64_encode(User::getLogin() . ":" . Crypt::decrypt($_SESSION['ADM_PASS_HASH']));
|
|
|
$uniqID = session_id();// TODO: uniq id for every request
|
|
|
// $cmd = "{$this->pathUrlActions}{$path}/do_build.sh";
|
|
|
@@ -116,6 +135,7 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
$cmd .= " -Dxpath={$pkField}";
|
|
|
$cmd .= " -Dxpath_value={$primaryKey}";
|
|
|
$cmd .= " -DtypeName=\"{$typeName}\"";
|
|
|
+ if ($template) $cmd .= " {$template} ";
|
|
|
$cmd .= " 2>&1";
|
|
|
|
|
|
$pathCmd = [];
|
|
|
@@ -141,9 +161,12 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
if (empty($out)) throw new Exception("Empty output");
|
|
|
if ($useShellExec) $out = explode("\n", $out);
|
|
|
|
|
|
+ $outputType = 'HTML';
|
|
|
$html = []; $startRead = false;
|
|
|
foreach ($out as $line) {
|
|
|
if (!$startRead) {
|
|
|
+ if ('OUTPUT__TYPE__XML' == $line) $outputType = 'XML';
|
|
|
+ if ('OUTPUT__TYPE__HTML' == $line) $outputType = 'HTML';
|
|
|
if ('OUTPUT__START' == $line) {
|
|
|
$startRead = true;
|
|
|
continue;
|
|
|
@@ -158,8 +181,11 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
|
|
|
}
|
|
|
if (empty($html)) UI::alert('danger', "Empty output!");
|
|
|
else {
|
|
|
- // echo UI::h('pre', [], htmlspecialchars(implode("\n", $html)));
|
|
|
- echo UI::h('div', ['class'=>"container", 'style'=>"padding:12px; border:1px solid #ddd"], $html);
|
|
|
+ if ('XML' == $outputType) {
|
|
|
+ echo UI::h('pre', [], htmlspecialchars(implode("\n", $html)));
|
|
|
+ } else if ('HTML' == $outputType) {
|
|
|
+ echo UI::h('div', ['class'=>"container", 'style'=>"padding:12px; border:1px solid #ddd"], $html);
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
UI::alert('danger', $e->getMessage());
|