Anwiki CMS

Anwiki CMS : the first wiki/CMS dedicated to multilingual contents
| Tasklist |

FS#48 - Ajax for autosync transaction & save

Attached to Project: Anwiki CMS
Opened by anw (anw) - Monday, 25 January 2010, 22:46 GMT
Task Type Improvement
Category Drivers → Storage drivers
Status New
Assigned To No-one
Operating System All
Severity High
Priority Normal
Reported Version Anwiki 0.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Currently, when a content is edited in one language and has to be saved:
- a mysql transaction is opened
- each translation is processed by autosync engine, in the same php thread
- each updated translations are checked for similar structure, to make sure they are in sync and to avoid potential autosync bugs
- each translation is saved
- mysql transaction is commited

This operation may be very long for large contents, and processing time is increasing with the number of translations. This is also memory consuming, and PHP process may be killed on some restrictive hosts it it exceeds memory_limit or max_execution_time.

To avoid this, I'm thinking to dispatch
execute autosync application & save with Ajax saving:
- when pressing on the "save" button, an Ajax controller is instancied and a progress bar is displayed
- an ajax calls autosync engine for each translation, in parallels php threads
- each thread applies autosync to one translation, checks the result, then save it on a temporary table
- when Ajax controller detects gets all responses, it starts a last thread for "commiting" these changes (updating the real table from the temporary one)
- save process is finished, progress bar is now 100% and edition lock is released.
- temporary table is regularly cleaned
- this temporary table could also be used to preview expected autosync results on all translations
This task depends upon

Comment by anw (anw) - Monday, 25 January 2010, 23:10 GMT
This has also to be compatible with "batch processing", such as the screen for importing and synchronizing all translation files at once.