Commit e82f65e5 authored by Carsten  Rose's avatar Carsten Rose
Browse files

UsersManual/indes.rst: Desription for STOREs updated.

parent 24290355
......@@ -209,12 +209,12 @@ Only variables that are known in a specified store can be substituted.
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
|Name |Description | Content |
+=====+========================================================================================+============================================================================+
| F | Form: data not saved in database yet. | All native form elements. Recent values from the Browser. |
| F | :ref:`STORE_FORM`: data not saved in database yet. | All native form elements. Recent values from the Browser. |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| S | SIP: Client parameter 's' will indicate the current SIP, which will be loaded from the | sip, r (record_id), form |
| | SESSION repo to the SIP-Store. | |
| S | :ref:`STORE_SIP`: Client parameter 's' will indicate the current SIP, which will be | sip, r (record_id), form |
| | loaded from the SESSION repo to the SIP-Store. | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| R | Record - the record that is going to be edited. For new records: empty. | All columns of the current record from the current table |
| R | :ref:`STORE_RECORD`: Record - the current record loaded in the form | All columns of the current record from the current table |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| P | Parent record. E.g.: on multi forms the current record of the outer query | All columns of the MultiSQL Statement from the table for the current row |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
......@@ -222,11 +222,11 @@ Only variables that are known in a specified store can be substituted.
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| M | Column type: The *table.column* specified *type* | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| C | Client: POST variable, if not found: GET variable | Parameter sent from the Client (=Browser). |
| C | :ref:`STORE_CLIENT`: POST variable, if not found: GET variable | Parameter sent from the Client (=Browser). |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| T | Typo3: a) Bodytext (ttcontent record), b) Typo3 internal variables like feUser, ... | See Typo3 tt_content record configuration |
| T | :ref:`STORE_TYPO3`: a) Bodytext (ttcontent record), b) Typo3 internal variables | See Typo3 tt_content record configuration |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| V | Vars - Generic variables | |
| V | :ref:`STORE_VARS`: Generic variables | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| 0 | Zero - allways value: 0, might be helpful if a variable is empty or undefined and will | All possible keys |
| | be used in an SQL statement. | |
......@@ -234,7 +234,7 @@ Only variables that are known in a specified store can be substituted.
| E | Empty - allways value: 0, might be helpful if a variable is empty or undefined and will| All possible keys |
| | be used in an SQL statement | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| Y | System: a) Database credentials, b) helper vars for logging/debugging: | |
| Y | :ref:`STORE_SYSTEM`: a) Database, b) helper vars for logging/debugging: | |
| | SYSTEM_SQL_RAW ... SYSTEM_FORM_ELEMENT_COLUMN | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
......@@ -250,6 +250,63 @@ Only variables that are known in a specified store can be substituted.
Predefined variable names
-------------------------
.. _STORE_FORM:
Store: *FORM* - F
^^^^^^^^^^^^^^^^^
* Represents the values in the form, typically before saving them.
* Used for:
* Formelements who will be rerendered, after a parent element has been changed by the user.
* Formelement actions, before saving the form.
* Values will be sanatized by the class configured in corresponding the formelement. By default, the sanitize class is `alnumx`.
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+====================+============================================================================================================================================+
| FormElement name | Name of native formelement. To get, exactly and only, the specified form element (for 'p_id'): *{{p_id:F}}* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_SIP:
Store: *SIP* - S
^^^^^^^^^^^^^^^^
* Filled automatically by creating links. E.g.:
* in `Report` by using `_page?` or `_link` (with active 's')
* in `Form` by using subrecords: 'new', 'edit', 'delete' links (system) or by column type `_page?`, `_link`.
+--------------------+-----------------------------------------------------------+
| Name | Explanation |
+====================+===========================================================+
| sip | 13 char uniqid |
+--------------------+-----------------------------------------------------------+
| r | current record id |
+--------------------+-----------------------------------------------------------+
| form | current form name |
+--------------------+-----------------------------------------------------------+
| table | current table name |
+--------------------+-----------------------------------------------------------+
| urlparam | all non Typo3 paramter in one string |
+--------------------+-----------------------------------------------------------+
| <user defined> | additional user defined link parameter |
+--------------------+-----------------------------------------------------------+
.. _STORE_RECORD:
Store: *RECORD* - R
^^^^^^^^^^^^^^^^^^^
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+======================+============================================================================================================================================+
| <record column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form element: *{{p_id:R}}* |
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_CLIENT:
Store: *CLIENT* - C
^^^^^^^^^^^^^^^^^^^
......@@ -277,55 +334,39 @@ Store: *CLIENT* - C
| EANREDE | *{{sex}}* == male >> Dear Mr., *{{sex}}* == female >> Dear Mrs. |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_TYPO3:
Store: *TYPO3* (Bodytext) - T
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+---------------+-------------------------------------------------------------------+
| Name | Explanation |
+===============+===================================================================+
| form | Formname defined in ttcontent record bodytext |
| | |
| | * Fix. E.g. *form = person* |
| | * via SIP. E.g. *form = {{form}}* |
+---------------+-------------------------------------------------------------------+
| pageId | Record id of current Typo3 page |
+---------------+-------------------------------------------------------------------+
| pageType | Current selected page type (typically URL parameter 'type') |
+---------------+-------------------------------------------------------------------+
| pageLanguage | Current selected page language (typically URL parameter 'L') |
+---------------+-------------------------------------------------------------------+
| ttcontentUid | Record id of current Typo3 content element |
+---------------+-------------------------------------------------------------------+
| feUser | Logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
| feUserUid | Logged in Typo3 FE User uid |
+---------------+-------------------------------------------------------------------+
| feUserGroup | FE groups of logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
Store: *FORM* - F
^^^^^^^^^^^^^^^^^
* Represents the values in the form, typically before saving them.
* Used for:
* Formelements who will be rerendered, after a parent element has been changed by the user.
* Formelement actions, before saving the form.
* Values will be sanatized by the class configured in corresponding the formelement. By default, the sanitize class is `alnumx`.
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+====================+============================================================================================================================================+
| FormElement name | Name of native formelement. To get, exactly and only, the specified form element (for 'p_id'): *{{p_id:F}}* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
Store: *RECORD* - R
^^^^^^^^^^^^^^^^^^^
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+====================+============================================================================================================================================+
| record column name | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form element: *{{p_id:R}}* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+---------------+-------------------------------------------------------------------+----------+
| Name | Explanation | Note |
+===============+===================================================================+==========+
| form | Formname defined in ttcontent record bodytext | |
| | | |
| | * Fix. E.g. *form = person* | |
| | * via SIP. E.g. *form = {{form}}* | |
+---------------+-------------------------------------------------------------------+----------+
| pageId | Record id of current Typo3 page | see note |
+---------------+-------------------------------------------------------------------+----------+
| pageType | Current selected page type (typically URL parameter 'type') | see note |
+---------------+-------------------------------------------------------------------+----------+
| pageLanguage | Current selected page language (typically URL parameter 'L') | see note |
+---------------+-------------------------------------------------------------------+----------+
| ttcontentUid | Record id of current Typo3 content element | see note |
+---------------+-------------------------------------------------------------------+----------+
| feUser | Logged in Typo3 FE User | |
+---------------+-------------------------------------------------------------------+----------+
| feUserUid | Logged in Typo3 FE User uid | |
+---------------+-------------------------------------------------------------------+----------+
| feUserGroup | FE groups of logged in Typo3 FE User | |
+---------------+-------------------------------------------------------------------+----------+
* **note**: not available
* in 'dynamicUpdate' or
* by FormElement class 'action' with type 'beforeSave', 'afterSave', 'beforeDelete', 'afterDelete'.
.. _STORE_VARS:
Store: *VARS* - V
^^^^^^^^^^^^^^^^^
......@@ -338,8 +379,50 @@ Store: *VARS* - V
| slaveId | see FormElement `action` |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
SQL
---
.. _STORE_SYSTEM:
Store: *SYSTEM* - S
^^^^^^^^^^^^^^^^^^^
+-------------------------+------------------------------------------------------------+
| Name | Explanation |
+=========================+============================================================+
| DB_USER | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| DB_SERVER | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| DB_NAME | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| DB_INIT | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| SQL_LOG | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| SQL_LOG_MODE | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| SHOW_DEBUG_INFO | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| CSS_CLASS_QFQ_CONTAINER | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| EXT_PATH | computed during runtime |
+-------------------------+------------------------------------------------------------+
| SITE_PATH | computed during runtime |
+-------------------------+------------------------------------------------------------+
| DATE_FORMAT | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| sqlFinal | computed during runtime, used for error reporting |
+-------------------------+------------------------------------------------------------+
| sqlParamArray | computed during runtime, used for error reporting |
+-------------------------+------------------------------------------------------------+
| sqlCount | computed during runtime, used for error reporting |
+-------------------------+------------------------------------------------------------+
SQL Statement
-------------
* The detection of an SQL command is case *insensitive*.
* Leading whitespace will be skipped.
......@@ -361,9 +444,9 @@ SQL
{{SELECT id, name, IF({{feUser}}=0,'Yes','No') FROM Vorlesung WHERE sem_id={{keySemId:Y}} }}
{{SELECT id, city FROM Address AS adr WHERE adr.p_id={{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. To deliver a result array specify an '!' before the SELECT: ::
*{{!SELECT ...}}*
*{{!SELECT ...}}*
* This is only possible for the outermost SELECT.
......@@ -913,9 +996,9 @@ current record either to finalize the upload or to delete a previous uploaded fi
* *fileDestination*: Destination where to copy the file. A good practice is to specify a relative `fileDestination` - such an
installation (filesystem and database) are moveable.
* If `fileDestination` should contain the original filename, the variable *{{_filename}}* can be used. Example::
* If `fileDestination` should contain the original filename, the variable *{{_filename}}* can be used. Example ::
fileDestination={{SELECT 'fileadmin/user/pictures/', p.name, '-{{_filename}}' FROM Person AS p WHERE p.id={{r}} }}
fileDestination={{SELECT 'fileadmin/user/pictures/', p.name, '-{{_filename}}' FROM Person AS p WHERE p.id={{r}} }}
* If a file already exist under `fileDestination`, an error message is shown and 'save' is aborted.
The user has no possibility to overwrite the already existing file. If the whole workflow is correct, this situation
......@@ -2296,11 +2379,8 @@ Result:
o Louis Armstrong
o Diana Ross
..
The same as above, but with braces::
10 {
sql = SELECT p.name FROM exp_person AS p
head = <ul>
......@@ -2309,24 +2389,14 @@ The same as above, but with braces::
rend = </li>
}
::
Two queries
::
Two queries: ::
10.sql = SELECT p.name FROM exp_person AS p
10.rend = <br />
20.sql = SELECT a.street FROM exp_address AS a
20.rend = <br />
..
Two queries: nested
::
Two queries: nested ::
# outer query
10.sql = SELECT p.name FROM exp_person AS p
......@@ -2336,13 +2406,9 @@ Two queries: nested
10.10.sql = SELECT a.street FROM exp_address AS a
10.10.rend = <br />
..
* For every record of '10', all records of 10.10 will be printed.
Two queries: nested with variables
* For every record of '10', all records of 10.10 will be printed.
::
Two queries: nested with variables ::
# outer query
10.sql = SELECT p.id, p.name FROM exp_person AS p
......@@ -2352,14 +2418,9 @@ Two queries: nested with variables
10.10.sql = SELECT a.street FROM exp_address AS a WHERE a.pid='{{10.id}}'
10.10.rend = <br />
..
* For every record of '10', all assigned records of 10.10 will be printed.
Two queries: nested with hidden variables in a table
::
Two queries: nested with hidden variables in a table ::
10.sql = SELECT p.id AS _p_id, p.name FROM exp_person AS p
10.rend = <br />
......@@ -2368,9 +2429,7 @@ Two queries: nested with hidden variables in a table
10.10.sql = SELECT a.street FROM exp_address AS a WHERE a.p_id='{{10.p_id}}'
10.10.rend = <br />
..
Same as above, but written in the nested notation::
Same as above, but written in the nested notation ::
10 {
sql = SELECT p.id AS _p_id, p.name FROM exp_person AS p
......@@ -2383,7 +2442,7 @@ Same as above, but written in the nested notation::
}
}
* Columns starting with a '_' won't be printed but can be accessed as regular columns.
* Columns starting with a '_' won't be printed but can be accessed as regular columns.
Best practice: Form
......@@ -2446,11 +2505,9 @@ via SIP parameter to the secondary form.
On the secondary form: for 'new' records choose the computed value, for existing records leave the value
unchanged.
* Primary form, `subrecord` formelement, field `parameter`: set
::
* Primary form, `subrecord` formelement, field `parameter`: set ::
detail=id:formId,{{SELECT '&', IFNULL(fe.ord,0)+10 FROM Form AS f LEFT JOIN FormElement AS fe ON fe.formId=f.id WHERE
detail=id:formId,{{SELECT '&', IFNULL(fe.ord,0)+10 FROM Form AS f LEFT JOIN FormElement AS fe ON fe.formId=f.id WHERE
f.id={{r:S0}} ORDER BY fe.ord DESC LIMIT 1}}:ord
......@@ -2573,8 +2630,8 @@ Best Practise: Chart
* system wide via Typo3 Template record.
* By splitting HTML and JavaScript code over several lines, take care not accidently to create a 'nesting'-end token.
Check the line after `10.tail =`. It's '}' alone on one line. This is a valid 'nesting'-end token!. There are two options
to circumvent this:
Check the line after `10.tail =`. It's '}' alone on one line. This is a valid 'nesting'-end token!. There are two options
to circumvent this:
* Don't nest the HTML & JavaScript code - bad workaround, this is not human readable.
* Select different nesting token, e.g. '<' / '>' (check the first line on the following example).
......
Supports Markdown
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