Commit 4d46add8 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Manual.rst: test some markup styles

parent f7034a82
Pipeline #1543 passed with stage
in 2 minutes and 19 seconds
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
.. External Links: `Bootstrap <http://getbootstrap.com/>`_: .. External Links: `Bootstrap <http://getbootstrap.com/>`_:
.. Add Images: https://wiki.typo3.org/ReST_Syntax#Images ... .. Add Images: https://wiki.typo3.org/ReST_Syntax#Images ...
.. ..
.. Admonitions (https://docs.typo3.org/typo3cms/drafts/github/xperseguers/RstPrimer/#admonitions)
.. .. note:: .. important:: .. tip:: .. warning::
..
.. -*- coding: utf-8 -*- with BOM. .. -*- coding: utf-8 -*- with BOM.
...@@ -384,7 +387,7 @@ Extension Manager: QFQ Configuration ...@@ -384,7 +387,7 @@ Extension Manager: QFQ Configuration
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+ +-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| formSubmitLogMode | all | | *all*: every form submission will be logged. | | formSubmitLogMode | all | | *all*: every form submission will be logged. |
| | | | *none*: no logging. | | | | | *none*: no logging. |
| | | | See `Form Submit Log page`_ for example QFQ code to display the log. | | | | | See `form-submit-log-page`_ for example QFQ code to display the log. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+ +-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| redirectAllMailTo | john@doe.com | If set, redirect all QFQ generated mails (Form, Report) to the specified. | | redirectAllMailTo | john@doe.com | If set, redirect all QFQ generated mails (Form, Report) to the specified. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+ +-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
...@@ -610,7 +613,8 @@ To get the name and current period: :: ...@@ -610,7 +613,8 @@ To get the name and current period: ::
Typically, it's necessary to offer a 'previous' / 'next' link. In this example, the STORE SIP holds the new periodId: :: Typically, it's necessary to offer a 'previous' / 'next' link. In this example, the STORE SIP holds the new periodId: ::
SELECT CONCAT('p:{{pageAlias:T}}&periodId=', {{periodId:SY0}}-1, '|Next') AS _page, ' ', name, ' ', CONCAT('p:{{pageAlias:T}}&periodId=', {{periodId:SY0}}+1, '|Next') AS _page FROM Period AS s WHERE s.id={{periodId:SY0}} SELECT CONCAT('p:{{pageAlias:T}}&periodId=', {{periodId:SY0}}-1, '|Next') AS _page, ' ', name, ' ',
CONCAT('p:{{pageAlias:T}}&periodId=', {{periodId:SY0}}+1, '|Next') AS _page FROM Period AS s WHERE s.id={{periodId:SY0}}
Take care for minimum and maximum indexes (do not render the links if out of range). Take care for minimum and maximum indexes (do not render the links if out of range).
...@@ -823,7 +827,7 @@ System tables ...@@ -823,7 +827,7 @@ System tables
| Split | Persistent | Data | | Split | Persistent | Data |
+---------------+------------+------------+ +---------------+------------+------------+
See `Mail Log page`_ and `Form Submit Log page`_ for some Frontend views for these tables. See `mail-log-page`_ and `form-submit-log-page`_ for some Frontend views for these tables.
* Check Bug #5459 - support of system tables in different DBs not supported. * Check Bug #5459 - support of system tables in different DBs not supported.
...@@ -922,7 +926,7 @@ Debug ...@@ -922,7 +926,7 @@ Debug
SQL Logging SQL Logging
----------- -----------
configuration_ Setup in configuration_
.. _SQL_LOG: .. _SQL_LOG:
...@@ -970,14 +974,14 @@ configuration_ ...@@ -970,14 +974,14 @@ configuration_
* *download*: * *download*:
* During a download (especially by using wkhtml), temporary files are not deleted automatically. Also the * During a download (especially by using wkhtml), temporary files are not deleted automatically. Also the
`wkhtmltopdf` and `pdftk` commandlines will be logged to `SQL_LOG`_. Use this only to debug problems on download. ``wkhtmltopdf`` and ``pdftk`` commandlines will be logged to `SQL_LOG`_. Use this only to debug problems on download.
.. _REDIRECT_ALL_MAIL_TO: .. _REDIRECT_ALL_MAIL_TO:
Redirect all mail to (catch all) Redirect all mail to (catch all)
-------------------------------- --------------------------------
configuration_ Setup in configuration_
* *redirectAllMailTo=john@doe.com* * *redirectAllMailTo=john@doe.com*
...@@ -990,7 +994,7 @@ configuration_ ...@@ -990,7 +994,7 @@ configuration_
* Clear 'CC' and 'Bcc' * Clear 'CC' and 'Bcc'
* Write a note and the original configured receiver at the top of the email body. * Write a note and the original configured receiver at the top of the email body.
_`Mail Log page` _`mail-log-page`
Mail Log page Mail Log page
------------- -------------
...@@ -1008,7 +1012,8 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte ...@@ -1008,7 +1012,8 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
FROM gGroup AS gr FROM gGroup AS gr
INNER JOIN MailLog AS ml ON ml.grId = gr.id INNER JOIN MailLog AS ml ON ml.grId = gr.id
GROUP BY gr.id GROUP BY gr.id
head = <form onchange='this.submit();' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>Filter By Group: <select name='grId' class='form-control'><option value=''></option> head = <form onchange='this.submit();' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>
Filter By Group: <select name='grId' class='form-control'><option value=''></option>
rbeg = <option value=' rbeg = <option value='
rend = </option> rend = </option>
tail = </select> tail = </select>
...@@ -1024,17 +1029,20 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte ...@@ -1024,17 +1029,20 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
sql = SELECT id, '</td><td>', grId, '</td><td>', xId, '</td><td>', sql = SELECT id, '</td><td>', grId, '</td><td>', xId, '</td><td>',
REPLACE(receiver, ',', '<br>'), '</td><td>', REPLACE(sender, ',', '<br>'), '</td><td>', REPLACE(receiver, ',', '<br>'), '</td><td>', REPLACE(sender, ',', '<br>'), '</td><td>',
DATE_FORMAT(modified, '%d.%m.%Y<br>%H:%i:%s'), '</td><td style="word-break:break-word;">', DATE_FORMAT(modified, '%d.%m.%Y<br>%H:%i:%s'), '</td><td style="word-break:break-word;">',
CONCAT('<b>', subject, '</b><br>', IF(@summary = 'true', CONCAT(SUBSTR(body, 1, LEAST(IF(INSTR(body, '\n') = 0, 50, INSTR(body, '\n')), IF(INSTR(body, '<br>') = 0, 50, INSTR(body, '<br>')))-1), ' ...'), CONCAT('<br>', REPLACE(body, '\n', '<br>'))) ) CONCAT('<b>', subject, '</b><br>', IF(@summary = 'true', CONCAT(SUBSTR(body, 1,
LEAST(IF(INSTR(body, '\n') = 0, 50, INSTR(body, '\n')), IF(INSTR(body, '<br>') = 0, 50,
INSTR(body, '<br>')))-1), ' ...'), CONCAT('<br>', REPLACE(body, '\n', '<br>'))) )
FROM MailLog WHERE (grId = @grId OR @grId = 0) FROM MailLog WHERE (grId = @grId OR @grId = 0)
ORDER BY modified DESC ORDER BY modified DESC
LIMIT 100 LIMIT 100
head = <table class="table table-condensed table-hover"><tr><th>Id</th><th>grId</th><th>xId</th><th>To</th><th>From</th><th>Date</th><th>E-Mail</th></tr> head = <table class="table table-condensed table-hover"><tr>
<th>Id</th><th>grId</th><th>xId</th><th>To</th><th>From</th><th>Date</th><th>E-Mail</th></tr>
tail = </table> tail = </table>
rbeg = <tr><td> rbeg = <tr><td>
rend = </td></tr> rend = </td></tr>
} }
_`Form Submit Log page` _`form-submit-log-page`
Form Submit Log page Form Submit Log page
-------------------- --------------------
...@@ -7464,7 +7472,8 @@ to edit `AutoCron` jobs: :: ...@@ -7464,7 +7472,8 @@ to edit `AutoCron` jobs: ::
10 { 10 {
# Table header. # Table header.
sql = SELECT CONCAT('p:{{pageAlias:T}}&form=cron') AS _pagen, 'id', 'Next run','Frequency','Comment','Last run','In progress', 'Status' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'='' sql = SELECT CONCAT('p:{{pageAlias:T}}&form=cron') AS _pagen, 'id', 'Next run','Frequency','Comment',
'Last run','In progress', 'Status' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = <table class='table table-hover qfq-table-50'> head = <table class='table table-hover qfq-table-50'>
tail = </table> tail = </table>
rbeg = <thead><tr> rbeg = <thead><tr>
...@@ -7605,31 +7614,31 @@ QFQ offers an API endpoint for GET (and later POST,PUT,DELETE) operations. :: ...@@ -7605,31 +7614,31 @@ QFQ offers an API endpoint for GET (and later POST,PUT,DELETE) operations. ::
<domain>/typo3conf/ext/qfq/Source/api/rest.php/<level1>/<id1>/<level2>/<id2>/.../?<var1>=<value1>&... <domain>/typo3conf/ext/qfq/Source/api/rest.php/<level1>/<id1>/<level2>/<id2>/.../?<var1>=<value1>&...
Append level names and ids after 'rest.php/...', separated by '/' each. Append level names and ids after `rest.php/...`, separated by '/' each.
E.g.: E.g.:
a) List of all persons: <domain>/typo3conf/ext/qfq/Source/api/rest.php/person 1. List of all persons: `<domain>/typo3conf/ext/qfq/Source/api/rest.php/person`
b) Data of person 123: <domain>/typo3conf/ext/qfq/Source/api/rest.php/person/123 2. Data of person 123: `<domain>/typo3conf/ext/qfq/Source/api/rest.php/person/123`
c) Adresses of person 123: <domain>/typo3conf/ext/qfq/Source/api/rest.php/person/123/address 3. Adresses of person 123: `<domain>/typo3conf/ext/qfq/Source/api/rest.php/person/123/address`
d) Adress details of address 45 from person 123: <domain>/typo3conf/ext/qfq/Source/api/rest.php/person/123/address/45 4. Adress details of address 45 from person 123: `<domain>/typo3conf/ext/qfq/Source/api/rest.php/person/123/address/45`
QFQ 'Forms' are used as a 'container' to configure all necessary export/import details per 'level'. QFQ 'Forms' are used as a 'container' to configure all necessary export/import details per 'level'.
Each 'level' is represented by a QFQ Form. Each 'level' is represented by a QFQ Form.
Only the last <level> of an URI will be processed. The former ones are just to fullfil a good looking REST API. Only the last <level> of an URI will be processed. The former ones are just to fulfil a good looking REST API.
Important: the level name is the QFQ form name. Important: the level name is the QFQ form name.
Each level name (=form name) is available via STORE_CLIENT and name '_formX'. E.g. in example Each level name (=form name) is available via STORE_CLIENT and name `_formX`. E.g. in example
d) '{{_form1:C:alnumx}}'='person' and '{{_form2:C:alnumx}}'='address'. (1) `{{_form1:C:alnumx}}=person` and `{{_form2:C:alnumx}}=address`.
Each level id is available via STORE_CLIENT and name '_idX'. E.g. in example Each level id is available via STORE_CLIENT and name `_idX`. E.g. in example
d) '{{_id1:C}}'='123' and '{{_id2:C}}'='45'. (2) `{{_id1:C}}=123` and `{{_id2:C}}=45`.
Also the 'id' after the last 'level' in the URI path (123 in example b), and 45 in example d) ) is copied to Also the `id` after the last `level` in the URI path, 123 in example (2) and 45 in example (4), is copied to
variable 'r' in STORE_TYPO3, access it via '{{r:T}}'. variable `r` in STORE_TYPO3, access it via `{{r:T}}`.
Export (GET) Export (GET)
...@@ -7639,17 +7648,19 @@ All data is exported in JSON notation. ...@@ -7639,17 +7648,19 @@ All data is exported in JSON notation.
A REST (GET) form has two modes: :: A REST (GET) form has two modes: ::
a) data: specific content to a given id. Defined via 'form.parameter.restSqlData'. This mode is selected data
if there is an id>0 given. Specific content to a given id. Defined via 'form.parameter.restSqlData'. This mode is selected if there is an
id>0 given.
b) list: a list of records will be exported. Defined via 'form.parameter.restSqlList'. This mode is selected if there list
is no id or id=0. A list of records will be exported. Defined via 'form.parameter.restSqlList'. This mode is selected if there is no
id or id=0.
There are *no* FormElements. There are *no* FormElements.
To simplify access to id parameter of the URI, a mapping is possible via 'form.parameter.restParam'. To simplify access to id parameter of the URI, a mapping is possible via 'form.parameter.restParam'.
E.g. 'restParam=pId,adrId' with example d) makes '{{pId:C}}=123' and '{{adrId:C}}=45'. The order of variable E.g. `restParam=pId,adrId` with example d) makes `{{pId:C}}=123` and `{{adrId:C}}=45`. The order of variable
names corresponds to the position in the URI. _id1 is always mapped to the first parameter name, _id2 to names corresponds to the position in the URI. `_id1` is always mapped to the first parameter name, `_id2` to
the second one and so on. the second one and so on.
GET Variables provided via URL are available via STORE_CLIENT as usual. GET Variables provided via URL are available via STORE_CLIENT as usual.
...@@ -7673,18 +7684,18 @@ Form.parameter: ...@@ -7673,18 +7684,18 @@ Form.parameter:
| Attribute | Description | | Attribute | Description |
+===================+==============================================================================+ +===================+==============================================================================+
| restSqlData | SQL query selects content shown in data mode. | | restSqlData | SQL query selects content shown in data mode. |
| | restSqlData={{!SELECT id, name, gender FROM Person WHERE id='{{r:T0}}'' }} | | | `restSqlData={{!SELECT id, name, gender FROM Person WHERE id='{{r:T0}}'' }}` |
+-------------------+------------------------------------------------------------------------------+ +-------------------+------------------------------------------------------------------------------+
| restSqlList | SQL query selects content shown in data mode. | | restSqlList | SQL query selects content shown in data mode. |
| | restSqlData={{!SELECT id, name FROM Person }} | | | `restSqlData={{!SELECT id, name FROM Person }}` |
+-------------------+------------------------------------------------------------------------------+ +-------------------+------------------------------------------------------------------------------+
| restParam | Optional. CSV list of variable names. E.g.: restParam=pId,adrId | | restParam | Optional. CSV list of variable names. E.g.: `restParam=pId,adrId` |
+-------------------+------------------------------------------------------------------------------+ +-------------------+------------------------------------------------------------------------------+
| restToken | Optional. User defined string. For dynamic token see below. | | restToken | Optional. User defined string. For dynamic token see below. |
+-------------------+------------------------------------------------------------------------------+ +-------------------+------------------------------------------------------------------------------+
There are no `special-column-names`_ available in 'restSqlData' or 'restSqlList'. Also there are no There are no `special-column-names`_ available in `restSqlData` or `restSqlList`. Also there are no
SIPs possible, cause REST typically does not offer sessions/cookies (which are necessary for SIPs). SIPs possible, cause REST typically does not offer sessions/cookies (which are necessary for SIPs).
Authorization Authorization
...@@ -7698,8 +7709,8 @@ QFQ internal 'HTTP header token based authorization'. ...@@ -7698,8 +7709,8 @@ QFQ internal 'HTTP header token based authorization'.
Token based authorization Token based authorization
''''''''''''''''''''''''' '''''''''''''''''''''''''
A form will require a 'token based authorization', as soon as there is a 'form.parameter.restToken' defined. A form will require a 'token based authorization', as soon as there is a `form.parameter.restToken` defined.
Therefore the HTTP Header 'Authorization' has to be set with 'token=<secret token>'. The 'secret token' will Therefore the HTTP Header 'Authorization' has to be set with `token=<secret token>`. The 'secret token' will
be checked against the server. Using HTTPS, such token can't be sniffed and will typically not be logged in be checked against the server. Using HTTPS, such token can't be sniffed and will typically not be logged in
any server logs. any server logs.
...@@ -7709,17 +7720,19 @@ Example: :: ...@@ -7709,17 +7720,19 @@ Example: ::
Test via commandline: curl -X GET -H 'Authorization: Token token=myCrypticString0123456789' "http://localhost/qfq/typo3conf/ext/qfq/Source/api/rest.php/person/123/address/" Test via commandline: curl -X GET -H 'Authorization: Token token=myCrypticString0123456789' "http://localhost/qfq/typo3conf/ext/qfq/Source/api/rest.php/person/123/address/"
The static setup with 'form.parameter.restToken=myCrypticString0123456789' is fine, as long as only one token The static setup with `form.parameter.restToken=myCrypticString0123456789 is fine, as long as only one token
exist. In case of multiple tokens, replace the static string against a SQL query. exist. In case of multiple tokens, replace the static string against a SQL query.
General: The HTML Header Authorization token is available in STORE_CLIENT via '{{Authorization:C:alnumx}}'. General: The HTML Header Authorization token is available in STORE_CLIENT via '`{{Authorization:C:alnumx}}`.
For example all created tokens are saved in a table 'Auth' with a column 'token'. Define: :: For example all created tokens are saved in a table 'Auth' with a column 'token'. Define: ::
form.parameter.restToken={{SELECT a.token FROM Auth AS a WHERE a.token='{{Authorization:C:alnumx}}' }} form.parameter.restToken={{SELECT a.token FROM Auth AS a WHERE a.token='{{Authorization:C:alnumx}}' }}
To restrict access to a subset of data, just save the limitations inside the Auth record and update the query To restrict access to a subset of data, just save the limitations inside the Auth record and update the query
to check it: :: to check it:
.. code-block:: pmysql
form.parameter.restToken={{SELECT a.token FROM Auth AS a WHERE a.token='{{Authorization:C:alnumx}}'}} form.parameter.restToken={{SELECT a.token FROM Auth AS a WHERE a.token='{{Authorization:C:alnumx}}'}}
form.parameter.restSqlList={{!SELECT p.id, p.name, p.email FROM Person AS p, Auth AS a WHERE a.token='{{Authorization:C:alnumx}}' AND a.attribute=p.attribute}} form.parameter.restSqlList={{!SELECT p.id, p.name, p.email FROM Person AS p, Auth AS a WHERE a.token='{{Authorization:C:alnumx}}' AND a.attribute=p.attribute}}
...@@ -7748,7 +7761,9 @@ Report ...@@ -7748,7 +7761,9 @@ Report
------ ------
Any HTML output can be extended by a tag - that's done by the webmaster. For QFQ generated links, an attribute like Any HTML output can be extended by a tag - that's done by the webmaster. For QFQ generated links, an attribute like
'data-reference' might be injected via token 'A' (attribute). :: 'data-reference' might be injected via token 'A' (attribute).
.. code-block:: mysql
SELECT 'p:personedit&form=person&r=1|b|s|A:data-reference="person-edit"|t:Edit person' AS _link SELECT 'p:personedit&form=person&r=1|b|s|A:data-reference="person-edit"|t:Edit person' AS _link
......
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