Project

General

Profile

Actions

Report As File » History » Revision 1

Revision 1/3 | Next »
Marc Egger, 22.07.2020 12:55


Report As File

Path structure

The directory structure mirrors exactly the typo3 page structure.

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.

Problem: The page name might not be unique thus multiple directories with the same name must exist.

File and tt-content table synchronization:

Assume we can recognize wheter the file or the report was changed since the last synchronization between the two.

File exists tt-content exists last synch data exists File Changed tt-content Changed QFQ reaction when Report is rendered
X X X     render Report from tt-content record
X X X X   Update tt-content record and render report
X X X   X Write tt-content to file and render report
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.
X X   - -  
X     - -  
  X   - -  
      - - never happens

Chalenges:

  • recognize changes since last synchronization efficiently
    • Obvious solution: create table "Sync" and use it to track the last synchronization
      • columns:
        • id
        • recordId
        • recordFingerprint
        • pathFileName
        • fileFingerprint
        • modified
        • created
  • overwrite tt-content without braking the typo3 tt-content history mechanism. 
    • look at how tt-content is edited by the QFQ admin interface in the frontend and copy aproach.
  • scenarios not covered yet:
    • file exists, but not tt-content
    • tt-content exists, but not file
    • both exists but where never synchronized
  • Typo3 does not enforce page pathes to be unique
    • Possible solution: QFQ enforces uniqueness by throwing exception if not satisfied

Updated by Marc Egger almost 4 years ago · 1 revisions