System.Web.Services.AJAX
[ class tree: System.Web.Services.AJAX ] [ index: System.Web.Services.AJAX ] [ all elements ]

Class: TAjaxServer

Source Location: /Web/Services/AJAX/TRemoteObjectServer.php

Class Overview


Prado AJAX server.

Class Details

[line 368]
Prado AJAX server.

Allows the javascript client to remotely invoke registered object methods. All request parameters and return values are automatically marshalled into JSON format.




abstract:  
version:  $Revision: 1.1 $ $Date: 2005/11/06 23:02:35 $
author:  Wei Zhuo<weizhuo[at]gmail[dot]com>


[ Top ]

Variables

Methods


Child classes:

TRemoteObjectServer
AJAX Remote Object server.

Class Variables

$NS =  '__AJAX'

[line 386]

Server namespace



access:  protected

Type:   string


[ Top ]

$objects = array()

[line 374]

List of registered remote objects.



access:  protected

Type:   TAjaxObjectInfo[]


[ Top ]

$uri =

[line 380]

AJAX Request URI.



access:  protected

Type:   TAjaxUri


[ Top ]



Class Methods


constructor __construct [line 392]

TAjaxServer __construct( [string $uri = null])

Create a new server for a particular URI.



access:  public


Overridden in child classes as:

TCallbackServer::__construct()
Create a new callback server.

Parameters:

string   $uri   server URI.

[ Top ]

method displayClient [line 429]

void displayClient( )

Displays the remote object javascript proxy code.



access:  protected


[ Top ]

method getJsSrc [line 491]

string getJsSrc( )

Returns the source URL for the client-side proxy code.



return:  JS proxy code URL
access:  public


[ Top ]

method getStubGenerator [line 439]

TAjaxStub getStubGenerator( )

Returns the remote object stub code generator.



return:  proxy code generator
access:  protected


Overridden in child classes as:

TCallbackServer::getStubGenerator()
Get the callback stub generator.

[ Top ]

method getUri [line 410]

TAjaxUri getUri( )

Gets the server URI.



access:  public


[ Top ]

method handleError [line 478]

void handleError( mixed $errno, mixed $errstr, mixed $errfile, mixed $errline)

Passes error details to the client-side by throwing an exception.



access:  public


[ Top ]

method handleException [line 469]

void handleException( Exception $e)

Passes exception details to the client-side javascript via JSON.



access:  public


Parameters:

Exception   $e   exception details.

[ Top ]

method handleRequest [line 499]

void handleRequest( )

Handle the AJAX request.



abstract:  
access:  public


Overridden in child classes as:

TRemoteObjectServer::handleRequest()
Handles AJAX client javascript and actual AJAX requests.

[ Top ]

method invoke [line 459]

void invoke( TAjaxProxy $object)

Invoke the remote object proxy, thus calling the method on the requested object. The results return from the method call are marshalled into JSON and send as part of HTTP header 'X-JSON'.



access:  protected


Parameters:

TAjaxProxy   $object   object proxy

[ Top ]

method register [line 419]

void register( string|object the $object)

Register an object or class for remote method calls by client-side javascript.



access:  public


Parameters:

string|object the   $object   name of the class or any existing object.

[ Top ]

method serve [line 447]

void serve( )

Serve AJAX remote object requests.



access:  protected


Overridden in child classes as:

TCallbackServer::serve()
Call the proxy method.

[ Top ]

method setUri [line 401]

void setUri( TAjaxUri $uri)

Sets the server URI.



access:  public


Parameters:

TAjaxUri   $uri  

[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.