Question & Answer
Question
Hints and tips for using DB2® Content Manager for iSeries™ Application Programming Interface (API) called QVISNDRCV
Answer
The following information applies to both DB2® Content Manager for iSeries™ Version 5 Release 1 and DB2 Content Manager for iSeries Version 5 Release 3. See Chapter 7 of the IBM® DB2 Content Manager for iSeries Application Programming Guide and Reference for more details regarding setup and use of the QVISNDRCV Application Programming Interface (API).
QVISNDRCV is a generic API for sending data to and receiving data from a workstation. This function can be used by DB2 Content Manager for iSeries applications to display documents through the DB2 Content Manager for iSeries client.
There is a sample C language program called QVISNDWS that has an example of how to write QVISNDRCV calls. This C language program is a stand-alone program which accepts the buffer to be sent as an input parameter. It can be used from within other programs, or can be used from a command line to test the interface. It sends the buffer, calls QVISNDRCV again to close the communication session, and ends. If QVISNDWS does not reside in the QVI library, you can download the zip file QVISNDWS.ZIP from one of the following websites:
A default workstation DLL (EKDVIDSP.DLL) is provided with the DB2 Content Manager for iSeries client. The buffer specified in QVISNDRCV is passed to the workstation DLL for processing. EKDVIDSP is provided, and supports Display, Reset, Print, and Search requests. The request type is specified in the first byte of the buffer as follows:
The remainder of the buffer contains information specific to the request.
The QVISNDWS program will take the parameters passed into it and move them to the QVISNDRCV buffer to be used on the QVISNDRCV API call. Here are a few examples of how you can call the QVISNDWS program to perform the above listed operations:
D for Display
Displays the item in either read or write mode.
call QVISNDWS 'DWDA98123AA.AAB F000000101 DA98125AA.ABG'
T for Table of Contents
A table of contents will be returned for each folder ID passed into QVISNDRCV.
Byte 1 is set to T.
The remainder of the buffer contains one or more folder IDs whose table of contents are to be returned. There must be a space between each folder ID.
call QVISNDWS 'TF000000001 F000000510'
R for Reset
Reset will clear the client window to prepare for the next display.
Byte 1 is set to R.
call QVISNDWS 'R'
P for Print
Prints the objects associated with an item.
Byte 1 is set to P.
Byte 2 may be a / (slash) to request that the DB2 Content Manager Print Options dialog be displayed for each document. If byte 2 is not a / then the documents are all printed with the defaults from that dialog.
The remainder of the buffer is the same as for Display. For example:
call QVISNDWS 'PDA98123AA.AAB F000000101 DA98125AA.ABG'
S for Search
Byte 1 is set to S.
Byte 2 is the delimiter, or separator character for the search expression.
Byte 3 is the delimiter, or separator character for the search expression. The first field in the search expression must be the name of the DB2 Content Manager Index Class or WAF File Cabinet.
The remainder of the buffer is composed of pairs of Attribute IDs (or names) and Attribute Values. If the data is in a format similar to "A41" then it is an Attribute ID (the number is obtained through the DB2 Content Manager APIs). To specify an Attribute Name, surround the name with the @ (at) character. For example, to find all documents in the NOINDEX (To be indexed) Index Class where the User ID starts with "VI" and the Source starts with "IMPORT", either of these search expressions could be used:
call QVISNDWS 'S/NOINDEX/A41/VI/A40/IMPORT/'
call QVISNDWS 'S/NOINDEX/@USER ID@/VI/@SOURCE@/IMPORT/'
The search will be performed by the DB2 Content Manager Client and a Search Results List will be displayed. Note that at this time, you must use either the attribute NUMBER or DESCRIPTION. This description can be used only if it is unique. This might change in the future so it is best to use attribute numbers.
Q for Quit
When the OLE interfaces are used to launch the DB2 Content Manager client, the client will stay active in the Task Manager even after the user logs off the client. If the client is not completely ended, the user's job on the server will not disconnect and the user count will not be decremented even though the user is no longer active via the client. To guarantee that the connection is completely closed when the user logs off the client, QVISNDWS (the program that calls QVISNDRCV) must be called one last time with a Quit request. This will end the connection between the client and the server and the user count will be decremented.
Byte 1 is Q.
call QVISNDWS 'Q"
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21215537