Backup AJAX integration done
Having got the actual mechanisms of the backup system working (generating files and saving them onto the server), I started integrating the AJAX scripting so that backup calls don't actually leave the page. Getting it working with Firefox was easy -- I initially had a pipeline that returned a single XHTML anchor tag, of which the text was the new modified date of the file -- but the predictable problems surfaced with IE, so I had to rethink. In the end, I have this:
- The "Generate backup" button makes a call to the appropriate flowscript function for the type of backup being made.
- The flowscript creates the backup, then reads its last modified date.
- The flowscript hands off (through a
cocoon.redirectTocall) to an XQuery script, passing the last modified date. - The XQuery script generates a single XML node, which is actually another anchor tag.
- The output from the XQuery is processed into text by an XSLT script.
- The text is received by the AJAX object, which uses it to replace the text in the existing anchor.
While the page is waiting, the target anchor tag has its text replaced with a series of dots, which shows a simple progress system. The effect is that the date/time shown on the link is updated on the page, every time a new backup is generated.
This is tested and working on FF, IE, Safari and Opera. The next stage is to create a sequence wrapper which can call the script many times, causing the items to update one at a time, while showing per-item progress somewhere at the top of the page. That shouldn't be too hard now.