Show
Ignore:
Timestamp:
06/23/08 23:34:06 (4 months ago)
Author:
mikey
Message:

remove possibility of configuring the name of the json-rpc-service.ini file
add configuration options within json-rpc-service.ini: namespace and generated source target directory
adjust phing generate-clients in release build files
one thing left todo: get rid of the projectcheck target

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcAbstractGenerateSubProcessor.php

    r1547 r1647  
    2121abstract class stubJsonRpcAbstractGenerateSubProcessor extends stubBaseObject implements stubJsonRpcSubProcessor 
    2222{ 
     23    /** 
     24     * default javascript namespace 
     25     * 
     26     * @var  string 
     27     */ 
     28    protected $jsNamespace = 'stubbles.json.proxy'; 
     29 
    2330    /** 
    2431     * helper method to detect the service url 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGenerateProxiesSubProcessor.php

    r1547 r1647  
    2323{ 
    2424    /** 
    25      * default javascript namespace 
    26      * 
    27      * @var  string 
    28      */ 
    29     protected $jsNamespace = 'stubbles.json.proxy'; 
    30  
    31     /** 
    3225     * does the processing of the subtask 
    3326     * 
     
    3629     * @param  stubResponse                        $response  the current response 
    3730     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     31     * @param  array<string,string>                $config    json-rpc config 
    3832     */ 
    39     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     33    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    4034    { 
     35        if (isset($config['namespace']) === false) { 
     36            $config['namespace'] = $this->jsNamespace; 
     37        } 
     38         
    4139        $classes = $request->getValidatedValue(new stubRegexValidator('/^[A-Za-z,0-9_\.]+$/'), '__generateProxy'); 
    4240        if ('__all' !== $classes) { 
     
    4442        } 
    4543             
    46         $response->write($this->jsNamespace . " = {};\n\n"); 
     44        $response->write($config['namespace'] . " = {};\n\n"); 
    4745        $generator = $this->getProxyGenerator(); 
    4846        foreach ($classMap as $jsClass => $fqClassName) { 
    4947            if (is_array($classes) === false || in_array($jsClass, $classes) === true) { 
    5048                try { 
    51                     $response->write($generator->generateJavascriptProxy($fqClassName, $jsClass)); 
     49                    $response->write($generator->generateJavascriptProxy($fqClassName, $jsClass, $config['namespace'])); 
    5250                } catch (Exception $e) { 
    5351                    $this->handleException($e, $response, 'Generation of proxy for ' . $fqClassName . ' failed.'); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGenerateSmdSubProcessor.php

    r1547 r1647  
    2626     * @param  stubResponse                        $response  the current response 
    2727     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     28     * @param  array<string,string>                $config    json-rpc config 
    2829     */ 
    29     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     30    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    3031    { 
     32        if (isset($config['namespace']) === false) { 
     33            $config['namespace'] = $this->jsNamespace; 
     34        } 
     35         
    3136        $class     = $request->getValidatedValue(new stubRegexValidator('/^[A-Za-z0-9_\.]+$/'), '__smd'); 
    3237        $generator = $this->getSmdGenerator($this->getServiceURL($request) . '&__class=' . $class); 
    3338        // get rid of namespace for class matching 
    34         $class     = preg_replace('/stubbles\.json\.proxy\./', '', $class); 
     39        $class     = preg_replace('/' . preg_quote($config['namespace']) . '\./', '', $class); 
    3540        try { 
    3641            $response->write($generator->generateSmd($classMap[$class], $class)); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGetSubProcessor.php

    r1547 r1647  
    4747     * @param  stubResponse                        $response  the current response 
    4848     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     49     * @param  array<string,string>                $config    json-rpc config 
    4950     */ 
    50     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     51    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    5152    { 
    5253        $requestId = $request->getValidatedValue(new stubRegexValidator(self::ID_PATTERN), 'id'); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcPostSubProcessor.php

    r1547 r1647  
    2929     * @param  stubResponse                        $response  the current response 
    3030     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     31     * @param  array<string,string>                $config    json-rpc config 
    3132     */ 
    32     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     33    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    3334    { 
    3435        $requestJsonObj = $request->getValidatedRawData(new stubPassThruValidator()); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcSubProcessor.php

    r1434 r1647  
    2626     * @param  stubResponse                        $response  the current response 
    2727     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     28     * @param  array<string,string>                $config    json-rpc config 
    2829     */ 
    29     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap); 
     30    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config); 
    3031} 
    3132?>