WebKit API Documentation

The WebKit Utilities are a series of uniVerse BASIC programs and subroutines useful in building WebKit applications.


UTILAlphameric is a subroutine strips all chars except A-Z and 0-9 
from the supplied string.
Back to Index

UTILCalendarDate is an IType subroutine that generates calendar date
Back to Index

HTMLCalDisp - Display a calendar for a specified month
usage: HTMLCalDisp [-W] [-L link] [-E EndMon] [-M] [-S|-D] 
                   StartMonth [Year]
  StartMonth The month or the beginning of a range of months
             when -E is used
  Year       The Year of the month to display (default=current)
  -U link    The url of the control handling the action, to which
             '+@dow=date' will be appended. (& if + is used)
  -W         Display weekends as actionable (linked)
  -E EndMon  The last month to process in a range
  -M         Start week on Monday
  -S         Inclusion Array using this format: 
               internal_date@VMopt@VMhtml(text.links,images)
               opt:  
             if SLNum is not specified, SL 1 is used 
  -D         Exclusion Array using this format: 
               internal_date@VMcellopt@VMhtml(text.links,images)
               opt:  
             if SLNum is not specified, SL 1 is used 
Back to Index

UTILCompareSource compares production and test files
record by record for differences
usage: UTILCompareSource [-D] filename WKPROD
where WKPROD is the name of the production account
this assumes that you are running this in the test account
and that for each file you are testing, there is a Q ptr
to the production version of the file named filename.WKXXXXXXXX
if option -D specified, the program displays the compared records in a table
Back to Index

UTILCryptFun encrypts and mimeencodes 
usage: SUBR("UTILCryptFun","VALUE")
-----------------
Back to Index

UTILDecryptFun encrypts and mimeencodes 
usage: SUBR("UTILDecryptFun","VALUE")
-----------------
Back to Index

UtilDownLoadCSV generates a CSV file.
The first record is a column header record.
The records to include are in SELECT LIST 1
if the select list items are multivalued then
UTILDownLoadCSV assumes it is processing a exploded association.
It uses the second value of the select list item
to select the value for each multivalued field being downloaded.
usage: UTILDownLoadCSV [-FLR] [-NH | -HO] [-NQ] [-FN][-VM c] [-SVM c] [-TM c] [-Mx] [-Dy] [-Rz] [-OF outfile] datafile downloadfield ...
       -FLR specifies Fixed Length Record output instead of csv, no quotes
       -NH specifies not to include header record as first record in ouput
       -HO specifies to output header record only (for documentation)
       -HFLR specifies to output fixed length record layout only (implies -FLR and -HO)
       -NQ specifies not to quote evry field (only fields that have field
            delimiter in them are quoted)
       -FN specifies to use Field Names instead of Col Header in header record
       -VM, SVM, TM c   specify the character into which
                  value mark, subvalue mark, text mark are to be transformed
       -Mx x specifies the character to use to replace Value Marks
          -Mx is for compatibility only - its use is deprecated
       in fields that are multivalued. Default is space
       -Dy y is the field delimiter character (default = ,)
       -DTAB signifies TAB delimiter
       -Rz z is the record delimiter character (default = <LF>)
       -OF specifies name of output file. CSV file is written directly to
       outfile (path) rather than to std out.
Back to Index

UTILDODecode reads data object string(s) from SLIST 1 and returns specified
 data labels.
Calling sequence is:
 UTILDODecode(HTMLOutput,URL,ValueNamePairs,PropertyNameValue,ArrayElementLabel,ArrayValueLabel)
where URL is the external call
      ValueNamePairs are appended to the URL
      PropertyNameValue is the tree path to extract, labels 
                        delimited with '|' 
      ArrayElementLabel is the name of a label within an array to extract
      ArrayValueLabel is the label of the data element associated with 
                      the previous argument
          Use the above to associate two elements, returned as
          Element=Value
Back to Index

UTILDOMMod resets field data and other DOM attributes
<script type='text/javascript'>
document.getElementById("DPC_EXP_SHIPPING<@SM>_MM/DD/YYYY").value="FieldVal";
    ...
</script>
UTILDOMMod [-I DOMID] [-A DOMattr] @FileName @ID FieldName
where @FileName - name of file containing update data
      @ID - the record ID
      FieldName - Field with the value to update
      DOMID - field's DOM ID (default: wk generated id
      DOMattr - DOM attribute to modify (default: value)
Back to Index

UTILRecRecv saves data formatted by RecPrep
Calling sequence is:
UTILRecRecv @FILE @ID @RECORD
where
	@File File to which the record is copied. Default is remote
@ID	Record ID to update/create. Default is remote
	@RECORD	is the record data from the other system
