Commit 052d9529 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'master' into corrections

# Conflicts:
#	Documentation/Manual.rst
parents 402b0e3c d52cba21
Pipeline #2540 passed with stages
in 2 minutes and 47 seconds
# EditorConfig is awesome:
# Use as master:
# top-most EditorConfig file
root = false
[{*.rst, *.rst.txt}]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 3
# MD-Files
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
# ignore generated documentation
# ignore typical clutter of IDEs and editors (this could be added in .git/info/exclude,
# but we add it here for convenience)
# Created by .ignore support plugin (
......@@ -13,20 +27,27 @@
......@@ -37,3 +58,6 @@ test.php
- VERSION=`cat ./version`
- RELDATE=`date '+%Y%m%d%H%M'`
- mkdir build || true
SELENIUM_LOGS_PATH: "/scratch/tmp/7/"
- before
- build
- selenium
stage: before
- docker pull t3docs/render-documentation
- source <(docker run --rm t3docs/render-documentation show-shell-commands)
- dockrun_t3rd makehtml
stage: build
- tags
expire_in: 1 week
- build/
- make VERSION=$VERSION snapshot
- chmod a+r qfq_$VERSION_*.zip
- scp qfq_$VERSION_*.zip w16:qfq/snapshots/
- make VERSION=${VERSION} phpunit_snapshot
- chmod a+r qfq_${VERSION}_*.zip
- echo "mv qfq_${VERSION}_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip"
- mv qfq_${VERSION}_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip
- scp qfq_${VERSION}_*.zip w16:qfq/snapshots/
- mv qfq_${VERSION}_*.zip build/
stage: build
- tags
expire_in: 1 week
- build/
- make VERSION=${VERSION} phpunit_release
- chmod a+r qfq_${VERSION}_*.zip
- scp qfq_${VERSION}_*.zip w16:qfq/releases/
- mv qfq_${VERSION}_*.zip build/
stage: selenium
- make VERSION=$VERSION release
- chmod a+r qfq_$VERSION_*.zip
- scp qfq_$VERSION_*.zip w16:qfq/releases/
- unzip -q build/ -d qfq
- cd docker/
- ./ -no-deploy
- ./ ../qfq
- ./
- echo "hello"
# remove containers and move logs to persistent location
- cd docker; ./ <<< "y"
- cd ..
- umask 002
- cp extension/Tests/selenium/selenium_logs/* "$SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA/"
- echo "Selenium Logs copied to $SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA/"
This diff is collapsed.
Design / Notes for fabric.js
* graphical annotation of PNG, SVG,....
* For the first version, no fullscreen
* The fabric element:
** is implemented as a form element
** is wrapped in col-md
* Server may send all the user images as inline/hidden HTML element with an HTML-ID.
* The images will be given to fabric using a json element as seen here::
<div class="annotate-graphic" data-images='{"images": [{"page": 1, "selector": "qfq-fabric-image-1", "refId": ""}, {"page":2, "selector": "#qfq..."}]}'>
* id Selector without #
* Form Submit is a regular Save.
* Per Exercise exists one Form Element which contain the Fabric Drawing JSON Data.
Design / Notes for Code Annotation
* Highlighting Code Syntax
* Write comments to code lines
* Use a form Element
* Hidden field, value with annotation json:
"annotations": [
{ "lineNumber": ##,
"comments": [
{ "uid": ##,
"comment": "Text / HTML Blob",
"dateTime": "Formatted Date"
}, { "lineNumber": ###,
"comments": [
{ "uid": ##,
"comment": "2 Comment for one line, first",
"dateTime": "2018-05-12 09:45:00"
{ "uid": ##,
"comment": "second",
"dateTime": "0000-00-00 00:00:00"
"users": [
{ "uid": ##,
"name": "Displayed Username",
"avatar": "Gravatar, Standard Picture, Photo"
* Target for rendering, div with class="annotate-text"
* data-target: Referencing hidden input form from above
* data-file: Script or Textfile to be read and displayed
* data-uid: JSON of logged in user, like:
uid: 5,
name: "Definitely not an AI",
avatar: "mockData/avatar1.png"
* data-highlight: Name of the language, that needs highlighting, if required
\ No newline at end of file
......@@ -60,7 +60,7 @@ LOAD
* The PHP code api/save.php, api/load.php is called directly, without any TYPO3 Framework. Therefore the Typo3 information
'pageId', 'feUser*', 'beUser*', 'ttContentUid', ... is not available.
* *Form load*: an additional hidden Formelement '_sipForTypo3Vars' will be created with a subset of the current
STORE_TYPO3 values. The workaround with the SIP is usefull, cause the same form can be shown on different places (QFQ records) -
STORE_TYPO3 values. The workaround with the SIP is useful, cause the same form can be shown on different places (QFQ records) -
this is not very likely, but might happen. The 'on the fly rendered' SIP helps to deliver the status.
AbstractBuildForm.php: process() > prepareT3VarsForSave() > Store.php: copyT3VarsToSip();
* *Form save*: FillStoreForm.php: process() > Store: fillTypo3StoreFromSip()
......@@ -280,8 +280,8 @@ FORM_LOG_EXPIRE (typically 1800 seconds).
* Correspondig expired logfiles will be deleted.
* Active logfiles will be filled.
Errormessages & Exceptions
Error Messages & Exceptions
* Exception types:
* Code
Neuer Build
* release: Wird ein *Tag* vergeben (egal welcher Branch) der mit 'v' beginnt, erzeugt das automatisch einen Build -
* snapshot: Jeder Commit (egal welcher Branch) erzeugt einen Snapshot -
* nightly: Nach einem Commit auf Branch 'master' tagsueber, wird um 23:55 ein 'nightly' Build erstellt -
......@@ -8,6 +9,8 @@ Neuer Build
Neue Versionsnummer
0) Fuer jede neue Version ein Ticket erstellen. Template: #6994
1) **Laufen** die Unit Tests durch?
2) Die aktuellen Commits anschauen und wichtige Topics uebernehmen (git log > ~/qfq.log, alles bis zum letzten TAG anschauen):
......@@ -25,38 +28,60 @@ Neue Versionsnummer
* Den Inhalt von Release.rst kopieren nach qfq/extension/RELEASE.txt.
* Den Inhalt von Release.rst kopieren nach
* Tickets
* Alle offenen Tickets im aktuellen Milestones verschieben auf den naechsten Milestone.
* Abgeschlossene Tickets schliessen.
3) In folgenden Files anpassen:
**Achtung**: die Release Minor darf KEINE fuehrenden Nullen enthalten!!! Ansonsten funktioniert die Verteilung vie TER nicht.
**Auto**: ./ <MAJOR>.<MINOR>.<MICRO>
* extension/Documentation/_make/ release, version
* extension/Documentation/Settings.cfg: version
* extension/Documentation/_make/ release, version-
* Documentation/Settings.cfg: version
* extension/ext_emconf.php: version
4) Im Projektverzeichnis: **Doc**
4) **Documentation**
make t3sphinx (dadurch fallen Fehler in der RESTdoc Syntax auf)
make doc-local (dadurch fallen Fehler in der RESTdoc Syntax auf)
5) **Update Version & Commit**
* Update the version number in this document (topic 6)
* Commit & Push new version changes to master branch:
New version x.y.z.
New version 19.10.0
6) **New Tag**:
git tag v18.6.1
git push -u origin v18.6.1
git tag v19.10.0
git push -u origin v19.10.0
7) Tickets:
* Schliessen und der QFQ Version zuweisen.
* Aktuellen Milestone schliessen
8) T3 Doc aktualisieren
Sollte durch den WebHook passieren.
9) Extension hochladen
TER: > Log in > My Extensions.
10) PhpStorm: **Sync** all files to VM qfq.
7) PhpStorm: **Sync** all files to VM qfq.
Update Doku auf
1) Copy 'qfq' doc to github project 'qfq-doc'. Commit changes. Push changes to github::
......@@ -67,4 +92,4 @@ Upload new version to TER
* > Log in > My Extensions.
* Rename the ZIP file to be TER compatible: e.g.
* Upload - that's all.
\ No newline at end of file
* Upload - that's all.
......@@ -387,7 +387,7 @@ URL Parameters
Server Response
: header("Content-type: $mimetype");
header("Content-Length: $length");
header("Content-Disposition: inline; filename=\"$outputFilename\"");
header("Content-Disposition: inline; filename='$outputFilename'");
header("Pragma: no-cache");
header("Expires: 0");
......@@ -506,10 +506,10 @@ Server Response
Asynchronous request (read AJAX) initiated by the Client receive a
JSON Response from the server (extended [Minimal Response]) containing:
"status": "success"|"error"|"conflict"|"conflict_allow_force",
"message": "<message>"e5
: {
: "status": "success"|"error"|"conflict"|"conflict_allow_force",
: "message": "<message>"e5
: }
`status` indicates how the request has been fulfilled by the server.
On`"success"`, the Client display nothing to the user.
......@@ -563,3 +563,30 @@ Current Page
: Issued by the Server. It is a command prompting the Client to
navigate away from the Current Page.
### Tablesorter Save View
To save a table view the client sends a post request with the following data:
"name": "<name of view>",
"public": <boolean>,
"tableId": "<id of table to which view belongs>",
"view": {
"columnSelection": <array of chosen column ids>,
"filters": <array of strings>,
"sortList": <array of arrays of length 2>
Request URL
: api/save.php
Request Method
URL Parameters
: `s=<SIP>` - to prove permission.
Server Response
: The response contains at least a [Minimal Response].
General Concept
* There is one PHP file to handle all REST calls:
* All further endpoints are appended after rest.php, seperated by '/'. Example:
The argument 'myEmail' is just to show how GET variables will be submitted.
* Each `level` is a QFQ form. In the above example: `restPerson` and `restAddress`
* A QFQ form will be enabled for REST calls via field 'Permit REST'. Possible options: get, insert (post), update (put), delete
* An optional HTML header token based 'authorization' is supported.
* At least one `level` (= form name) has to be given.
* Multiple `level/id` tuple are possible.
* Only the last level will be used. The last `level` becomes automatically `form` in STORE_TYPO3.
* The last `id` becomes automatically `r` in STORE_TYPO3.
* Previous `level` and `id` are accessible via `{{_id1:C}}`, `{{_form1:C:alnumx}}`,`{{_id2:C}}`, `{{_form2:C:alnumx}}`, ...
* Import/Export data has to be/is JSON encoded.
* The following settings has no impact to QFQ forms called via REST: `form.Permit New`, `form.Permit Edit`
HTML Requests
GET - export
curl -X GET "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson"
* no `id` or `id=0` (example: 1, 123): The result of `Form.parameter.restSqlList` will be generated.
* `id>0` (example: 1, 123): the result of `Form.parameter.restSqlData` will be generated.
* The whole resultset will be JSON encoded.
* It's not possible to render subrecords. This has to be done via a sub level (next form).
* Future: If this is not sufficient, a possible solution might be a `report`-notation (special FormElement), which do
not implode all output, but leave the rows/cells intact as an array - the json_encode will then to the rest.
POST - insert
curl -X POST "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson" -d '{"name":"Miller","firstname":"Jonni"}'
* The data has to be JSON encoded transferred to the REST API.
* The JSON stream will be decoded to an array and copied to $_POST.
* The further process is identically to a standard 'form submit'.
* There should be no `id` given or `id=0`.
PUT - update
curl -X PUT "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson/1" -d '{"name":"Miller","firstname":"Jonni"}'
* The data has to be JSON encoded transferred to the REST API.
* The JSON stream will be decoded to an array and copied to $_POST.
* The further process is identically to a standard 'form submit'.
* There have to be an `id>0`.
curl -X DELETE "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson/1"
* The data has to be JSON encoded transferred to the REST API.
* The JSON stream will be decoded to an array and copied to $_POST.
* The further process is identically to a standard 'form submit'.
* There have to be an `id>0`.
Header Token Authorization
curl -X GET -H 'Authorization: Token token="mySuperSecretToken"' "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson/"
Static token
Per form configure `form.parameter.restToken=mySuperSecretToken`.
Dynamic token
The client supplied authorization token is available via the client store: `{{Authorization:C:alnumx}}`.
Take the Client token and check if it saved in a table with all user token:
form.parameter.restToken={{SELECT a.token FROM Auth AS a WHERE a.token='{{Authorization:C:alnumx}}' }}
Append the GET variable `?XDEBUG_SESSION_START=1`
curl -X POST "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson?XDEBUG_SESSION_START=1" -d '{"name":"Miller","firstname":"Jonni"}'
PhpStorm with activated debugger will stop at any breakpoint and 'stepping' through the code is possible.
T3 Documentation
* QFQ Documentation:
* Build local documentation: ``make doc-local``
* Example Code Documentation:
* Pushing a tag on the project triggers a rebuild.
Manual trigger of documentation rebuild
* > QFQ > Settings > Integrations > Webhook: Test
Log errors
* >> Recent Actions
* > QFQ > Settings > Integrations > Webhook: > Edit: Recent Deliveries
Best Practice T3 reST
* Best Practice T3 reST:
* Reference:
General Concept
Tablesorter supports filter, column on/off and sort.
A QFQ enhancement allows save/delete/activate of custom tablesorter `views`. This feature is described in this document.
QFQ uses the table 'Setting' to store per user, public and readonly settings. At time of writing only 'tablesorter' settings
are supported. Further settings might come in the future.
Show table with tablesorter activate/save/delete
A page with a HTML table includes the command `{{'<uniqueName>' AS _tablesorter-view-saver}}` inside of the HTML table tag.
QFQ will replace the command::
<table {{ 'allperson' AS _tablesorter-view-saver }} class="tablesorter tablesorter-filter tablesorter-column-selector"> ... </table>
<table data-tablesorter-id='allperson' data-tablesorter-sip='5d0e29c4eacc2'
data-tablesorter-view='[{"name":"test","public":false,"tableId":"mytable","view":"eyJjb2x1bW5TZWxlY3Rpb24iOlswLDEsMiwzXSwiZmlsdGVycyI6WyIiLCIiLCIiLCIiXSwic29ydExpc3QiOltdfQ=="}]' class="table tablesorter tablesorter-column-selector tablesorter-filter tablesorter-pager">
tableId: the '<uniqueName>', in the example it's 'allperson'
feUser: the current logged in FE user. If no FE user is logged in, take the QFQ cookie. With this workaround, it's at
least possible to work with 'views' during a browser session.
data-tablesorter-view: JSON encoded array
Array of views.
Each view:
['name'] - Name of the view. Value is html entity encoded.
['public'] - true or false. false mean's 'private'.
['tableId'] - '<uniqueName>' - this is the filter to assign views to a specific HTML table.
['view'] - base64 encoded JSON array. It's base64 encoded for two reasons:
a) we do not have to take care about SQL injection (the user might supply filter strings, incl. regex expressions)
b) the JSON array will contain '}}', which confuses QFQ/evaluate.
QFQ will collect all views:
a) all private views of the current table and FE User,
b) all public views of the current table.
Save tablesorter view
The user might click on 'Save Private View' or 'Save Public View'.