BEA Logo BEA eLink Adapter for BroadVision Release 1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   eLink Adapter for BroadVision Doc Home   |   eLink Adapter for BroadVision User Guide   |   Previous Topic   |   Next Topic   |   Contents   |  

Running a Sample Application

 

Setting up and running the sample application for the eLink Adapter for BroadVision consists of three major steps:

  1. Setting up the 'sales' Sample eLink Platform Application.

  2. Configuring the eLink Adapter for BroadVision to Invoke this eLink Platform Application

  3. Running the Sample Application

The information in this section is designed to help you start and run a sample application.

 


Setting up the 'sales' Sample eLink Platform Application

This section contains the following topics:

Step 1: Copy the Sales eLink Platform Application Files

Step 2: Set Up Environment File

Step 3: Edit the eLink Platform Configuration File

Step 4: Load the eLink Platform Configuration File

Step 5: Edit the eLink Adapter for BroadVision Configuration File

Step 6: Examine the Sample eLink Platform Server

Step 7: Build the Sample eLink Platform Server

Step 8: Boot the eLink Platform System

Step 9: Run udRdAirBill

Step 1: Copy the Sales eLink Platform Application Files

    1. Make a directory for the sales application and cd to it using the following commands.

            mkdir sales
      cd sales

    2. Copy the sales eLink Platform application files.

            cp $TUXDIR/elink/bvision/simpbvis/sales/* ./

      Table 4-1 Description of eLink Platform Application Files

      Application File Names

      Description

      fieldtable

      FML field definition table

      makefile.sh

      Korn shell to build sample eLink Platform server

      sales.data

      Data returned by sample eLink Platform server

      setenv.sh

      Korn shell script to set environment

      udRdAirBill

      Sample ud32 script for use with sample eLink Platform server

      testsalesvr.c

      Sample eLink Platform server that advertises service TESTSERVICE

      ubbsales

      Sample eLink Platform configuration file (UBBCONFIG)

      bvtux.conf

      Sample eLink Adapter for BroadVision configuration file

Step 2: Set Up Environment File

To set and export environment variables, you must edit the setenv.sh file. You need TUXDIR and PATH to access files in the eLink Platform System /T directory structure. With HPUX on HP90000, use SHLIB_PATH instead of LD_LIBRARY_PATH. Listing 4-1 shows a sample of the environment variables for the Unix platform. To set and export the environment variables follow these steps:

    1. Bring up setenv.sh in your text editor.

    2. Replace the fields delimited with '<' and '>' signs.

    3. Set the environment by executing the script:

           . ./setenv.sh

      Listing 4-1 Sample Environment File for UNIX


      #!/bin/sh
      APPDIR=<your eLink application directory>
      export APPDIR
      TUXDIR=<your TUXEDO installation directory>
      export TUXDIR
      TUXCONFIG=${APPDIR}/tuxconfig
      export TUXCONFIG
      FLDTBLDIR32=${APPDIR}:$(TUXDIR}/udataobj
      export FLDTBLDIR32
      FIELDTBLS32=fieldtable,Usysfl32
      export FIELDTBLS32
      PATH=${TUXDIR}/bin:${APPDIR}:${PATH}
      export PATH
      SHLIB_PATH=${TUXDIR}/lib:${SHLIB_PATH}
      export SHLIB_PATH


Step 3: Edit the eLink Platform Configuration File

The provided eLink Platform configuration file ubbsales defines the eLink Platform server testsalesvr. In this file, replace the fields delimited with '<' and '>' signs. For more information on eLink Platform UBBCONFIG configuration files, see BEA Tuxedo Reference Manual Section File Formats and Data Descriptions. Listing 4-2 shows the provided sample eLink Platform configuration file.

Listing 4-2 Sample eLink Platform Configuration File


#Replace the <bracketed> items with the appropriate values.

*RESOURCES
IPCKEY 34257
DOMAINID sales
MASTER eLink
MAXACCESSERS 10
MAXSERVERS 5
MAXSERVICES 10
MODEL SHM
LDBAL Y

*MACHINES
DEFAULT:
APPDIR="<your eLink app directory>"
TUXCONFIG="<your eLink app directory>/tuxconfig"

                TUXDIR="<your TUXEDO install directory>"

"<uname>" LMID=eLink

*GROUPS
GROUP1
LMID=eLink GRPNO=1 OPENINFO=NONE

*SERVERS
DEFAULT:
CLOPT="-A"

testsalesvr SRVGRP=GROUP1 SRVID=1 MIN=2 MAX=5

*SERVICES
TESTSERVICE


Step 4: Load the eLink Platform Configuration File

Perform two primary tasks to load the eLink Platform configuration file:

Step 4.1: Load the File

Run tmloadcf to load the configuration file as shown in Listing 4-3

Listing 4-3 Sample Code for Loading the eLink Platform Configuration File


$ tmloadcf ubbsales.ubb
Initialize TUXCONFIG file: /usr/me/simpbvis/tuxconfig [y, q] ? y
$


Step 4.2: Check the Results

Check to ensure that a file called tuxconfig is a new file under the control of eLink Platform System/T. Listing 4-4 shows a sample eLink Platform configuration file.

Listing 4-4 Sample eLink Platform Configuration File


$ ls -l tuxconfig
total 216
-rw-r----- 1 userid grpid 106496 May 29 09:26 tuxconfig


Step 5: Edit the eLink Adapter for BroadVision Configuration File

The sample eLink Adapter for BroadVision configuration file bvtux.conf needs to be edited to reflect the location of the eLink Platform application. The configuration file defines the following:

Edit this file and replace the fields delimited by the '<' and '>' characters. Listing 4-5 lists the sample eLink Adapter for BroadVision configuration file bvtux.conf.

Listing 4-5 Sample eLink Adapter for BroadVision Configuration File


*SERVER
TUXDIR=<your TUXEDO install directory>
APPDIR=<your eLink app directory>
TUXCONFIG=<your eLink app directory>/tuxconfig
FLDTBLDIR32=<your eLink app directory>
FIELDTBLS32=fieldtable
PRALLEL_MODE_SLEEP_MILLISECONDS=1000

USER_NAME=usr
CLIENT_NAME=clt
PASSWORD=paswd
GROUP_NAME=grp
DATA=data


*FIELD
FML_NAME=TUX_FCARRIER
ADAPTER_FIELD_NAME=FCARRIER

*FIELD
FML_NAME=TUX_AIRBILLNUMBER
ADAPTER_FIELD_NAME=AIRBILLNUMBER

*FIELD
FML_NAME=TUX_MSRAIRBILLNUM
ADAPTER_FIELD_NAME=MSRAIRBILLNUM

*FIELD
FML_NAME=TUX_FLIGHT
ADAPTER_FIELD_NAME=FLIGHT

*FIELD
FML_NAME=TUX_SHIPDATE
ADAPTER_FIELD_NAME=SHIPDATE

*FIELD
FML_NAME=TUX_QTY
ADAPTER_FIELD_NAME=QTY

*FIELD
FML_NAME=TUX_LOTNUM
ADAPTER_FIELD_NAME=LOTNUM

*FIELD
FML_NAME=TUX_INVOICENUM
ADAPTER_FIELD_NAME=INVOICENUM

*FIELD
FML_NAME=TUX_SORDERNUM
ADAPTER_FIELD_NAME=SORDERNUM

*FIELD
FML_NAME=TUX_PONUM
ADAPTER_FIELD_NAME=PONUM

*FIELD
FML_NAME=TUX_LSINUM
ADAPTER_FIELD_NAME=LSINUM

*FIELD
FML_NAME=TUX_CUSTNUM
ADAPTER_FIELD_NAME=CUSTNUM

*FIELD
FML_NAME=TUX_BOOKDATE
ADAPTER_FIELD_NAME=BOOKDATE

*FIELD
FML_NAME=TUX_CSCHDATE
ADAPTER_FIELD_NAME=CSCHDATE

*FIELD
FML_NAME=TUX_CUSTOMER
ADAPTER_FIELD_NAME=CUSTOMER

*FIELD
FML_NAME=TUX_MARKID
ADAPTER_FIELD_NAME=MARKID

*FIELD
FML_NAME=TUX_PRICE
ADAPTER_FIELD_NAME=PRICE

*FIELD
FML_NAME=TUX_REQDATE
ADAPTER_FIELD_NAME=REQDATE

*FIELD
FML_NAME=TUX_SHIPTO
ADAPTER_FIELD_NAME=SHIPTO

*FIELD
FML_NAME=TUX_BILLTO
ADAPTER_FIELD_NAME=BILLTO

*FIELD
FML_NAME=TUX_DESC
ADAPTER_FIELD_NAME=DESC

*FIELD
FML_NAME=TUX_PAYTERMS
ADAPTER_FIELD_NAME=PAYTERMS

*FIELD
FML_NAME=TUX_NOTE
ADAPTER_FIELD_NAME=NOTE

*FIELD
FML_NAME=TUX_APPERROR
ADAPTER_FIELD_NAME=APPERROR

*FIELD
FML_NAME=TUX_SHORTY
ADAPTER_FIELD_NAME=SHORTY

*FIELD
FML_NAME=TUX_CHARY
ADAPTER_FIELD_NAME=CHARY

*FIELD
FML_NAME=TUX_DOUBLY
ADAPTER_FIELD_NAME=DOUBLY

*FIELD
FML_NAME=TUX_CARRAYY
ADAPTER_FIELD_NAME=CARRAYY

*SERVICE
NAME=TESTSERVICE
ADAPTER_SERVICE_NAME=TESTSERVICE


Step 6: Examine the Sample eLink Platform Server

Included with the sample eLink Platform application is a eLink Platform server program. This server advertises an eLink Platform service called TESTSERVICE. This service is meant to simulate a query request for Air Billing information.

The TESTSERVICE service expects an FML32 buffer as input. This buffer should contain the field TUX_MSRAIRBILLNUM. This field is an AirBillNumber. The AirBillNumber is used by the service to return additional information for this Air Bill from the file sales.data. The contents of sales.data are given below in Listing 4-6.

Listing 4-6 Sample Code for sales.data


1000,"Fcarrier1000",1000,"Flight1000","01021999",100,100,1000,1000,1000,100,100,
"01011999","01021999","Customer100",100,100.00,"01011999","shipto100","billto100
","desc100","paymentterms100","Note100"
2000,"Fcarrier2000",2000,"Flight2000","01031999",100,101,1001,1000,1001,101,200,
"01021999","01021999","Customer200",200,200.00,"01041999","shipto200","billto200
","desc200","paymentterms200","Note200"
3000,"Fcarrier3000",3000,"Flight3000","01071999",300,102,1002,2000,1002,102,300,
"01081999","01081999","Customer300",300,300.00,"01081999","shipto300","billto300
","desc300","paymentterms300","Note300"


Step 7: Build the Sample eLink Platform Server

The Korn shell script makefile.sh builds the source file testsalesvr.c into the eLink Platform server program testsalesvr. To build, issue the following command:

$ ksh ./makefile.sh

You should end up with a program testsalesvr as shown in Listing 4-7.

Listing 4-7 Program testsalesvr


$ ls -l testsalesvr
-rwxrwxrwx 1 usr myusrgrp 73728 Jan 7 12:36 testsalesvr


Step 8: Boot the eLink Platform System

Use the eLink Platform utility tmboot to bring up the configured eLink Platform application. The BBL process and the testsalesvr process should start. Listing 4-8 shows a sample boot sequence.

Listing 4-8 Sample Boot Sequence


$ tmboot -y

Booting all admin and server processes in /mydir/eLink/bvision/simpbvis/sales/tuxconfig
INFO: TUXEDO(r) System Release 6.5
INFO: Serial #: 1000045015, Expiration 2000-01-28, Maxusers 1000000

INFO: Licensed to: peter

Booting admin processes ...

exec BBL -A :
process id=9267 ... Started.

Booting server processes ...

exec testsalesvr -A :
process id=9268 ... Started.
exec testsalesvr -A :
process id=9269 ... Started.
3 processes started.


Step 9: Run udRdAirBill

BEA eLink Platform provides a client program, ud32, that creates FML32 buffers and invokes eLink Platform services via tpcall(). ud32 is a client program that reads tab delimited text to populate an FML32 buffer and invoke an eLink Platform service. The tab delimited text in udRdAirBill can be used to invoke the eLink Platform application that you have configured. Listing 4-9 shows an invocation of the TESTSERVICE service using the ud32 utility and the udRdAirBill text file.

Listing 4-9 Sample Code for TESTSERVICE Service Invocation


$ ud32 < udRdAirBill
SENT pkt(1) is :
TUX_MSRAIRBILLNUM 1000
SRVCNM TESTSERVICE

RTN pkt(1) is :
TUX_LOTNUM 100
TUX_AIRBILLNUMBER 1000
TUX_QTY 100
TUX_INVOICENUM 1000
TUX_SORDERNUM 1000
TUX_PONUM 1000
TUX_LSINUM 100
TUX_CUSTNUM 100
TUX_MARKID 100
TUX_PRICE 100
TUX_FCARRIER "Fcarrier1001"
TUX_FLIGHT "Flight1000"
TUX_SHIPDATE "01021999"
TUX_BOOKDATE "01011999"
TUX_CSCHDATE "01021999"
TUX_CUSTOMER "Customer100"
TUX_REQDATE "01011999"
TUX_SHIPTO "shipto100"
TUX_BILLTO "billto100"
TUX_DESC "desc100"
TUX_PAYTERMS "paymentterms100"
TUX_NOTE "Note100"


 


Configuring the eLink Adapter for BroadVision to Invoke this eLink Platform Application

Now that you have successfully configured the sample eLink Platform application 'sales', the next step is to setup the eLink Adapter for BroadVision so that it can access the eLink Platform service TESTSERVICE. This section contains the following topics:

Step 1: Configure the Interaction Manager startup scripts

The eLink Adapter for BroadVision is a shared library that is loaded in the BroadVision Interaction Manager process. The first step that must be completed is to copy startup scripts to a startup script directory of the Interaction Manager. The Interaction Manager process executes these scripts when it is brought up.

Step 1.1 Login as BroadVision user bv1to1

$ login bv1to1

Password:

Step 1.2 Examine the Interaction Manager configuration file

The Interaction Manager configuration file is usually located in the directory /etc/opt/BVSNsmgr. The configuration file is in this directory and is named name.cfg where name is the name of the Interaction Manager (the default name is bvsn). Edit this file and record the value of the startup-script-directories parameter. Listing 4-10 shows an example bvsm.cfg with the startup-script-directories parameter highlighted in bold.

Listing 4-10 Sample Code for bvsm.cfg


$ vi /etc/opt/BVSNsmgr/bvsm.cfg
# Required entries
cfg-version = V4.1
hostname = mynode.beasys.com
ip-address = 127.0.0.1
engines = 1
threads = 16
document-root = /apps/opt/bv1to1
gateway-name = /cgi-bin/bvsm
default-BV_UseBVCookie = no
smgr-first-port = 1026
smgr-max-connections = 256
default-object-path = /apps/opt/bv1to1/lib/components:/home/bv1to1/lib/component
s:/apps/opt/bv1to1/lib/objects:/home/bv1to1/lib/objects
# Optional entries
startup-script-directories = /apps/opt/bv1to1/script_library:/home/bv1to1/lib/sc
ript_library
default-page = index.html
default-page-protocol = http
default-page-port = 80
engine-check-interval = 60
session-idle-max = 10
gc-frequency = 20
validate-ip-addr-mask = 255.255.255.255
browser-list = MSIE 3,MSIE 4.0b1vheader-select-timeout = 240
content-select-timeout = 1000
bv-system-call-timeout = 90
http-port = 80
https-port = 443
http-max-connections = 256
cgi-log-level = 3
access-control-file = /etc/opt/BVSNsmgr/bvsm.ACL
js-num-contexts = 16
js-pool-size = 2097152
js-stack-size = 8192
js-max-retries = 20


Step 1.3 Copy the Interaction Startup Scripts to a Startup Script Directory

The startup scripts elink.js and elinkconst.js need to be copied to a directory specified in the start-script-directories parameter of the Interaction Manager configuration file. Listing 4-11 is an example.

Listing 4-11 Example of Startup Script Parameters


 cp $TUXDIR/elink/bvision/simpbvis/startup/* /home/bv1to1/lib/script_library


Step 1.4 Modify elink.js to Point to bvtux.conf

The startup script elink.js needs to be edited to reflect the location of the eLink Platform application directory. Edit this file in the Interaction Manager startup script directory. The line shown in Listing 4-12 needs to be edited.

Listing 4-12 elink.js Startup Script that Must be Edited


var tuxAdapter = new BVI_TuxAdapter("<your eLink application directory>/bvtux.conf");


Step 1.5 Restart the Interaction Manager

To restart the Interaction manager, use the Broadvision utility imgr_conf. The commands shown in Listing 4-13 shuts down the Interaction Manager and brings it back up again.

Listing 4-13 Commands for Shutting Down the Interaction Manager


$ imgr_conf -a stop
$ imgr_conf -a start


Consult Broadvision documentation for additional information on administration of the Interaction Manager.

Step 2 Supplement the Broadway Sample Application

Broadvision One-to-One Enterprise comes with a sample application called Broadway. The sample application for the eLink Adapter for BroadVision supplements the Broadway application by adding calls to the eLink Platform Service TESTSERVICE from the Broadway application.

Step 2-1 Copy bea_start.html to HTTP Server's Default Document Directory

The file bea_start.html needs to be copied to the default document directory of your HTTP server. Below is an example copy command, where /opt/ns-ftrack/docs-httpd-default is the default document directory of your HTTP server.

cp $TUXDIR/elink/bvision/simpbvis/broadway/bea_start.html /opt/ns-ftrack/docs-httpd-default

Step 2-2 Create the Directory bea_broadway/scripts

The directory bea_broadway/scripts needs to be created under the BV1TO1 directory. Login as bv1to1 and create the directory with the following command:

mkdir -p ${BV1TO1}/bea_broadway/scripts

Step 2-3 Copy the Additonal Files to the bea_broadway/scripts directory

The following files need to be copied from the $TUXDIR/eLink/bvision/simpbvis/broadway to the ${BV1TO1}/bea_broadway/scripts directory.

bw_login.jsp
bw_menu.jsp
bw_frameset.jsp
executeasync.jsp
getreply.jsp
testexecute.jsp
testexecuteasync.jsp
tux_asyncsearch.jsp
tux_executesearch.jsp
tux_search.jsp


These files should be examined to see the API calls that are made to the eLink Adapter for BroadVision. Listing 4-14 shows the code that you should review.

Listing 4-14 API Calls

bw_login.jsp

Connecting to eLink Adapter for BroadVision and returning a new session:

var tuxSession = tuxAdapter.getNewSession();

tux_search.jsp

Initializing a eLink Platform session:

var tuxSession = Session.tuxSession;

testexecute.jsp

Represents the remote eLink Platform service. Create a new BVI_TuxService object for each distinct service you are calling. Also, create a new BVI_TuxService object for each simultaneous asynchronous service you are calling.

var service = session.getNewService(TESTSERVICE);

Represents a buffer containing request parameters or a response from the remote eLink Platform service. Capable of storing an entire table of information.

var message = new BVI_TuxMessage();


Adds value to the buffer as an occurrence of name.

!message.addLong("MSRAIRBILLNUM",Request.value("airBillVal"))


testexecuteasync.jsp

This method should be called only after the executeAsync() method is called, otherwise the method fails and returns false.

service.getReply()



 


Running the Sample Application

Once the configuration is complete, follow the instructions below to run the sample application. This section contains the following topics:

Step 1: Start Your Web Browser

In the Address bar enter the http address http://mybvisnode/bea_start.html where mybvisnode is the node where Broadvision is installed. The HTML screen shown in Figure 4-1 should eventually display. If this screen does not appear, click on another link to reload the screen.

Figure 4-1 Sample Application HTML Screen

Step 2: Click on the Enter as Guest Link

The following screen displays.

Step 3: Click on the Search Link Under the Tuxedo Menu

The following screen displays.

Step 4: Enter the Master Air Bill Number

Enter 1000 as the Master Air Bill Number and hit the Search button. The following HTML screen displays showing the information retrieved from the Tuxedo Service TESTSERVICE.