Sfoglia il codice sorgente

added getNamespace to ACL objects

Piotr Labudda 9 anni fa
parent
commit
5ff2beb459

+ 1 - 2
SE/se-lib/Api/WfsDataServer.php

@@ -220,7 +220,6 @@ class Api_WfsDataServer extends Api_WfsServerBase {
 		$xmlWriter->writeAttribute('xsi:schemaLocation', "{$wfsNsUri} {$featureTypeUri}");
 
 		if($DBG){echo '(geomFld: '.$geomFld.'):';print_r($acl->getFieldType($geomFld));echo "\n";}
-		$sourceName = $acl->getSourceName();
 		$tblName = $acl->getName();
 		foreach ($items as $itemKey => $item) {
 			if (!is_array($item)) $item = (array)$item;
@@ -231,7 +230,7 @@ class Api_WfsDataServer extends Api_WfsServerBase {
 			$xmlWriter->startElement('gml:featureMember');
 				$xmlWriter->startElement("{$wfsNs}:{$type}");
 					$xmlWriter->writeAttribute('fid', "{$type}.{$itemKey}");
-					if (!$simple) $xmlWriter->writeAttribute("{$rootWfsNs}:web_link", Request::getPathUri() . "index.php?_route=ViewTableAjax&typeName=p5_{$sourceName}:{$tblName}#EDIT/{$itemKey}");
+					if (!$simple) $xmlWriter->writeAttribute("{$rootWfsNs}:web_link", Request::getPathUri() . "index.php?_route=ViewTableAjax&namespace=" . $acl->getNamespace() . "#EDIT/{$itemKey}");
 					foreach ($fldList as $idZasob => $fldName) {
 						if($DBG_DS){echo ">>> loop({$itemKey}) item({$item['ID']}) fld({$fldName}): ";var_dump($item[$fldName]);echo"\n";}
 						$fldType = $acl->getXsdFieldType($fldName);

+ 1 - 7
SE/se-lib/Api/WfsServerBase.php

@@ -1413,13 +1413,7 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
 			$cTypeNode = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:complexType');
 			$rootNode->appendChild($cTypeNode);
 			$cTypeNode->setAttribute('name', $typeName);
-			if (!$simple) {
-				$sourceName = $acl->getSourceName();
-				if ('default_db' == $sourceName) {
-					$tblName = $acl->getName();
-					$cTypeNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:web_link", Request::getPathUri() . "index.php?_route=ViewTableAjax&typeName=p5_{$sourceName}:{$tblName}");
-				}
-			}
+			if (!$simple) $cTypeNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:web_link", Request::getPathUri() . "index.php?_route=ViewTableAjax&namespace=" . $acl->getNamespace());
 
 			$cConNode = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:complexContent');
 			$cTypeNode->appendChild($cConNode);

+ 1 - 0
SE/se-lib/Core/AclBase.php

@@ -11,6 +11,7 @@ Lib::loadClass('Api_WfsException');
 */
 class Core_AclBase {
 
+  public function getNamespace() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function getSourceName() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function getName() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function getRootTableName() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }

+ 1 - 0
SE/se-lib/Schema/AccessGroupStorageAcl.php

@@ -7,6 +7,7 @@ Lib::loadClass('ParseOgcFilter');
 
 class Schema_AccessGroupStorageAcl extends Core_AclBase {// Read only class
 
+  public function getNamespace() { return 'default_objects/' . $this->getName(); }
   public function getSourceName() { return 'objects'; }
   public function init($force = false) {}
   public function isInitialized() { return true; }

+ 1 - 0
SE/se-lib/Schema/AccessOwnerStorageAcl.php

@@ -5,6 +5,7 @@ Lib::loadClass('ParseOgcFilter');
 
 class Schema_AccessOwnerStorageAcl extends Core_AclBase {
 
+  public function getNamespace() { return 'default_objects/' . $this->getName(); }
   public function getSourceName() { return 'objects'; }
   public function init($force = false) {}
   public function isInitialized() { return true; }

+ 1 - 0
SE/se-lib/Schema/FileStorageAcl.php

@@ -6,6 +6,7 @@ Lib::loadClass('FileStorage');
 class Schema_FileStorageAcl extends Core_AclBase {
 
   public function __construct() {}
+  public function getNamespace() { return 'default_objects/' . $this->getName(); }
   public function getSourceName() { return 'objects'; }
   public function init($force = false) {}
   public function isInitialized() { return true; }

+ 1 - 0
SE/se-lib/Schema/KorespondencjaStorageAcl.php

@@ -9,6 +9,7 @@ class Schema_KorespondencjaStorageAcl extends Core_AclBase {
     $this->parentAcl = User::getAcl()->getObjectAcl('default_db', 'IN7_DZIENNIK_KORESP');
     // DBG::_(true, true, "parentAcl", $this->parentAcl, __CLASS__, __FUNCTION__, __LINE__);
   }
+  public function getNamespace() { return 'default_objects/' . $this->getName(); }
   public function getSourceName() { return 'objects'; }
   public function init($force = false) {}
   public function isInitialized() { return true; }

+ 1 - 0
SE/se-lib/Schema/TestPermsStorageAcl.php

@@ -9,6 +9,7 @@ class Schema_TestPermsStorageAcl extends Core_AclBase {
     $this->parentAcl = User::getAcl()->getObjectAcl('default_db', 'TEST_PERMS');
     // DBG::_(true, true, "parentAcl", $this->parentAcl, __CLASS__, __FUNCTION__, __LINE__);
   }
+  public function getNamespace() { return 'default_objects/' . $this->getName(); }
   public function getSourceName() { return 'objects'; }
   public function init($force = false) {}
   public function isInitialized() { return true; }

+ 1 - 0
SE/se-lib/TableAcl.php

@@ -37,6 +37,7 @@ class TableAcl extends Core_AclBase {
 	private $_schemaLoaded = false;
 
 	public function __construct($zasobID) { $this->_zasobID = $zasobID; }
+	public function getNamespace() { return 'default_db/' . $this->getName(); }
 	public function getSourceName() { return 'default_db'; }
 	public function getName() { return $this->_name; }
 	public function getRootTableName() { return $this->_name; }