Back to my page

Developer Blog



Ginger’s new functionalities for UWA developers (part 1)

With the arrival of Netvibes Ginger, users can now have two sides for their Netvibes account: one private (the classic page), where users put their favorite and most useful widgets like e-mails, feeds, social networks, all to be seen by them only ; and one public (the Netvibes Universe), where the users will tend to put widgets that present his/her online identity instead of giving access to private data.

These are two sides of a great coin, but obviously not all widgets can work for both sides: while games and feeds are just fine, some other widgets are so-so, like those fetching private data from Flickr, and others are a big no-no, like putting your gmail account on your Universe by mistake.

The read/write thingamagob

We call this conundrum the “read/write” paradigm* : basically, your private page should have widget that are able to display your private and let you send new data to your various accounts, whereas a public page (the Universe) should only allow widgets that are able to “read” data for which it has been set, NOT let visitors of your Universe send their data to your accounts.

In short, the ideal would be to have two sides to widget too: one allowing the widget viewer to read/write, one where only read is available. Let’s take the Twitter widget: if placed on your private page, it should display your twits and those from your followers, along with a form to let you send new twitts to the service ; if placed on your universe, it should only display your twitts and those from your followers.

Ok, you get it by now, so I’ll just answer the question that is clinging on your lips, “How can I know if my widget is used on private page or a Universe?”

Not “42″

The answer, in the eternal words of Obi-Wan Kenobi, is: use the widget.readOnly, Luke.

Ginger adds a handful of new functionalities to UWA, among which the widget.readOnly property, which is set by Netvibes to true or false, depending on where the widget is placed: true for a Universe, false for a private page.

From there, you can guess to code to use in order to your widget to take its placement into account:

if (!widget.readOnly) {
  // private-only code
} else {
  // in-Universe code
}

You can even go a bit further if your widget uses Netvibes-specific methods - which we’ll overview in a coming post:

if (!widget.readOnly && !widget.environment.netvibes) {
  widget.setBody('This widget can only work in Netvibes!');
  return false;
}

Now you are able to know when your widget is on a Universe or on a public page, and you can act accordingly. So if your widget is built to handle private data, start adapting it now!

* : well, we don’t really use it among us, but I wanted to use such words ;)

Tags: , , , ,

2 Responses to “Ginger’s new functionalities for UWA developers (part 1)”

  1. ahmbay Says:

    i thing that widget not a popular and functionalty application

  2. Xavier Says:

    @ahmbay: well that’s too bad, many widgets from Ecosystem aim at proving you wrong :)

Leave a Reply


Business

Click here if you want to know more about how netvibes can help you widgetize your brand and connect to your audience.

Developers

Click here to learn about netvibes open widget platform and how you can create cool widgets for your service or your application that run everywhere.

Community

Click here to know how to join the netvibes community, get involved and help us translate and create a global directory of widgets for netvibes

Media

Click here to access informations about the company, our latest press release, our logos and media kit