[Mapbender-commits] r7042 - in trunk/mapbender: http/classes resources/db/pgsql/UTF-8/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Oct 14 14:46:41 EDT 2010


Author: armin11
Date: 2010-10-14 11:46:40 -0700 (Thu, 14 Oct 2010)
New Revision: 7042

Modified:
   trunk/mapbender/http/classes/class_metadata_new.php
   trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
Log:
Add a new possibility to define a hidden custom category for wmc docs. This docs can be used as a intro configurations for different questions. We now have a title, an abstract and some metadata for those confs ;-)

Modified: trunk/mapbender/http/classes/class_metadata_new.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata_new.php	2010-10-12 14:25:33 UTC (rev 7041)
+++ trunk/mapbender/http/classes/class_metadata_new.php	2010-10-14 18:46:40 UTC (rev 7042)
@@ -203,6 +203,7 @@
 				$this->databaseTableName = 'wfs_featuretype';
 				//$this->keywordRelation = 'wfs_featuretype_keyword';
 				$this->searchView = 'search_wfs_view';
+				$this->whereStrCatExtension = "";
 				switch ($this->orderBy) {
 					case "rank":
 						$this->orderBy = " ORDER BY wfs_id,featuretype_id,wfs_conf_id ";
@@ -228,6 +229,8 @@
 				$this->databaseTableName = 'layer';
 				//$this->keywordRelation = 'layer_keyword';
 				$this->searchView = 'wms_search_table';
+				//$this->searchView = 'wms_search_view';
+				$this->whereStrCatExtension = "";
 				switch ($this->orderBy) {
 					case "rank":
 						$this->orderBy = " ORDER BY load_count DESC";
@@ -252,6 +255,8 @@
 				$this->searchView = 'search_wmc_view';
 				$this->databaseIdColumnName = 'wmc_serial_id';
 				$this->databaseTableName = 'wmc';
+				//the following is needed to give a special filter to the custom cat table!
+				$this->whereStrCatExtension = "custom_category.custom_category_hidden != 1";
 
 				switch ($this->orderBy) {
 					case "rank":
@@ -271,6 +276,7 @@
 				}
 				
 				$this->resourceClasses = array(0,1,2); #TODO adopt to count classifications
+				#$this->resourceClasses = array();		
 				$this->generateWMCMetadata($this->wmcDoc);
 			}
 		}
@@ -1152,8 +1158,12 @@
 						$sqlCat[$i] .= $this->resourceClassifications[$i]['tablename']."_id=";
 						$sqlCat[$i] .= $this->resourceClassifications[$i]['relation_'.$this->searchResources].".fkey_";
 						$sqlCat[$i] .= $this->resourceClassifications[$i]['tablename']."_id)";
-						$sqlCat[$i] .= " WHERE ".$whereStr."  GROUP BY ";
-
+						//the following is needed to filter the custom cats for those which should not be seen in the classification
+						if ($this->resourceClassifications[$i]['title'] != "Custom"){
+							$sqlCat[$i] .= " WHERE ".$whereStr." GROUP BY ";
+						} else {
+							$sqlCat[$i] .= " WHERE ".$whereStr.$this->whereStrCatExtension." GROUP BY ";
+						}
 						$sqlCat[$i] .= $this->resourceClassifications[$i]['tablename'].".";
 						$sqlCat[$i] .= $this->resourceClassifications[$i]['tablename']."_id,";
 						$sqlCat[$i] .= $this->resourceClassifications[$i]['tablename'].".";
@@ -1163,6 +1173,7 @@
 
 						//call sql for count of category
 						$res = db_prep_query($sqlCategory, $v, $t);
+						$e = new mb_exception("class_metadata: countCatsql: ".$sqlCategory);
 						$categoryCounts = db_fetch_all($res);
 						//if none found: $categoryCounts=false
 						#echo "<br>count sub categories :".$categoryCounts."<br>";

Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql	2010-10-12 14:25:33 UTC (rev 7041)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql	2010-10-14 18:46:40 UTC (rev 7042)
@@ -2986,5 +2986,12 @@
   ON wmc_load_count
   USING btree
   (fkey_wmc_serial_id);
+-- Column: custom_category_hidden
 
+-- ALTER TABLE custom_category DROP COLUMN custom_category_hidden;
 
+ALTER TABLE custom_category ADD COLUMN custom_category_hidden integer;
+ALTER TABLE custom_category ALTER COLUMN custom_category_hidden SET STORAGE plain;
+-- one special category as options to start mapbender geoportal 
+insert into custom_category (custom_category_key, custom_category_code_en,custom_category_code_de,custom_category_hidden) values ('mbc1','special standard wmc documents','Spezielle Standard WMC Dokumente',1);
+



More information about the Mapbender_commits mailing list