Explorar o código

fixed root arg in GetFeature print recurse

Piotr Labudda %!s(int64=8) %!d(string=hai) anos
pai
achega
79f03139da
Modificáronse 2 ficheiros con 4 adicións e 2 borrados
  1. 3 2
      SE/se-lib/Api/Wfs/GetFeature.php
  2. 1 0
      SE/se-lib/Api/WfsDataServer.php

+ 3 - 2
SE/se-lib/Api/Wfs/GetFeature.php

@@ -317,6 +317,7 @@ class Api_Wfs_GetFeature {
 		$attrs = V::get('xsdAttributes', [], $params, 'array');
 		$attrs = V::get('xsdAttributes', [], $params, 'array');
 		$showAdvancedAttrs = V::get('showAdvancedAttrs', false, $params, 'bool');
 		$showAdvancedAttrs = V::get('showAdvancedAttrs', false, $params, 'bool');
 		$dbgFid = V::get('fid', 0, $attrs);
 		$dbgFid = V::get('fid', 0, $attrs);
+		$isRoot = V::get('root', false, $params, 'bool');
 		$outputBlobFormat = V::get('outputBlobFormat', '', $params, 'word');
 		$outputBlobFormat = V::get('outputBlobFormat', '', $params, 'word');
 		if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: print Xml Feature Recurse... '{$tagName}'" . ( $dbgFid ? " fid='{$dbgFid}'" : "" )); // TODO: DBG
 		if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: print Xml Feature Recurse... '{$tagName}'" . ( $dbgFid ? " fid='{$dbgFid}'" : "" )); // TODO: DBG
 		// DBG::log($acl, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$acl)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$acl");
 		// DBG::log($acl, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$acl)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$acl");
@@ -420,8 +421,8 @@ class Api_Wfs_GetFeature {
 			DBG::log(">>> loop {$idZasob} => {$fldName}...");
 			DBG::log(">>> loop {$idZasob} => {$fldName}...");
 			$fldType = $acl->getXsdFieldType($fldName);
 			$fldType = $acl->getXsdFieldType($fldName);
 			DBG::log(">>> loop '{$fldName}' xsdType: '{$fldType}'");
 			DBG::log(">>> loop '{$fldName}' xsdType: '{$fldType}'");
-			if (!$acl->canReadObjectField($fldName, (object)$item)) if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: skip - !canReadObjectField('{$fldName}')"); // TODO: DBG
-			if (!$acl->canReadObjectField($fldName, (object)$item)) continue;
+			if (!$acl->canReadObjectField($fldName, (object)$item)) if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: skip - !canReadObjectField('{$fldName}') isRoot({$isRoot})"); // TODO: DBG
+			if (!$acl->canReadObjectField($fldName, (object)$item) && !$isRoot) continue;
 			DBG::log(">>> loop '{$fldName}' can read...");
 			DBG::log(">>> loop '{$fldName}' can read...");
 
 
 			if ($geomFld != null && $fldName == $geomFld) {
 			if ($geomFld != null && $fldName == $geomFld) {

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

@@ -275,6 +275,7 @@ class Api_WfsDataServer extends Api_WfsServerBase {
 				),
 				),
 				'showAdvancedAttrs' => !$simple,
 				'showAdvancedAttrs' => !$simple,
 				'outputBlobFormat' => $args['outputBlobFormat'],
 				'outputBlobFormat' => $args['outputBlobFormat'],
+				'root' => $args['root'],
 			], $schemaCache);
 			], $schemaCache);
 			$xmlWriter->endElement();// gml:featureMember
 			$xmlWriter->endElement();// gml:featureMember
 		}
 		}