NAME

Business::Bof::Cient -- Client interface to Business Oriented Framework

SYNOPSIS

use Business::Bof::Client;

my $client = new Business::Bof::Client(server => localhost,
      port => 12345,
      session => myserver
);

my $parms = {
  '!Table' => 'order, customer',
  '!TabJoin' => 'order JOIN customer USING (contact_id)',
  '$where'  =>  'ordernr = ?',
  '$values'  =>  [ $ordernr ]
};

$result = $client -> getData($sessionId, $parms);
$showresult = Dumper($result);
print "getData: $showresult\n";

DESCRIPTION

Business::Bof::Client is a Perl interface to the Business Oriented Framework Server. It is meant to ease the pain of accessing the server, making SOAP programming unnecessary.

Method calls

$obj = new(server => $hostname, port => $portnr, session => $session)

Instantiates a new client and performs a connection to the server with the information given. Will fail if no server is active at that address.

$sessionId = $obj->login({name => $username, password => $password});

Creates a session in the server and returns an ID. This ID is to be used for all subsequent requests from the client to the BOF server.

name and password must be a valid pair in the Framework Database.

$obj->logout();

Will terminate the session in the server and delete all working data.

getSessiondata
$obj -> getData($parms);

The purpose of getData is to request a set of data from the server. The format of the request 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 ]
};
$obj -> cacheData($cachename, $somedata);

cacheData will let the server save some data for the client. It is very useful in a web environment, where the client is stateless. E.g.:

my $data = { foo => 'bar', this => 'that' }; $obj -> cacheData('some data', $data);

getCachedata

getCachedata retrieves the cached data, given the right key. E.g.:

$thedata = $obj -> getCachedata('some data');

callMethod

The main portion of the client call will be callMethod. It will find the class and method, produce a new instant and execute it with the given data as parameter.

It looks like this:

$parms = { class => 'myClass', data => $data, method => 'myMethod', [long => 1, task => 1 ] };

$res = $obj -> callMethod($parms);

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.

AUTHOR

Kaare Rasmussen <kar at kakidata.dk>