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: http://EditorConfig.org
#
# Use as master: https://github.com/TYPO3-Documentation/T3DocTeam/blob/master/.editorconfig
# 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
[*.md]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
# ignore generated documentation
*GENERATED*
# ignore typical clutter of IDEs and editors (this could be added in .git/info/exclude,
# but we add it here for convenience)
*~
*.bak
*.idea
*.project
*.swp
.project
.webprj
nbprojec
# Created by .ignore support plugin (hsz.mobi) # Created by .ignore support plugin (hsz.mobi)
.python_virtualenv/ .python_virtualenv/
.virtual_env .virtual_env
...@@ -13,20 +27,27 @@ ...@@ -13,20 +27,27 @@
.support .support
.support_plantuml .support_plantuml
.support_sonar .support_sonar
qfq.flowchart.dia.autosave
test.json test.json
test.php test.php
test.html
*.autosave *.autosave
composer.lock
/Documentation-GENERATED-temp
/bower_components /bower_components
/composer.phar /composer.phar
/css /css
/dist/ /dist/
/doc/*.pdf
/doc/jsdoc /Documentation-develop/*.pdf
/doc/phpdoc /Documentation-develop/jsdoc
/doc/plantuml /Documentation-develop/phpdoc
/extension/Documentation/_make/build /Documentation-develop/plantuml
/extension/Documentation/html
/extension/Resources/Private/vendor /extension/vendor
/extension/Documentation/_make
/extension/Resources/Public/Css /extension/Resources/Public/Css
/extension/Resources/Public/fonts /extension/Resources/Public/fonts
/extension/Resources/Public/JavaScript /extension/Resources/Public/JavaScript
...@@ -37,3 +58,6 @@ test.php ...@@ -37,3 +58,6 @@ test.php
/qfq.flowchart.dia.autosave /qfq.flowchart.dia.autosave
/support /support
/vendor /vendor
/javascript/src/.vscode
/javascript/src/npm-debug.log
before_script: before_script:
- VERSION=`cat ./version` - VERSION=`cat ./version`
- RELDATE=`date '+%Y%m%d%H%M'`
- mkdir build || true
variables:
SELENIUM_LOGS_PATH: "/scratch/tmp/7/"
stages:
- before
- build
- selenium
documentation:
stage: before
script:
- docker pull t3docs/render-documentation
- source <(docker run --rm t3docs/render-documentation show-shell-commands)
- dockrun_t3rd makehtml
snapshot: snapshot:
stage: build
except: except:
- tags - tags
artifacts:
expire_in: 1 week
paths:
- build/
script: script:
- make VERSION=$VERSION snapshot - make VERSION=${VERSION} phpunit_snapshot
- chmod a+r qfq_$VERSION_*.zip - chmod a+r qfq_${VERSION}_*.zip
- scp qfq_$VERSION_*.zip w16:qfq/snapshots/ - 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/qfq.zip
release: release:
stage: build
only: only:
- tags - tags
artifacts:
expire_in: 1 week
paths:
- build/
script:
- make VERSION=${VERSION} phpunit_release
- chmod a+r qfq_${VERSION}_*.zip
- scp qfq_${VERSION}_*.zip w16:qfq/releases/
- mv qfq_${VERSION}_*.zip build/qfq.zip
selenium:
stage: selenium
script: script:
- make VERSION=$VERSION release - unzip -q build/qfq.zip -d qfq
- chmod a+r qfq_$VERSION_*.zip - cd docker/
- scp qfq_$VERSION_*.zip w16:qfq/releases/ - ./run_qfq_docker.sh -no-deploy
- ./deploy_to_container.sh ../qfq
- ./run_selenium_tests_docker.sh
- echo "hello"
after_script:
# remove containers and move logs to persistent location
- cd docker; ./remove-containers.sh <<< "y"
- cd ..
- umask 002
- mkdir "$SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA"
- 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
==========================================
General
-------
* graphical annotation of PNG, SVG,....
* For the first version, no fullscreen
Concept
-------
* 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::
````
<html>
...
<div class="annotate-graphic" data-images='{"images": [{"page": 1, "selector": "qfq-fabric-image-1", "refId": "image.id"}, {"page":2, "selector": "#qfq..."}]}'>
...
</html>
````
* 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
==================================
General
-------
* Highlighting Code Syntax
* Write comments to code lines
Concept
-------
* 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 ...@@ -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 * 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. 'pageId', 'feUser*', 'beUser*', 'ttContentUid', ... is not available.
* *Form load*: an additional hidden Formelement '_sipForTypo3Vars' will be created with a subset of the current * *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. 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(); AbstractBuildForm.php: process() > prepareT3VarsForSave() > Store.php: copyT3VarsToSip();
* *Form save*: FillStoreForm.php: process() > Store: fillTypo3StoreFromSip() * *Form save*: FillStoreForm.php: process() > Store: fillTypo3StoreFromSip()
...@@ -280,8 +280,8 @@ FORM_LOG_EXPIRE (typically 1800 seconds). ...@@ -280,8 +280,8 @@ FORM_LOG_EXPIRE (typically 1800 seconds).
* Correspondig expired logfiles will be deleted. * Correspondig expired logfiles will be deleted.
* Active logfiles will be filled. * Active logfiles will be filled.
Errormessages & Exceptions Error Messages & Exceptions
========================== ===========================
* Exception types: * Exception types:
* Code * Code
......
Neuer Build Neuer Build
=========== ===========
* release: Wird ein *Tag* vergeben (egal welcher Branch) der mit 'v' beginnt, erzeugt das automatisch einen Build - https://w3.math.uzh.ch/qfq/release. * release: Wird ein *Tag* vergeben (egal welcher Branch) der mit 'v' beginnt, erzeugt das automatisch einen Build - https://w3.math.uzh.ch/qfq/release.
* snapshot: Jeder Commit (egal welcher Branch) erzeugt einen Snapshot - https://w3.math.uzh.ch/qfq/snapshot. * snapshot: Jeder Commit (egal welcher Branch) erzeugt einen Snapshot - https://w3.math.uzh.ch/qfq/snapshot.
* nightly: Nach einem Commit auf Branch 'master' tagsueber, wird um 23:55 ein 'nightly' Build erstellt - https://w3.math.uzh.ch/qfq/nightly. * nightly: Nach einem Commit auf Branch 'master' tagsueber, wird um 23:55 ein 'nightly' Build erstellt - https://w3.math.uzh.ch/qfq/nightly.
...@@ -8,6 +9,8 @@ Neuer Build ...@@ -8,6 +9,8 @@ Neuer Build
Neue Versionsnummer Neue Versionsnummer
=================== ===================
0) Fuer jede neue Version ein Ticket erstellen. Template: #6994
1) **Laufen** die Unit Tests durch? 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): 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 ...@@ -25,38 +28,60 @@ Neue Versionsnummer
* Den Inhalt von Release.rst kopieren nach qfq/extension/RELEASE.txt. * Den Inhalt von Release.rst kopieren nach qfq/extension/RELEASE.txt.
* Den Inhalt von Release.rst kopieren nach CHANGELOG.md. * Den Inhalt von Release.rst kopieren nach CHANGELOG.md.
* Tickets
* Alle offenen Tickets im aktuellen Milestones verschieben auf den naechsten Milestone.
* Abgeschlossene Tickets schliessen.
3) In folgenden Files anpassen: 3) In folgenden Files anpassen:
**Achtung**: die Release Minor darf KEINE fuehrenden Nullen enthalten!!! Ansonsten funktioniert die Verteilung vie TER nicht.
**Auto**: ./setVersion.sh <MAJOR>.<MINOR>.<MICRO> **Auto**: ./setVersion.sh <MAJOR>.<MINOR>.<MICRO>
Manuell: Manuell:
* extension/Documentation/_make/conf.py: release, version * extension/Documentation/_make/conf.py: release, version-
* extension/Documentation/Settings.cfg: version * Documentation/Settings.cfg: version
* extension/ext_emconf.php: 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** 5) **Update Version & Commit**
* Update the version number in this document (topic 6) * Update the version number in this document (topic 6)
* Commit & Push new version changes to master branch: * Commit & Push new version changes to master branch:
New version x.y.z. New version 19.10.0
6) **New Tag**: 6) **New Tag**:
git tag v18.6.1 git tag v19.10.0
git push -u origin v18.6.1 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 git.math.uzh.ch WebHook passieren.
9) Extension hochladen
TER: https://extensions.typo3.org/ > Log in > My Extensions.
10) PhpStorm: **Sync** all files to VM qfq.
7) PhpStorm: **Sync** all files to VM qfq.
Update Doku auf docs.typo3.org Update Doku auf docs.typo3.org
============================== ==============================
https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/ https://docs.typo3.org/p/IMATHUZH/qfq/master/en-us/
1) Copy 'qfq' doc to github project 'qfq-doc'. Commit changes. Push changes to github:: 1) Copy 'qfq' doc to github project 'qfq-doc'. Commit changes. Push changes to github::
...@@ -67,4 +92,4 @@ Upload new version to TER ...@@ -67,4 +92,4 @@ Upload new version to TER
* https://extensions.typo3.org/ > Log in > My Extensions. * https://extensions.typo3.org/ > Log in > My Extensions.
* Rename the ZIP file to be TER compatible: e.g. qfq_18.6.0.zip. * Rename the ZIP file to be TER compatible: e.g. qfq_18.6.0.zip.
* Upload - that's all. * Upload - that's all.
\ No newline at end of file
...@@ -387,7 +387,7 @@ URL Parameters ...@@ -387,7 +387,7 @@ URL Parameters
Server Response Server Response
: header("Content-type: $mimetype"); : header("Content-type: $mimetype");
header("Content-Length: $length"); header("Content-Length: $length");
header("Content-Disposition: inline; filename=\"$outputFilename\""); header("Content-Disposition: inline; filename='$outputFilename'");
header("Pragma: no-cache"); header("Pragma: no-cache");
header("Expires: 0"); header("Expires: 0");
file_get_contents($file); file_get_contents($file);
...@@ -506,10 +506,10 @@ Server Response ...@@ -506,10 +506,10 @@ Server Response
Asynchronous request (read AJAX) initiated by the Client receive a Asynchronous request (read AJAX) initiated by the Client receive a
JSON Response from the server (extended [Minimal Response]) containing: JSON Response from the server (extended [Minimal Response]) containing:
{ : {
"status": "success"|"error"|"conflict"|"conflict_allow_force", : "status": "success"|"error"|"conflict"|"conflict_allow_force",
"message": "<message>"e5 : "message": "<message>"e5
} : }
`status` indicates how the request has been fulfilled by the server. `status` indicates how the request has been fulfilled by the server.
On`"success"`, the Client display nothing to the user. On`"success"`, the Client display nothing to the user.
...@@ -563,3 +563,30 @@ Current Page ...@@ -563,3 +563,30 @@ Current Page
Redirect Redirect
: Issued by the Server. It is a command prompting the Client to : Issued by the Server. It is a command prompting the Client to
navigate away from the Current Page. 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
: POST
URL Parameters
: `s=<SIP>` - to prove permission.
Server Response
: The response contains at least a [Minimal Response].
====
REST
====
* https://en.wikipedia.org/wiki/Representational_state_transfer
* https://restfulapi.net
* https://poe-php.de/tutorial/rest-einfuehrung-in-die-api-erstellung
* https://blog.restcase.com/top-5-rest-api-security-guidelines/
General Concept
===============
* There is one PHP file to handle all REST calls:
typo3conf/ext/qfq/Classes/Api/rest.php
* All further endpoints are appended after rest.php, seperated by '/'. Example:
http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson/1/restAddress/123?myEmail=jonni@miller.com
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
------------
Example:
curl -X GET "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson"
Details:
* 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
-------------
Example:
curl -X POST "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson" -d '{"name":"Miller","firstname":"Jonni"}'
Details:
* 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
------------
Example:
curl -X PUT "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson/1" -d '{"name":"Miller","firstname":"Jonni"}'
Details:
* 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`.
Delete
------
Example:
curl -X DELETE "http://localhost/qfq/typo3conf/ext/qfq/Classes/Api/rest.php/restPerson/1"
Details:
* 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
==========================
Example:
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}}' }}
DEBUG
=====
Append the GET variable `?XDEBUG_SESSION_START=1`
Example:
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: https://docs.typo3.org/p/IMATHUZH/qfq/master/en-us/Index.html
* Build local documentation: ``make doc-local``
* https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingDocForExtension
* Example Code Documentation: https://github.com/TYPO3-Documentation/TYPO3CMS-Example-ExtensionManual.git
* Pushing a tag on the project triggers a rebuild.
Manual trigger of documentation rebuild
---------------------------------------
* https://git.math.uzh.ch > QFQ > Settings > Integrations > Webhook: https://docs-hook.typo3.org: Test
Log errors
----------
* https://intercept.typo3.com/admin/docs/deployments >> Recent Actions
* https://git.math.uzh.ch > QFQ > Settings > Integrations > Webhook: https://docs-hook.typo3.org > Edit: Recent Deliveries