How Resources Work

 

Documentation home

 

See also: Summary of Supplied Resources, Resources View

 

Resources, fields and mappings 1

Script Examples 2

 

Resources, fields and mappings

Ebase supports integration with a number of external resources: databases, stored procedures, email, XML, Web Services, message systems such as MQSeries, printing and custom resources.

 

What these external resources have in common is that they all have the capability of exchanging data with Ebase form fields or tables via a mappings layer. The Ebase view of these resources is that they consist of a number of resource fields, and that these resource fields can be mapped to form fields. Data exchange between an external resource and a form is performed using script coding, see examples below.

 

The Ebase integration framework for external resources is shown in the following diagram:

 

The steps to integrate a form with an external resource are:

 

1.      Create the resource

2.      Add the resource to the form by dragging it into the Resources View within the Form Editor

3.      Import fields from the resource into the form or create a table backed by the resource then import the columns

4.      Code script commands to read/write data to or from the resource as required

 

The advantage of importing fields from an external resource as described in step 3 is that this automatically creates the mappings between form fields and resource fields; an alternative approach is to manually create the mappings using the mappings icon  at the top of the Resources View in the Form Editor.

 

 

Script Examples

 

Javascript (uses Ebase programming API):

 

By invoking methods on the resource objects e.g.

 

resources.DbResource1.fetch();

resources.DbResource1.insert();

resources.Email1.sendmail();

resources.WebServiceExample.call();

resources.Xml1.read();

 

Tables are different, you invoke methods on the table and the table is linked to a resource:

 

tables.CustomerTable.fetchTable();            // loads data into the table from the resource

tables.CustomerTable.updateTable();           // updates the resource from the table

 

FPL:

 

By issuing commands: e.g. fetch, insert, read, sendmail etc

 

fetch DbResource1;

insert DbResource1;

sendmail Email1;

call WebServiceExample;

read Xml1;

 

Tables are different, you invoke commands on the table and the table is linked to a resource:

 

fetchtable CustomerTable;                       // loads data into the table from the resource

updatetable CustomerTable                     // updates the resource from the table