| Jive | SAP | iGoogle | |
|---|---|---|---|
| osapi.people.get() | X | ||
| groups | X | ||
| canvas view | X | X | |
| osapi.activities | X | X | X |
var MyBaseGadget = function(params){
this.platform = params.platform;
if(params.platform == 'jive'){
this.jive = new JiveFeatures();
}
else if(params.platform == 'google'){
this.google = new GoogleFeatures();
}
};
MyBaseGadget.prototype.getPeople = function(){
if(this.platform == 'jive'){
this.jive.getPeople();
}
else if(this.platform == 'google'){
this.google.getPeople();
}
};
...
var GoogleFeatures = function(params){
//if we need to reference the base class
this.basegadget = BASE_WIDGET_INSTANCE;
};
GoogleFeatures.prototype.getPeople = function(){
//get people using v0.8
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), 'viewer');
var viewerFriends = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" : "FRIENDS" });
req.add(req.newFetchPeopleRequest(viewerFriends, params), 'viewerFriends');
req.send();
};
...

