Project

General

Profile

Report As File » History » Version 1

Marc Egger, 22.07.2020 12:55

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
*File and tt-content table synchronization:*
12
13
Assume we can recognize wheter the file or the report was changed since the last synchronization between the two.
14
15
| File exists | tt-content exists | last synch data exists | File Changed | tt-content Changed | QFQ reaction when Report is rendered |
16
| X | X | X |   |   | render Report from tt-content record |
17
| X | X | X | X |   | Update tt-content record and render report |
18
| X | X | X |   | X | Write tt-content to file and render report |
19
| 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. |
20
| X | X |   | - | - |   |
21
| X |   |   | - | - |   |
22
|   | X |   | - | - |   |
23
|   |   |   | - | - | never happens |
24
25
*Chalenges*<notextile></notextile>:
26
27
* recognize changes since last synchronization efficiently
28
** Obvious solution: create table "Sync" and use it to track the last synchronization
29
*** columns:
30
**** id
31
**** recordId
32
**** recordFingerprint
33
**** pathFileName
34
**** fileFingerprint
35
**** modified
36
**** created
37
* overwrite tt-content without braking the typo3 tt-content history mechanism. 
38
** look at how tt-content is edited by the QFQ admin interface in the frontend and copy aproach.
39
* scenarios not covered yet:
40
** file exists, but not tt-content
41
** tt-content exists, but not file
42
** both exists but where never synchronized
43
* Typo3 does not enforce page pathes to be unique
44
** Possible solution: QFQ enforces uniqueness by throwing exception if not satisfied