Additional Supplied Functions
This document contains details of additional functions that have been developed to meet the needs of individual customers. The Java code for these functions is shipped with the standard Ebase product, but the functions have not been added to the functions table (Tools -> Maintain Functions). They can be added as required. For each function, the implementation section describes the parameters required to add the function to the system using (Tools -> Maintain Functions) and these can be cut and pasted into the functions dialog. The functions are then immediately available for use.
These functions are supported by Ebase on a best efforts basis.
Please note that the Quick Address system must be installed and the proweb.jar file available on the Ebase classpath to use this function.
|
Syntax: |
addresslookupqa (string1, string2) |
|
|
|
|
Description: |
This function is used to perform Returns the number of addresses at postcode in string1. string2 must be a literal containing the name of a form field of display type selection. Populates string2 with list of addresses found, if any. |
|
|
|
|
Examples: |
set ADDRESS_COUNT
= addresslookupqa(POSTCODE, 'ADDRESSES'); |
|
|
|
|
Implementation: |
please contact Ebase support support@ebasetech.com for
implementation details. |
Please note that the Quick Address system must be installed and the proweb.jar file available on the Ebase classpath to use this function.
|
Syntax: |
addressidlookupqa (string1, string2, string3, string4, string5, string6, string7, string8) |
|
|
|
|
Description: |
This function is used to perform Returns the number of addresses (always 1) for address id string1.string2 , string3, string4, string5, string6, string7, string8 must be a literals containing names of form fields of display type text.Populates form fields represented by string2 , string3, string4, string5, string6, string7, string8 with address line 0, address line 1, address line 2, address line 3, town, county and postcode respectively for address id string1. |
|
|
|
|
Examples: |
set DUMMY =
addressidlookupqa(ADDRESS_ID, 'LINE_0', 'LINE_1', 'LINE_2', 'LINE_3', 'TOWN',
'COUNTY', 'POSTCODE'); |
|
|
|
|
Implementation: |
please contact Ebase support support@ebasetech.com for
implementation details. |
|
Syntax: |
deletefile(fullpath_filename_ext) |
||||||||||||||||
|
|
|
||||||||||||||||
|
Description: |
Deletes a file from a given folder |
||||||||||||||||
|
|
|
||||||||||||||||
|
Examples: |
set
FULLPATH_FILENAME_EXT = 'c:/temp/MyTest.txt'; set STATUS =
deletefile(FULLPATH_FILENAME_EXT); |
||||||||||||||||
|
|
|
||||||||||||||||
|
Implementation: |
|
|
Syntax: |
getActionField() |
||||||||||
|
|
|
||||||||||
|
Description: |
Returns the name of the field that triggered the current processing. This is only applicable for immediate validation fields, buttons and hyperlinks. Note that in the particular case when the current processing was triggered by an event associated with a table column e.g. hyperlink, button etc, and a fetchtable FPL command is issued against the table as part of this processing, this function will return null. |
||||||||||
|
|
|
||||||||||
|
Examples: |
set ACTION_FIELD =
getActionField(); |
||||||||||
|
|
|
||||||||||
|
Implementation: |
|
|
Syntax: |
getActionTableRow() |
||||||||||
|
|
|
||||||||||
|
Description: |
Returns the row number of the field that triggered the current processing when the field is a table cell. This is only applicable for immediate validation fields, buttons and hyperlinks. Returns 0 if processing is not triggered by a table cell action event. |
||||||||||
|
|
|
||||||||||
|
Examples: |
set ROW_NUM =
getActionTableRow(); |
||||||||||
|
|
|
||||||||||
|
Implementation: |
|
|
Syntax: |
getCallingForm() |
||||||||||
|
|
|
||||||||||
|
Description: |
Returns the name of the form that called the current form. |
||||||||||
|
|
|
||||||||||
|
Examples: |
set CALLING_FORM =
getCallingForm(); |
||||||||||
|
|
|
||||||||||
|
Implementation: |
|
|
Syntax: |
getMessageText(project, message_number [, parm1, parm2,…] ) project is the name of the project containing the message message_number is the number of the message parm1, parm2 etc are variables to be substituted into the message text replacing && strings |
||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||
|
Description: |
Returns a message text with any variables substituted. In a multi-lingual system, the same rules are applied to select the language as are used to display a text using the FPL message command. |
||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||
|
Examples: |
set TEXT1 =
getMessageText($PROJECT, 1007); set TEXT2 =
getMessageText('GLOBAL', 10000, POSTCODE, CITY); |
||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||
|
Implementation: |
|
|
Syntax: |
getmilisecBTD(DATE1,DATE2) |
|||||||||||||||||||
|
|
|
|||||||||||||||||||
|
Description: |
Returns the milliseconds between two dates Where DATE1 and DATE2 are fields of type date |
|||||||||||||||||||
|
|
|
|||||||||||||||||||
|
Examples: |
set DATE1 =
'01/09/2006'; set DATE2 =
'05/09/2006'; set STATUS =
getmilisecBTD(DATE1,DATE2); |
|||||||||||||||||||
|
|
|
|||||||||||||||||||
|
Implementation: |
|
|
Syntax: |
getmilisecs() |
||||||||||
|
|
|
||||||||||
|
Description: |
Returns the milliseconds of the current time |
||||||||||
|
|
|
||||||||||
|
Examples: |
set MILISECS =
getmilisecs(); |
||||||||||
|
|
|
||||||||||
|
Implementation: |
|
|
Syntax: |
javaMethod(methodName, methodArg1, methodArg2 ...) |
||||||||||
|
|
|
||||||||||
|
Description: |
Call a static method in any java class in the classpath. The first argument is the name of the method including the full class name. This is followed by any number of arguments. The argument and return types must all be of type java.lang.String or java.lang.Double. |
||||||||||
|
|
|
||||||||||
|
Examples: |
Set TIMEZONE =
javaMethod('java.lang.System.getProperty', 'user.timezone'); |
||||||||||
|
|
|
||||||||||
|
Implementation: |
|
|
Syntax: |
isCalledForm() |
||||||||||
|
|
|
||||||||||
|
Description: |
Returns Y or N to indicate that the current form has been called using CALL FORM. |
||||||||||
|
|
|
||||||||||
|
Examples: |
if [
isCalledForm() = 'Y' ] |
||||||||||
|
|
|
||||||||||
|
Implementation: |
|
|
Syntax: |
isUserInGroup(userid, groupid) |
|||||||||||||||||||
|
|
|
|||||||||||||||||||
|
Description: |
Returns true or false to indicate whether a user is in a security group. |
|||||||||||||||||||
|
|
|
|||||||||||||||||||
|
Examples: |
if [ isUserInGroup( $USER, GROUPNAME ) ) … |
|||||||||||||||||||
|
|
|
|||||||||||||||||||
|
Implementation: |
|
|
Syntax: |
requestProperty(property) |
||||||||||||||||
|
|
|
||||||||||||||||
|
Description: |
Returns information about the HTTP request |
||||||||||||||||
|
|
|
||||||||||||||||
|
Examples: |
set IPADDRESS =
requestProperty(‘remoteAddr’); |
||||||||||||||||
|
|
|
||||||||||||||||
|
Implementation: |
|
|
Syntax: |
runScheduledEvent(fullpath_filename_ext) |
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
|
Description: |
Executes a scheduler event via a trigger |
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
|
Examples: |
set RESP =
runscheduleevent (FULLPATH_FILENAME_EXT); |
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
|
Implementation: |
|
|
Syntax: |
testURLConnection(url) |
||||||||||||||||
|
|
|
||||||||||||||||
|
Description: |
Tests whether a Http URL connection is available. Returns ‘Y’ if the connection is available or ‘N’ if the connection is unavailable. This function performs a HTTP GET to the calling URL. If a response is not received within 20 seconds then the function will return ‘N’. |
||||||||||||||||
|
|
|
||||||||||||||||
|
Examples: |
set AVAILABLE =
testurlconnection( ‘http://www.google.co.uk’ ); |
||||||||||||||||
|
|
|
||||||||||||||||
|
Implementation: |
|
|
Syntax: |
write2csv(DIR, FNAME, FIELDS, DELIM, HEAD, NEW, QUOTE) DIR - the directory to which the file should be written FNAME - the name that should be given to the file FIELDS - a comma separated list of form fields whose data should be written to the file DELIM - the character that should be used to separate the data in the file HEAD - should a header row be created with the file names? (Y/N) NEW - should a new file be created? (Y/N) QUOTE - should double quotes be placed around each data element in the file? |
|
|
|
|
Description: |
Writes data to a delimited text file using parameters passed from a form |
|
|
|
|
Examples: |
In this example we will create a new CSV file and write a
single row which will contain the
Then we will loop through a table and write out column values to the same file.
Create the Header
Row:
set DIR =
'C:/Temp/'; set FNAME =
'MyCsvFile.csv'; set FIELDS =
('FIRST_NAME,LAST_NAME,AGE,TITLE, POSTCODE'); set DELIM = ',' ; set HEAD = 'Y'; set NEW = 'Y'; set QUOTE = 'Y'; set STATUS =
write2csv (DIR,FILENAME,FIELDS,DELIM,HEAD,NEW,QUOTE); |