Back to Index

UTILRecSend Formats a record for copy to another account or system
Calling sequence is:
UTILRecSend [-d] RemoteCmd LocFile LocID [RemFile] [RemID]
where:
      -d 	does not delete curl script (PS*) and record (PR*) details
      RemoteCmd 	appends record data to "curl -s "
	LocFile File from which the record is copied
LocID	Record ID to copy
RemFile	File name on the receiving machine.  If unspecified, the
		local file name is used.
RemID	Record ID on the receiving machine.  If unspecified, the
		local file name is used.
Delimiter is of the format qCq, use caution where this sequence occurs
in data.  Consider adding bracketing characters as an argument for
decryption
Back to Index

UTILExportDBF generates a DBF format file.
usage: UTILExportDBF filename field [...]
where filename is the name of the universe file
and field ... specifies the fields to include in the output
SELECT LIST 1 contains the records to include in the output.
Back to Index

GENEQU will generate the equates needed to refer to file fields
using the dictionary names rather than field number
Calling sequence is
       GENEQU filename BPfile
where filename is the name of the file you are generating the equates for,
and BPfile is the BASIC source file to place the EQUATEs into.
The equates are generated in a source record named filename.H in file BPfile.
Back to Index

UTILEreplace subroutine to provide ereplace functionality in an IType
Back to Index

IFNAME - an I-TYPE Subroutine to extract the first name from a full name field
Back to Index

ILNAME is an I-TYPE Subroutine to extract the last name from a full name field
Back to Index

IMNAME - I-TYPE Subroutine to extract the middle initial from a full name field
Back to Index

NCLUDE HTML.BP H.H
Back to Index

      RecDelim is the initial record label, use if the results may include multiple records
JSON is in Select List 1
Requires database with field names that equate to the schema
hierarchy. Only fields that exist are saved.
Read data, look for value pairs in start tag, value between start
and end tag.  Nested values become PARENT.CHILD, PARENT.CHILD.GRANDCHILD,
etc.
Back to Index

      RecDelim is the initial record label, use if the results may include multiple records
JSON is in Select List 1
Requires database with field names that equate to the schema
hierarchy. Only fields that exist are saved.
Read data, look for value pairs in start tag, value between start
and end tag.  Nested values become PARENT.CHILD, PARENT.CHILD.GRANDCHILD,
etc.
Back to Index

UTILLoadCSV loads a comma delimited format file into a uniVerse data file
usage:UTILLoadCSV [-R y] [-D x] [-ID z] [-VM c] [-SVM c] [-TM c] [-U] [-V] [-S listname] [-C] [-IGNOREQ] universefile csvfile [field ... ]
where  universefile the name of a uniVerse file
       csvfile       the pathname of the Comma Delimited Format file
       field         names of the fields to put the data into.
                     first comma delimited field goes into first named field
                     and so on.
                     A field name with location 0 in the dictionary specifies
                     which comma delimited field is the ID.
                     The field name of - means skip that column in the input
                     field name of the form fieldname="constant value"
                     fills field fieldname with "constant value"
                     for each output record
     -D x             x is the field delimiter character (default = ,)
     -R y             y is the record delimiter character (default = <LF>)
     -ID z            z is the concatenated ID delimiter
     -VM, SVM, TM arg	specify the string to be transformed into
                      value mark, subvalue mark, text mark
     -U               update records by placing the new field values from the
                      comma delimited files into an existing record. Duplicate
                      IDs in input file will mean the last one
                      is the one written to output.
                      if -U is specified and a fieldname has a +/- prefix then
                      the value of that field is inserted as the last/first
                      value in that multi-valued field
     -NONEW		new records are ignored.
                      Used with -U to update only existing records
     -V               displays the record IDs as they are updated.
     -S listname      puts the Record IDs of the loaded records into
                      record "listname" in &SAVEDLISTS& on exit
                      Puts the names of the fields updated, space delimited
                      into listname.FIELDS in &SAVEDLISTS&
     -C               specifies that the fields specified on the command line
                      select the subset of the fields in the first row of
                      csv file to be loaded. Other fields are ignored.
                      If the command line fields do not contain the @ID
                      record and the first line of the data file does, the
                      @ID column is loaded.
     -IGNOREQ         ignore quotes as meta chars. Treat them as data.
     if no field names are specified on the command line, they must be the
     first line of the data file
     If no @ID field name is specified, then
     sequential id's are generated. Duplicate IDs are made
     unique by adding a sequencer _nn to the ID.
Back to Index

