http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72981

Revision: 72981
Author:   jeroendedauw
Date:     2010-09-14 15:49:32 +0000 (Tue, 14 Sep 2010)

Log Message:
-----------
Changes for 0.7 - updated query printers to use Validator 0.4

Modified Paths:
--------------
    trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php
    trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_QueryPrinters.php

Modified: trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php
===================================================================
--- trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php      
2010-09-14 15:49:22 UTC (rev 72980)
+++ trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php      
2010-09-14 15:49:32 UTC (rev 72981)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * File holding abstract class SMMapPrinter.
+ * Abstract class that provides the common functionality for all map query 
printers.
  *
  * @file SM_MapPrinter.php
  * @ingroup SemanticMaps
@@ -10,22 +10,6 @@
  * @author Robert Buzink
  * @author Yaron Koren
  */
-
-if ( !defined( 'MEDIAWIKI' ) ) {
-       die( 'Not an entry point.' );
-}
-
-/**
- * Abstract class that provides the common functionality for all map query 
printers.
- *
- * @ingroup SemanticMaps
- *
- * @author Jeroen De Dauw
- * @author Robert Buzink
- * @author Yaron Koren
- * 
- * The adaptor pattern could be used to prevent this.
- */
 abstract class SMMapPrinter extends SMWResultPrinter implements 
iMappingFeature {
 
        /**
@@ -66,11 +50,6 @@
         * @var string
         */     
        protected $output = '';
-       
-       /**
-        * @var string
-        */     
-       protected $errorList;
 
        /**
         * @var array
@@ -161,7 +140,7 @@
                        }
                }
 
-               return array( $this->output . $this->errorList, 'noparse' => 
true, 'isHTML' => true );
+               return array( $this->output, 'noparse' => true, 'isHTML' => 
true );
        }
        
        /**
@@ -184,16 +163,19 @@
                $parameterInfo = array_merge_recursive( $parameterInfo, 
$this->service->getParameterInfo() );
                $parameterInfo = array_merge_recursive( $parameterInfo, 
$this->getSpecificParameterInfo() );
                
-               $manager = new ValidationManager();
+               $this->validator = new Validator( $this->getName() );
                
-               $showMap = $manager->manageParsedParameters( $mapProperties, 
$parameterInfo );
+               $this->validator->setParameters( $mapProperties, $parameterInfo 
);
                
+               $this->validator->validateParameters();
+               
+               $showMap = $this->validator->hasFatalError();
+                       
                if ( $showMap ) {
-                       $this->setMapProperties( $manager->getParameters( false 
) );
+                       $this->validator->formatParameters();
+                       $this->setMapProperties( 
$this->validator->getParameterValues() );
                }
                
-               $this->errorList = $manager->getErrorList();
-               
                return $showMap;
        }
        

Modified: 
trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_QueryPrinters.php
===================================================================
--- trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_QueryPrinters.php   
2010-09-14 15:49:22 UTC (rev 72980)
+++ trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_QueryPrinters.php   
2010-09-14 15:49:32 UTC (rev 72981)
@@ -111,7 +111,7 @@
                        'limit' => array(
                                'type' => 'integer',
                                'criteria' => array(
-                                       'in_range' => array( 0 )
+                                       'in_range' => array( 0, false )
                                )
                        ),
                        'offset' => array(



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to