[Developers] Using the Freebase.com client as an IFRAME your own web app

brendan brendan at metaweb.com
Wed Mar 26 17:36:34 UTC 2008


agreed, except this part:

> Since the mwLastWriteTime cookie isn't set, re-running the MQL query
> won't give the latest data.

- user brings up the modal dialog for a topic and edits something
- freebase.com last write cookie set (though they will be asked to  
login, inline, if not already logged in)
- user closes the dialog and refreshes the mjt/js app browser window
- ajaxy mqlread is issued, freebase.com last write cookie is used and  
observed, cache is invalidated

right? archiportal doesn't proxy anything, if the user is signed in,  
the browser freebase.com cookies are used and subsequent mqlreads use  
the same cookies.

that said, Zak and I tried having the archiportal screen refresh  
automatically whenever a user returns from using the modal iframe.  It  
sucked because, as you've pointed out, even if the user doesn't do a  
write, now you have to wait around for all the freebase and google api  
calls to be made which takes several seconds.

I'd like to see a solution for this too because I think this kind of  
pattern is pretty sound, dare I say "lazy in a good way?".  Writes are  
more difficult to implement and aren't done that often by the user, so  
it allows someone to build a mashup spending their time coding the  
part that is used the most. Also, on the read/write side, as the  
architecture schema is extended, the freebase.com client automatically  
keeps up.

Brendan

On Mar 26, 2008, at 10:07 AM, Will Moffat wrote:

> Hello,
>
> I've seen a few Javascript developers (including myself) go through
> this process:
>
> * write a cool Javascript Freebase app (like Zak's http://dev.mqlx.com/~zak/arch/)
> * decide to give users the ability to edit data
> * decide you can't be bothered to re-implement the features of the
> Freebase.com client (and learn mqlwrite + setup an api proxy)
> * Take the path of least resistance and use a modal dialog IFRAME to
> display the topic in Freebase
>
> This Freebase-in-IFRAME approach has two problems:
>
> * How do we know if the user changed data?
> (We want to avoid rebuilding the state of a complex AJAX app if
> possible)
> The mwLastWriteTime cookie may have been updated, but it's
> inaccessible since the app isn't on freebase.com
>
> * How do we get this changed data?
> Since the mwLastWriteTime cookie isn't set, re-running the MQL query
> won't give the latest data.
> You need to resort to cache-busting techniques like incrementing  
> limit'
>
> Any ideas about how to solve these problems?
> cheers,
> --Will
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers



More information about the Developers mailing list