S/Web User Manual

Home S/Web Description S/Web Overview S/Web Installation S/Web Features S/Web Functions S/Web Objects S/Web Settings S/Web Troubleshoot S/Web FAQ S/Web Appendices

Links on this page:
 
Program Description Type
DICT_WWW_CLIENT_EQUATESEquates record for the WWW_CLIENTS_TABLEEquates
DICT_WWW_REPOSITORY_EQUATESEquates record for the WWW_REPOSITORY TABLEEquates
RTP25Replacement debuggerSystem
SWEB_DOCUMENTFunction to return a repository defined document back to the clientUser
Example
SWEB_IMAGEFunction to return a repository defined image back to the client.User
Example
SWEB_LOGOUTFunction is used to logout a user 
SWEB_REDIRECTFunction redirects the browser to another URL 
WWW_ASSIGNEDSystem program to check if a variable is unassigned.  This program works on all version of Advanced Revelation, OpenInsight and RevGUser
System
WWW_CACHEFunction  to handle general disk based resource caching tasks.System
WWW_CACHE_EQUATESEquates for the WWW_CACHE functionEquates
WWW_CLIENTFunction to deal with client authentication and login processingUser
System
WWW_CLIENT_EQUATESEquates for the WWW_CLIENT functionEquates
WWW_CONVHandles conversions for internal processingSystem
WWW_DOCUMENTFunction to handle document related functionsUser
System
WWW_DOCUMENT_EQUATESEquates for the WWW_DOCUMENT functionEquates
WWW_EXAMPLE_LOGIN_PROCExample program demonstrating how to create a login procedureUser
WWW_EXEC_METHODGeneric execution method for S/WEB objectsSystem
WWW_GET_PROPERTYGeneric program to retrieve properties for S/WEB system objects.User
System
WWW_GET_STATUSFunction to examine error status from an S/WEB functionUser
System
WWW_LHFunction to handle Linear Hash methods in the S/WEB contextUser
System
WWW_LH_EQUATESEquates for the WWW_LH functionEquates
WWW_PROPERTY_EQUATESEquate record containing the list of valid objects available in the system.Equates
WWW_RECOVERYRestores the system after a call to the debuggerSystem
WWW_REPOSITORYFunction to handle repository accessUser
System
WWW_REPOSITORY_EQUATESEquates for the WWW_REPOSITORY functionEquates
WWW_REQUESTMethods for the request objectUser
System
WWW_REQUEST_EQUATESEquates for the WWW_REQUEST functionEquates
WWW_RESPONSEMethods for the response objectUser
System
WWW_RESPONSE_COMMONHolds common block declarations used by the WWW_RESPONSE functionEquates
Common
WWW_RESPONSE_EQUATESEquates for the WWW_RESPONSE functionEquates
WWW_RESPONSE_SUBFunction that handles additional processing for WWW_RESPONSESystem
WWW_SERVERMain processing loop for S/WEBSystem
WWW_SERVER_EQUATESEquates for WWW_SERVEREquates
WWW_SESSIONFunctions to handle the SESSION objectUser
System
WWW_SESSION_EQUATESEquates for the WWW_SESSION functionEquates
WWW_SET_PROPERTYGeneric program to set properties for S/WEB system objects.User
System
WWW_SET_STATUSFunction to set error status from an S/WEB functionUser
System
WWW_STATUS_EQUATESEquates used by WWW_GET_STATUS and WWW_SET_STATUSEquates
WWW_TABLESEquate record listing the tables used by S/WEBEquates
WWW_UIFunctions to manipulate the user interface in S/WEBUser
System
WWW_UI_EQUATESEquates for the WWW_UI functionEquates
WWW_UTILITYGeneral routines for use in S/WEBUser
System
WWW_UTILITY_EQUATESEquates for the WWW_UTILITYEquates
WWW_YIELDFunction to yield the systemSystem

[top]

DICT_WWW_CLIENT_EQUATES

Equate Name ValueDescription
WWW_CLIENT$AUTHENTICATED$1 
WWW_CLIENT$EXPIRY_DATE$2This is the date the client expires
WWW_CLIENT$EXPIRY_TIME$3This is the time the client expires
WWW_CLIENT$IP_ADDRESS$4This is the IP address of the client
WWW_CLIENT$REQUEST_CACHE_KEY$5 
WWW_CLIENT$IP_ADDRESS_HISTORY$6 
WWW_CLIENT$USERNAME$7 
WWW_CLIENT$USER_DATA_KEY$8 

