Dr. LAPI - Configure the Livelink Builder for LAPI Development

This small article describes how you could run the Livelink Builder (SDK) to debug LAPI calls.

The Livelink Builder runs a single threaded livelink Application Server, in which you are able to develop and test code that interacts with Livelink, such as WebLingo, OScript and of course LAPI. In the same CD pack as your Livelink Builder you will find all the LAPI class files and the LAPI OScript Module.

When you next open up the Livelink Builder, it will enumerate all the modules and XDB's in your instance. Each of the LAPI class calls are in an OSpace - or Object Space - inside one of the many Livelink Modules. This article assumes that you have installed the Livelink Builder on a development machine, which has a working development instance of Livelink, and that you have some knowledge/exposure to working with Livelink and the Builder tool itself.

Before starting any work with the Builder, ensure that you make a backup of your Livelink root files to a safe place where you can restore you can restore them if needed. To test this, try removing some files on your dev instance and try restarting the Livelink Builder - or even the Livelink application for that server. Obviously livelink will throw errors. Now try the restore and see if you can start from where you where. This may save you a lot of problems later, a database backup may also be helpful.

Notifications - formerly called Change Agents - should be disabled since as the Livelink Builder is single threaded, if these are not disabled then Livelink will try to run those when appropriate. This can be done by updating [loader] section of the opentext.ini file as shown in the following table :

OpenText.ini Entry Description
#load=sockserv;agents;notify  The default should look something like this, will the entire line commented out.
#load=sockserv;agents;  Notify commented out.
load=sockserv  This should be the standard LAPI development mode.

When you are starting Builder you will get the screen opposite if the Livelink instance you are trying to connect to is already active in any way. In most cases, the option to select from this dialog is Shutdown. Otherwise, the Builder will start up and show the main screen. Depending on your computers processing power and the number of modules and XDBs - AN XDB is a translate or Xlate Ospace, contains translations of most of the GUI Labels - installed.

 

Screenshot
The LAPI code is grouped into several sets of classes for ease of reference, they are :

LAPI Class Description
DAPI The Document API is in the OSpace APIDOC->APIDocuments and contains all the functions that interact with documents, such as AddDocument.
UAPI The User API is in the OSpace APIUSER->APIUser and contains all the functions that interact with Users & Groups and Livelink's ACLs - Access Control Lists - such as ListUserGroup.
WAPI The Workflow API is in the OSpace APIWORK->APIWork and contains all the functions that interact with Livelink's Workflow and Form modules, such as StartWorkFlow.
APISEARCH The Search API is the OSpace that contains all the functions that interact with Livelink's Search and Indexing components.

Each object has its methods and you break points can be added either within your code or the relevant LAPI module as required. Breakpoints can be added in one of two ways. The firstly a Script level break, these stop when the Livelink application opens the WebLingo template, Script, LAPI or OScript file that has the breakpoint set in it. The second case is a Line level break, which stops when the Livelink application reaches any line in any file that has a breakpoint set on it. The latter are especially useful if you want to move through a large file and stop at several key points. The following screenshot shows a Script level breakpoint which has been added to the execute method of the ListUsers. You can tell this because of the breakpoint icon (Script Level Breakpoint), as opposed to the normal icon (Script Level Breakpoint), in the top right corner. Clicking on the icon toggles the breakpoint on and off.

Script level breakpoint in the Livelink Builder

Within each file, you can also set a breakpoint on a given line within a file which may or may not already contain one or more Line level breakpoints or possibly even a Script. This is done by right clicking on the relevant line and selecting Set Break option from the context menu as shown in the screenshot below. A red diamond (line level breakpoint) appears at the start of the line on which you have set the breakpoint to indicate the breakpoint.

Setting a line level breakpoint in the Livelink Builder

As you can see the Livelink Builder can be used to assist in the development and maintenance of LAPI code as well as standard OScript - for which is more commonly known and used. Now your debugging starts and welcome to the world of Assocs, RecArrays and Lists.Happy programming. And of course as every OOP person knows this is your object.
Website Designed by Adservio Consulting Valid HTML 4.01 Strict    Valid CSS!    Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0