Changeset 789

Show
Ignore:
Timestamp:
08/09/07 15:26:07 (1 year ago)
Author:
mikey
Message:

moved net.stubbles.websites.processors.stubJsonRpcProcessor to net.stubbles.service.jsonrpc.stubJsonRpcProcessor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/config/xml/processors.xml

    r737 r789  
    77    <processor name="xml" type="net.stubbles.websites.xml.stubXMLProcessor" interceptorDescriptor="interceptors" /> 
    88    <processor name="page" type="net.stubbles.websites.memphis.stubMemphisProcessor" interceptorDescriptor="interceptors" /> 
    9     <processor name="jsonrpc" type="net.stubbles.websites.memphis.stubJsonRpcProcessor" interceptorDescriptor="interceptors" /> 
     9    <processor name="jsonrpc" type="net.stubbles.service.jsonrpc.stubJsonRpcProcessor" interceptorDescriptor="interceptors" /> 
    1010  </defaultResolver> 
    1111</xj:configuration> 
  • trunk/examples/config/xml/processors.xml

    r737 r789  
    77    <processor name="xml" type="net.stubbles.websites.xml.stubXMLProcessor" interceptorDescriptor="interceptors-xml" /> 
    88    <processor name="page" type="net.stubbles.websites.memphis.stubMemphisProcessor" interceptorDescriptor="interceptors" /> 
    9     <processor name="jsonrpc" type="net.stubbles.websites.memphis.stubJsonRpcProcessor" interceptorDescriptor="interceptors" /> 
     9    <processor name="jsonrpc" type="net.stubbles.service.jsonrpc.stubJsonRpcProcessor" interceptorDescriptor="interceptors" /> 
    1010  </defaultResolver> 
    1111</xj:configuration> 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessor.php

    r786 r789  
    55 * @author      Richard Sternagel 
    66 * @author      Stephan Schmidt <schst@stubbles.net> 
     7 * @author      Frank Kleine <mikey@stubbles.net> 
    78 * @package     stubbles 
    8  * @subpackage  websites_processors 
     9 * @subpackage  service_jsonrpc 
    910 */ 
    1011stubClassLoader::load('net.stubbles.websites.processors.stubAbstractProcessor', 
     
    1415                      'net.stubbles.service.annotations.stubWebMethodAnnotation', 
    1516                      'net.stubbles.util.encoding.stubEncodingHelper', 
    16                       'net.stubbles.ioc.injection.injection'); 
    17  
     17                      'net.stubbles.ioc.injection.injection' 
     18); 
    1819/** 
    1920 * JSON-RPC Processor (generic Proxy for Web Services) 
    2021 * 
    21  * @author      Richard Sternagel 
    22  * @author      Stephan Schmidt <schst@stubbles.net> 
    2322 * @package     stubbles 
    24  * @subpackage  websites_processors 
     23 * @subpackage  service_jsonrpc 
    2524 */ 
    2625class stubJsonRpcProcessor extends stubAbstractProcessor { 
     
    136135        stubClassLoader::load('net.stubbles.service.jsonrpc.util.stubJsonRpcProxyGenerator'); 
    137136 
    138         $tmp = parse_url($this->request->getURI()); 
     137        $tmp        = parse_url($this->request->getURI()); 
    139138        $serviceUrl = '//' . $tmp['path']; 
    140139        if ($this->request->hasValue('processor')) { 
    141             $processor = $this->request->getValidatedValue(new stubPassThruValidator(), 'processor', stubRequest::SOURCE_PARAM); 
     140            $processor   = $this->request->getValidatedValue(new stubPassThruValidator(), 'processor', stubRequest::SOURCE_PARAM); 
    142141            $serviceUrl .= '?processor='.$processor; 
    143142        } 
    144143 
    145144        $generator = new stubJsonRpcProxyGenerator($serviceUrl); 
    146         $jsCode = ''; 
    147145        foreach ($this->classMap as $jsClass => $serviceConfig) { 
    148146            if (is_array($classes) && !in_array($jsClass, $classes)) { 
    149147                continue; 
    150148            } 
     149             
    151150            try { 
    152                 $jsCode = $generator->generateJavascriptProxy($serviceConfig['className'], $jsClass, $jsCode); 
     151                $this->response->write($generator->generateJavascriptProxy($serviceConfig['className'], $jsClass)); 
    153152            } catch (Exception $e) { 
    154153                if ($this->serviceConfig['use-firebug'] === true) { 
    155                     $jsCode = $jsCode . "console.error('Generation of proxy for {$serviceConfig['className']} failed.');\n"
    156                     $jsCode = $jsCode . $this->convertStringToFirebug($e->__toString()); 
     154                    $this->response->write("console.error('Generation of proxy for {$serviceConfig['className']} failed.');\n")
     155                    $this->response->write($this->convertStringToFirebug($e->__toString())); 
    157156                } 
    158157            } 
    159158        } 
    160         $this->response->write($jsCode); 
    161159    } 
    162160 
  • trunk/src/test/php/net/stubbles/service/ServiceTestSuite.php

    r539 r789  
    2222        $this->TestSuite('All service tests'); 
    2323        $dir = dirname(__FILE__); 
     24        $this->addTestFile($dir . '/jsonrpc/stubJsonRpcProcessorTestCase.php'); 
    2425        $this->addTestFile($dir . '/jsonrpc/util/stubJsonRpcProxyGeneratorTestCase.php'); 
    2526    } 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessorTestCase.php

    r696 r789  
    11<?php 
    22/** 
    3  * Test for net.stubbles.websites.processors.stubJsonRpcProcessor 
     3 * Test for net.stubbles.service.jsonrpc.stubJsonRpcProcessor 
    44 * 
    55 * @author          Richard Sternagel 
    66 * @author          Stephan Schmidt <schst@stubbles.net> 
    77 * @package         stubbles 
    8  * @subpackage      websites_processors_test 
     8 * @subpackage      service_jsonrpc_test 
    99 */ 
    10 stubClassLoader::load('net.stubbles.websites.processors.stubJsonRpcProcessor'); 
     10stubClassLoader::load('net.stubbles.service.jsonrpc.stubJsonRpcProcessor'); 
    1111Mock::generate('stubPageFactory'); 
    1212Mock::generate('stubRequest'); 
     
    1818 * 
    1919 * @package     stubbles 
    20  * @subpackage  websites_processors_test 
     20 * @subpackage  service_jsonrpc_test 
    2121 */ 
    2222class stubMyJsonRpcProcessor extends stubJsonRpcProcessor 
     
    4444 
    4545/** 
    46  * Tests for net.stubbles.websites.processors.stubJsonRpcProcessor 
     46 * Tests for net.stubbles.service.jsonrpc.stubJsonRpcProcessor 
    4747 * 
    4848 * @package     stubbles 
    49  * @subpackage  websites_processors_test 
     49 * @subpackage  service_jsonrpc_test 
    5050 */ 
    51 class stubJsonRpcProcessorTestCase extends UnitTestCase { 
    52  
     51class stubJsonRpcProcessorTestCase extends UnitTestCase 
     52
    5353    /** 
    5454     * mocked page factory 
     
    9090        $this->mockResponse          = new MockstubResponse(); 
    9191        $this->mockPageFactory       = new MockstubPageFactory(); 
    92         $this->proc                      = new stubMyJsonRpcProcessor($this->mockRequest, 
     92        $this->proc                  = new stubMyJsonRpcProcessor($this->mockRequest, 
    9393                                                                  $this->mockSession, 
    9494                                                                  $this->mockResponse, 
  • trunk/src/test/php/net/stubbles/websites/WebsitesTestSuite.php

    r561 r789  
    3232        $this->addTestFile($dir . '/processors/stubAbstractProcessorResolverTestCase.php'); 
    3333        $this->addTestFile($dir . '/processors/stubDefaultProcessorResolverTestCase.php'); 
    34         $this->addTestFile($dir . '/processors/stubJsonRpcProcessorTestCase.php'); 
    3534        $this->addTestFile($dir . '/processors/stubProcessorResolverXJConfFactoryTestCase.php'); 
    3635        $this->addTestFile($dir . '/processors/stubSimpleProcessorResolverTestCase.php');