Open social application development made a giant leap.An eclipse plugin that eases the development of opensocial apps.I have written about open social applications before and I had a chance to work on it.Apache shindig is the initiative to develop a SNS container for application development and testing.I would say
OSDE plugin developed by
Yoichiro Tanaka rocks!! It uses apache shindig and hibernate for a dynamic development, so the developer can create a single application for different data models.As apache shindig provides java REST support, the application development will become more extensible.The database packaged with the plugin is
H2(a Java SQL database).Before this plugin came, we had to develop and run the applications iniside a sandbox which was really tiring.This plugin has features of wizard like development for both javascript widgets and Java REST client applications.We can have our own custom social data which can be easily persisted due to the excellent plugin architecture.So I tried to develop a simple application ...
After the plugin is installed create a new OSDE project
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMzr8s2TlPV3As_ih4Ktc29ksRxoKqc2YzUTvIAYcNnzb5uNXpGnKQRrcjVMRqbOP29qttnGpLRkosSZ0HlCpf-wAJPwdO4y5eWSRn3L_Iw-fZcnn4DeWpsEVm37gBRe9N3V2y-Y8ffHE/s400/osde_1.JPG)
Specify the gadget.xml and the API specs etc
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg3F6dOYjDarae_emjY7372VPq63qsv2H6S3j9TQYErPPho7kkElEFIBovgF7ru8BLehV019iuKXmtphzVKKeMATUxr3oIITW4-xxoRRJLKQNmNxH0NHvq-Xkn1j5KOvLnGlCmDuxH-Ts/s400/osde_2.JPG)
For the development we need to run the apache shindig in the background.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAGJybnxDEkwU4XXDYKc_tH78tSZBmWRW9TmbzKdyewuRuVzWP_x7St_Yv4efwcfIgw8I1U7IgWF-Rp26P8IvISXhZNYY9BnnJYIWPUVkpz1tWst4PZPaR0vZAqjhRkkjyZkS8GB_-oiM/s400/osde_4.JPG)
To have a custom social data create people and add relationships between them.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcRTcInCWs3c6cSgq9sPnL2v7JgtC06IGN9xVJedugHAeJwm0-cMCy81Q1-d3SiIjzF0FNGYfRB-g9SwEtslmb4xF1dudbEbTB9xmywo9W7Kk4SqkvxXfhUNCBjdzhnE12XIIDt0dTCnk/s400/osde_6.JPG)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPs3HmCQ8Db3Hj3jJn_yESqG5v5nXVUT0nHBvXF3DlqRpiBup48gWo6WfQpo7QHh2gBY5v2UMtMONl0gAVW0FhAjHriaW6lkb2T-2hQgYwa13YpYllRjnV1f9VQhNUXvma6A0FpzX3PKo/s400/osde_5.JPG)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx5HRuWixkKlKSC58jxL4-usGFy8z8Jun6mszMmn1cj2yteN9yEELDv4HoVzxyaM6mrxB1GvNHoOKGBfssR3mMSZwbds0rOSdvj42_rEFxjQhOec6NlY9NKvivgjkzUGm-FEBojlH0QBU/s400/osde_7.JPG)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie_hY33_zamkRRqT3i-EN4mcg37TdmakpXP9sTzNQo0A2FtID4SkZpL0OcRHvtvbGrJFUILpwklhInAneBmb9FdHnBlYcjsVMIBLyM7Fcjr0dfZZDrFfFGco7hfLwe7WEpLGbSzVZY6fw/s400/osde_9.JPG)
Write a simple gadget ... (templates can be generated by the plugin if needed)
----src-------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><module><moduleprefs author_email="harisa@pramati.com" description="A friendly os app" title="Friends"><require feature="opensocial-0.8"><require feature="dynamic-height"></moduleprefs><content view="canvas" type="html">
<!-- Fetching People and Friends -->
<div>
<button onclick='fetchPeople();'>Fetch</button>
<div style="margin-left:20px;">
I am ... <span id='viewer' style="background-"></span><br/>My friends are ...
<ul id='friends' style="margin-top:5px;list-style:none;margin-left:75px;"></ul>
</div>
</div>
<script type='text/javascript'>
function fetchPeople() {
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), 'viewer');
var params = {};
params[opensocial.IdSpec.Field.USER_ID] = opensocial.IdSpec.PersonId.VIEWER;
params[opensocial.IdSpec.Field.GROUP_ID] = 'FRIENDS';
var idSpec = opensocial.newIdSpec(params);
req.add(req.newFetchPeopleRequest(idSpec), 'friends');
req.send(function(data) {
var viewer = data.get('viewer').getData();
document.getElementById('viewer').innerHTML = viewer.getId();
var friends = data.get('friends').getData();
document.getElementById('friends').innerHTML = '';
friends.each(function(friend) {
document.getElementById('friends').innerHTML += '<li>»' + friend.getId() + '</li>';
});
gadgets.window.adjustHeight();
});
}
</script>
----src ends---------
Run the application
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTlzlAb41S-8ZSLI4ox0CBIvkABLxBGW6AZqr4xClqpHCZzaDwUjuWE40MwAd0rqc4liZWqFnAymLdXL3wdgNLttDr1pkRbPtosx1WX_DgzE3JecWZ9EGaM04j8yaEFfk0jJ3wYZbAUIM/s400/osde_8.JPG)
Gadget --->
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKIUvklIYbSV1OcEjhH2jOxlIVZs-YhVUHgJJpi2nRc4LJ4YUTPO7OBQ-vuQGJ98hr25ZX5dxF-bWjCCefaVyiFePT3TPW2_-rvcNt1-cswzPuZt8j1cQxzSwQRe2MZXuGMMfbF1b7_f8/s400/osde_10.JPG)
Cool... Its simple. But this plugin will be really useful when we develop the complex applications and aiming for multiple containers supporting open social api.
More ....
opensocial-development-environmentscreencastsyoutube