Commit 0710528e authored by Carsten  Rose's avatar Carsten Rose
Browse files

Manual.rst: more rewriting on explaining QFQ variables.

parent cb4a7b3b
......@@ -628,24 +628,33 @@ QFQ Variables
Most elements of a form or report specification might contain (QFQ) variables. Such a variable is surrounded by
double curly braces. There are three types of QFQ variables:
* STORE: one or more stores are specified to be searched for the given key (=variable name).
* STORE: zero or more stores might be specified to be searched for the given VarName. Syntax:
*{{VarName[:<store / prio>[:<sanitize class>[:<escape>]]]}}*
* SQL statements (limited set of),
* If no store is specified, the default is: FSRVD (=FORM > SIP > RECORD > VARS > DEFAULT)
* If the VarName not found in one store, the next store is searched,
until a value is found.
* If the varname is not found in any store, nothing is replaced - the '{{<varname>}}' remains.
* If anywhere along the line an empty string is found, this **is** a value: therefore, the search will stop.
* SQL statements. See also `sql-statement`_.
*{{SQL Statement}}*
* Fields in a report statement (=Typo3 QFQ page content records), fired previously. See `access-to-upper-column-values`_.
* Fields in a report statement. See `access-to-upper-column-values`_ and `syntax-of-report`_.
*{{<line identifier>.<column>}}*
There might be name conflicts between VarName / SQL keywords and <line identifier>. QFQ checks first for '<line identifier>',
than for SQL keywords and than for VarNames.
All types might be nested with each other. There is no limit of nesting variables.
Very specific: Also, it's possible that the content of a variable is a new variable - this is sometimes used in text
templates, where the template is retrieved from a record and specific locations in the text will be (automatically by QFQ)
replaced by values from other sources.
Very specific: Also, it's possible that the content of a variable is again (including curly braces) a not already
substituted variable - this is sometimes used in text templates, where the template is retrieved from a record and
specific locations in the text will be (automatically by QFQ) replaced by values from other sources.
* General examples:
......@@ -670,11 +679,6 @@ replaced by values from other sources.
* *{{ SELECT "Hello World" }}* acts as *{{SELECT "Hello World"}}*
* *{{ varname }}* acts as *{{varname}}*
* There are several stores, from where to retrieve the value. If a value is not found in one store, the next store is searched,
until a value is found.
* If anywhere along the line an empty string is found, this **is** a value: therefore, the search will stop.
* If no value is found, the value is an <empty string>.
URL Parameter
^^^^^^^^^^^^^
......@@ -1155,6 +1159,8 @@ Store: *SYSTEM* - Y
| sqlCount | computed during runtime, used for error reporting |
+-------------------------+--------------------------------------------------------------------------+
.. _`sql-statement`:
SQL Statement
-------------
......@@ -1168,7 +1174,6 @@ SQL Statement
* A SQL Statement might contain parameters, including additional SQL statements. Inner SQL queries will be executed first.
* All variables will be substituted one by one from inner to outer.
* Maximum recursion depth: 5 (a recursion depth of 2 is sometimes used for mailing with templates, 3 and more probably confuses too much and is therefore not practicable, but supported until depth of 5)
* The number of variables inside an input field or a SQL statement is not limited.
* A resultset of a SQL statement will be imploded over all: concat all columns of a row, concat all rows - there is no glue string.
......@@ -1178,11 +1183,10 @@ SQL Statement
{{SELECT id, name, IF({{feUser}}=0,'Yes','No') FROM Vorlesung WHERE sem_id={{keySemId:Y}} }}
{{SELECT id, city FROM Address AS adr WHERE adr.pId={{SELECT id FROM Account AS acc WHERE acc.name={{feUser}} }} }}
* Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT: ::
* Special case for `SELECT` input fields and FormElement.type=action `sqlValidate`. To deliver a result array specify an '!' before the SELECT: ::
{{!SELECT ...}}
* This is only possible for the outermost SELECT.
.. _LDAP:
......@@ -3759,8 +3763,10 @@ HTML output:
..
Syntax
------
.. _`syntax-of-report`:
Syntax of `report`
------------------
All **root level queries** will be fired in the order specified by 'level' (Integer value).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment