Changeset 6230
- Timestamp:
- 05/18/12 11:12:43 (11 years ago)
- Location:
- sandbox/2.4-expresso-api/prototype
- Files:
-
- 18 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4-expresso-api/prototype/api/datalayer.js
r5888 r6230 198 198 else 199 199 result = dt; 200 201 }, 202 'error': function( dt, textStatus, jqXHR ){ 203 204 if( callback ) 205 { 206 fired = true; 207 result = callback( $.parseJSON(dt.responseText), textStatus, jqXHR ); 208 } 209 else 210 result = $.parseJSON(dt.responseText); 200 211 201 212 }, … … 254 265 create: function( uri, data, callback, accept ){ 255 266 256 return this.send( this.dispatchPath +'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback,267 return this.send( 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback, 257 268 {'beforeSend' : function (xhr){ 258 269 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} … … 272 283 update: function( uri, data, callback, accept ){ 273 284 274 return this.send( this.dispatchPath +'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback,285 return this.send( 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback, 275 286 {'beforeSend' : function (xhr){ 276 287 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} … … 290 301 "delete": function( uri, callback, accept ){ 291 302 292 return this.send( this.dispatchPath +'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback,303 return this.send( 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback, 293 304 {'beforeSend' : function (xhr){ 294 305 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} -
sandbox/2.4-expresso-api/prototype/config/PostgreSQL.srv
r5888 r6230 3 3 [config] 4 4 port = 5432 5 dbname= expresso 24cristianoAPI5 dbname= expressoApiCoutinho 6 6 user=postgres 7 7 host = /tmp -
sandbox/2.4-expresso-api/prototype/config/Tonic.srv
r5888 r6230 9 9 NewsLastResource = /news/NewsLastResource.php 10 10 11 [/dynamiccontacts] 12 DynamicContactsResource = /contact/DynamicContactsResource.php 13 14 [/oi] 15 DynamicContactDeleteResource = /contact/DynamicContactDeleteResource.php 16 17 [/dynamiccontacts/:id] 18 DynamicContactResource = /contact/DynamicContactResource.php 19 11 20 [/token] 12 21 TokenResource = /oauth/TokenResource.php -
sandbox/2.4-expresso-api/prototype/library/oauth2/lib/OAuth2.php
r5888 r6230 459 459 session_write_close(); //Fecha session anterior 460 460 session_id($token['refresh_token']); //Define o id da session o mesmo do resfresh token 461 session_start(); 462 461 @session_start(); 462 463 /* TODO - Verificar melhor solução para verificação de tratamento para sessions já startadas 464 if(!isset($_SESSION)) 465 session_start(); 466 */ 463 467 return $token; 464 468 } -
sandbox/2.4-expresso-api/prototype/library/tonic/lib/tonic.php
r5888 r6230 126 126 127 127 /** 128 * Body data of incoming request 129 * @var array 130 */ 131 public $dataDecoded; 132 133 /** 128 134 * Array of if-match etags 129 135 * @var str[] … … 298 304 $this->method = strtoupper($this->getConfig($config, 'method', 'REQUEST_METHOD', $this->method)); 299 305 300 // get HTTP request data 301 $this->data = $this->getConfig($config, 'data', NULL, file_get_contents("php://input")); 302 306 // get HTTP request data 307 $this->data = $this->getConfig($config, 'data', NULL, file_get_contents("php://input")); 308 309 // get HTTP request dataDecode into array 310 $this->dataDecoded = $this->__decodeData( $this->data ); 311 303 312 // conditional requests 304 313 if ($config['ifMatch']) { … … 415 424 416 425 } 417 426 427 /** 428 * Convert the string data into a array data 429 * @return array 430 * @codeCoverageIgnore 431 */ 432 function __decodeData($data) { 433 $arrayData = array(); 434 if($data){ 435 $arrayIndex = explode('&', $data); 436 foreach($arrayIndex as $key => $value){ 437 list($i,$val) = explode ('=', $value); 438 $arrayData[$i] = $val; 439 } 440 } 441 return $arrayData; 442 } 443 418 444 /** 419 445 * Convert the object into a string suitable for printing -
sandbox/2.4-expresso-api/prototype/rest/calendar/CalendarLastResource.php
r5888 r6230 16 16 function GET($request){ 17 17 $this->secured(); 18 18 19 19 $calendar = Controller::find( array( 'concept' => 'calendarSignature' ), array('calendar'), array( 'filter' => array( '=', 'user', Config::me("uidNumber") ) ) ); 20 20 -
sandbox/2.4-expresso-api/prototype/rest/dispatch.php
r5888 r6230 37 37 // handle request, passing the current env baseUri and autoload mapping; 38 38 $request = new Request(array( 39 'baseUri'=> '/ cristiano/expresso-api/rest',39 'baseUri'=> '/acoutinho/expressoAPI/rest', 40 40 'autoload' => $autoload, 41 41 ));
Note: See TracChangeset
for help on using the changeset viewer.