UTILLoadMime creates a mime type file for HTMLFile use
usage: UTILLoadMime uvmimefilename mime.type.file.path
The uvmimefile is a universe file with file ext as the @ID and
mime type for that file ext in Field 1 (MIME.TYPE).
input format is:
type=mime/type         exts=ext1,ext2...
all other lines are ignored, including enc lines
Back to Index

UTILMailAddresses generates several different forms of email addresses
UTILMailAddresses type [option]
NOTE: This is obsolete - use /etc/aliases :include directive instead
where type and option are:
       ALIAS aliasname - generates the list as a line to be inserted in
                         the /etc/aliases file to define alias aliasname.
Since the database that contains aliases has a restriction of 1000 bytes
per alias, UTILMailAddress breaks longer aliases up into smaller chunks
and chains them.
SELECT List 1 contains the email addresses.
an ALIAS definition is written to &UFD& aliasname.txt
Back to Index

UTILMakeCSV creates a an IType that can be used to generate a character
delimited file from a uniVerse file.
The default field delimiter is a comma
calling sequence: UTILMakeCSV universefile Itype delimiter field ...
where  universefile name of universe file
       Itype        name of Itype to create
       delimiter    field delimiter
       field	      field names
Back to Index

MKMAKE inserts a new BASIC object into a MAKE file
Calling sequence is:
MKMAKE bpfile source catalog dependson ...
where bpfile is the name of the BP file containing the source and make files
      source is the name of the source record
      catalog is the name of the catalog entry to be made
      dependson are multiple objects in the sources file that
                this object depends on.
MKMAKE generates a rule of the form:
 uv "BASIC bpfile source"
 uv "CATALOG bpfile catalog source LOCAL FORCE"
MKMAKE assumes that there are macro definitions SRC and OBJ
if the object specified is does not start with "$" then MKMAKE
assumes that it is a filename in the bpfile and it prefaces it
with $(SRC). If it starts with "$" it puts it in verbatim
Back to Index

PARSENAME extracts parts of a name from a full name field passed
as the argument. This routine is used in I-Type subroutines:
     HONORIFIC, IFNAME, ILNAME, IMNAME
PARSE.NAME returns the following values
honorific <- the supplied honorific or "Mr." if none supplied
lname <- the last name token (dropping any suffix like Jr. or PHD)
fname <- everything between the honorific and the initial (if one)
         or the last name (if no initial)
ival  <- a middle initial if present between first and last name
ffname <- first of multiple fnames
                   (e.g., for John and Jane X. Doe, III)
                    lname = Doe
                    fname = John and Jane
                    ival = X
                    ffname = John
Back to Index

UTILPrepCreateFile Creates files in production accounts as needed by WebKit processes:
CAR, WKCONTROL
Back to Index

UTILPrepLocal creates "localized" VOC entries when WKPREP is run.
UTILPrepLocal can be run seperately to reddefine entries.
The pieces that let this utility work are:
VOC.WEBKIT LOCAL.RECS - contains initial values of local variables
VOC LOCAL.RECS - contains the last value specified for a local variable
Back to Index

UTILRecCopy copies a UniVerse file record from a different system
Calling sequence is:
UTILRecCopy url [LocFile] [LocID]
where:
	url	is the action on the remote server which formats the record
	contents for output
	LocFile File to which the record is copied. Default is remote
LocID	Record ID to update/create. Default is remote
Back to Index

UTILRecPrep Formats a record for copy to another account or system
Calling sequence is:
UTILRecPrep LocFile LocID
where:
	LocFile File from which the record is copied
LocID	Record ID to copy
Back to Index

CLIENTProgram {Options} ID
UTILRecPull triggers record copy from remote system to local
Calling sequence is:
UTILRecPull url
where url is the command that copies the record
Back to Index

UTILRecPush triggers record copy from remote system to local
Calling sequence is:
UTILRecPush url
where url is the command that copies the record
Back to Index

UTILRecPush triggers record copy from remote system to local
Calling sequence is:
UTILRecPush url
where url is the command that copies the record
Back to Index

UTILRecRecv saves data formatted by RecPrep
Calling sequence is:
UTILRecRecv @FILE @ID @RECORD
where
	@File File to which the record is copied. Default is remote
@ID	Record ID to update/create. Default is remote
	@RECORD	is the record data from the other system
Back to Index

UTILRecSend Formats a record for copy to another account or system
Calling sequence is:
UTILRecSend [-d] [-a] RemoteCmd LocFile LocID [RemFile] [RemID]
where:
      -d 	does not delete curl script (PS*) and record (PR*) details
      -a      do the curl asynchronously
      RemoteCmd 	appends record data to "curl -s "
	LocFile File from which the record is copied
LocID	Record ID to copy
RemFile	File name on the receiving machine.  If unspecified, the
		local file name is used.
RemID	Record ID on the receiving machine.  If unspecified, the
		local file name is used.
