IHT2 package contains functions and procedures
to assist the construction of www-pages in Oracle PL/SQL
language.
Author: Harri Laine, 13.2.1999
Procedures and functions (most commonly needeed functions are shown in
blue background):
procedure add_any_js(js in char, checklist in out varchar2); |
procedure colored_text(cTextColor char, cBgColor char, cText char,
nWidth integer:=100, nSize integer:=NULL); |
Prints a text item (ctext) in boldface on a
colored background.
cTextcolor specifies the color of the text either as the
name of the color (e.g. red, white, blue,...)
or as a RGB-value
(e.g. #FFFFFF). cBgColor specifies the background color.
It uses values similar to cTextColor.
cText specifies the text to be printed.
nSize specifes the propotional font size,
+I indicates an increase of I units, -I
indicates decrease of I units with respect to the
default font size.
Values zero and NULL result in default font size.
cWidth specifies the width of the print area
as a percentage of the width of the page.
|
procedure field_print(cPrompt char, cElement in char, cStyle in char:= 'NL_COL2'); |
Prints a value (cElement) and an associated prompt (cPrompt). The positioning of the prompt can be controlled with
parameter cStyle. The values for style equal to the ones used in procedure form_field. The following styles are defined
NL_COL2 (default> |
prompt and the value are printed in two successive columns as a new row in a table |
COL2 |
prompt and the value are printed in two successive columns of already started a row in a table |
COL |
only the value is printed in a column of a table. prompt is ignored. |
NONE |
No prompt, only the field. |
TOP |
prompt is printed in small font above the value |
TOP_COL |
value and prompt are printed in the same column of a
table, prompt in small font above the field |
PRE |
prompt preceeding delimiter colon (:) in front of the value |
Example: field_print('Name:','Value','NL_COL2');
|
procedure form_button(cType char, cValue char, cName char:= null, cStyle char:='COL') |
Appends a button on the form.
cType defines the type of the button {SUBMIT/RESET}.
cValue determines the text to be shown on the button.
The optional parameter cName is ignored if the
type of the button is of type RESET. When attached to a submit
button it causes a parameter with the given name and value to be
delivered with the form.
cName should be assigned a value if the form contains many
submit buttons, and it is significant to know which one was pressed.
cStyle controls the layout as defined
in procedure form_field
|
procedure form_date_field(cPrompt char, cName char,
cValue char := NULL, cStyle char := 'NL_COL2'); |
procedure form_field(cPrompt in char,cElement in char, cStyle in char); |
Appends a promted element in a form.
This procedure is used as an auxiliary procedure in the dedicated
append procedures. It may also be used for those elements that do not
have a dedicated append procedure in this library.
cPrompt specifies the prompt. cElement is an HTML representation of the element to be appended. cStyle defines the layout.
NL_COL2 (default> |
prompt and the element are printed in two successive columns as a new row in a table |
COL2 |
prompt and the element are printed in two successive columns of already started a row in a table |
COL |
only the element is printed in a column of a table. prompt is ignored. |
NONE |
No prompt, only the field. |
TOP |
prompt is printed in small font above the element |
TOP_COL |
the element and the prompt are printed in the same column of a
table, prompt in small font above the element |
PRE |
prompt preceeding delimiter colon (:) in front of the element |
Example: form_field('Name','<input name="name" ...>','NL_COL2');
|
procedure form_hidden_field(cname char, cvalue char); |
procedure form_menu(cPrompt char, cName char, cOptions char,
cSelected char, cStyle char:= 'NL_COL2'); |
Appends a pull-down menu on the form. cPrompt is the prompt attached to the menu.
cName is the name of the field. cOptions contains a comma separated
list of menu options. A menu option may contain a visible value and
a delivery value. The delivery value is optional. If given it should succeed
the visible value after the #-delimiter, for example, 'VISIBLE1#DELIVERY1,VIS2,VIS3#DELIVERY3'.
If delivery value is omitted the visible value is used as a substitute.
cSelected specifies the default selection. It is given as a delivery value.
cStyle defines the layout as specified in procedure form_field.
|
procedure form_number_field(cPrompt char, cName char, nSize integer,
cValue char:= null, cStyle char:= 'NL_COL2'); |
procedure form_range_field(cPrompt char,
cName char, nSize integer,
nLower integer, nUpper integer,
cValue char := null, cStyle char:= 'NL_COL2'); |
procedure form_start(cURL in char, cMethod in char:='post',
cSubmitCheck in char:=null); |
Starts a html-form. cURL gives the URL of the program that will process the
submitted form. cMethod specifies the way to pass the parameters. Alternatives
are 'post' (thru Sysinput, not visible in the browser) and 'get' (thru an environment variable,
visible in the address-field of the browser).
cSubmitCheck contains the JavaScript checks to be executed
before the form is submitted. Because fields accept also empty input one of the uses of
this Javascript is to check that all the required input is given. To generate
the checks you may use the fuction value_required that
provides the check for a single field and combine these with the procedure
add_any_js as an and-connected set of checks.
|
procedure form_textarea(cPrompt char, cName char, cValue char,
nCols int:=40, nRows int:=3, cStyle char:='NL_COL2'); |
procedure form_text_field(cPrompt char, cName char, nSize integer,
nMaxLength integer, cValue char := null, cStyle char:= 'NL_COL2'); |
procedure form_2_standard_buttons(cSubmit varchar2, cReset varchar2); |
procedure form_4_standard_buttons; |
Appends a row of four buttons in the form. There are three submit-buttons,
each with name 'optype'. The values attached to these buttons are
'Poista' (=delete), 'Kirjaa muutos' (update) and 'Uusi' (new).
|
Includes the checks for empty fields, dates, numeric fields and ranges in
the Javascript block.
This procedure should be used after a Javascript block has been opened
and before closing it. If you are not going to specify any JavaScript
functions of your own use js_checksonly instead.
|
Includes in the page a Javascript block that contains the checks for empty fields, dates, numeric fields and ranges.
This procedure should be applied in consructing the header of the page, before starting the body.
This procedure first opens a JavaScript block, then uses js_allchecks and
finally closes the block. Thus you cannot place your own functions
in this block.
|
procedure js_functions_start; |
Generates code for the javascript function
isInRange(textfield, lower, upper) that
evaluates to true if the argument is numeric and is between
lower and upper, otherwise false. This functtion doesn't provide any
error message.
|
Generates code for javascript function
rangecheck(textfield,lower,upper) that
evaluates true if the argument is a numeric one between lower and upper,
otherwise it evaluates false and produces an error message.
|
procedure page_end( cdate varchar2, csignature varchar2); |
procedure page_start(ctitle in char); |
function text_field(cName char, nSize integer, nMaxlength integer,
cValue char , cCheck char) return varchar2; |
function value_required(fieldname char) return varchar2; |