|
|
@@ -33,6 +33,10 @@ class Api_Wfs_GetFeature {
|
|
|
$args['resolve'] = V::get('resolve', '', $rawArgs);
|
|
|
$args['resolveDepth'] = V::get('resolveDepth', 0, $rawArgs, 'int'); // TODO: if ('*' === resolveDepth) - recurse resolve
|
|
|
|
|
|
+ $args['backRefPK'] = V::get('backRefPK', '', $rawArgs);
|
|
|
+ $args['backRefNS'] = V::get('backRefNS', '', $rawArgs);
|
|
|
+ $args['backRefField'] = V::get('backRefField', '', $rawArgs);
|
|
|
+
|
|
|
$lowerArgs = array(); foreach ($rawArgs as $name => $value) $lowerArgs[ strtolower($name) ] = trim($value);
|
|
|
|
|
|
$args['xsd:type'] = V::get('typename', '', $lowerArgs);
|
|
|
@@ -346,6 +350,41 @@ class Api_Wfs_GetFeature {
|
|
|
$xmlWriter->endElement();// {$itemPrefix}:{$fldName}
|
|
|
return;
|
|
|
}
|
|
|
+ if (1 === count($item) && !empty($item['p5:links'])) {
|
|
|
+ DBG::log($item, 'array', "TODO: p5:links");
|
|
|
+ // array (
|
|
|
+ // 'p5:links' =>
|
|
|
+ // array (
|
|
|
+ // 'p5:next' =>
|
|
|
+ // array (
|
|
|
+ // '@typeName' => 'default_db__x3A__CRM_WSKAZNIK:CRM_WSKAZNIK',
|
|
|
+ // '@backRefPK' => '6125',
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // )
|
|
|
+ $xmlWriter->startElement('p5:links');
|
|
|
+ foreach ($item['p5:links'] as $type => $link) {
|
|
|
+ if ('p5:next' === $type) {
|
|
|
+ $xmlWriter->startElement('p5:next');
|
|
|
+ if (empty($link['@typeName'])) throw new Exception("Missing 'p5:links/p5:next/@typeName'");
|
|
|
+ if (empty($link['@backRefNS'])) throw new Exception("Missing 'p5:links/p5:next/@backRefNS'");
|
|
|
+ if (empty($link['@backRefPK'])) throw new Exception("Missing 'p5:links/p5:next/@backRefPK'");
|
|
|
+ if (empty($link['@startIndex'])) throw new Exception("Missing 'p5:links/p5:next/@startIndex'");
|
|
|
+ if (empty($link['value'])) throw new Exception("Missing 'p5:links/p5:next'");
|
|
|
+ $xmlWriter->writeAttribute("p5:typeName", $link['@typeName']);
|
|
|
+ $xmlWriter->writeAttribute("p5:backRefNS", $link['@backRefNS']);
|
|
|
+ $xmlWriter->writeAttribute("p5:backRefPK", $link['@backRefPK']);
|
|
|
+ $xmlWriter->writeAttribute("p5:startIndex", $link['@startIndex']);
|
|
|
+ $xmlWriter->text($link['value']); // str_replace('&', '&', $link['value'])
|
|
|
+ $xmlWriter->endElement(); // 'p5:next'
|
|
|
+ } else {
|
|
|
+ DBG::log("TODO: Not Implemented p5:links chldren '{$type}'");
|
|
|
+ $xmlWriter->writeComment("TODO: Not implemented p5:links chldren '{$type}'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $xmlWriter->endElement(); // 'p5:links'
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
$xmlWriter->startElement($tagName);
|
|
|
foreach ($attrs as $name => $value) {
|
|
|
@@ -403,8 +442,8 @@ class Api_Wfs_GetFeature {
|
|
|
if (!array_key_exists($fieldNs, $schemaCache)) {
|
|
|
// maybe only xlinks - acl not needed
|
|
|
$firstItem = reset($item[$fldName]);
|
|
|
- if (1 === count($firstItem) && !empty($firstItem['xlink'])) { // TODO: $schemaCache[$fieldNs] must exists for xlinks - xlmns is required
|
|
|
- foreach ($item[$fldName] as $childItem) {
|
|
|
+ if (1 === count($firstItem) && !empty($firstItem['xlink'])) {
|
|
|
+ foreach ($item[$fldName] as $childItem) { // xlink or p5:links
|
|
|
self::printXmlFeatureRecurse($xmlWriter, $childAcl = null, $childItem, [
|
|
|
'fields' => [],
|
|
|
'tagName' => $fldName,
|