فهرست منبع

added ogc:Filter in AclQueryFeatures

Piotr Labudda 9 سال پیش
والد
کامیت
afccff30f7
2فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 9 1
      SE/se-lib/AclQueryFeatures.php
  2. 1 1
      SE/se-lib/Route/Debug.php

+ 9 - 1
SE/se-lib/AclQueryFeatures.php

@@ -2,6 +2,7 @@
 
 
 Lib::loadClass('ACL');
 Lib::loadClass('ACL');
 Lib::loadClass('SqlQueryWhereBuilder');
 Lib::loadClass('SqlQueryWhereBuilder');
+Lib::loadClass('ParseOgcFilter');
 
 
 // usage: (Acl class)::buildQuery($params): return new AclQueryFeatures($this, $params);
 // usage: (Acl class)::buildQuery($params): return new AclQueryFeatures($this, $params);
 //        (view): $queryFeatures = $acl->buildQuery($params);
 //        (view): $queryFeatures = $acl->buildQuery($params);
@@ -241,6 +242,13 @@ class AclQueryFeatures {
     return (!empty($orWhere)) ? [null, 'or', $orWhere] : null;
     return (!empty($orWhere)) ? [null, 'or', $orWhere] : null;
   }
   }
 
 
+  public function parseOgcFilter($ogcFilter) {
+    $parser = new ParseOgcFilter();
+    $parser->loadOgcFilter($ogcFilter);
+    $queryWhereBuilder = $parser->convertToSqlQueryWhereBuilder();
+    return $queryWhereBuilder->getQueryWhere($this->_fromPrefix);
+  }
+
   public function getQuery() {
   public function getQuery() {
     if ($this->_query) return $this->_query;
     if ($this->_query) return $this->_query;
     // $ds = $this->_acl->getDataSource(); // TODO: only for TableAcl // TODO: move _parseSqlWhere to this class
     // $ds = $this->_acl->getDataSource(); // TODO: only for TableAcl // TODO: move _parseSqlWhere to this class
@@ -269,7 +277,7 @@ class AclQueryFeatures {
           default: throw new Exception("Not Implemented special filter '".substr($k, 3)."'");
           default: throw new Exception("Not Implemented special filter '".substr($k, 3)."'");
         }
         }
       } else if ('ogc:Filter' == $k) {
       } else if ('ogc:Filter' == $k) {
-        throw new Exception("Not Implemented ogc:Filter");
+        $this->_query->where($this->parseOgcFilter($v));
       } else if ('primaryKey' == $k) {
       } else if ('primaryKey' == $k) {
         $fieldName = $this->_acl->getPrimaryKeyField();
         $fieldName = $this->_acl->getPrimaryKeyField();
         $fieldType = $this->_acl->getXsdFieldType($fieldName);
         $fieldType = $this->_acl->getXsdFieldType($fieldName);

+ 1 - 1
SE/se-lib/Route/Debug.php

@@ -238,7 +238,7 @@ class Route_Debug extends RouteBase {
     UI::gora();
     UI::gora();
     // UI::menu();
     // UI::menu();
     UI::setTitle("Debug");
     UI::setTitle("Debug");
-    echo UI::h('div', ['class'=>'container'], [
+    echo UI::h('div', ['class'=>'container', 'style'=>'position:fixed; top:0; left:0; background-color:#ddd; padding:3px; width:100%'], [
       UI::h('a', ['href'=>$this->getLink()], "wróć"),
       UI::h('a', ['href'=>$this->getLink()], "wróć"),
       UI::h('span', ['style'=>'padding:0 6px'], "|"),
       UI::h('span', ['style'=>'padding:0 6px'], "|"),
       UI::h('span', ['class' => 'label label-'.(DBG::isActive() ? "success" : "danger")], "(Debug - " . (DBG::isActive() ? "włączony" : "wyłączony") . ") "),
       UI::h('span', ['class' => 'label label-'.(DBG::isActive() ? "success" : "danger")], "(Debug - " . (DBG::isActive() ? "włączony" : "wyłączony") . ") "),