Project

General

Profile

Report As File » History » Revision 2

Revision 1 (Marc Egger, 22.07.2020 12:55) → Revision 2/3 (Marc Egger, 22.07.2020 12:59)

h1. 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. 

 Problem: QFQ applications depend on more than the tt-content records: 

 * position of tt-content record on page (center/column) 
 * order of tt-content records on page 
 * page alias of page on which tt-content record is 
 * page alias of all other pages 

 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. 

 *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*<notextile></notextile>: 

 * 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