Tag Archive > api

dojo.store, dijits and the FB Graph API (part 1)

» 27 February 2011 » In development » 1 Comment

I’ve spent a few hours this evening checking out the new dojo object store implementation, looking to see if I could hook it up to the Graph API.

Getting id/identity and basic query data back from the Graph API took all of five minutes – using dojo.io.script to automate handling the callbacks from the Graph APIs JSONP responses. The new store is much simpler to implement than the old dojo.data interfaces. Big win there.

I’ve not managed to get full querying working just yet, as the Graph API is pretty big and the range of connections available for each of the different types in the Graph API isn’t documented particularly clearly.

I’ve also run into some snags wrapping my object store in a dojo.data store. I’ve successfully got a ComboBox populated from my friend list if I take the output from my object store, use that as the constructor for a dojo.store.Memory store and then pass that into the constructor of the dojo.data.ObjectStore, but it’s a bit messy. I’m sure there’s something I’ve just missed out as this definitely shouldn’t be necessary.

Still, not a bad effort so far. Hopefully I’ll have a full object store and data store implementation ready to roll soon, meaning you’ll be able to populate all your favourite dijits with data from your favourite social network :)

I’ll get an example online soon and put the code up on github with create a patch for dojo trunk once I’m happy with the results. Things are a bit hectic at the moment tho so it might take a few weeks…

Continue reading...

Tags: , , , , , ,