dbms_library.comp
provides database interface. Some of its methods are also used by frame.html. .mql
files. Subroutine Name | Parameter Name | Valid Input | Description |
---|---|---|---|
check_where_clause() |
|||
Permission() |
|||
$permission_group |
Group to which user must be authorized. | ||
$table |
Name of the table for which the permission is being checked. | ||
ReportMethod() |
The subroutine checks the $report parameter for suffix and returns which report utility is used. |
||
$report |
report_name.odt , report_name.pdf , report_name.rep |
Report name. If the $report is not defined or there is no suffix the utility is chosen based on value of the DefaultReportEngine variable from the Apache config file. |
|
CheckIfReportExists() |
If the report method is odt or pdf the subroutine checks if the report name can be found in public.odt_reports table. If the report method is rep the subroutine uses FindReportmanFile() to search and validate the found report file. The subroutine returns 1 on success and 0 on failure. |
||
$table |
Name of the table for which the permission is being checked. |
check_where_clause()
subroutine parses the query and verifies that only authorized keywords, fields and operators are used. Here are the methods that change its behavior:
Method Name | Description | Default Contents |
---|---|---|
PERMISSION |
Is used for overriding of the default PERMISSION_BY_PROFILE . |
<%method PERMISSION><&SELF:PERMISSION_BY_PROFILE&></%method> |
PERMISSION_BY_PROFILE |
It reads permissions for the record-set manipulation based on the user's profile. It is used often to return user's permissions of the current FUNZIONE . |
Possible return values:INSERT, SELECT, UPDATE, DELETE, ... ; Empty return is equivalent to have no permissions allowed; * is equivalent to having all permissions. |
AUTHORIZED_FUNCTIONS |
A list of authorized functions. Used to check queries from browser. | Empty. |
AUTHORIZED_KEYWORDS |
A list of authorized keywords. Used to check queries from browser. | Default keywords are AND, OR, NOT, IS, NULL . |
AUTHORIZED_OPERATORS |
A list of authorized operators. Used to check queries from browser. | Default authorized operators are <=, >=, =, <, >, =, ~*, LIKE, ILIKE |
AUTHORIZED_FIELDS |
A list of authorized fields. Used to check queries from browser. | Default list is <& SELF:KEY &>, <& SELF:FIELDS &>, <& SELF:FIND_FIELDS &> |
Method Name | Description | Default Contents | Example |
---|---|---|---|
CHILD_SELECTED |
Is intended to be used with multiple child tables; It indicates which child tab is activated when the page is loaded. |
It is empty by default which indicates the first tab will be opened. | <%method CHILD_SELECTED> |
SCHEMA_CHILD_SELECTED |
Overloads the default method. | <&SELF:SCHEMA&> |
<%method SCHEMA_CHILD_SELECTED> |
CHILDREN |
A comma separated list of children. | Empty by default. | See the CONFIGURING FATHER .MQL example. |
CHILDREN_FIELDS |
A comma separated list of key fields. | Empty by default. | See the CONFIGURING FATHER .MQL example. |
SCHEMA_CHILDREN |
A comma separated list of children each prefixed with SELF:SCHEMA |
The list SELF:CHILDREN with each child prefixed by the SELF:SCHEMA . |
<%method SCHEMA_CHILDREN> |
KEY |
Indicates a primary key of a table. | <&SELF:FROM&> |
<%method KEY> |
KEY_NAME |
A primary key field without a table name. | By default it's derived from the database. | <%method KEY_NAME> |
SERIAL_SEQ |
A serial sequence name. | <%method SERIAL_SEQ><&SELF:SCHEMA_FROM&>_ |
<%method SERIAL_SEQ> |
SELECT_CHILDREN_ID |
A select statement which is used for listing children keys. Parameters: $FIELDS , $WHERE , $ORDER |
||
CHILDREN_CONTAINER |
Is used in the frame.html | The default value is 'Stack' when there is one child or 'Tab' when there's many children (Tab & Stack are Dojo tooolkit containers) |
|
CHILD_TEMPLATE |
Is used in the frame.html; If the method exist in child .mql file it changes its type of form. |
Does not exist by default. | <%method CHILD_TEMPLATE> ,<%method CHILD_TEMPLATE> ,<%method CHILD_TEMPLATE> ,<%method CHILD_TEMPLATE> or<%method CHILD_TEMPLATE> |
ORDER |
Determines how to order a table, which columns to order by. It is important that the sorting must be unique, otherwise the cache mechanism will report errors in the sorting of keys in the cache. |
Empty by default. The recordset is ordered with ascendig primary key. |
<%method ORDER> |
GUI_ORDER |
GUI user sorting. List of fields (separated by ",") that the user can sort from the browser. For each field, in addition to the name, the sorting type applied as default (in the list order) and possibly the SQL field code. - ASC or blank = ascending sort - DESC = descending sort - SEL = orderable field in the GUI In the forms the user can reverse or cancel the sorting of the fields declared here with a click on the field header. Each variation moves the field to the bottom of the sorting. A double click on the fields header resets the user-modifiable sorting and the sorting will set by ORDER . |
Empty by default. The recordset is ordered with ORDER . |
<%method ORDER_GUI>name ASC UPPER(name), surname ASC UPPER(surname), year SEL, month SEL, day SEL</%method> |
FATHER |
Provides foreign_key_name:father_table_name[:father_primary_key_name] parameters. |
Empty by default. | See the CONFIGURING CHILD .MQL example. |
FATHER_WHERE |
It returns where statement composed of the foreign_key_name and $FATHER_ID parameter. |
Extracts a foreign_key_name from the FATHER method. Returns <% $field %> = <%$father_id%> string. The $father_id is str2sql_js_delimited($FATHER_ID). |
|
FATHER_ID_NAME |
It obtains the father ID field name (foreign_key_name ) to be used in insert and update. |
Extracts the field name from the FATHER method. |
|
FATHER_NAME |
It returns a father_table_name . |
Extracts a full name of the father table (schema.father_name ) from the FATHER method. |
|
FATHER_KEY_NAME |
It returns an id of the father table (father_primary_key_name ). |
Extracts a father id from the FATHER method.It also verifies that the father .mql file exists. |
|
FATHER_TABLE_KEY_NAME |
It returns a table.id of the father table. |
Extracts a father table and id from the FATHER method.It also verifies that the father .mql file exists. |
FIELDS
methods were already encountered in previous chapters; Here's the complete list of the FIELDS
methods:
Method Name | Description | Default Contents | Example Usage |
---|---|---|---|
FIELDS |
The list of fields from a table to be queried. | <%method FIELDS> |
See the CONFIGURING CHILD .MQL example. |
FIELDS_NOT_NULL |
When one or more of fields listed in FIELDS_NOT_NULL is empty the row will not to be displayed. |
Empty. | See the NULLS AND AGGREGATE EXPRESSIONS example. |
FIELDS_DESCR |
Labels for the fields. | <%method FIELDS_DESCR> |
<%method FIELDS_DESCR> |
FIELDS_RO |
Marks fields as Read-Only in the GUI and in the database. | Empty. | <%method FIELDS_RO>*</%method> <%method FIELDS_RO> |
FIELDS_RO_UPDATE |
Marks fields as Read-Only in the GUI but they are still writable in the database. The method is useful for processing a values that can not be modified directly by an user. | <%method FIELDS_RO_UPDATE> By default the same list as FIELDS_RO method. |
<%method FIELDS_RO_UPDATE> |
FIELDS_NO_WRITE |
An user can supply values in the GUI but can not save them directly to the database. The method is useful for giving an user possibility to supply values which are then processed by the back-end. In practice it may be the value of a SQL view which is processed by the server and does not necessarily correspond to a value to be saved in the database. | <%method FIELDS_NO_WRITE> By default the same list as FIELDS_RO method. |
<%method FIELDS_NO_WRITE> |
FIELDS_NEW |
Defines a default new values when user clicks on the Nuovi button.New default values are separated by comma in the order of method FIELDS . |
Empty. | <%method FIELDS_NEW>,,,</%method> defines three new empty fields. |
FIELDS_DUP |
Configures the Duplica button. When pressed the button adds a new record populated with the duplicate values from previous record. The button duplicates the current record (FORM ) or the selected record if type is TABLE or DIVS . A comma separated list defines which fields to duplicate. The duplicated field must be marked with a letters d or D . A field marked with upper case letter D is always copied. A field marked with lower case letter d is copied only if not empty. The fields that are not duplicated will be empty or set to default values defined in the FIELDS_NEW method. |
When the method is empty the Duplica button is not shown. |
<%method FIELDS_DUP> |
FIELDS_HIDDEN |
A list of hidden fields; See also the HIDDEN parameter of the INFO method. |
Empty. | <%method FIELDS_HIDDEN> |
FIELD
methods:
Method Name | Attribute/Parameter Name | Description | Example Usage |
---|---|---|---|
_ALIAS |
A field name alias. | <%method id_referente_ALIAS>id_socio</%method> |
|
_CHECK |
The method that verifies the specified field. It can be <field_name>_CHECK or <alias>_CHECK |
||
_FIELD |
A _FIELD method determines how the field should be displayed. |
Examples of _FIELD method usage:Adding Field Method, Adding Select Field, Adding HtmlSelect Field, Adding DivSelect Field, Adding Child Frame There are also a couple of examples of _FIELD methods in the global_autohandler file. |
|
select_name_prefix |
|||
select_from |
The select_from is used for setting additional parameters to a select widget to optimize data transfer from server to the browser. |
||
_OUT_FILTER |
If the method is defined, applies the filter to the output of the specified field. Returns an array with two fields (value, parameter). | ||
$field |
A field name. | ||
$key |
A primary key value. | ||
$value |
A field value. | ||
$names |
An array of the field names. | ||
$fetch_row |
A hash of the field values. | ||
$comp |
A component (.mql ), if not defined using the basic component. |
||
$noparam |
If set to 1, it does not retrieve the parameters (used to optimize in cases where they are not used) | ||
_NAME_PREFIX |
|||
_FROM |
Method Name | Parameter Name | Description | Default Value |
---|---|---|---|
FIND |
The method displays a find-bar for filtering the records. The method can position the find-bar on the left or on the right side of the web page. It uses the GENERIC_FIND method and the FIND_FIELDS, FIND_FIELDS_DESCR settings to display the find-bar. |
||
FIND_FIELD_WIDTH |
|||
FIND_MENU |
The method displays a find-bar for filtering the records. The method positions the find-bar on the top or on the bottom of the web page. It uses the GENERIC_FIND method and the FIND_MENU_PRE , FIND_FIELDS, FIND_FIELDS_DESCR, FIND_MENU_POST settings to display the find-bar. |
||
$find_fields |
A list of fields an user is able to filter. | Default value is FIND_FIELDS. | |
$Recordset |
A DataBinding object. |
||
$Display |
A DisplayBinding object. |
||
$DescrOnRight |
Value of the MenuDescrOnRight parameter from the frame.html. | Undefined. | |
GENERIC_FIND |
The method displays one input field with find options. The FIND or FIND_MENU use it to construct the find-bar. The find field width can be configured with the FIND_FIELD_WIDTH method. It's possible to customize the GENERIC_FIND behavior for individual find-fields using the <field_name>_FIND_WIDGET methods. |
||
FIND_MENU_PRE |
It is called from FIND_MENU method just before the FIND_MENU form. Example usage: <%method FIND_MENU_PRE><br><br><br></%method> |
||
FIND_MENU_POST |
It is called from FIND_MENU method just after the FIND_MENU form. |
||
_FIND_FIELD |
Defines an input widget to be used for specific find-field. Is used by the Find_Component() subroutine. | Does not exist by default. | |
_FIND_ALIAS |
Defines an input widget to be used for specific find-field. Is used by the Find_Component() subroutine. | Does not exist by default. |
Method Name | Arguments | Description | Default Contents | Example Usage |
---|---|---|---|---|
SELECT_FIELDS |
A list of fields to be inserted into table's select query. |
<%method SELECT_FIELDS> By default identical to the FIELDS method. |
<%method SELECT_FIELDS> |
|
JOIN_TABLES |
Is used for defining additional join clauses. | <%method JOIN_TABLES> |
See data/public/messages_users_detail.mql anddata/public/user_messages.mql |
|
WHERE |
A contents of WHERE statement. | Empty. | <%method WHERE> |
|
EVAL_WHERE |
Evaluates the query provided by the browser. It is called from SelectWhere() to check the SQL query for unauthorized access (sql injection). | Method does not exist by default. | ||
$where |
The parameter contains the query from the browser. | |||
SELECT_WHERE |
Is passed to the EvalSqlWhere(). | <%method SELECT_WHERE> |
||
PRE_SELECT |
The method is called just before SELECT query. | Method does not exist by default. | See data/public/logs_report.mql |
|
$PARAMS |
The argument contains optional parameters for the prepared query. | |||
$ID |
Parameter undefined by default. When defined it is compared to <&SELF:KEY&> = <% encodeSql($ID) |
|||
$WHERE |
WHERE statement. | |||
DIV_SELECT |
Method Name | Arguments | Description | Default Contents |
---|---|---|---|
INSERT |
Insert a new record. The metod is called from Array2UpdateSql() function which uses it with the Perl DBI. The Array2UpdateSql() first makes a prepared query then it executes it with the @{$LIST_VALUES} parameters. |
insert into <&SELF:SCHEMA_FROM&> (<%$FIELDS%>) values (<%$VALUES%>); If the key is not provided, it is retrieved from the sequence: select currval('<&SELF:SERIAL_SEQ&>'); |
|
$NEW_KEY | A new primary key - if provided. | ||
$FIELDS | List of field names: field1, field2, ... |
||
$FIELDS_INSERT | A hash of the field names with their values. The $FIELDS, $VALUES and $LIST_VALUES are extracted from the $FIELDS_INSERT . |
||
$VALUES | A list of question marks: ?,?,... |
||
$LIST_VALUES | An array of values $LIST_VALUES->[n] used during $sth->execute(); The list can be modified. |
||
UPDATE |
Update an existing record. The method is called from Array2UpdateSql() function where it is handled similarly to the INSERT method. Prior to the insertion it is checked whether the DELETE_IF_FIELD_EMPTY method must be handled. |
update <&SELF:SCHEMA_FROM&> set <%$UPDATES%> where <&SELF:KEY&> = <% encodeSql($KEY) %>; |
|
$UPDATES | A list of fields to be updated: field1 = ?, field2 = ?, ... |
||
$FIELDS_UPDATE | A hash of the field names with their values. | ||
$LIST_VALUES | An array of values $LIST_VALUES->[n] used during $sth->execute(); It can be modified. |
||
$KEY | A primary key. | ||
DELETE |
Delete a record. The method is called from Array2DeleteSql() function, from the delete method and also during handling of the UPDATE query.Examples of the overloaded DELETE method can be found in:/opt/masonsql/htdocs/data/public/anagrafiche.mql ,/opt/masonsql/htdocs/data/public/funzioni.mql files. |
delete from <&SELF:SCHEMA_FROM&> where <&SELF:KEY&> = <% encodeSql($KEY) %>; |
|
$KEY | A primary key. |
.mql
files, many examples of their use can be found in the /opt/masonsql/htdocs/
directory tree.
Group Name | Method Name | Arguments | Description |
---|---|---|---|
PRE_ |
The PRE methods are called before the main query is executed. |
||
PRE_INSERT |
|||
$FIELDS_INSERT |
Is a hash pointer. The $FIELDS, $VALUES and $LIST_VALUES are extracted from the $FIELDS_INSERT . |
||
$DUP_KEY |
$Params->{'dup_key'} |
||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
PRE_UPDATE |
The PRE_DELETE , DELETE are also called just before PRE_UPDATE if any of the fields from DELETE_IF_FIELD_EMPTY is to be updated with an empty value. |
||
$KEY |
A primary key value. | ||
$FIELDS_UPDATE |
Is a hash pointer. The $UPDATES and $LIST_VALUES are extracted from the $FIELDS_UPDATE . |
||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
PRE_DELETE |
|||
$KEY |
A primary key value. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
POST_ |
The POST methods are called after the main query was executed. |
||
POST_INSERT |
|||
$KEY |
A primary key value. | ||
$DUP_KEY |
$Params->{'dup_key'} |
||
$ROW |
A contents of a record. | ||
$FIELDS_INSERT |
Is a hash pointer. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
POST_UPDATE |
|||
$KEY |
A primary key value. | ||
$ROW |
A contents of a record. | ||
$FIELDS_UPDATE |
Is a hash pointer. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
POST_DELETE |
|||
$KEY |
A primary key value. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
POST_NO_ |
The POST_NO methods are called when the main query was not executed. |
||
POST_NO_INSERT |
|||
$KEY |
A primary key value. | ||
$DUP_KEY |
$Params->{'dup_key'} |
||
$ROW |
A contents of a record. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
POST_NO_UPDATE |
|||
$KEY |
A primary key value. | ||
$ROW |
A contents of a record. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
||
POST_NO_DELETE |
|||
$KEY |
A primary key value. | ||
$PARAMS |
A parameters for the prepared query must be added to the \%params |
.mql
files.Method Name | Arguments | Description![]() |
Default Contents |
---|---|---|---|
ENTITY_CHILDREN |
|||
ENTITY_FIELDS |
|||
ENTITY_RELATIONS |
|||
DB_LOG |
Add variations to logs table | ||
DELETE_IF_FIELD_EMPTY |
Contains a list of field names. Defines which field causes execution of PRE_DELETE and DELETE on the specified row prior to UPDATE, when the field is empty. | By default the method does not exist. | |
$fields | hash of modified fields | ||
$old_fields | hash of original fields | undef | |
$id | record id (PK) | ||
$table_name | table name (with schema) | undef | |
$type | update type (insert, update, delete) |
Name | Arguments | Description |
---|---|---|
Array2UpdateSql() |
The subroutine is used for updating or inserting records sent by GUI in an array format. The array is passed from gotoRecords method from the lib/databinding.js in the update parameter and it contains only record-sets of changed or inserted fields. The record-set exchanged between a server and a browser are in a array format with the Primary Key in the first column and fields in the same positions as defined with the FIELDS method from the .mql file. |
|
Call_OutFieldFilter() |
See the _OUT_FILTER method. | |
Call_InFieldFilter |
If the _IN_FILTER method is defined, applies the filter to the specified field. |
|
EvalSqlWhere() |
||
ExecQuery() |
||
PrepareQuery() |
||
SelectWhere() |
||
SqlSelect() |
||
SqlWhere() |
||
str2sql_js_delimited() |
It returns a string adapted to be inserted into a SQL query, or to be inserted in a JavaScript code. |
Method Name | Description | Default Contents |
---|---|---|
xls |
Is the method that is called when user presses the XLS button. Its default behavior can be changed with SELECT_XLS , SELECT_XLS_FIELDS and TYPE_FIELDS_XLS methods. |
The method exports currently displayed table into the .xls file.The Xls permissions relate specifically to this function. |
SELECT_XLS |
A select query that configures SqlSelect() subroutine from the xls method. |
<%method SELECT_XLS> |
SELECT_XLS_FIELDS |
A list of select fields for the query from the xls method. The list configures SqlSelect() subroutine. |
<%method SELECT_XLS_FIELDS> |
TYPE_FIELDS_XLS |
A list of field types in the XLS table. If the method is not defined the xls method tries to obtain field types from the database.(In old release <= 1.9.1, inclusive in the initial position with the format (number) of the primary key) |
Not defined. |
Method Name | Parameter Name | Description | Default Value |
---|---|---|---|
FORM_TYPE |
TABLE , DIVS , FORM , TEMPLATE or LINEAR , see also frame.html. |
FORM | |
FORM_HEADER |
The method shows the header bar which displays the methods in this order: The CONTROLS method, HEADER_INCLUDE method and the DESCRIPTION method. |
Empty method. | |
HEADER_INCLUDE |
Displays additional fields in the table header. Used by the FORM_HEADER method. |
||
TABLE |
The generic method which displays records in a table. | ||
TABLE_HEADER |
The generic method which displays the table header. | ||
TABLE_ROWS |
Number of rows in TABLE or in DIVS form. |
||
ROW_TABLE |
The generic row method for browsing the table with TABLE method. Used only by TABLE method. |
||
DIVS |
The generic method which displays records in rows but without table header. | ||
ALL_ROW_DIVS |
|||
ROW_DIVS |
The generic row method for browsing the DIVS type of table. Used by DIVS and ALL_ROW_DIVS methods. |
||
SEP_DIV |
The <div> separator. Used only by DIVS method. |
<hr> |
|
FORM |
The form method displays one record at a time. | ||
LINEAR |
The generic form method with a linear format for browsing the database table. In this format the fields are sorted in the order in which they were listed. To interrupt a line insert the character / at the bottom of the field description. |
||
TEMPLATE |
The generic form for browsing the database table. The fields are inserted into the template with the provided FORM_TEMPLATE method (or with parameter $Template ). For example: <%method FORM_TEMPLATE><p><DESCR:description>:<FIELD:description></p></%method> See also FATHER_TEMPLATE , CHILDREN_TEMPLATE and CHILD_TEMPLATE in frame.html. |
||
FORM_TEMPLATE |
The generic form for browsing the database table. Display or edit single record at a time. For example: <%method FORM_TEMPLATE><p> |
||
DIVS_TEMPLATE |
The generic method for browsing the database table. Display or edit multiple records at a time. For example: <%method DIVS_TEMPLATE>Rec: <RECORD><CHECKBOX><DESCR:par_id>:<FIELD:par_id><DESCR:cod>:<FIELD:cod><DESCR:unit>:<FIELD:unit><DESCR:prezzo>:<FIELD:prezzo><DESCR:rifer>:<FIELD:rifer> |
||
ROW_DIVS_TEMPLATE |
The generic row method for browsing the table with DIVS_TEMPLATE . Used only by DIVS_TEMPLATE . |
||
GENERIC_FIELD |
|||
GENERIC_D_FIELD |
|||
BOOL_FIND_FIELD |
|||
STANDARD_FIELD |
|||
FIELD_ROW_DIVS |
DEPRECATED: Its beavior to permit to view in GUI a variable number of rows modified by GUI with preloaded templates. The beavior is activated with FIELD_ROW_DIVS method (name of field record that determining the type of line in the case of type DIVS template variables). |
Method Name | Parameter Name | Description | Default Value |
---|---|---|---|
CONTROLS |
The method shows the control bar with refresh, navigation, modify, delete, save and the rest of the control buttons. The enabling of the buttons depends on the configuration but can also be individually passed to the frame.html. | ||
$disp_navbar |
Display control bar. | 1 |
|
$disp_cancel |
Display Annulla button. |
1 |
|
$disp_refresh |
Display Aggiorna buttton. |
1 |
|
$disp_change |
Display Modifica button. |
1 |
|
$disp_insert |
Display Nuovo button. |
1 |
|
$disp_dup |
Display Duplica button. |
0 |
|
$disp_save |
Display Salva button. |
1 |
|
$disp_delete |
Display Cancella button. |
1 |
|
$disp_print |
Display Stampa button. |
1 |
|
$disp_xls |
Display XLS button. |
1 |
|
$disp_log |
Display LOG button. |
1 |
|
BUTTON_Ctrl_filter |
The Filtra button in the find bar. |
Calls loadRecords('rewind') |
|
BUTTON_Ctrl_printsel |
The St.sel button in the find bar. |
Calls printSelected('recordset') |
|
BUTTON_Ctrl_xlssel |
The XLS button in the find bar. |
Calls printSelected('xls_recordset') |
pdf
query request (see Testing Queries). DisplayBinding
object. printSelected()
uses the printUrl() function, from DataBinding
object, to construct query request url with attached parameters.
Method Name | Parameter Name | Description | Default Value |
---|---|---|---|
pdf |
The method wraps around the PDF method. The method gets $GROUP_ID and $report_ids by calling SqlSelect2report_id() and passes them to the PDF method. Afterwards, when the PDF returns, it removes all $GROUP_ID records from public.report_id table with delete print group query. |
||
PDF |
Prepares the parameters for the report.pdf component. | ||
$GROUP_ID |
Is simply passed forward. | Not defined. | |
$report_ids |
It's checked if the REPORT_ID argument exists which overrides the $report_ids . The REPORT_ID can be defined defined in the ODT Reports as one of the cmd_parameters that are used for testing ODT reports. Then the $report_ids is passed forward to the report.pdf component. |
Not defined. | |
$LANDSCAPE |
If it finds $LANDSCAPE parameter in a list of parameters it is discarded. |
Not defined. | |
$report |
The parameter represents name of the report file used by the Reportman or ODT Reportman to generate the report. | Not defined. | |
$report_method |
The report method is determined by the ReportMethod() subroutine. Valid values are: rep , odt or pdf . |
None. | |
$report_file |
The $report_file is used by the Reportman. The value is determined by the FindReportmanFile() subroutine. |
||
PRINT_FORM |
Schema/form_name to be used for the report with attached orientation. See the button example. |
<%method PRINT_FORM>\ |
|
PRINT_RECORDS |
The method inserts the primary key of the public.recorset table and the group_id in the public.report_id table. |
||
$WHERE |
Empty string. | ||
$GROUP_ID |
Not defined. |
Subroutine Name | Parameter Name | Valid Input Value | Description |
---|---|---|---|
Array2report_idSql() |
Inserts each key from the $arr list into the public.report_id table. Returns $group_id and $report_ids . |
||
$group_id |
Group ID. | ||
$arr |
A list of parameters. | ||
FindReportmanFile() |
Uses request_to_comp_path() subroutine with different combinations of the parameter $report and the Apache config variable ReportmanADOserver to find the right Reportman configuration file. |
||
$report |
The report name. | ||
ReportmanADOserver |
If this Apache configuration variable exists the subroutine searches for and validates the Wine report configuration files. Otherwise the subroutine searches for and validates the Kylix report configuration files. | ||
ReportMethod() |
Analyzes the report name to determine which reporting method is used (Reportman or ODT Report. The subroutine first tries to determine the reporting method from the $report suffix. If there is no suffix present it uses the value of the Apache config variable DefaultReportEngine. If it finds unknown report suffix or if the DefaultReportEngine is not defined it raises an error. |
||
$report |
The report name. Optional suffix determines the reporting method. See the button example to understand how the $report name is constructed. |
||
my_report_name.rep |
The report will be created with the Report Manager and printed in .pdf format. |
||
my_report_name.odt |
The report will be created with the ODT Report and printed in .odt format. |
||
my_report_name.pdf |
The report will be created with the ODT Report and printed in .pdf format. |
||
NewGroupId() |
Uses Apache config variable PrintNextValQuery to obtain new group ID value. By default, if the config variable is missing, it uses select nextval('public.report_id_id_seq') query. |
||
SqlSelect2report_id() |
It uses the NewGroupId() to get a new $group_id value. Initializes the report_id table with the IDs of the records to be printed. Returns $group_id and $report_ids to be passed as parameters to the PDF method. The returned parameter $group_id contains a $GROUP_ID value. The returned parameter $report_ids contains a reference to an array of a $REPORT_ID values. |
||
$Params->{'reportlist'} |
If the reportlist parameter is defined the function returns Array2report_idSql() |
||
$Params->{'type'} |
Otherwise, if the reportlist parameter is not defined, the $Params->{'type'} is set to records |
||
$Params->{'where'} and $Params->{'numrec'} |
Both parameters are used for making SqlSelect2report_id numrec query. The result of the query is saved to $SQL{MAX_ROWS} |
||
$Params->{'where'} |
Is also used for making SqlSelect2report_id print query. |
Method or Subroutine Name |
Parameter Name | Valid Input Value or Attribute Value |
Description | Default Value |
---|---|---|---|---|
Find_Component() |
Returns the name of the component to be used in the search field. It first seeks for _FIND_FIELD, _FIND_ALIAS, _ALIAS, _FIELD methods. |
If component is not found it returns BOOL_FIND_FIELD or STANDARD_FIELD . |
||
INFO |
Retrieves information from a .mql file and from a database table.It is cached in global hash $Global{"ATTRS_<SCHEMA>_<TABLE>"} |
|||
NAME |
The INFO method will retrieve all fields parameters or parameters of one field with parameter NAME . See also FIELDS method. |
|||
TYPE |
Data type of the field (integer , float , ...)The parameter limits the response to the requested type of query. |
|||
SIZE |
The field size in digits. | |||
DECIMAL |
Decimal size of the field. | |||
NOTNULL |
The field is not null-able; See also FIELDS_NOT_NULL method. | |||
PRIMARY_KEY |
The field is a primary key. | |||
DESCR |
Use description from the FIELDS_DESCR method. | |||
FIND_DESCR |
Use description from FIND_FIELDS_DESCR method. | |||
HIDDEN |
The field is not visible. Non-visible fields are defined with FIELDS_HIDDEN method. | |||
List2Array() |
Converts an input string into an array using input separator. | |||
$list |
Input string. | |||
$sep |
Input separator. | The default separator is , |
||