hello robert and everyone
I'm just working on shindig with rails site.
Though I don't know about metadata server, but you can call rails
itself from java.
Java Scripting (only Java 6) can call any script language inside java
code.
This is a sample code
RailsEngine.java
==
import javax.script.*;
public class RailsEngine {
public static void main(String[] args) throws ScriptException,
Exception {
ScriptEngine engine = new
ScriptEngineManager().getEngineByName("jruby");
System.setProperty("jruby.home", "/usr/local/jruby");
engine.eval("require 'RAILS_ROOT/jruby_init.rb'");
Invocable inv = (Invocable) engine;
Object user =
engine.eval("User.find_by_username('matake').following");
if (user != null) {
Object userJson = inv.invokeMethod(user, "to_json");
System.out.println(userJson);
} else {
System.out.println("User not found");
}
}
==
jruby_init.rb
==
$LOAD_PATH.unshift(
ENV['JRUBY_HOME'] + '/lib/ruby/site_ruby/1.8',
ENV['JRUBY_HOME'] + '/lib/ruby/site_ruby',
ENV['JRUBY_HOME'] + '/lib/ruby/1.8',
ENV['JRUBY_HOME'] + '/lib/ruby/1.8/java',
'lib/ruby/1.8/java'
).uniq!
require File.dirname(__FILE__) + '/config/environment.rb'
==
nov matake
smart.fm developer
http://smart.fm
On 2009/06/24, at 17:50, rgravina 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
-~----------~----~----~----~------~----~------~--~---