|
@@ -82,12 +82,17 @@ class Api_Wfs_GetFeature {
|
|
|
// TODO: add $contextAcl and context xpath to check for special perms by contextAcl
|
|
// TODO: add $contextAcl and context xpath to check for special perms by contextAcl
|
|
|
public static function printXmlFeatureRecurse($xmlWriter, $acl, $item, $showFields, $tagName, $attrs = [], $showAdvancedAttrs = false, $schemaCache = [], $printedFidLog = []) {
|
|
public static function printXmlFeatureRecurse($xmlWriter, $acl, $item, $showFields, $tagName, $attrs = [], $showAdvancedAttrs = false, $schemaCache = [], $printedFidLog = []) {
|
|
|
$dbgFid = V::get('fid', 0, $attrs);
|
|
$dbgFid = V::get('fid', 0, $attrs);
|
|
|
- if ($dbgFid) $printedFidLog[] = $dbgFid;
|
|
|
|
|
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");
|
|
|
DBG::log($item, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$item)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$item");
|
|
DBG::log($item, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$item)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$item");
|
|
|
DBG::log($showFields, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$item)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$showFields");
|
|
DBG::log($showFields, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$item)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$showFields");
|
|
|
DBG::log([$attrs, $showAdvancedAttrs, array_keys($schemaCache), $printedFidLog], 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$attrs, \$showAdvancedAttrs, keys(\$schemaCache), \$printedFidLog)");
|
|
DBG::log([$attrs, $showAdvancedAttrs, array_keys($schemaCache), $printedFidLog], 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$attrs, \$showAdvancedAttrs, keys(\$schemaCache), \$printedFidLog)");
|
|
|
|
|
+ if ($dbgFid) {
|
|
|
|
|
+ if (in_array($dbgFid, $printedFidLog)) {
|
|
|
|
|
+ DBG::log("TODO: in_array({$dbgFid}, \$printedFidLog)");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($dbgFid) $printedFidLog[] = $dbgFid;
|
|
|
// $rootWfsNs = 'p5';
|
|
// $rootWfsNs = 'p5';
|
|
|
list($itemPrefix, $localName) = explode(':', $tagName);
|
|
list($itemPrefix, $localName) = explode(':', $tagName);
|
|
|
|
|
|
|
@@ -96,14 +101,7 @@ class Api_Wfs_GetFeature {
|
|
|
$xlink = $item['xlink'];
|
|
$xlink = $item['xlink'];
|
|
|
list($xlinkUrl, $xlinkFid) = explode('#', $xlink);
|
|
list($xlinkUrl, $xlinkFid) = explode('#', $xlink);
|
|
|
|
|
|
|
|
- // } else if (1 == count($item[$fldName]) && !empty($item[$fldName][0]['xlink'])) {
|
|
|
|
|
- // $xmlWriter->writeComment("TODO: xlinks for '{$fldName}'"); // TODO: DBG
|
|
|
|
|
- DBG::log($item[$fldName], 'array', "TODO: xlinks for '{$tagName}'");
|
|
|
|
|
- // $xlink = $item[$fldName][0]['xlink'];
|
|
|
|
|
- // $xlinkParts = explode(':', $xlink);
|
|
|
|
|
- // if (2 != count($xlinkParts)) throw new Exception("Error Processing Request - wrong xlink format for ".$acl->getName().".{$itemKey}/{$fldName}");
|
|
|
|
|
- // $xlinkParts[0] = Api_WfsNs::getNsUri($xlinkParts[0]);
|
|
|
|
|
- // $xlink = implode('#', $xlinkParts);
|
|
|
|
|
|
|
+ DBG::log($item[$fldName], 'array', "xlinks for '{$tagName}'");
|
|
|
$xmlWriter->startElement($tagName);
|
|
$xmlWriter->startElement($tagName);
|
|
|
foreach ($attrs as $name => $value) {
|
|
foreach ($attrs as $name => $value) {
|
|
|
$xmlWriter->writeAttribute($name, $value);
|
|
$xmlWriter->writeAttribute($name, $value);
|
|
@@ -182,7 +180,7 @@ class Api_Wfs_GetFeature {
|
|
|
if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("Error Processing Request - field is not ref or missing acl ".$acl->getName().".{$itemKey}/{$fldName}");
|
|
if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("Error Processing Request - field is not ref or missing acl ".$acl->getName().".{$itemKey}/{$fldName}");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- DBG::log($schemaCache[$fieldNs], 'array', "TODO: xxxxxxx ".$acl->getName().".{$itemKey}/{$fldName}");
|
|
|
|
|
|
|
+ DBG::log($schemaCache[$fieldNs], 'array', "fetch child acl ".$acl->getName().".{$itemKey}/{$fldName}");
|
|
|
$childAcl = Core_AclHelper::getAclByNamespace($schemaCache[$fieldNs]['namespace'], false, $schemaCache[$fieldNs]);
|
|
$childAcl = Core_AclHelper::getAclByNamespace($schemaCache[$fieldNs]['namespace'], false, $schemaCache[$fieldNs]);
|
|
|
$childName = $schemaCache[$fieldNs]['name'];
|
|
$childName = $schemaCache[$fieldNs]['name'];
|
|
|
foreach ($item[$fldName] as $childItem) {
|
|
foreach ($item[$fldName] as $childItem) {
|