|
@@ -538,7 +538,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
|
|
|
$sourceStorage = SchemaFactory::loadDefaultObject('SystemSource');
|
|
$sourceStorage = SchemaFactory::loadDefaultObject('SystemSource');
|
|
|
$sourceItem = $sourceStorage->getItem($idStorage);
|
|
$sourceItem = $sourceStorage->getItem($idStorage);
|
|
|
if (!$sourceItem) throw new Exception("Storage id='{$idStorage}' not exists");
|
|
if (!$sourceItem) throw new Exception("Storage id='{$idStorage}' not exists");
|
|
|
- DBG::nicePrint($sourceItem, '$sourceItem');
|
|
|
|
|
|
|
+ DBG::log($sourceItem, 'array', '$sourceItem');
|
|
|
|
|
|
|
|
// TODO: fetch SystemObject childrens from $sourceItem:
|
|
// TODO: fetch SystemObject childrens from $sourceItem:
|
|
|
// 1. 'SystemSource' -> getItems([ 'cols' => 'SystemObject/*', 'featureId' => $sourceItem['idZasob'] ])
|
|
// 1. 'SystemSource' -> getItems([ 'cols' => 'SystemObject/*', 'featureId' => $sourceItem['idZasob'] ])
|
|
@@ -550,6 +550,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
|
|
|
$objectStorage->getTotal();
|
|
$objectStorage->getTotal();
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
UI::alert('warning', $e->getMessage());
|
|
UI::alert('warning', $e->getMessage());
|
|
|
|
|
+ DBG::log($e);
|
|
|
$objectStorage->updateCache();
|
|
$objectStorage->updateCache();
|
|
|
UI::alert('info', "Lista obiketów zaktualizowana");
|
|
UI::alert('info', "Lista obiketów zaktualizowana");
|
|
|
}
|
|
}
|
|
@@ -602,108 +603,9 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
|
|
|
jQuery.notify(payload.msg, payload.type);
|
|
jQuery.notify(payload.msg, payload.type);
|
|
|
});
|
|
});
|
|
|
");
|
|
");
|
|
|
-
|
|
|
|
|
-return;
|
|
|
|
|
- echo '<hr>';
|
|
|
|
|
-
|
|
|
|
|
- $storagePdo = DB::getStorage($idStorage);
|
|
|
|
|
- $viewRealList = $storagePdo->getViewList();
|
|
|
|
|
- $tableRealList = $storagePdo->getTableList();
|
|
|
|
|
- $tableZasobList = array();
|
|
|
|
|
- foreach (DB::getPDO()->fetchAllByKey("
|
|
|
|
|
- select z.ID, z.`DESC`, z.A_STATUS
|
|
|
|
|
- from CRM_LISTA_ZASOBOW z
|
|
|
|
|
- where z.PARENT_ID = '{$idStorage}'
|
|
|
|
|
- ", $key = 'DESC') as $ind => $row) {
|
|
|
|
|
- $tableZasobList[strtolower($ind)] = $row;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $emptyItem = array();
|
|
|
|
|
- $emptyItem['nazwa'] = '';
|
|
|
|
|
- $emptyItem['type'] = '';
|
|
|
|
|
- $emptyItem['id_zasob'] = '';
|
|
|
|
|
- $emptyItem['struktura'] = '';
|
|
|
|
|
- $emptyItem['objectTest'] = '';
|
|
|
|
|
- $emptyItem['xsd'] = '';
|
|
|
|
|
- $emptyItem['isHist'] = '';
|
|
|
|
|
- $emptyItem['uwagi'] = '';
|
|
|
|
|
-
|
|
|
|
|
- $tableList = array();
|
|
|
|
|
- foreach ($tableRealList as $row) {
|
|
|
|
|
- $tblName = $row['table_name'];
|
|
|
|
|
- $tblItem = V::cloneArray($emptyItem);
|
|
|
|
|
- $tblItem['nazwa'] = $tblName;
|
|
|
|
|
- $tblItem['type'] = $row['table_type'];
|
|
|
|
|
- $tblItem['struktura'] = '<a href="index.php?_route=Storage&_task=tableStruct&idStorage=' . $idStorage . '&table=' . $tblName . '">' . "struct" . '</a>';
|
|
|
|
|
- $tblItem['xsd'] = '<a href="index.php?_route=Storage&_task=tableXsd&idStorage=' . $idStorage . '&table=' . $tblName . '" target="_blank">' . "xsd" . '</a>';
|
|
|
|
|
- $tblItem['objectTest'] = '<a href="index.php?_route=Storage&_task=objectTest&idStorage=' . $idStorage . '&table=' . $tblName . '">' . "objectTest" . '</a>';
|
|
|
|
|
- $tblItem['isHist'] = ('_hist' == substr($tblName, -5));
|
|
|
|
|
- $tblItem['uwagi'] = '';
|
|
|
|
|
- $tblZasob = V::get($tblName, '', $tableZasobList);
|
|
|
|
|
- if ($tblZasob) {
|
|
|
|
|
- $tableZasobList[$tblName]['_checked'] = true;
|
|
|
|
|
- $tblItem['id_zasob'] = $tblZasob['ID'];
|
|
|
|
|
- } else {
|
|
|
|
|
- $tblItem['uwagi'] .= 'TODO: ADD ZASOB';
|
|
|
|
|
- $ajaxAddZasobLink = Request::getPathUri() . "index.php?_route=Storage&_task=addTableToZasoby&idStorage={$idStorage}&tblName={$tblName}";
|
|
|
|
|
- $onClick = "return p5UI__ButtonAjax(this, 'p5UIBtnAjax:Storage:addTableToZasoby', { href: '{$ajaxAddZasobLink}' })";
|
|
|
|
|
- $tblItem['id_zasob'] = '<a onclick="'.$onClick.'" class="btn btn-xs btn-primary" href="#">TODO: ADD ZASOB</a>';
|
|
|
|
|
- }
|
|
|
|
|
- $tableList[] = $tblItem;
|
|
|
|
|
- }
|
|
|
|
|
- foreach ($viewRealList as $row) {
|
|
|
|
|
- $tblName = $row['table_name'];
|
|
|
|
|
- $tblItem = V::cloneArray($emptyItem);
|
|
|
|
|
- $tblItem['nazwa'] = $tblName;
|
|
|
|
|
- $tblItem['type'] = $row['table_type'];
|
|
|
|
|
- $tblItem['struktura'] = '<a href="index.php?_route=Storage&_task=tableStruct&idStorage=' . $idStorage . '&table=' . $tblName . '">' . "struct" . '</a>';
|
|
|
|
|
- $tblItem['uwagi'] = '';
|
|
|
|
|
- $tblZasob = V::get($tblName, '', $tableZasobList);
|
|
|
|
|
- if ($tblZasob) {
|
|
|
|
|
- $tableZasobList[$tblName]['_checked'] = true;
|
|
|
|
|
- $tblItem['id_zasob'] = $tblZasob['ID'];
|
|
|
|
|
- } else {
|
|
|
|
|
- $tblItem['uwagi'] .= 'TODO: ADD ZASOB';
|
|
|
|
|
- $tblItem['id_zasob'] = 'TODO: ADD ZASOB';
|
|
|
|
|
- }
|
|
|
|
|
- $tableList[] = $tblItem;
|
|
|
|
|
- }
|
|
|
|
|
- foreach ($tableZasobList as $tblName => $row) {
|
|
|
|
|
- if (!$row['_checked']) {
|
|
|
|
|
- $tblItem = V::cloneArray($emptyItem);
|
|
|
|
|
- $tblItem['nazwa'] = $tblName;
|
|
|
|
|
- $tblItem['id_zasob'] = $row['ID'];
|
|
|
|
|
- $tblItem['type'] = 'unknown';
|
|
|
|
|
- $tblItem['uwagi'] = 'TODO: nie istnieje w bazie danych';
|
|
|
|
|
- $tableList[] = $tblItem;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- usort($tableList, function($rowA, $rowB) {
|
|
|
|
|
- $a = $rowA['nazwa']; $b = $rowB['nazwa'];
|
|
|
|
|
- if ($a == $b) return 0;
|
|
|
|
|
- $a1 = substr($a, 0, 1); $b1 = substr($b, 0, 1);
|
|
|
|
|
- if (('_' == $a1 || '_' == $b1) && $a1 != $b1) {
|
|
|
|
|
- return ($a1 < $b1) ? 1 : -1;
|
|
|
|
|
- }
|
|
|
|
|
- return ($a < $b) ? -1 : 1;
|
|
|
|
|
- });
|
|
|
|
|
- DBG::table("tableList", $tableList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
- ?>
|
|
|
|
|
-<script>
|
|
|
|
|
-jQuery(document).on('p5UIBtnAjax:Storage:addTableToZasoby:click', function(e, n, payload) {
|
|
|
|
|
- console.log('event p5UIBtnAjax:Storage:addTableToZasoby:click', n, payload);
|
|
|
|
|
-});
|
|
|
|
|
-jQuery(document).on('p5UIBtnAjax:Storage:addTableToZasoby:ajaxLoaded', function(e, n, payload) {
|
|
|
|
|
- console.log('event p5UIBtnAjax:Storage:addTableToZasoby:ajaxLoaded', n, payload);
|
|
|
|
|
- if ('success' == payload.type && payload.body && payload.body.id > 0) {
|
|
|
|
|
- jQuery(n).parents('td').text(payload.body.id);
|
|
|
|
|
- }
|
|
|
|
|
- jQuery.notify(payload.msg, payload.type);
|
|
|
|
|
-});
|
|
|
|
|
-</script>
|
|
|
|
|
- <?php
|
|
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
|
|
+ DBG::log($e);
|
|
|
}
|
|
}
|
|
|
UI::endContainer();
|
|
UI::endContainer();
|
|
|
UI::dol();
|
|
UI::dol();
|
|
@@ -1663,15 +1565,13 @@ jQuery(document).on('p5UIBtnAjax:Storage:addTableToZasoby:ajaxLoaded', function(
|
|
|
UI::table([
|
|
UI::table([
|
|
|
'rows' => array_map(
|
|
'rows' => array_map(
|
|
|
function ($item) {
|
|
function ($item) {
|
|
|
- $exNs = explode('/', $item['namespace']);
|
|
|
|
|
- $name = array_pop($exNs);
|
|
|
|
|
- $typeName = implode('__x3A__', $exNs) . ':' . $name;
|
|
|
|
|
return [
|
|
return [
|
|
|
'ns' => $item['namespace'],
|
|
'ns' => $item['namespace'],
|
|
|
- 'nazwa' => $name,
|
|
|
|
|
|
|
+ 'nazwa' => $item['name'],
|
|
|
|
|
+ 'type' => $item['_type'],
|
|
|
'edit' => '<a href="index.php?_route=ViewTableAjax&namespace=' . $item['namespace'] . '">edit</a>',
|
|
'edit' => '<a href="index.php?_route=ViewTableAjax&namespace=' . $item['namespace'] . '">edit</a>',
|
|
|
- 'wfs Describe' => '<a href="wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&REQUEST=DescribeFeatureType&TYPENAME=' . $typeName . '">DescribeFeatureType</a>',
|
|
|
|
|
- 'wfs getFeature' => '<a href="wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&REQUEST=GetFeature&TYPENAME=' . $typeName . '&MAXFEATURES=10">GetFeature</a> (max:10)'
|
|
|
|
|
|
|
+ 'wfs Describe' => '<a href="wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&REQUEST=DescribeFeatureType&TYPENAME=' . $item['typeName'] . '">DescribeFeatureType</a>',
|
|
|
|
|
+ 'wfs getFeature' => '<a href="wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&REQUEST=GetFeature&TYPENAME=' . $item['typeName'] . '&MAXFEATURES=10">GetFeature</a> (max:10)'
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
, $acl->getItems([
|
|
, $acl->getItems([
|
|
@@ -1717,9 +1617,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:addTableToZasoby:ajaxLoaded', function(
|
|
|
|
|
|
|
|
public function reinstallAntAcl($item) {
|
|
public function reinstallAntAcl($item) {
|
|
|
Lib::loadClass('AntAclBase');
|
|
Lib::loadClass('AntAclBase');
|
|
|
- $exNs = explode('/', $item['namespace']);
|
|
|
|
|
- $name = array_pop($exNs);
|
|
|
|
|
- $antAclPath = APP_PATH_SCHEMA . DS . 'ant-object' . DS . implode('.', $exNs) . DS . $name;
|
|
|
|
|
|
|
+ $antAclPath = APP_PATH_SCHEMA . DS . 'ant-object' . DS . str_replace(['__x3A__', ':'], ['.', '/'], $item['typeName']);
|
|
|
if (!file_exists("{$antAclPath}/build.xml")) throw new Exception("Ant build file not exists");
|
|
if (!file_exists("{$antAclPath}/build.xml")) throw new Exception("Ant build file not exists");
|
|
|
DBG::log($antAclPath, 'string', '$antAclPath');
|
|
DBG::log($antAclPath, 'string', '$antAclPath');
|
|
|
$antBin = APP_PATH_WWW . DS . 'stuff' . DS . 'dita-ot-2.3.3' . DS . 'bin' . DS . 'ant';
|
|
$antBin = APP_PATH_WWW . DS . 'stuff' . DS . 'dita-ot-2.3.3' . DS . 'bin' . DS . 'ant';
|