Project

General

Profile

Report As File » History » Version 2

Marc Egger, 22.07.2020 12:59

1 1 Marc Egger
h1. Report As File
2
3
*Path structure*
4
5
The directory structure mirrors exactly the typo3 page structure.
6
7
Each QFQ tt-content record corresponds to exactly one file located in the directory which is named after the page in which the tt-content record lies.
8
9
Problem: The page name might not be unique thus multiple directories with the same name must exist.
10
11 2 Marc Egger
Problem: QFQ applications depend on more than the tt-content records:
12
13
* position of tt-content record on page (center/column)
14
* order of tt-content records on page
15
* page alias of page on which tt-content record is
16
* page alias of all other pages
17
18
Problem: If someone used the page id or the uid of a tt-content record inside a QFQ report as a link, then this will break.
19
20 1 Marc Egger
*File and tt-content table synchronization:*
21
22
Assume we can recognize wheter the file or the report was changed since the last synchronization between the two.
23
24
| File exists | tt-content exists | last synch data exists | File Changed | tt-content Changed | QFQ reaction when Report is rendered |
25
| X | X | X |   |   | render Report from tt-content record |
26
| X | X | X | X |   | Update tt-content record and render report |
27
| X | X | X |   | X | Write tt-content to file and render report |
28
| X | X | X | X | X | Show an error message to developer with two sip protected links: "overwrite file" and "overwrite database"If one is clicked, the page is reloaded with a respective flag which indicates to QFQ what it should overwrite. |
29
| X | X |   | - | - |   |
30
| X |   |   | - | - |   |
31
|   | X |   | - | - |   |
32
|   |   |   | - | - | never happens |
33
34
*Chalenges*<notextile></notextile>:
35
36
* recognize changes since last synchronization efficiently
37
** Obvious solution: create table "Sync" and use it to track the last synchronization
38
*** columns:
39
**** id
40
**** recordId
41
**** recordFingerprint
42
**** pathFileName
43
**** fileFingerprint
44
**** modified
45
**** created
46
* overwrite tt-content without braking the typo3 tt-content history mechanism. 
47
** look at how tt-content is edited by the QFQ admin interface in the frontend and copy aproach.
48
* scenarios not covered yet:
49
** file exists, but not tt-content
50
** tt-content exists, but not file
51
** both exists but where never synchronized
52
* Typo3 does not enforce page pathes to be unique
53
** Possible solution: QFQ enforces uniqueness by throwing exception if not satisfied