Changeset 1124

Show
Ignore:
Timestamp:
12/06/07 20:01:11 (9 months ago)
Author:
mikey
Message:

removed "use-firebug" switch, make decision depending on mode instead: no firebug error output only in mode PROD (subsequent implementation of enhancement #113)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/config/xml/json-rpc-service.xml

    r689 r1124  
    44    xmlns="http://stubbles.net/service/json-rpc"> 
    55  <service-url>${jsonrpc.service.url}</service-url> 
    6   <use-firebug>true</use-firebug> 
    76  <services> 
    87    <service name="MathService" className="net.stubbles.examples.service.MathService"/> 
  • trunk/examples/config/xml/json-rpc-service.xml

    r598 r1124  
    44    xmlns="http://stubbles.net/service/json-rpc"> 
    55  <service-url>http://localhost/?processor=jsonrpc</service-url> 
    6   <use-firebug>true</use-firebug> 
    76  <services> 
    87    <service name="MathService" className="net.stubbles.examples.service.MathService"/> 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessor.php

    r1007 r1124  
    99 * @subpackage  service_jsonrpc 
    1010 */ 
    11 stubClassLoader::load('net.stubbles.websites.processors.stubAbstractProcessor', 
    12                       'net.stubbles.util.validators.stubRegexValidator', 
    13                       'net.stubbles.util.validators.stubPassThruValidator', 
     11stubClassLoader::load('net.stubbles.ioc.stubBinder', 
     12                      'net.stubbles.lang.stubMode', 
    1413                      'net.stubbles.reflection.reflection', 
    1514                      'net.stubbles.service.annotations.stubWebMethodAnnotation', 
    1615                      'net.stubbles.service.jsonrpc.stubJsonRpcResponse', 
    17                       'net.stubbles.ioc.stubBinder' 
     16                      'net.stubbles.util.validators.stubPassThruValidator', 
     17                      'net.stubbles.util.validators.stubRegexValidator', 
     18                      'net.stubbles.websites.processors.stubAbstractProcessor' 
    1819); 
    1920/** 
     
    137138        $xjconf->parse($serviceConfigFile); 
    138139        $this->classMap = $xjconf->getConfigValue('services'); 
    139         $this->serviceConfig['use-firebug'] = $xjconf->getConfigValue('use-firebug'); 
    140  
    141         $cacheData = array( 
    142                        'classMap'      => $this->classMap, 
    143                        'serviceConfig' => $this->serviceConfig 
    144                      ); 
     140        $cacheData      = array('classMap'      => $this->classMap, 
     141                                'serviceConfig' => $this->serviceConfig 
     142                          ); 
    145143        file_put_contents($cacheFile, serialize($cacheData)); 
    146144    } 
     
    170168                $this->response->write($generator->generateJavascriptProxy($serviceConfig['className'], $jsClass)); 
    171169            } catch (Exception $e) { 
    172                 if (true === $this->serviceConfig['use-firebug']) { 
     170                if (stubMode::$CURRENT->name() !== 'PROD') { 
    173171                    $this->response->write("console.error('Generation of proxy for {$serviceConfig['className']} failed.');\n"); 
    174172                    $this->response->write($this->convertStringToFirebug($e->__toString())); 
     
    198196            $this->response->write($generator->generateSmd($classInfo['className'], $class)); 
    199197        } catch (Exception $e) { 
    200             if (true === $this->serviceConfig['use-firebug']) { 
     198            if (stubMode::$CURRENT->name() !== 'PROD') { 
    201199                $this->response->write("console.error('Generation of SMD for {$classInfo['className']} failed.');\n"); 
    202200                $this->response->write($this->convertStringToFirebug($e->__toString())); 
  • trunk/src/main/resources/xjconf/json-rpc-service.xml

    r588 r1124  
    44    <tag name="services" type="array" /> 
    55    <tag name="service-url" type="string" /> 
    6     <tag name="use-firebug" type="boolean" /> 
    76    <tag name="service" type="array" keyAttribute="name"> 
    87      <attribute name="name" type="string" required="true"/>