[top]

DICT_WWW_REPOSITORY_EQUATES

Equate Name ValueDescription
WWW_REPOSITORY$TABLE_ID$1The name of the LH table this repository item is stored in.
WWW_REPOSITORY$RECORD_ID$2The name of the LH record.
WWW_REPOSITORY$TITLE$3A title for the repository item
WWW_REPOSITORY$DESCRIPTION$4A description of the repository item
WWW_REPOSITORY$CACHE_CONTROL$5 
WWW_REPOSITORY$USE_TIMESTAMP$6 
WWW_REPOSITORY$HTTP_CONTENT_TYPE$7The HTTP content type
WWW_REPOSITORY$IGNORE_SERVER_CACHE$8 
WWW_REPOSITORY$UPDATE_DATE$30The date this item was last updated
WWW_REPOSITORY$UPDATE_TIME$31The time this item was last updated
WWW_REPOSITORY$UPDATE_NOTES$32 
WWW_REPOSITORY$BUFFER_COUNT$40 

[top]

RTP25 System

This program should never be called by the application developer 

RTP25 is replacement debugger for the Advanced Revelation instances of the S/WEB server.  This program prevents Advanced Revelation from going to the debugger prompt.  

[top]

SWEB_DOCUMENT

This example program shows how you can return a repository defined document back to the client. 

This function uses the WWW_EXEC_METHOD, WWW_GET_STATUS , WWW_SET_PROPERTY and WWW_SET_STATUS functions.

[top]

SWEB_IMAGE

This example program shows how you can return a repository defined image back to the client.

This function uses the WWW_EXEC_METHOD, WWW_GET_STATUS , WWW_SET_PROPERTY and WWW_SET_STATUS functions.

[top]

SWEB_LOGOUT

This function is used to logout a user. It allows the developer to specify a URL to redirect the user to. This is done by setting the keyword "URL" to the URL to go to. If no URL is specified the user will be taken to the server home page.

Usage:
http:/www.myserver.com/scripts/sweb.dll/logout?url=http://www.ask.com

[top]

SWEB_REDIRECT

This function redirects the browser to another URL and is primarily used to illustrate changing the LOCATION property of the RESPONSE object.

Usage:
http:/www.myserver.com/scripts/sweb.dll/redirect?urli=http://www.ask.com

[top]

WWW_ASSIGNED

This program return back a Boolean value indicating whether the passed variable has been assigned.  The primary purpose for this routine was to allow an unassigned variable check in Advanced Revelation and Revelation G versions that do not have the Assigned or UnAssigned functions and opcodes.  If your version of Advanced Revelation contains either of these functions or opcodes, this function gives no extra benefits.

Usage:
if www_Assigned( Variable ) else variable = ""
or
Status   =   www_Assigned( Variable )

[top]

WWW_CACHE

This is the underlying function for the CACHE method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all CACHE method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_CACHE_EQUATES

This is an equates record used by the WWW_CACHE function.

[top]

WWW_CLIENT

This is the underlying function for the CLIENT method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all CACHE method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_CLIENT_EQUATES

This is an equate record used by the WWW_CLIENT function.

[top]

WWW_CONV

This function is called as a user-defined conversion

