The RBO Server API consists of a number of BASIC functions intended to
facilitate the generation of BASIC methods and server event handlers.
These functions share a common syntax:
where status is a value returned by all the API functions to indicate success or failure. Each API member is defined as a BASIC function within the item RBO.H, which resides in the WWINSERT file. This file must be INCLUDEed in any user code that intends to use any of the API functions. The RBO.H file defines the function prototypes, and possible status return values.
Note that there is a single status value that indicates success for any of the API functions. This value is EQUated in the RBO.H file as RBO.NO.ERROR and therefore, any returned value other than this indicates an error of some type.
{Function Summary} | |
{fbi:=RBO.createObject} | Creates an instance of a RBO class |
{fbi:=RBO.callMethod} | Invokes a method in a RBO object |
{fbi:=RBO.getProperty} | Retrieves the value of a property from a RBO object |
{fbi:=RBO.setProperty} | Sets the value of a property in a RBO object |
{fbi:=RBO.setMessage} | Inserts an alert message into the {p:WW:connection=rtn_info} property of the {c:WW:connection} object |
{fbi:=RBO.setError} | Inserts an error message into the {p:WW:connection=rtn_info} property of the {c:WW:connection} object |
{fbi:=RBO.setDBVals} | Sets the values of specified database fields in a RBO object |
{fbi:=RBO.getDBVals} | Gets the values of specified database fields in a RBO object as held by the RedBack server |
{Function Detail} |
Function RBO.createObject(CLASSNAME, OBJECTHANDLE)
Use this function to create an instance of CLASSNAME class. If successful, the handle to the new object is returned in OBJECTHANDLE. This function returns RBO.NO.ERROR if the create succeeded, or RBO.ERROR if the class could not be instantiated.
Function RBO.callMethod(OBJECTHANDLE, METHODNAME)
Invokes the method called METHODNAME in the object defined by OBJECTHANDLE. This function will return RBO.NO.ERROR if the method existed, and the call to that method did not return an error. RBO.ERROR is returned on any error condition.
Function RBO.getProperty(OBJECTHANDLE, PROPNAME, PROPDATA)
This function is used to retrieve the value of the property with the name PROPNAME from the object defined by OBJECTHANDLE. If successful, the property value is returned in PROPDATA, and the function returns RBO.NO.ERROR.
If the request fails, the status value may be one of:
RBO.BAD.OBJECT - Object not found. Is OBJECTHANDLE defined? RBO.BAD.CLASS - Class not found. Check OBJECTHANDLE is an instance of an object in the {cb:WW:RBO} class hierarchy. RBO.BAD.PROPNAME - Property not found. Check PROPNAME value. RBO.BAD.PERMS - Permission denied. Is PROPNAME readable? RBO.ERROR - Other generic (ie: undefined) error
Function RBO.setProperty(OBJECTHANDLE, PROPNAME, PROPDATA)
Use this function to set the value of the property called PROPNAME in the object defined by OBJECTHANDLE, to the value passed in PROPDATA. If successful, the function returns RBO.NO.ERROR. Other values indicate an error.
These values are:
RBO.BAD.OBJECT - Object not found. Is OBJECTHANDLE defined? RBO.BAD.CLASS - Class not found. Check OBJECTHANDLE is an instance of an object in the {cb:WW:RBO} class hierarchy. RBO.BAD.PROPNAME - Property not found. Check PROPNAME value. RBO.BAD.PERMS - Permission denied. Is PROPNAME setable? RBO.ERROR - Other generic (ie: undefined) error
Function RBO.setMessage(MSGTEXT)
This function is used to insert an alert message (ie: not an error message) into the {p:WW:connection=rtn_info} property of the {c:WW:connection} object.
Calling this function is equivalent to the steps:
ERC = RBO.getProperty("connection", "rtn_info", RVAL) IF ERC = RBO.NO.ERROR THEN RVAL<-1> = "ALERT ":MSGTEXT ERC = RBO.setProperty("connection", "rtn_info", RVAL) ENDThis function returns RBO.NO.ERROR if successful, or RBO.ERROR on any error.
Function RBO.setError(MSGTEXT)
This function is used to insert an error message (ie: not an alert message) into the {p:WW:connection=rtn_info} property of the {c:WW:connection} object.
Calling this function is equivalent to the steps:
ERC = RBO.getProperty("connection", "rtn_info", RVAL) IF ERC = RBO.NO.ERROR THEN RVAL<-1> = "ERROR ":MSGTEXT ERC = RBO.setProperty("connection", "rtn_info", RVAL) ENDThis function returns RBO.NO.ERROR if successful, or RBO.ERROR on any error.
Function RBO.setDBVals(NAMELIST, VALLIST)
Use this function to set the values of specified database fields. This function can be used in conjunction with the {m:WW:uObject=PostRead}, {m:WW:uObject=PreWrite}, {m:WW:uObject=PostWrite} and {m:WW:uObject=NoWrite} server actions. NAMELIST contains an attribute mark delimited list of all the field names for which values are to be set. VALLIST is an attribute mark delimited list that specifies a value for each corresponding field name in NAMELIST. This function returns RBO.NO.ERROR if successful, or RBO.ERROR on any error.
Function RBO.getDBVals(NAMELIST, VALLIST)
This function is used to get the values of the specified database fields, as held by the RedBack server. Note that these values may not match those held in data aware properties associated with the same field, as these reflect the latest changes at the user interface level. This function can be used in conjunction with the {m:WW:uObject=PostRead}, {m:WW:uObject=PreWrite}, {m:WW:uObject=PostWrite} and {m:WW:uObject=NoWrite} server actions. NAMELIST contains an attribute mark delimited list of all the field names for which values are to be returned. If a null value is passed in this variable, then all field names will be interrogated, and this list of names will be returned in this parameter. VALLIST has no meaning as an input parameter, but on return will contain an attribute mark delimited list of database values, one for each corresponding field name in NAMELIST. This function returns RBO.NO.ERROR if successful, or RBO.ERROR on any error.