Honey Web

about all things sweet and web-ish

Generating files from client-only web apps

leave a comment »

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.

I’ve also been thinking about offering features that aren’t inherent in JavaScript as a global object window.sugar. Things like notifications (alerts, timed alerts, etc.), closing the activity and other things that aren’t otherwise possible using just web technologies. I may also be convinced to add a more direct Journal interaction API, but I’m inclined to say no right now. window.sugar should be the point where Karma activities ‘do more interesting stuff in Sugar’.

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.

Advertisements

Written by Lucian

July 29, 2009 at 11:54 pm

Posted in sugar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: