- Timestamp:
- 05/30/12 11:34:56 (12 years ago)
- Location:
- sandbox/2.4.1-3/prototype
- Files:
-
- 152 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.1-3/prototype/api/datalayer.js
r6008 r6351 1 internalUrl = /^([A-z0-9-_]+)(:[A-z0-9-_]+)?$/;1 internalUrl = /^([A-z0-9-_]+)(:[A-z0-9-_]+)?$/; 2 2 internalUri = /^([a-zA-Z0-9-_]+)\(([a-zA-Z0-9-_]+)\):\/\/(.*)|([a-zA-Z0-9-_]+):\/\/(.*)$/; 3 3 isGeneratedId = /^\d+\(javascript\)$/; … … 213 213 214 214 }, 215 'error': function( dt, textStatus, jqXHR ){ 216 217 if( callback ) 218 { 219 fired = true; 220 result = callback( $.parseJSON(dt.responseText), textStatus, jqXHR ); 221 } 222 else 223 result = $.parseJSON(dt.responseText); 224 225 }, 215 226 'complete': function( jqXHR, textStatus ){ 216 227 … … 234 245 235 246 return( result ); 247 }, 248 249 /** 250 * This method is used to read resources from the server. 251 * 252 * @param uri Uri of the resource that gonna be readed. 253 * @param callback A function that is called when the resource is loaded successfully. When the parameter is ignored the request is made synchrounsly. 254 * @param accept The attribute accept that is used to ask the target format to the server 255 * @return The target resource when the callback is ommitted ( made it synchronous ) 256 */ 257 258 read: function( uri, data, callback, accept ){ 259 //return this.send( this.dispatchPath + 'rest' + uri, [ 'get', accept || 'json' ], false, callback ); 260 //http://expressodev.prognus.com.br/cristiano/expresso-api/rest/maillast 261 return this.send( ('rest' + uri), [ 'get', accept || 'json' ], data, callback, !!!callback, 262 {'beforeSend' : function (xhr){ 263 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} 264 }); 265 266 }, 267 268 /** 269 * This method is used to create resources from the server. 270 * 271 * @param uri Uri of the resource that gonna be readed. 272 * @param callback A function that is called when the resource is created on the server successfully. When the parameter is ignored the request is made synchrounsly. 273 * @param accept The attribute accept that is used to ask the target format to the server. 274 * @return The result response of the create from the server when the callback is ommitted ( made it synchronous ) 275 */ 276 277 create: function( uri, data, callback, accept ){ 278 279 return this.send( 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback, 280 {'beforeSend' : function (xhr){ 281 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} 282 }); 283 284 }, 285 286 /** 287 * This method is used to update resources from the server. 288 * 289 * @param uri Uri of the resource that gonna be readed. 290 * @param callback A function that is called when the resource is update on the server successfully. When the parameter is ignored the request is made synchrounsly. 291 * @param accept The attribute accept that is used to ask the target format to the server 292 * @return The result response of the update from the server when the callback is ommitted ( made it synchronous ) 293 */ 294 295 update: function( uri, data, callback, accept ){ 296 297 return this.send( 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback, 298 {'beforeSend' : function (xhr){ 299 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} 300 }); 301 302 }, 303 304 /** 305 * This method is used to delete resources from the server. 306 * 307 * @param uri Uri of the resource that gonna be readed. 308 * @param callback A function that is called when the resource is deleted successfully in the server. When the parameter is ignored the request is made synchrounsly. 309 * @param accept The attribute accept that is used to ask the target format to the server 310 * @return The result response of the delete from the server when the callback is ommitted ( made it synchronous ) 311 */ 312 313 "delete": function( uri, callback, accept ){ 314 315 return this.send( 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback, 316 {'beforeSend' : function (xhr){ 317 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} 318 }); 319 236 320 }, 237 321 … … 2039 2123 2040 2124 if( !this.dispatchPath ) 2041 this.dispatchPath = " ../../";2125 this.dispatchPath = "prototype/"; 2042 2126 2043 2127 if( !this.templatePath ) … … 2054 2138 2055 2139 this.start(); 2140 this.me = this.dispatch( "me" ); 2056 2141 } 2057 2142 } -
sandbox/2.4.1-3/prototype/config/OpenLDAP.srv
r6173 r6351 4 4 idAtribute = "uidNumber" 5 5 host = 127.0.0.1 6 context = "LDAP_DN" 7 ; Caso o LDAP requisite autenticacao, configure os parametros a seguir 8 ;user = 9 ;password = 6 7 context = "dc=prognus" 8 user = "cn=admin,dc=prognus" 9 password = "prognus" 10 -
sandbox/2.4.1-3/prototype/config/PostgreSQL.srv
r6081 r6351 7 7 ;host = 127.0.0.1 8 8 port = 5432 9 dbname = expresso 10 user = postgres9 dbname = expressoDFDTezza 10 user = expressodev 11 11 ; Caso o usuario tenha senha... 12 12 ;password= -
sandbox/2.4.1-3/prototype/me.php
r5399 r6351 4 4 5 5 $me = Controller::read(array('concept' => 'user', 'service' => 'OpenLDAP' , 'id' => Config::me('uidNumber'))); 6 $me['token'] = $_SESSION['oauth']['access_token']; 6 7 7 8 echo json_encode( $me ); -
sandbox/2.4.1-3/prototype/services/OpenLDAP.php
r5804 r6351 13 13 if( !isset($criteria["limit"]) ) 14 14 $criteria["limit"] = $this->limit; 15 15 16 16 $sr = ldap_search( $this->con , $this->config['context'] , self::parseCriteria($criteria , $map) , self::parseJustthese($justthese, $map) , 0 , $criteria["limit"]); 17 17 if(!$sr) return false; … … 156 156 $as = array_shift( $filter ); 157 157 $op = self::parseOperator( $as ); 158 158 159 159 if( is_array($filter[0]) ) 160 160 { -
sandbox/2.4.1-3/prototype/services/PostgreSQL.php
r6145 r6351 197 197 $val[] = '\''.addslashes($v).'\''; 198 198 } 199 200 return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING '.$map['id'].' as id'; 199 200 // return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING '.$map['id'].' as id'; 201 return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING id'; 201 202 } 202 203 … … 306 307 case 'or': return( $op ); 307 308 case 'in': return array( $op ); 309 case '!in': return array( 'NOT IN' ); 308 310 case '^': return array( 'like', '%', '' ); 309 311 case '$': return array( 'like', '', '%' );
Note: See TracChangeset
for help on using the changeset viewer.