Changeset 588
- Timestamp:
- 04/20/07 15:19:36 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/config/xml/json-rpc-service.xml
r517 r588 4 4 xmlns="http://stubbles.net/service/json-rpc"> 5 5 <service-url>http://localhost/?processor=jsonrpc</service-url> 6 <use-firebug>true</use-firebug> 6 7 <services> 7 8 <service name="BuddyQuoteService" className="_test.service.BuddyQuoteService"/> trunk/src/main/php/net/stubbles/websites/processors/stubJsonRpcProcessor.php
r580 r588 52 52 53 53 /** 54 * Configuration of the service 55 * 56 * @var array 57 */ 58 protected $serviceConfig = array(); 59 60 /** 54 61 * The class used in the service 55 62 * … … 71 78 */ 72 79 public function doProcess() { 73 74 80 $xjconf = new stubXJConfFacade(new XJConfFacade(array('__default' => stubXJConfLoader::getInstance()))); 75 81 $xjconf->addDefinitions(stubFactory::getResourceURIs('xjconf/json-rpc-service.xml')); … … 77 83 $xjconf->parse($configFile); 78 84 $this->classMap = $xjconf->getConfigValue('services'); 85 $this->serviceConfig['use-firebug'] = $xjconf->getConfigValue('use-firebug'); 79 86 80 87 if ($this->request->hasValue('__generateProxy', stubRequest::SOURCE_PARAM)) { … … 114 121 continue; 115 122 } 116 $jsCode = $generator->generateJavascriptProxy($serviceConfig['className'], $jsClass, $jsCode); 123 try { 124 $jsCode = $generator->generateJavascriptProxy($serviceConfig['className'], $jsClass, $jsCode); 125 } catch (stubClassNotFoundException $e) { 126 if ($this->serviceConfig['use-firebug'] === true) { 127 $jsCode = $jsCode . "console.error('Class {$serviceConfig['className']} does not exist, generation of proxy failed.');\n"; 128 } 129 } 117 130 } 118 131 $this->response->write($jsCode); trunk/src/main/resources/xjconf/json-rpc-service.xml
r507 r588 4 4 <tag name="services" type="array" /> 5 5 <tag name="service-url" type="string" /> 6 <tag name="use-firebug" type="boolean" /> 6 7 <tag name="service" type="array" keyAttribute="name"> 7 8 <attribute name="name" type="string" required="true"/>
