Hey Robert, As the guy who said that, I guess I'm the right person to clarify :)
The quickest way to check out how the meta data interface works is by loading up the sample-metadata.html sample, and inspecting the requests using something like firebug, here's a live example: http://modules.partuza.nl/gadgets/files/container/sample-metadata.html So that's one part done, how to gather the meta data of a gadget (title, prefs, thumbnail, etc etc), and using that you can generate the iframe's that contain the gadgets, however to get to a working situation you need implement 2 more things: 1) Security Tokens.. The gadget get's it owner id / viewer id / app id / container string / module id from the security token, in a typical production setup this would be an encrypted blob generated by the container (ie 'the social website'), and put on the gadget's iframe with a &st=<encrypted blob>. Encryption ensures that that data can't be tampered with so that people can't spoof their user id's etc. Now both java and php shindig both use the same methodigy to generate their tokens (see shindig/php/src/common/{BasicBlobCrypter,BasicSecurityToken,BasicSecurityTokenDecoder}.php for example), so you really have two options, either implement the same crypto logic / format (it's basically a test string, with entries seperated by :'s, and aes128 encryption with a shared secret) in Ruby, or create your own crypto and implement a PHP class that can decrypt it (and tell shindig to use that new class using the 'security_token_signer' and 'security_token' configuration keys, similar configuration can be found in java shindig in one of it's .xml config files). The first option is probably the simplest solution, I'm not terribly familiar with Ruby but I assume that aes128 is available in it either natively or through a library, 2) The social data bindings. Now java and php differ slightly here, with php you use the same configuration as I mentioned above to tell shindig which classes to use, and with java you'd use Guice to inject the right classes, but the basics are the same: You'll need to somehow get the social data requests that happen in shindig to your data back-end. Now when you are running php or java already this is pretty simple since you can use that code directly, however in this situation you really have two choices, either you implement the DB logic in PHP or Java (for PHP, you can use Partuza's (an example opensocial implementation) service implementation as example: http://code.google.com/p/partuza/source/browse/trunk/Shindig/PartuzaService.phpand http://code.google.com/p/partuza/source/browse/trunk/Shindig/PartuzaDbFetcher.php), or you can implement an RPC method (using something like json-rpc) where shindig relays all social data calls to your back-end. Alternatively (as nov matake just posted) you can also just include your Ruby code in java directly, I personally don't have any experience with that but it sounds like a perfectly reasonable solution :) OpenSocial and thus Shindig has 4 data call types, People, Activities, AppData and Messages; Now the spec states that the only must-have of those is the People interface, and you could return a NOT_IMPLEMENTED error code on every other call type.. however if you want to run the typical OpenSocial app, it's advisable to also support the Activities and AppData interfaces.. Messages is a nice to have, but in practice most social sites don't support this so it's not a big issue at all if you don't. Hope that helps! -- Chris On Wed, Jun 24, 2009 at 10:50 AM, rgravina <[email protected]> wrote: > > In an google i/o 08 talk chis chabot mentions that you can integrate > Shindig into your own site using the "metadata server": > > http://sites.google.com/site/io/apache-shindig-make-your-social-site-an-opensocial-container > > > He says you can POST the gadget, user etc. details to Shindig and it > will return a rendered iframe and you can use to use Shindig within > your own site and that this can be used for people wanting to develop > in Python etc. (in my case, Ruby). > > I can't find any more information about this anywhere... basically, > how would I run a opensocial application in my rails site? Is there > any way of say implementing something in PHP or Java which would call > the rails site for user etc. information via REST? Or do I just need > to setup the database details in Shindig (the same DB my rails app > connects to and stores user information) and write simple classes > which return the information in PHP/Java and can just include these > gadgets in my application as iframes? > > Robert > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Implementing OpenSocial Containers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/opensocial-container?hl=en -~----------~----~----~----~------~----~------~--~---
