Laddawn.com : Programming Specs - Avante Web Interface

Avante – Web Interface
Purpose: Communicate information from Avante to the web, and from the web to Avante.
Overview: The only way we can get information from the website back to Avante is to use TXX files. However, to get information from Avante to the website it can pass parameters as part of the address we want the browser to navigate to. So, Avante will store the parameters the website will need to use in its TXX file, then pass along 2 parameters, PortNumber, and MarkerID. The website will look for those parameters, and if they are set, it will hold them to pass into each RPC call.
Process:

  • Avante Side:
    • Create a routine in Avante that will build and save the Web parameters to the TXX file. This way we have one location to update the record structure.
      • Build the record defined below.
      • Record ID: WEB.INFO.INTERNALTIME
    • Create a routine that can be called by routines the website calls. Parameters PORT.NUMBER, PORT.MARKER, WEBOPTIONS.
      • Objective: Find the correct file to read the record from. Read the record into WEBOPTIONS.
      • It has to be KTXX aware. Every "/" command moves all the contents of the current TXX file to another file, but it leave a marker record saying where it put it. The format of this record is always the same.
        • F1: Information Message – Current Terminal File Contents have
        • F2: been Preserved by SYSS0002 on File KTXX##
          • Where ## is some system assigned number. So the file name of where to look is in FIELD(F2, " ", 7)
      • Meaning that when the routine will read the PORT.MARKER from the file. If the read fails, then look for PRESERVED.TO If that read fails then the PORT.MARKER does not exist for this port number. If there is a PRESERVED.TO record then grab the last (seventh) word from F2 and use that as the file name to read from next.

 

  • Web Side:
    • Check if PortNumber and MarkerID are set. Save them with the Session Cookie. We will modify Base Entity to pass these fields along to every RPC call. These are the markers signifying that it is an internal person logging into the site.

 

  • WEB.INFO Marker Record Structure:
    • F1: Contact Number
    • F2: Customer Number
    • F3: Operator Code
    • F4: Request Number


Pseudo Code:

  • Avante Saving Marker Record

BP WEB.SAVE.TXX.RECORD(PARAM)
INCLUDES IIPLUS.TOP
TXX.REC = ""
TXX.REC<1> = PARAM<1> ;*CONTACT NUMBER
TXX.REC<2> = PARAM<2> ;*CUSTOMER NUMBER
TXX.REC<3> = PARAM<3> ;*OPERATOR CODE
TXX.REC<4> = PARAM<4> ;*REQUEST NUMBER
WRITE TXX.REC TO TXX, "WEBINFO.":TIME()

  • Avante Port Marker Record Read

LDLIB FIND.AVANTE.WEBINFO(PARAM.BUFFER)
INCLUDES LAD.COMMON
T.FILE = T: (PORT.NUMBER formatted to 3 digits)
LOOP UNTIL DONE
READ MARKER.REC FROM T.FILE, PORT.MARKER THEN
DONE = 1
ELSE
READ PRESERVE.REC FROM T.FILE, "PRESERVED.TO" THEN
T.FILE = FIELD(PRESERVE.REC<2>, " ", 7)
ELSE
DONE=1
FAIL = 1
END
END
IF FAIL = 0 THEN
PARAM.BUFFER = ""
ELSE
PARAM.BUFFER = MARKER.REC
END