Delimiter is of the format qCq, use caution where this sequence occurs
in data.  Consider adding bracketing characters as an argument for
decryption
Back to Index

where: 	FileName is the transaction file
		@ID is the transaction record
		authscript is a shell script in WKSCRIPTS
               (default: restauth.sh)
TRANS.AUTH record must be defined to process
6/4 - change to save auth in transaction file dict
Back to Index

t(arg.) FileName then
Back to Index

UTILSlideShow generates the controlling paramenters for a photo
slide show
calling sequence: UTILSlideShow @ID sequence
Back to Index

UTILSpamCheck searches for form data commonly associated with spam and
flags it based on a dictionary item.
UTILSpamCheck FileName @ID RulesRecord
where FileName is the CAR file
	@ID is the record to check
	RulesRecord is an X type in DICT_FileName, the format is:
      0001: X
      0002: Location of TYPE/STATUS field which will be set to SPAM unless*			@VMOtherString is specifid
      0003: and higher - Pattern(s) to match (Default: http://)
     		Field Format: Pattern@VMFieldName@VMNumberofOccurrences
If no Rules Record, the program checks for the existence of a global
definition in SL.WEBKIT
Back to Index

SUBROUTINE UTILUDODecode(HTMLOutput,URL,SearchTerm,PropertyNameValue,ArrayElementLabel,ArrayValueLabel)
Back to Index

UTILUpdateWKVoc - unconditionally update all production
accmunts with an entry in the WEBKIT VOC.
UTILUpdateWKVoc VOC.ENTRY
where	VOC.ENTRY is the VOC item in webkit's VOC
Back to Index

UTILWeek is an IType subroutine that generates week of the year
Week is returned as the date of the Monday starting the week
March 1 1997 is returned as 2/24/1997
Back to Index

WEEKTEST.B test the subroutine UTILWeek
Back to Index

UTILWKDocGen generates WebKit documentation from the source files.
usage: UTILWKDocGen xxxx
       where xxxx.BP is a BP file that follows WebKit naming conventions
       Basic files are named xxx.B
       and the documentation is the 4th line through the first line
       that is not a comment.
turn off prompts and disable pagination
Back to Index

UTILWKReplace reads SELECTed records and executes command's between
<WK> tags. Result can replace the original or written to a different directory.
usage:UTILWKReplace {-O outfile} file [record]
     where file specifies the directory in which the template/iframe
     file(s) are located
     if record is not specified UTILWKReplace looks in Select List 1
     for a list of record specifiers
     -O outfile specifies outfile as the directory where output is written
     UTILWKReplace reads the template file and looks for lines containing
     the <wk> tag. Lines between start and end tag are executed and their
     output is inserted into the document.
Back to Index

UTILWKSplit splits a template file into html segments
            for use in a WKCONTROL transaction
usage:UTILWKSplit {-T token} {-I insertToken} {-O outfile} {-D} file [record]
     where file and record specify the html template file
     if record is not specified UTILWKSplit looks in Select List 1
     for a list of record specifiers
     token specifies the token that identifies split lines.
           Default is %WEBKIT
     -O outfile specifies outfile as the directory where output is written
        default is file
     -P prefix is the prefix (String following token) to be replaced
        with the current filename on output
     -D specifies that UTILWKSplit write out an html comment
        with the source file name for each split segment
        it writes the comment out as the last line except for the
        default .post segment. It puts it first for that one.
     -I command execution insertion token. Output of command after token is
        included in generated output. Default is WKINS  **mdj
     UTILWKSplit reads the template file and looks for lines containing token
     When it finds a line containing the token it looks for a string of the
     form tokenTfilenameT where T is the first character of the token
     It writes all the lines up to but not including the token line
     as a new file in file named filename.
     if filename is exit, then UTILWKSplit exits without writing anything else
     if filename is ignore, then UTILWKSplit discards previous lines.
     The last set of lines is written to file named prefix.post.
     example:  file FORMS template.html contains
            <html><head><title>Form Template</title></head>
            <body>
            %WEBKIT%form.pre%
            <form method=POST action=/bin/f.wk?WK.EXAMPLE>
            %WKINS%VOC.COMMAND%
            %WEBKIT%form.mid%
            <input type=submit value=Submit></form>
            </body></html>
Back to Index

      RecDelim is the initial record label, use if the results may include multiple records
XML is in Select List 1
Requires database with field names that equate to the schema
hierarchy. Only fields that exist are saved.
Read data, look for value pairs in start tag, value between start
and end tag.  Nested values become PARENT.CHILD, PARENT.CHILD.GRANDCHILD,
etc.
Back to Index
Revised: 06/01/2017