thyDataSource

Class to automate data exchange between client and server

Events

read write startup

Summary
Class to automate data exchange between client and server
Sends the appropriate values to the appropriate linked element
Sets the protocol to be used by this DataSource
If the user of DataSource will communicate to server using a standard format, that is, the same class for startup, read, write and remove and that class has these methods, one can call setServerClass method instead of setStartupMethod, setReadMethod, setWriteMethod or setRemoveMethod; setServerClass will do that, appending the correct string to the parameter passed.
Sets the method that will be called when performed a write call
Sets the method that will be called when performed a read call
Sets the method that will be called when performed a remove call
Sets the method that will be called when a startup is performed
Tells the Connector to put its message on the specified Progress Holder
Alias of setProgressHolder
Tells the Connector which messages are to be shown when calling read
Tells the Connector which messages are to be shown when calling write
Tells the Connector which messages are to be shown when calling remove
Link Object to this DataSource
Unlink Object from this DataSource
Performs a startup call.
Method that connects to the server, gets the data and populate previous linked elements
Method that sweepOut all linked elements data, connects to the server and sends the data to the server
Method that connects to the server and execute remove method
Handler for incomming connections called from read method
Handler for incomming connections called from write method
Handler for incomming connections called from remove method
Handler for incomming connections called from startup method

populate

p.populate = function (data,
event)

Sends the appropriate values to the appropriate linked element

Parameter

dataThe data that should be feed up
eventstartup, read or write

setProtocol

p.setProtocol = function (protocol,
url)

Sets the protocol to be used by this DataSource

Parameters

protocolThe Protocol Object aready instantiated

setServerClass

p.setServerClass = function (className)

If the user of DataSource will communicate to server using a standard format, that is, the same class for startup, read, write and remove and that class has these methods, one can call setServerClass method instead of setStartupMethod, setReadMethod, setWriteMethod or setRemoveMethod; setServerClass will do that, appending the correct string to the parameter passed.

  • Note - This method has been structured to handle call in the format ‘classname.method’, so it will append a ‘.’ and the methods to the passed classname.

Parameter

classThe class name (how it is handled by the server)

setWriteMethod

p.setWriteMethod = function (method)

Sets the method that will be called when performed a write call

Parameters

methodThe method string

setReadMethod

p.setReadMethod = function (method)

Sets the method that will be called when performed a read call

Parameters

methodThe method string

setRemoveMethod

p.setRemoveMethod = function (method)

Sets the method that will be called when performed a remove call

Parameters

methodThe method string

setStartupMethod

p.setStartupMethod = function (method)

Sets the method that will be called when a startup is performed

Parameters

methodThe method string

setProgressHolder

p.setProgressHolder = function(holder)

Tells the Connector to put its message on the specified Progress Holder

Parameters

holderThe DynLayer (or derivate) that will hold the Messages

setMessageHolder

Alias of setProgressHolder

setReadMessages

p.setReadMessages = function (messages)

Tells the Connector which messages are to be shown when calling read

Parameters

messagesArray with messages.  There are 3 possible messages:
  • messages[0] - Contacting Server
  • messages[1] - Server Contacted
  • messages[2] - Loading Server Data

setWriteMessages

p.setWriteMessages = function (messages)

Tells the Connector which messages are to be shown when calling write

Parameters

messagesArray with messages.  There are 3 possible messages:
  • messages[0] - Contacting Server
  • messages[1] - Server Contacted
  • messages[2] - Loading Server Data

setRemoveMessages

p.setRemoveMessages = function (messages)

Tells the Connector which messages are to be shown when calling remove

Parameters

messagesArray with messages.  There are 3 possible messages:
  • messages[0] - Contacting Server
  • messages[1] - Server Contacted
  • messages[2] - Loading Server Data

link

p.link = function(obj,
name,
event)

Link Object to this DataSource

Upon calling this method, one attach an element to the instantiated DataSource Object on the specified event

Parameters

objThe Object that implements DataLayer methods
nameThe name to be used on data exchange with server
eventThe event (or array of events) that will use this object.  Default to all

unlink

p.unlink = function(name,
event)

Unlink Object from this DataSource

Upon calling this method, one deattach an element from the instantiated DataSOurce Object.

Parameters

nameThe name that was used on data
eventThe event (or array of events) that will not use this object

startup

p.startup = function (data)

Performs a startup call.  This is generally used to get static data, configuration variables and all sort of data that may be used by the owner of the DataSource.

Parameters

dataAditional Information to be sent to the Server Startup Method

read

p.read = function(data)

Method that connects to the server, gets the data and populate previous linked elements

Parameters

dataAditional Information to be sent to the Server Read Method

write

p.write = function(data)

Method that sweepOut all linked elements data, connects to the server and sends the data to the server

Parameters

dataAditional Information to be sent to the Server Write Method

remove

p.remove = function(data)

Method that connects to the server and execute remove method

Parameters

dataAditional Information to be sent to the Server Remove Method

_readHandler

p._readHandler = function ()

Handler for incomming connections called from read method

Scope

Protected

_writeHandler

p._writeHandler = function ()

Handler for incomming connections called from write method

Scope

Protected

_removeHandler

p._removeHandler = function ()

Handler for incomming connections called from remove method

Scope

Protected

_startupHandler

p._startupHandler = function ()

Handler for incomming connections called from startup method

Scope

Protected

p.populate = function (data,
event)
Sends the appropriate values to the appropriate linked element
p.setProtocol = function (protocol,
url)
Sets the protocol to be used by this DataSource
p.setServerClass = function (className)
If the user of DataSource will communicate to server using a standard format, that is, the same class for startup, read, write and remove and that class has these methods, one can call setServerClass method instead of setStartupMethod, setReadMethod, setWriteMethod or setRemoveMethod; setServerClass will do that, appending the correct string to the parameter passed.
p.setStartupMethod = function (method)
Sets the method that will be called when a startup is performed
p.setReadMethod = function (method)
Sets the method that will be called when performed a read call
p.setWriteMethod = function (method)
Sets the method that will be called when performed a write call
p.setRemoveMethod = function (method)
Sets the method that will be called when performed a remove call
p.setProgressHolder = function(holder)
Tells the Connector to put its message on the specified Progress Holder
p.setReadMessages = function (messages)
Tells the Connector which messages are to be shown when calling read
p.read = function(data)
Method that connects to the server, gets the data and populate previous linked elements
p.setWriteMessages = function (messages)
Tells the Connector which messages are to be shown when calling write
p.write = function(data)
Method that sweepOut all linked elements data, connects to the server and sends the data to the server
p.setRemoveMessages = function (messages)
Tells the Connector which messages are to be shown when calling remove
p.remove = function(data)
Method that connects to the server and execute remove method
p.link = function(obj,
name,
event)
Link Object to this DataSource
p.unlink = function(name,
event)
Unlink Object from this DataSource
p.startup = function (data)
Performs a startup call.
p._readHandler = function ()
Handler for incomming connections called from read method
p._writeHandler = function ()
Handler for incomming connections called from write method
p._removeHandler = function ()
Handler for incomming connections called from remove method
p._startupHandler = function ()
Handler for incomming connections called from startup method