", " ", " ", " ID", " 1003", " ", " ", " ID", " 608", " ", " ", " ", ]; $listExampleProp = []; $listExampleProp['lvl1'] = [ " ID", " PARENT_ID", " TYPE", " DESC", " default_db__x3A__CRM_PROCES:PROCES", ]; $listExampleProp['lvl2'] = [ " ID", " PARENT_ID", " TYPE", " DESC", " default_db__x3A__CRM_PROCES:PROCES/ID", " default_db__x3A__CRM_PROCES:PROCES/PARENT_ID", " default_db__x3A__CRM_PROCES:PROCES/TYPE", " default_db__x3A__CRM_PROCES:PROCES/DESC", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES", ]; $listExampleProp['lvl2wsk'] = [ " ID", " PARENT_ID", " TYPE", " DESC", " OPIS", " path", " default_db__x3A__CRM_PROCES:PROCES/ID", " default_db__x3A__CRM_PROCES:PROCES/PARENT_ID", " default_db__x3A__CRM_PROCES:PROCES/TYPE", " default_db__x3A__CRM_PROCES:PROCES/DESC", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_WSKAZNIK:CRM_WSKAZNIK", " default_db__x3A__CRM_PROCES:PROCES_INIT/*", " ", " default_db__x3A__CRM_WSKAZNIK:CRM_WSKAZNIK/*", ]; $listExampleProp['lvl3'] = [ " ID", " PARENT_ID", " TYPE", " DESC", " OPIS", " path", " default_db__x3A__CRM_PROCES:PROCES/ID", " default_db__x3A__CRM_PROCES:PROCES/PARENT_ID", " default_db__x3A__CRM_PROCES:PROCES/TYPE", " default_db__x3A__CRM_PROCES:PROCES/DESC", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES/ID", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES/PARENT_ID", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES/TYPE", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES/DESC", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_PROCES:PROCES", " default_db__x3A__CRM_PROCES:PROCES/default_db__x3A__CRM_WSKAZNIK:CRM_WSKAZNIK/*", " default_db__x3A__CRM_PROCES:PROCES_INIT/*", " ", " default_db__x3A__CRM_WSKAZNIK:CRM_WSKAZNIK/*", ]; $exampleWfsRequestBody = "" . implode("\n", array_merge($listExampleProp['lvl1'], $exampleFltr)) . ""; UI::startContainer(); // Lib::loadClass('Vendor_Monolog'); // $logger = new Vendor_Monolog('dbg-logger-name'); // $logger->pushHandler(new StreamHandler('/tmp/monolog-test.log', Vendor_Monolog::WARNING)); // $logger->warning('Foo'); // $logger->error('Bar'); // // $logFile = '/tmp/monolog-test-json.log'; // $formatter = new JsonFormatter(); // // Create a handler // $stream = new StreamHandler($logFile, Vendor_Monolog::INFO); // $stream->setFormatter($formatter); // // bind it to a logger object // $securityLogger = new Vendor_Monolog('View Info'); // $securityLogger->pushHandler($stream); // $securityLogger->addInfo('debug message / label', [ 'dbg-object' => [ 'x' => 'y', 'z' ] ]); echo UI::h('textarea', [ 'id' => 'wfsRequestBody', 'style' => "width:100%; height:300px" ], htmlspecialchars($exampleWfsRequestBody)); echo UI::h('button', [ 'class' => "btn btn-primary", 'onClick' => "return sendWfsRequest(this)" ], "Wyslij"); echo UI::h('div', [ 'style' => "display:inline", 'id' => "wfs-example-btns" ]); echo UI::h('details', [ 'style' => "padding:6px; background-color:#333; color:#fff", 'open' => "open" ], [ UI::h('summary', [ 'style' => "padding:0 3px; outline:none; cursor:pointer" ], "WFS Response"), UI::h('pre', [ 'id' => 'wfsResponse', 'style' => "margin:0; font-size:x-small; border-radius:0" ], 'loading...'), ]); echo UI::h('details', [ 'style' => "padding:6px; background-color:#68cbfd; color:#fff" ], [ UI::h('summary', [ 'style' => "padding:0 3px; outline:none; cursor:pointer" ], [ UI::h('i',[ 'class' => "glyphicon glyphicon-question-sign" ]), " WFS 1.1, 2.0 fetch nested objects (traverse, resolve)", ]), UI::h('pre', ['style' => "margin:0; font-size:x-small; border-radius:0"], implode("\n", [ "WFS 1.1 - traverseXlinkDepth, traverseXlinkExpiry " . UI::h('a', ['href'=>"http://docs.opengeospatial.org/is/04-094r1/04-094r1.html#50"], "http://docs.opengeospatial.org/is/04-094r1/04-094r1.html#50"), "WFS 2.0 - resolve, resolveDepth, resolveTimeout " . UI::h('a', ['href'=>"http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#57"], "http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#57"), "", "WFS 1.1 traverseXlinkDepth type=\"string\" ('*' or int > 0) - recurse limit ('*' - no limit)", "WFS 1.1 traverseXlinkExpiry type=\"xsd:positiveInteger\" - timeOut in minutes", "WFS 1.1 Note: traverse used in wfs:GetFeature or inside wfs:Query tag wfs:XlinkPropertyName (same like wfs:PropertyName but with @traverse* attributes)", "", "WFS 2.0 resolve type=\"wfs:ResolveValueType\" default=\"none\" (enum: 'local', 'remote', 'all', 'none')", " - resolve=\"local\" - operation shall only resolve local references", " - resolve=\"remote\" - operation shall only resolve remote resource references", " - resolve=\"all\" - means that an operation shall resolve all resource references", " - resolve=\"none\" - means that an operation shall not resolve any resource references", "WFS 2.0 resolveDepth type=\"wfs:positiveIntegerWithStar\" default=\"*\" ('*' or int > 0) - recurse limit ('*' - no limit)", "WFW 2.0 resolveTimeout type=\"xsd:positiveInteger\" default=\"300\" - timeOut in seconds", "WFS 2.0 Note: resolve used in wfs:GetFeature or inside wfs:Query tag wfs:PropertyName", " in wfs:PropertyName may use resolvePath - @see " . UI::h('a', ['href'=>"http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#103"], "http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#103"), "", "WFS 2.0 resolve, resolveDepth example " . UI::h('a', ['href'=>"http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.ogc/ogc-schemas/2.2.0/ogc/wfs/2.0/examples/GetFeature/GetFeature_12.xml"], "http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.ogc/ogc-schemas/2.2.0/ogc/wfs/2.0/examples/GetFeature/GetFeature_12.xml"), ])), ]); UI::endContainer(); $examples = array_map(function ($props) use ($exampleFltr) { return "" . implode("\n", array_merge($props, $exampleFltr)) . ""; }, $listExampleProp); echo UI::h('script', [], " var examples = " . json_encode($examples) . "; console.log('examples', examples) function setWfsExample(i) { document.getElementById('wfsRequestBody').value = examples[i] sendWfsRequest() } for (var i in examples) { jQuery(document.getElementById('wfs-example-btns')).append('') } "); echo UI::h('script', [], " function sendWfsRequest() { document.getElementById('wfsResponse').innerHTML = 'loading...' var postBody = document.getElementById('wfsRequestBody').value.replace(/</g, '<').replace(/>/g, '>') console.log('wfsRequestBody:', postBody) p5WFS_GetFeature('default_db__x3A__CRM_PROCES:PROCES', { 'ogc:Filter': postBody, }).then(function (features) { console.log('features', features) document.getElementById('wfsResponse').innerHTML = JSON.stringify(features, null, 2) }).catch(function (e) { console.warn(e) document.getElementById('wfsResponse').innerHTML = JSON.stringify(e, null, 2) p5UI__notifyAjaxCallback({ type: 'error', msg: e }) }) return false } (function () { console.log('p5WFS_GetFeature(default_db__x3A__CRM_PROCES:PROCES, ...)') sendWfsRequest() })() "); } catch (Exception $e) { UI::alert('danger', $e); } UI::dol(); } }