NAME
Business::Bof::Server::Connection -- Server methods for The Business Oriented Framework
SYNOPSIS
See Business::Bof::Client
DESCRIPTION
Preferably to be used from Business::Bof::Client these methods help the user in common enterprise related tasks.
- login($logInfo)
-
Login will take a hash reference to login data and validate it against the Framework Database. If it is a valid data pair, it will return a session ID for the client to use in all subsequent calls. The format of the hash is
{name => $username, password => $password}
- logout($session_id)
-
Provide your session ID to this function so it can clean up after you. The server will be grateful ever after!
- get_data($session_id, $parms)
-
get_data takes two parameters. The obvious session ID and a hash reference with SOAP name
parms
. The format of the hash is the same as is used by DBIx::Recordset. E.g.:my $parms = { '!Table' => 'order, customer', '!TabJoin' => 'order JOIN customer USING (contact_id)', '$where' => 'ordernr = ?', '$values' => [ $ordernr ] };
NOTE get_data is deprecated and will modt likely be removed in a future release. Use Class::DBI and the ROE interface instead.
- call_method($session_id, $parms)
-
call_method will find the class and method, produce a new instant and execute it with the given parameter (SOAP name
parms
).It looks like this:
$parms = { class => 'myClass', data => $data, method => 'myMethod', [long => 1, task => 1 ] };
Two modifiers will help the server determine what to do with the call.
If
long
is defined, the server will handle it as a long running task, spawning a separate process.If
task
is defined, the server will not execute the task immediately, but rather save it in the framework's task table. The server will execute it later depending on the server's configuration settings.See Business Classes and Methods for an introduction to the layout of the class layout for server classes.
- cache_data($session_id, $cachename, $somedata);
-
The server saves the data with SOAP name
data
under the name provided with SOAP namename
for later retrieval by getCachedata. - get_cachedata($session_id, $cachename);
-
The server returns the cached data, given the key with SOAP name
name
. - get_clientdata
-
This method returns the data provided in the ClientSettings section of the BOF server's configuration file. It also provides some additional information about the current session.
- get_task($session_id, $taskId);
-
The server returns the task with the given taskId.
- get_tasklist($session_id);
-
The server returns the list of tasks.
- print_file($session_id, $parms)
-
print_file will print a file from Bof's queue system. The given parameter indicates which file is to be printed.
It looks like this:
$parms = { type => 'doc' or 'print', file => $filename, queue => $queuename };
- get_printfile($session_id, $parms)
-
get_printfile works like print_file, except it returns the file instead of printing it.
- get_printfilelist($session_id, $parms)
-
get_printfilelist returns an array containing information about the files in the chosen queue
$parms = { type => 'doc' or 'print', queue => $queuename };
- get_queuelist($session_id, $parms)
-
get_queuelist returns an array containing information about the available queues.
$parms = { type => 'doc' or 'print', };
Business Classes and Methods
The actual classes that the application server will service when using call_method must adhere to some standards.
The new
method
new
must accept three parameters, its type, the database handle and the reference to the server settings as provided in the configuration file.
The methods
The individual methods must accept two parameters, the single value (scalar, hash ref or array ref) that the client program sent and a hash ref with the session's user info.
Requirements
AUTHOR
Kaare Rasmussen <kar at kakidata.dk>