|
|
@@ -379,7 +379,7 @@ class Api_Wfs_GetFeature {
|
|
|
$xmlWriter->endElement(); // 'p5:next'
|
|
|
} else {
|
|
|
DBG::log("TODO: Not Implemented p5:links chldren '{$type}'");
|
|
|
- $xmlWriter->writeComment("TODO: Not implemented p5:links chldren '{$type}'");
|
|
|
+ $xmlWriter->writeComment("TODO: Not implemented p5:links children '{$type}'");
|
|
|
}
|
|
|
}
|
|
|
$xmlWriter->endElement(); // 'p5:links'
|
|
|
@@ -560,4 +560,23 @@ class Api_Wfs_GetFeature {
|
|
|
$xmlWriter->endElement();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static function printJsonFeatures($items, $acl, $showFields = []) {
|
|
|
+ header('Content-Type: text/json; charset=UTF-8');
|
|
|
+ // TODO: only fields with Read access, then filter by $showFields list if set
|
|
|
+ $outputBlobFormat = V::get('outputBlobFormat', 'base64', $_GET);
|
|
|
+ if ('default_db/COMPANIES_FV' === $acl->getNamespace()) {
|
|
|
+ $items = array_map(function ($item) use ($outputBlobFormat) {
|
|
|
+ if (1 == $item['DOKUMENT']) {
|
|
|
+ $item['DOKUMENT'] = ('base64' === $outputBlobFormat)
|
|
|
+ ? base64_encode( DB::getPDO()->getBlob('COMPANIES_FV', 'DOKUMENT', 'ID', $item['ID']) )
|
|
|
+ : Request::getPathUri() . "wfs-data.php?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetBlob&namespace=default_db/COMPANIES_FV&primaryKey={$item['ID']}&fieldName=DOKUMENT";
|
|
|
+ }
|
|
|
+ return $item;
|
|
|
+ }, $items);
|
|
|
+ }
|
|
|
+ echo json_encode($items);
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+
|
|
|
}
|