Calling a mashup directly from iGoogle Widget
Hi Nimish,
You can certainly use the PrestoConnect API for Javascript to invoke Mashups from an iGoogle Gadget. Invoking a mashup using the PC4JS (PrestoConnect for Javascript) is as easy as:
var connection = new Presto.Connection({prestoUrl: http://server:port/presto, username: 'foo', password: 'bar'};OR
var connection = new Presto.Connection({prestoUrl: http://server:port/presto, authToken: 'authToken'};
connection.request({sid: 'serviceid', oid: 'operationId', params: []}, {
onSuccess: function(response) {
// handle success here
},
onFailure: function(error) {
// handle failures here
},
scope: this
});Another option is to call a jsp containing the mashlet from your gadget. This would be something like:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Your Widget" scrolling="true" height="460" >
<Require feature="opensocial-0.7" />
<Require feature="dynamic-height"/>
</ModulePrefs>
<Content type="url" href="http://yourhost/yourPath/Your.jsp"/>
</Module>
The jsp would include the mashlet with the Tag inclusion like
<html>
<head>
</head>
<body>
<div name="main">
<script src="http://yourhost/mashlets?mashlet=PrestoWidgets.AccountDetail"></script>
</div>
</body>
Hope it helps






Hi,
Is there a way by which I can call a mashup directly through a IGoogle Widget? I know I can publish a mashup, create a mashlet and include mashlet within an HTML page but is it possible to directly call the mashup and define my own container (iGoogle widget in my case) to display the output.
Thanks.
Nimish