bpi.set.tagval2()

bpi.set.tagval2()

Blue Prairie Forms works by building a set of tag/value arrays then passing those tags and values to a routine that intelligently swaps tag names in the OpenOffice template with values associated with those tags.  This subroutine allows the programmer to pass tags and values into associated arrays that are then passed into the document make routine for creation of the output document.  This subroutine will be used often when converting legacy print routines to Blue Prairie Forms. Calls to bpi.set.tagval2() will replace legacy print statements in legacy print programs.  Instead of printing variable values to a spooled output file, those variable values will be passed into the tag/value array.

Subroutine Syntax

CALL bpi.set.tagval2( blocks, tags, vals, this.block, this.tag, this.value, mode, pos,verbose )

Parameters

Param

Direction

Description

blocks

passed

returned

A attribute delimited array of block names associated with elements in the tags and vals array.  Blocks are used for advanced repeating data used in templates and may not be applicable in all instances.  A block of ‘blank’ means that the tag is not associated with a specific repeating block of data but instead applies to the entire document.

tags

passed

returned

A attribute delimited array of tag names. The ‘this.tag’ value will be added to this array if it does not already exist in the tags array.

vals

passed

returned

A attribute delimited array of values to be associated with corresponding tag in the tags array.  Note, repeating data may be multivalued within this attribute position.

this.block

passed

returned

A block name associated with the this.tag/this.value pair being added or updated in the blocks/tags/vals arrays.

 this.tag

passed

returned

A tag name such as "%companyName% that will be used inside the template as a placeholder where the value will be inserted

this.value

passed

returned

The value to be assigned to this.tag.  For example "ABC COMPANY"

mode

passed

Normally, this parameter should be left blank.

If unsigned integer, this.tag/val will be placed at that position in array.  This will overlay any tag/value previously in that position.


If string 'add' will add this.tag/value to end of the arrays.


anything other than integer or 'add' then routine will look for this.tag in tags and use the located position and update that position in arrays overlaying the prior value. if it can't find this..tag in tags, then it
add behave as 'add' mode.

pos

returned

This will be set to the vector (position) within the tags array where the routine placed the tag and value you passed.  If this is a new tag that had not previously been created, then the tag would be added to the end of the array and pos would be an integer indicating the position where that tag was placed.

verbose

passed

An integer indicating the level of verbosity for this subroutine.  Zero puts out no messaging.  The higher the number, the more messaging is output by the subroutine to the screen.

 

bpi.server.verifyremotefile()

bpi.server.verifyremotefile()

This subroutine checks make sure that a file is accessible on the Oo server.

Subroutine Syntax

CALL bpi.server.verifyremotefile( host, user, filepath,form.id, level, status, result, verbose )

Parameters

Param

Direction

Description

host

passed

The hostname or ip address of the Oo server

user

passed

The user name to use for each ssh directive

filepath

passed

The path to the directory on the Oo server where the document lives

form.id

passed

The name of the file in the filepath to check

level

passed

For future use

status

returned

0 if the file is found, error code if the file is not found

result

returned

Full text of message returned from the remote system ls -x1 directive.

verbose

passed

level of verbosity

 

Note: It is a good practice to call bpi.server.verifyremotefile to ensure that the mount on the remote server is alive and active before calling bpi.oo.render

bpi.server.getprinterstatus()

bpi.server.getprinterstatus()

This routine checks the printer status on the Oo server and returned a result.  It is advised that this routine be called in programs sending print jobs that wish to determine if the printer is available before rendering a document for printing.

Subroutine Syntax

CALL bpi.server.getprinterstatus( host, user, printer, level, status, verbose, result )

Parameters

Param

Direction

Description

host

passed

The hostname or ip address of the Oo server

user

passed

The user name to use for each ssh directive

printer

passed

The printer name on the Oo server to check

level

passed

reserved for future use

status

returned

Set to 1 if the printer is accepting requests and 0 if not

verbose

passed

level of verbosity

result

returned

the text output from the directive issued on the Oo server

 

bpi.server.checkalive()

bpi.server.checkalive()

This subroutine performs a simple check of the Oo server.  It is advised to check the server each time a document is sent to it. This can also be integrated into application code to take action in the event that the OpenOffice server is unavailable.

Subroutine Syntax

CALL bpi.server.checkalive( host, user, level, status, verbose, ping.result,echo.result )

Parameters

Param

Direction

Description

host

passed

The hostname or ip address of the Oo server

user

passed

The user name to use for each ssh directive

level

passed

defines the intensity of the check:

0 = ping only

1 = ping and ssh echo bounce

status

returned

1 if successful, 0 if failed

verbose

passed

level of verbosity

ping.result

returned

the text output from the ping directive issued

echo.result

returned

the text output from the echo directive issued

Page 1 of 5