Option IConvOConvDescription
DATETIMEYesYesIConv:   Returns back standard R/BASIC/Basic+ DateTime format (DT) based on the server type.  Different servers store dates and times in different internal formats. Oconv:  Converts an R/BASIC/Basic+  DateTime format (DT) to the DateTime format for the required server.
IPHEXYesYes
Iconv converts an 8 byte hex string to a properly formatted IP address
CommandResult
@ANS = IConv( "C0A8591D","[WWW_CONV,IPHEX]")192.168.89.29
OConv Converts an IP address to an 8 byte hex string.
CommandResult
@ANS = OConv( "192.168.89.29",[WWW_CONV,IPHEX]")C0A8591D
DISPTIMENoYes
Displays R/BASIC & Basic+ internal time value as HEX
CommandResult
@ANS = OConv( "609429","[WWW_CONV,DISPTIME]")7 Days, 01 hours, 17 minutes, 09 seconds

[top]

WWW_DOCUMENT

This is the underlying function for the CLIENT method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all CACHE method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_DOCUMENT_EQUATES

This is an equates record used by the WWW_DOCUMENT function.

[top]

WWW_EXAMPLE_LOGIN_PROC

This function is designed to show how to write an example login procedure for S/Web applications.  It can be modified and used for other applications.

S/Web login procedures are called by the CLIENT object's CREATE method if it determines that a client making a request has not been logged into the system yet.  Before it gets here it sets up some properties that we can use to determine the state of the request...

Once we have determined the state ( i.e. - are we trying to login or not? ) We then check the client's credentials ( if appropriate ) and/or send back the login document.

If the client has been properly validated, the CLIENT object is updated.  A valid CLIENT object would have the VALID property assigned to logical True.  In most cases, a username and other information (company, access rights, e-mail address, etc.) will be stored in the DATA property.

[top]

WWW_EXEC_METHOD

This is the mother of all programs, such as the saying goes.  It is the main calling routine for all the various methods in the S/Web system.  All method calls to any object should be made through this routine.  For more information on each object, and specific function syntax, please see Chapter 6, S/Web Objects or click on the hyperlink in the table below.

General usage:

www_Exec_Method( OBJECT, METHOD, Param1, Param2 ,Param3 ,Param4, Param5, Param6,)

Specific usage:

www_Exec_Method( "REQUEST", "GETQUERYVAL", "UN", 1, 1, username )

Valid System Objects Description
CACHEThis object handles information relating to the S/WEB cache.
CLIENTThis object handles information relating to the client making the current request.
DOCUMENTThis object handles information relating to a repository based document
LHThis object handles information relating to Linear Hash files
REPOSITORYThis object handles information relating to the S/WEB repository
REQUESTThis object handles information relating to the HTTP request.
RESPONSEThis object handles information relating to the HTTP response.
SERVERThis object handles information relating to this specific running S/WEB server
SESSIONThis object handles information relating to the current S/WEB session

This function is used to retrieve properties from S/Web object.  Multiple objects and properties can be delimited by record marks.

For a listing of the properties associated with each object,  please see Chapter 6, S/Web Objects.

General Syntax:

dataArray =        www_Get_Property( objxArray, propArray )

Specific Syntax:

objxArray = "REQUEST"
propArray = "SERVERURL"
objxArray := @Rm : "REQUEST"
propArray := @Rm : "SERVEREXTENSION"
dataArray =  www_Get_Property( objxArray, propArray )

[top]

WWW_GET_STATUS

This function is used to check the error status of a system program.  If there is an error, this function will return a logical False.  If there was no error, this function will return a logical True.  Any error text will be returned in the optional passed parameter

General Syntax:

errorStatus   =     www_Get_Status( errorText )

Specific Syntax:

....
www_Exec_Method( "REQUEST", "GETQUERYVAL", "UN", 1, 1, username )
If www_Get_Status( errorText ) Else
     * Danger Will Robinson!  Danger! Danger! We have received an error!
     classID  =     "HTML"
     docID         =     "GENERAL_ERROR"
     call www_Exec_Method( "DOCUMENT", "READ", classID, docID, docBuffer, docProperties, docBufferNo, docBufferCount )
     if www_Get_Status( errorText ) then
         abort  = TRUE$
     end else
          swap "%%ERRORTEXT%%" with errorText in docBuffer
          call www_Exec_Method( "RESPONSE", "SETCONTENT", docBuffer, "+" )
          docBufferNo += 1
          if ( docBufferNo > docBufferCount ) then
               eofDocument = TRUE$
          end
     end
     until ( eofDocument or abort )
     repeat
end

[top]

WWW_LH

This is the underlying function for the LH method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all CACHE method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_LH_EQUATES

This is an equates record used by the WWW_LH function.

[top]

WWW_PROPERTY_EQUATES

This equate record contains a list of all the valid system object.

[top]

WWW_RECOVERY

This function is used to restart the server if a critical error occurs.  This program should not be called by the end user.

[top]

WWW_REPOSITORY

This is the underlying function for the REPOSITORY method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all REPOSITORY method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_REPOSITORY_EQUATES

This is an equates record used by the WWW_DOCUMENT function.

[top]

WWW_REQUEST

This is the underlying function for the REQUEST method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all REQUEST method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_REQUEST_EQUATES

This is an equates record used by the WWW_REQUEST function.

[top]

WWW_RESPONSE

This is the underlying function for the RESPONSE method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all RESPONSE method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_RESPONSE_COMMON

This is an equates record used by the WWW_RESPONSE function.

[top]

WWW_RESPONSE_EQUATES

This is an equates record used by the WWW_RESPONSE function.

[top]

WWW_RESPONSE_SUB

This function contains additional code for the WWW_RESPONSE function.

[top]

WWW_SERVER

This program starts the main S/WEB server.  It should only be called to start and stop the S/Web server.  For more information,  please see the sections in Chapter 3 on starting the S/Web server in Advanced Revelation or OpenInsight.

[top]

WWW_SERVER_EQUATES

This is an equates record used by the WWW_REQUEST function.

[top]

WWW_SESSION

This is the underlying function for the SESSION method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all SESSION method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_SESSION_EQUATES

This is an equates record used by the WWW_SESSION function.

[top]

WWW_SET_PROPERTY

This function is used to set properties into an S/Web object.  Multiple objects and properties can be delimited by record marks.  The original values are returned from the function.

For a listing of the properties associated with each object,  please see Chapter 6, S/Web Objects.

General Syntax:

OrigDataArray  =  www_Set_Property( objxArray, propArray, dataArray )

Specific Syntax:

objxArray  =  "CLIENT"
propArray  =  "VALID"
dataArray  =  clientValid
objxArray  :=  @Rm  :  "CLIENT"
propArray  :=  @Rm  :  "DATA"
dataArray  :=  @Rm  :  clientData
origDataArray  =  www_Set_Property( objxArray, propArray, dataArray )

[top]

WWW_SET_STATUS

This function is used to set the error status of a system program.

General Syntax:

ErrorStatus  =  www_Get_Status( opFlag, errorText )

Valid opFlag values

Equate Name ValueDescription
WWWSTATUS_PUSH$-3Temporarily saves the current error list.
WWWSTATUS_POP$-2Restores the last saved error list.
WWWSTATUS_APPEND$-1Places the passed error text at the end of the current error list.
WWWSTATUS_REPLACE$1Replaces the current error list
WWWSTATUS_CLEAR$0Clears the current error list.

Specific Syntax:

....
www_Exec_Method( "REQUEST", "GETQUERYVAL", "UN", 1, 1, username )
If www_Get_Status( errorText ) Else
     * Danger Will Robinson!  Danger! Danger! We have received an error!
     classID  =     "HTML"
     docID         =     "GENERAL_ERROR"
     call www_Exec_Method( "DOCUMENT", "READ", classID, docID, docBuffer, docProperties, docBufferNo, docBufferCount )
     if www_Get_Status( errorText ) then
          abort  = TRUE$
          errorText     =     "Unable to read the " : docID :" document."
          call www_Set_Status( WWW_STATUS_APPEND$, errorText )
     end else
          swap "%%ERRORTEXT%%" with errorText in docBuffer
          call www_Exec_Method( "RESPONSE", "SETCONTENT", docBuffer, "+" )
          docBufferNo += 1
          if ( docBufferNo > docBufferCount ) then
               eofDocument = TRUE$
          end
     end
     until ( eofDocument or abort )
     repeat
end

[top]

WWW_STATUS_EQUATES

This is an equates record used by the WWW_SET_STATUS function.

Equate Name ValueDescription
WWWSTATUS_PUSH$-3Temporarily saves the current error list.
WWWSTATUS_POP$-2Restores the last saved error list.
WWWSTATUS_APPEND$-1Places the passed error text at the end of the current error list.
WWWSTATUS_REPLACE$1Replaces the current error list
WWWSTATUS_CLEAR$0Clears the current error list.

[top]

WWW_TABLES

This is an equate record holds the definitive listing of S/Web Linear Hash table names..

[top]

WWW_UI

This is the underlying function for the UI method of the WWW_EXEC_METHOD function.  This program should not be called directly.  You should use the WWW_EXEC_METHOD function for all UI method access.  Sprezzatura does not guarantee that the calling parameters for this function will remain constant.

[top]

WWW_UI_EQUATES

This is an equates record used by the WWW_UI function.

[top]

WWW_UTILITY

This function provides for various utilities we needed in writing the system.

DOSCOPYThis function copies an OS file to a new location
DOSMOVEThis function moves an OS file to a new location
ERRORTEXTThis function takes the error code array and attempts to turn it into a more user-friendly string.
ESCAPEThis routine escapes a string as per JavaScript and URL encoding - see RFC. 1738
FSERRORCalls the ERRORTEXT method to place the contents of @File.Error into a more user-friendly string
GETDATEFORMATThis function grabs the default system DATE format from the specified LND record
GETRESOURCETEXTThis method retrieves the resource text associated with a particular code(s) passed.  The codes and text are stored in the WWW_ENV table in the SWEB_RESOURCE_STRING record.
GETTIMEFORMATThis function grabs the default system DATE format from the specified LND record.
LHASHThis function scrambles a string by converting it into hex with a small bit of flotsam thrown in for good measure.  Note: Param1 should not exceed 100 chars
NAMECAPAttempts to capitalize a string as befitting a proper name.  For example, HOMER SIMPSON would be turned into Homer Simpson while RONALD MCDONALD would be turned into Ronald Mcdonald.
OSERRORMoves the content of Status() into @FILE.ERROR for use with the ERRORTEXT method
RESOLVEPATHThis function attempts to turn an relative path into an absolute path
RESOLVETIME 
TOKENISETokenises a string based on a delimiter, respecting quotes
UNESCAPEThis routine unescapes a string as per JavaScript and URL encoding - see RFC. 1738>
VERIFYPROCThis function verifies if the passed routine is a valid system routine. Advanced Revelation:  A valid system routine is a cataloged RBASIC program with a valid target or exists in the SYSOBJ file. OpenInsight:  A valid system routine exists in the SYSOBJ file.  The program does not have to be qualified into the current application.

DOSCOPY

Calling syntax

Argument Description 
param1  Full name and path of the source file
param2  Full name and path of the destination file
param3  Logical TRUE to overwrite the destination file
param4  Not used. 
param5  Not used. 
returnValueTrue if successful, false otherwise.

DOSMOVE

Calling syntax

ArgumentDescription
param1  Full name and path of the source file
param2  Full name and path of the destination file
param3  Logical TRUE to overwrite the destination file
param4  Not used. 
param5  Not used. 
returnValueTrue if successful, false otherwise.

ERRORTEXT

Calling syntax

Argument Description
param1  Error code string
param2  Not used
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueFormatted text string

ESCAPE

Calling syntax

Argument Description
param1  String to encode
param2  Not used.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueEncoded string.

FSERROR

Calling syntax

Argument Description
param1  Not Used.
param2  Not used.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueError Text

GETDATEFORMAT

Calling syntax

Argument Description
param1  Not used.
param2  Not used.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueDate format value

GETRESOURCETEXT

Calling syntax

Argument Description
param1  @Fm'd list of codes to get the text for
param2  @Fm'd list of replaceable parameters for each string
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValue@Fm'd list of text string

GETTIMEFORMAT

Calling syntax

Argument Description
param1  Not used.
param2  Not used.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueTime format value.

LHASH

Calling syntax

Argument Description
param1  String to modify  NOTE:  Must never exceed 100 characters!
param2  True to descramble - defaults to false
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueHashed value

NAMECAP

Calling syntax

Argument Description
param1  String to convert
param2  Delimiter  -  defaults to space
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueConverted string

OSERROR

Calling syntax

Argument Description
param1  Status() code
param2  Name of DOS file that caused the error.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueString representing the error.

RESOLVEPATH

Calling syntax

Argument Description
param1  The relative path to resolve
param2  The current directory - default is REVBOOT
param3  Not used.  H
param4  Not used. 
param5  Not used. 
returnValueThe absolute path

RESOLVETIME

Calling syntax

Argument Description
param1   
param2   
param3   
param4   
param5   
returnValue 

TOKENISE

Calling syntax

Argument Description
param1  String to tokenise
param2  character to use as a delimiter in the tokenized string - defaults to @Rm
param3  character to use as a delimiter when tokenizing the string - defaults to space
param4  Not used. 
param5  Not used. 
returnValueTokenised string

UNESCAPE

Calling syntax

Argument Description
param1  String to decode
param2  Not used.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueDecoded string

VERIFYPROC

Calling syntax

Argument Description
param1  Name of routine to check
param2  Not used.
param3  Not used. 
param4  Not used. 
param5  Not used. 
returnValueTrue if routine exists.

WWW_UTILITY_EQUATES

This is an equates record used by the WWW_UTILITY function.

[top]

WWW_YIELD

Calls the Yield() opcode in Advanced Revelation (if version 3.12) or the yield() function in OpenInsight.

WWW_YIELD surrounds the yield call with a PUSH.SELECT and a POP.SELECT

[top]

Copyright © 2005 The Sprezzatura Group. All rights reserved.