Generating files from client-only web apps
At bemasc’s brilliant suggestion, I looked to data: URIs for generating files from web pages. I tried it in Firefox and it worked nicely. I even found some examples of very cool usage of data URIs on the web.
But when I tried it in Browse, I hit this bug: #1029. If you look at the dates, I opened that ticket 3 weeks ago. It really took that long to finally find a(n almost) proper solution for it. Of course I did other things as well in the meantime, but you get the point. There’s still the issue of title for the created file, right now it’s the actual data in the URI, which is not very pretty at all.
With that patch, you can save data URIs as Journal objects from Browse and open them in other activities as desired. Here’s a demo. I have yet to create the reverse, opening Journal items in web apps, but it should be possible with either Gears’s openFile or twFile. I consider this outside the scope of GSoC, though.
Oh, and about Gears, I have a workaround, but I probably need to fix my jhbuild.
There is one aspect I haven’t explored during my work: collaboration. bemasc has suggested that web apps already do collaboration quite well (Google Docs, Bespin, Wave), but I am concerned with the case of client-only activities, particularly Karma activities. One possibility is starting local servers in each Browse and using XMLHttpRequest to send data between them. The other choice is adding an API for this in window.sugar and using the existing Sugar collaboration Python API as a backend.