<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Netvibes Developers blog &#187; Tutorials</title>
	<atom:link href="http://dev.netvibes.com/blog/category/article/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.netvibes.com/blog</link>
	<description>News and articles about the Netvibes API</description>
	<lastBuildDate>Wed, 14 Oct 2009 10:42:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Understanding the TabView control</title>
		<link>http://dev.netvibes.com/blog/2009/10/14/understanding-the-tabview-control/</link>
		<comments>http://dev.netvibes.com/blog/2009/10/14/understanding-the-tabview-control/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 10:28:28 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=292</guid>
		<description><![CDATA[The TabView control, which allows you to put a standardized set of tabs within your widget, had been documented since day one, back in 2007. But that documentation was somewhat inprecise and lacking details, to say the least.
While its documentation has been severly improved since then (let us know if you consider it could still [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dev.netvibes.com/doc/uwa/templates_and_controls/tabview">The TabView control</a>, which allows you to put a standardized set of tabs within your widget, had been documented since day one, back in 2007. But that documentation was somewhat inprecise and lacking details, to say the least.</p>
<p>While its documentation has been severly improved since then (let us know if you consider it could still be better!), there remains a feeling that implementing tabs in a widget is a complex task, best left to wizard developers.</p>
<p>It&#8217;s not! And this article will drive the more sceptic among you through code samples that should make everything clear. Here goes.</p>
<h3>Sample 1: three different tabs</h3>
<p>The first sample code presents how to combine 3 widgets into one widget with 3 tabs, each one displaying the same content as the original widget. The three panels will display, in our example,</p>
<ul>
<li>some regular text;</li>
<li>the latest Astronomy Picture of the Day, as per <a href="http://dev.netvibes.com/doc/uwa/examples/apod">the APOD sample widget</a>;</li>
<li>the latest posts from this very blog, as per <a href="http://dev.netvibes.com/doc/uwa/examples/rssreader">the RSSReader sample widget</a>.</li>
</ul>
<p><img class="aligncenter size-full wp-image-303" title="uwa-tabview-various" src="http://dev.netvibes.com/blog/wp-content/uploads/uwa-tabview-various.gif" alt="uwa-tabview-various" width="424" height="233" /></p>
<p>The resulting widget is available <a href="http://nvmodules.typhon.net/xavier/uwa-samples/uwa-tabview-various.html">here</a>.</p>
<p>We can only advise you to dive into its code, and compare to the original widgets&#8217; code. We&#8217;ve provided as much comments as possible, so as to help you understand how we implemented some parts.</p>
<h3>Sample 2: three different tabs, paging in feeds</h3>
<p>You&#8217;d notice in the previous example that we did not use the Pager component, in order to simplify the code to the maximum. Therefore, if the user were to change the preference to only display the 5 of the 10 items in the feeds, he wouldn&#8217;t get the expected &#8220;prev/next&#8221; buttons at the bottom of the widget. This is what this sample code implements.</p>
<p><img class="aligncenter size-full wp-image-295" title="uwa-tabview-various-pager" src="http://dev.netvibes.com/blog/wp-content/uploads/uwa-tabview-various-pager.png" alt="uwa-tabview-various-pager" width="424" height="143" /></p>
<p>The resulting widget is available <a href="http://nvmodules.typhon.net/xavier/uwa-samples/uwa-tabview-various-pager.html">here</a>.</p>
<p>The difference with the previous sample code mostly resides in the block of code that starts with this line:</p>
<pre id="line29">var pager = new UWA.Controls.Pager(</pre>
<p>Here, the pager object is instantiated, and the rest of the code show you how to properly have it displayed.</p>
<h3>Sample 3: three tabs with a different feed each</h3>
<p>As you may know, the most popular use of tabs is to have one widget for many feeds, thus reducing the needed space. To that end, you&#8217;d need to re-use the previous sample widget, and duplicate the third tab into the two first ones.</p>
<p><img class="aligncenter size-full wp-image-296" title="uwa-tabview-onlyFeeds" src="http://dev.netvibes.com/blog/wp-content/uploads/uwa-tabview-onlyFeeds.png" alt="uwa-tabview-onlyFeeds" width="424" height="157" /></p>
<p>The resulting widget is available <a href="http://nvmodules.typhon.net/xavier/uwa-samples/uwa-tabview-onlyFeeds.html">here</a>.</p>
<p>Since we remove the code that displays the first two tabs (the text one, and the image one), the code gets shorter, but you should actually pay more attention to the code, because it presents how to have the logic work for us, and not crash the widget every time we change tab.</p>
<p>For instance, in the previous sample code, the pager was placed in a given, non-changing DIV tag:</p>
<pre id="line29">var pagerDiv = widget.createElement('div', {'class':'paging'});</pre>
<p>It is important to understand that each of the three tabs require its one pager, and therefore to have the code properly implement the pager so that tab-changing would not break it:</p>
<pre id="line24">var pagerDiv = widget.createElement('div', {'class':'paging_'+tabName});</pre>
<p>There are more advanced uses of the TabView control, which will have a look at in another post&#8230;</p>
<h3>Your turn!</h3>
<p>Go ahead, dive into each sample widget&#8217;s code, and you should come out of it with more understanding of tabs and their inner working.</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Understanding%20the%20TabView%20control&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F&amp;t=Understanding%20the%20TabView%20control" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F&amp;title=Understanding%20the%20TabView%20control" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F&amp;title=Understanding%20the%20TabView%20control" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F&amp;title=Understanding%20the%20TabView%20control" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F&amp;title=Understanding%20the%20TabView%20control" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F&amp;title=Understanding%20the%20TabView%20control" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F14%2Funderstanding-the-tabview-control%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2009/10/14/understanding-the-tabview-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making JavaScript and Flash work together in a UWA widget</title>
		<link>http://dev.netvibes.com/blog/2009/10/02/making-javascript-and-flash-work-together-in-a-uwa-widget/</link>
		<comments>http://dev.netvibes.com/blog/2009/10/02/making-javascript-and-flash-work-together-in-a-uwa-widget/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 08:43:49 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=275</guid>
		<description><![CDATA[We recently stumbled upon an interesting part of web application : making a Flash object communicating with its containing HTML page&#8217;s JavaScript functions. This is not unheard of, of course, but in the world of UWA, this can prove difficult to implement in a working way.
A reminder: JavaScript in UWA
As UWA developers know, portability and [...]]]></description>
			<content:encoded><![CDATA[<p>We recently stumbled upon an interesting part of web application : making a Flash object communicating with its containing HTML page&#8217;s JavaScript functions. This is not unheard of, of course, but in the world of UWA, this can prove difficult to implement in a working way.</p>
<h3>A reminder: JavaScript in UWA</h3>
<p>As UWA developers know, portability and predictability in the framework&#8217;s usage has lead us to not recommend the use of JavaScript objets such as &#8216;window&#8217; and &#8216;document&#8217;, instead recommending the equivalent to some of their methods that have been implemented in the UWA-specific &#8216;widget&#8217; objet. For instance, &#8216;window.open()&#8217; is to be dropped in favor of &#8216;widget.openURL()&#8217;, or document.getElementById(&#8217;uniqueID&#8217;)&#8217; is to be replaced by unique classes and the use of &#8216;widget.boy.getElementsById(&#8217;uniqueClass&#8217;)[0]&#8216;, among other things.<br />
Failing to find the needed function equivalent in the UWA JS Framework, developers are suggested to implement the required code within the widget&#8217;s HTML page.</p>
<p>That is all fine and dandy: all UWA developers are now used to play with these idiosynchrasies, and their widgets just get sturdier thanks to that. But when it comes to Flash-JavaScript communication, things get more &#8220;idiosynchratic&#8221;, if you will&#8230;</p>
<h3>The curious case of Flash-JavaScript communication</h3>
<p><img class="alignright size-full wp-image-283" title="Adobe_Flash_CS4_Logo" src="http://dev.netvibes.com/blog/wp-content/uploads/Adobe_Flash_CS4_Logo.png" alt="Adobe_Flash_CS4_Logo" width="256" height="256" />Flash-JS communication is a subject at least as old as Flash itself (well, at least as old as Flash 2 and FSCommand, then). The solutions at the time seemed almost magical, nowadays they are well understood and implemented within ActionScript &#8211; the Flash scripting language.</p>
<p>Calling a JavaScript function from the Flash application&#8217;s containing HTML page only requires a couple of ActionScript lines with Flash CS4. Let&#8217;s say we have on our Flash scene two main instances: a textfield named myInputText and a button named myButton. With a click on myButton, we want Flash to send the text content of myInputText to a JavaScript function called, for lack of a better name, theJavaScriptFunction().</p>
<p>Here&#8217;s how our ActionScript code could look like:</p>
<pre>import flash.external.ExternalInterface;
myButton.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
  if (ExternalInterface.available) {
    try {
       var tempStr:String = ExternalInterface.call("theJavaScriptFunction", myInputText.text);
    }
    catch (error:SecurityError) {
       // ignore
    }
  }
}</pre>
<p>Basically, with Flash CS4, the ExternalInterface object is the central place to improve your communication skillz. Past versions of Flash had other methods, that we&#8217;ll let you peruse at will, since it&#8217;s a safe bet CS4&#8217;s methods are here to stay&#8230;</p>
<h3>Flash-JavaScript communication in UWA</h3>
<p>Since UWA isn&#8217;t much more than a XHTML page, having Flash communicate with JS in that context should be a cake, right?</p>
<p>Wrong. Remember the first part of the article, where I reminded you of the &#8220;no &#8216;document&#8217; object&#8221; recommendation? Well, as it turns out, JS method calls from Flash are targetted at the document &#8211; which means, basically, that if you try to call your MyWidget.AwesomeFunction(), Flash will in fact target document.MyWidget.AwesomeFunction(). Hilarity ensues.</p>
<p>One solution here is to break out of the &#8220;no &#8216;document&#8217; object&#8221; rule, and build a proxy function for each JS method that you want called. For instance, in order to call this function:</p>
<pre>MyWidget.AwesomeFunction = function(var) {
  // some code
}</pre>
<p>&#8230;you&#8217;d simply have to define a proxy AwesomeFunction directly on the page&#8217;s default object (the &#8216;document&#8217; one), and have it call your UWA-tied function, like so:</p>
<pre>function AwesomeFunction(var) {
  MyWidget.AwesomeFunction(var);
}</pre>
<p>So, this would tend to prove a little diversion can go a long way. But wait! There&#8217;s more!</p>
<h3>Making your way through domains</h3>
<div id="attachment_284" class="wp-caption alignright" style="width: 373px"><a href="http://kb2.adobe.com/cps/402/kb402450.html"><img class="size-full wp-image-284" title="kb402450_crossdomain-text" src="http://dev.netvibes.com/blog/wp-content/uploads/kb402450_crossdomain-text.png" alt="kb402450_crossdomain-text" width="363" height="248" /></a><p class="wp-caption-text">Official explanation graphic from Adobe</p></div>
<p>Let&#8217;s say your ActionScript and JavaScript code is in place, as explain above. You load the widget directly in your browser (standalone mode), and it just works: awesomeness! But then you decide to install the widget on a Netvibes page, and lo!, it fails to even trigger AwesomeFunction(). <em>Fatalitas!</em></p>
<p>No, Netvibes is not blocking such usage of UWA code. Simply put, Flash has some security restriction which you will need to check one by one before you can make it all shine.</p>
<p>The basis of these security measures is the domain name. In short, by default, a Flash app (.swf) can only communicate with external files (.html, .php, .xml, .js &#8230;) if it is hosted on the very same domain name.</p>
<p>This behavior is therefore broken once in Netvibes (or any Exposition-based widget server, for that matter), since widget&#8217;s are not only displayed within an iFrame (which might be a problem in itself), but also on a unique domain name. Hence, the HTML file can never be on the same domain as the SWF file, and therefore the data loading (or JavaScript communication, in our case) cannot happen.</p>
<p>Luckilly, Macromedia at the time undertstood that need, and gave us support for a crossdomain.xml file, which would let the developer allow (or disallow) a given set of domain to be accessed by the SWF. This XML file, hosted at the root of the domain bearing the Flash file, can take this form:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
&lt;cross-domain-policy&gt;
  &lt;allow-access-from domain="*" /&gt;
&lt;/cross-domain-policy&gt;</pre>
<p>For added fun, you can add the following lines to your ActionScript code:</p>
<pre>import flash.system.Security;
Security.allowDomain("*");</pre>
<p>These lines are another way for Flash to validate crossdomain access.</p>
<p>One down, only one more to go&#8230;.</p>
<p>But that&#8217;s only for data, here. What we need in our case is access to the local JavaScript. This, in turn, is made possible by adding the AllowScriptAccess attribute in the SWF&#8217;s embed code, and setting it to &#8220;always&#8221;. Your embed code would therefore look like this:</p>
<pre>&lt;embed type="application/x-shockwave-flash"
  src="http://domain-name.net/uwa-flash.swf"
  width="250" height="100" bgcolor="#FFFFFF"
  AllowScriptAccess="always"&gt;&lt;/embed&gt;</pre>
<p>Still willing to use Flash for your widget? Then hop onto the next section!</p>
<h3>Handling UWA preferences from a Flash application</h3>
<p>As if that wasn&#8217;t enough, there are cases where you&#8217;d like your Flash application to make use of UWA&#8217;s preferences methods, if only in order to record the user&#8217;s settings for the Flash app within the confines of the UWA environment.</p>
<p>This case should be view from two points:</p>
<ol>
<li>Have the Flash settings be saved as UWA preferences;</li>
<li>Have the Flash app load the UWA preferences on startup.</li>
</ol>
<p>The first part is pretty ease if you you follow the instructions above: instead of calling widget.setValue() directly from ActionScript (which would result in document.widget.setValue() being called instead, and therefore nothing happenning), you&#8217;d call UWA_setValue(), which in the HTML file would be defined as&#8230;</p>
<pre>function UWA_saveInPref(varid) {
  widget.setValue('myValue', varid);
}</pre>
<p>Obviously, if you have more than one preference to set from Flash, you&#8217;d nees to expand on this code a bit&#8230;</p>
<p>Now, we want the SWF file to load up a preference, but only if it is set (obviously, else it would load the preference as &#8216;null&#8217; or other unset values). That can be done pretty easily by passing variables to Flash via the embed code&#8217;s URL (or more precisely, its query string).</p>
<div id="attachment_285" class="wp-caption aligncenter" style="width: 434px"><img class="size-full wp-image-285" title="uwa-flash" src="http://dev.netvibes.com/blog/wp-content/uploads/uwa-flash.png" alt="Why, yes it is!" width="424" height="255" /><p class="wp-caption-text">Why, yes it is!</p></div>
<p>Here is one way to get a nice, working query string for your Flash app&#8230;</p>
<p>First, retrieve the preference value, and build it into your query string via a ternary operator, for instance. Here is an example:</p>
<pre>var myValue = widget.getValue('myValue');
div_flash.innerHTML += '&lt;embed type="application/x-shockwave-flash"
  src="http://domain-name.net/uwa-flash.swf'+ (myValue?'?theValue='+myValue+'':'')
  +'" width="250" height="100" bgcolor="#FFFFFF" AllowScriptAccess="always"&gt;&lt;/embed&gt;';
widget.setBody(div_flash);</pre>
<p>If the ternary XXX finds that myValue is not empty (ergo, the preference is set), then it assigns its content to the Flash app&#8217;s theValue internal variable. If it is empty, &#8216;theValue&#8217; is not even defined in the query string, and the Flash app launches in its default state &#8211; which is pretty much the whole point of this ternary operator.</p>
<p>Second, add the following two lines of ActionScript in your SWF&#8217;s first frame (given that you want to update a &#8216;myInputText&#8217; textfield based on that query string):</p>
<pre>var myQueryStrings = this.loaderInfo.parameters;
myInputText.text = myQueryStrings.theValue;</pre>
<p>This will load our query string (using the loaderInfo object and its &#8216;parameters&#8217; property), and assign the &#8216;theValue&#8217; value as the text content of our beloved myInputText. Done: the textfield is updated with the correct UWA preference on each loading (or preference update)!</p>
<p>You can see it for yourself with <a href="http://nvmodules.typhon.net/xavier/uwa-samples/uwa-flash.html">this basic widget</a>, the code of which is available <a href="http://nvmodules.typhon.net/xavier/uwa-samples/uwa-flash.zip">here</a> (you might need Flash CS4).</p>
<h3>Two final tips, for the road</h3>
<p>1) Don&#8217;t forget to add wmode=&#8221;opaque&#8221; to your embed code, so that i doesn&#8217;t overlap with Netvibes&#8217;s content!</p>
<p>2) Choose the &#8220;hidden&#8221; preference type if you want that preference to only be changeable through your Flash app!</p>
<p>Now go and build more awesome Flash-based UWA widgets!</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F&amp;t=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F&amp;title=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F&amp;title=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F&amp;title=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F&amp;title=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F&amp;title=Making%20JavaScript%20and%20Flash%20work%20together%20in%20a%20UWA%20widget" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F10%2F02%2Fmaking-javascript-and-flash-work-together-in-a-uwa-widget%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2009/10/02/making-javascript-and-flash-work-together-in-a-uwa-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building your own animated theme for Netvibes</title>
		<link>http://dev.netvibes.com/blog/2009/07/29/building-your-own-animated-theme-for-netvibes/</link>
		<comments>http://dev.netvibes.com/blog/2009/07/29/building-your-own-animated-theme-for-netvibes/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:12:01 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=234</guid>
		<description><![CDATA[It&#8217;s been a month since we revealed that Netvibes is supporting animated themes &#8211; that is, themes that change throughout the day, depending on the designer&#8217;s wishes.

Today marks another milestone for animated themes in Netvibes, with the official support of 10 brand new themes, which obviously make plenty o&#8217; use of time ranges.
I want my [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a month since we revealed that <a href="http://dev.netvibes.com/blog/2009/06/25/netvibes-now-supports-dynamic-themes/">Netvibes is supporting animated themes</a> &#8211; that is, themes that change throughout the day, depending on the designer&#8217;s wishes.</p>
<p><img class="aligncenter size-full wp-image-237" title="dyn-theme-animation" src="http://dev.netvibes.com/blog/wp-content/uploads/dyn-theme-animation1.gif" alt="dyn-theme-animation" width="520" height="98" /></p>
<p>Today marks another milestone for animated themes in Netvibes, <a href="http://blog.netvibes.com/?2009%2F07%2F29%2F294-10-new-animated-themes-to-personalize-your-page">with the official support of 10 brand new themes</a>, which obviously make plenty o&#8217; use of time ranges.</p>
<h3>I want my own!</h3>
<p>We hear ya! One of the great projects released with the <a href="http://www.netvibes.com/labs/">Netvibes Lab</a>s launch, <a href="http://blog.netvibes.com/?2009/04/15/264-netvibes-labs">back in April &#8216;09</a>, was the <a href="http://www.netvibes.com/labs/projects/theme-designer/">Theme Designer</a>, which allowed you to design your theme visually rather than through a tedious XML format.</p>
<p>However, our Theme Designer is not yet able to build animated themes (that&#8217;s planned for a further iteration), so in order to feast your visitors&#8217; eyes with an everchanging design, you will still have to dive into the code. Don&#8217;t be scared: it&#8217;s quite easy as long as you know how to handle XML.</p>
<p>Our <a href="http://dev.netvibes.com/doc/theme">theme documentation</a> already features most of the information you might need in order to code your own theme, be it static or animated.</p>
<p>In this article, we&#8217;ll dive into building a complete animated theme step by step, using the Theme Designer. That editor doesn&#8217;t yet support animated themes, but we can just as well use it to build a handful of static themes, and merge them into one file by hand, in order to get an animated theme!</p>
<h3>Step one: Deciding on the time ranges and graphics</h3>
<p>Before we hop into the editor and start choosing the header color for widgets, you should first have a clear idea of what you want your theme to look and behave like &#8211; which could greatly impact the header graphics.</p>
<p>For instance, you can have up to 24 different designs (one per hour of the day/night), but you can just as well have an animated theme with two different states.</p>
<p>For the purpose of this article, we&#8217;ll show you how to build a 5-parts theme, with 3 different behaviors: work, lunch, and spare time &#8211; therefore, your visitors will be able to know what you&#8217;re up to just by looking at your theme!</p>
<p>Each behavior fits into a specific time range:</p>
<ol>
<li>12am-9am: spare time</li>
<li>9am-1pm: work</li>
<li>1pm-2pm: lunch</li>
<li>2pm-7pm: work</li>
<li>7pm-12am: spare time</li>
</ol>
<p>Note that while the two &#8220;spare time&#8221; ranges are next to each other, the XML format requires us to keep them separated rather than having a single &#8220;spare time&#8221; range going from 7 PM to 9 AM: valid time ranges are from 12am &#8211; 12am, and if the end time is before the start time, it will cause an error.<br />
Also, make sure you set ranges for the full 24h of the day &#8212; you wouldn&#8217;t want your users to miss out on an hour&#8230;</p>
<h3>Step two: Making the graphics</h3>
<p>Our theme  has 5 parts, but we will base it upon 3 designs: &#8220;lunch&#8221; (used once), work (used twice) and &#8220;spare time&#8221; (used twice).</p>
<p>We&#8217;ll leave the graphic creation to you, and will simply remind you of the size recommendations for a good header image, as well as useful information:</p>
<ul>
<li>Images should be at least 175px tall. Since the user can expand the header&#8217;s height, it is recommended to go up to 260px, or even 300px to be on the safe side.</li>
<li>Center image must be at least 640px wide.</li>
<li>Tile image can be any size, but must wrap-up seamlessly.</li>
<li>Image should not weight more than 100 kb. Recommended weight is 40 kb, but prefer better quality to smaller size.</li>
<li>Images are centered in the header, both horizontally and vertically.</li>
<li>Images can use any format. Recommended are <acronym title="Portable Network Graphics">PNG</acronym> and<acronym title="Joint Photographics Experts Group">JPG</acronym>, but <acronym title="Graphics Interchange Format">GIF</acronym> can of course be used. Use <acronym title="Portable Network Graphics">PNG</acronym>/<acronym title="Graphics Interchange Format">GIF</acronym> if you need to use transparency.</li>
</ul>
<p>A lot more information is available in the <a href="http://dev.netvibes.com/doc/theme">theme documentation</a>, such as a description of the various layers available for the header, and image tiling&#8230;</p>
<h3>Step three: Making the themes using the Theme Designer</h3>
<p>Now that you have everything at hand, you can launch the <a href="http://www.netvibes.com/labs/projects/theme-designer/">Theme Designer</a> and simply fill-in the blanks for each section. You&#8217;ll have to do that for each of the various time ranges of your animated theme.</p>
<p><img class="aligncenter size-medium wp-image-249" title="nv-themedesigner" src="http://dev.netvibes.com/blog/wp-content/uploads/nv-themedesigner-500x358.png" alt="nv-themedesigner" width="500" height="358" /></p>
<p>Once you feel you static theme is perfect, you can save it by clicking on the &#8220;Download theme&#8221; button, available from the Main tab. You end up with an XML file containing all the needed info for your static theme, and named &#8220;theme.xml&#8221; &#8211; which we advise you to promptly rename into something more informative, for fear of overwriting it with your next theme saving.</p>
<h3>Step four: Merging static themes into a animated theme</h3>
<p>Each of the three static themes we have created are wholly contained within the &lt;ConfigMap type=&#8221;Skin&#8221;&gt;&#8230;&lt;/ConfigMap&gt; tags of each of their respective XML files. One theme XML file can contain more than one such &lt;ConfigMap&gt; tag, and they are differentiated using the sub-tag &lt;Trait&gt;, as explained in both the <a href="http://dev.netvibes.com/doc/theme">theme documentation</a> and <a href="http://dev.netvibes.com/blog/2009/06/25/netvibes-now-supports-dynamic-themes/">the announcement from last month</a>.</p>
<p>Therefore, merging static themes into one animated theme is simply a question of copy/pasting the &lt;ConfigMap&gt; tags from all files into the remaining one, after its own such tag. Once the pasting is done, add a &lt;Trait&gt; tag with the proper time range settings to each &lt;ConfigMap&gt;, and you&#8217;re pretty much done!</p>
<p>In our case, we have three static themes which apply to 5 time ranges, so two of them are bound to be duplicated within the XML. They will be singled out by their &lt;Trait&gt;.</p>
<p>In order to build our animated theme, we&#8217;ll start with the file for the static theme tied to the first time range, then paste the &lt;ConfigMap&gt; tags from the two other files into 5 distinct &lt;ConfigMap&gt; section, and finally differentiate them using their very own &lt;Trait&gt; tags. The sequence of the &lt;Trait&gt; tags might be as such:</p>
<ol>
<li>&#8220;spare time&#8221; theme: &lt;Trait name=&#8221;TimeOfDay&#8221;&gt;12am-9am&lt;/Trait&gt;</li>
<li>&#8220;work&#8221; theme: &lt;Trait name=&#8221;TimeOfDay&#8221;&gt;9am-1pm&lt;/Trait&gt;</li>
<li>&#8220;lunch&#8221; theme: &lt;Trait name=&#8221;TimeOfDay&#8221;&gt;1pm-2pm&lt;/Trait&gt;</li>
<li>&#8220;work&#8221; theme: &lt;Trait name=&#8221;TimeOfDay&#8221;&gt;2pm-7pm&lt;/Trait&gt;</li>
<li>&#8220;spare time&#8221; theme: &lt;Trait name=&#8221;TimeOfDay&#8221;&gt;7pm-12am&lt;/Trait&gt;</li>
</ol>
<p>Easy as peas!</p>
<h3>Step 5: applying the theme on your page</h3>
<p>You must upload the XML files and all the media files it uses on a public host in order to apply it. Do not remove it from the host after installation, since your page would lose the theme altogether&#8230;</p>
<p>Now comes the part were you get to see your theme in action. As explained in the documentation, you can apply the theme on either one of your private pages, or your public (or all of them!) &#8211; it all depends on the syntax you use.</p>
<p>If it&#8217;s on a private page:</p>
<ol>
<li>Go to that page of yours ;</li>
<li>Type the following in your browser&#8217;s adress bar:<br />
http://www.netvibes.com/?theme=http://URLOF YOURTHEME</li>
</ol>
<p>If it&#8217;s on your public page (http://www.netvibes.com/PAGEID):</p>
<ul>
<li>http://www.netvibes.com/?visit= PAGEID&amp;theme=http://URLOF YOURTHEME</li>
</ul>
<h3>Explore 10 exclusive themes!</h3>
<p>The 10 exclusive animated themes that were released today are available for your to browse through, in order to learn how to build awesome themes yourself!</p>
<p>Here are the links to their XML files, along with links to apply them on your current private page:</p>
<ul>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/4seasons/theme.xml">4 Seasons</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/4seasons/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/24hours/theme.xml">24 Hours</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/24hours/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/aurora/theme.xml">Aurora</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/aurora/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/colors/theme.xml">Colors</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/colors/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/food/theme.xml">Food</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/food/theme.xml">apply i</a>t)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/grey_texture/theme.xml">Grey Texture</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/grey_texture/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/heart/theme.xml">Heart</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/heart/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/lightness/theme.xml">Lightness</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/lightness/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/sea_serpent/theme.xml">Sea Serpent</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/sea_serpent/theme.xml">apply it</a>)</li>
<li><a href="http://www.netvibes.com/themes/xml-dynamic/yann_arthus_bertrand/theme.xml">Yann Arthus-Bertrand</a> (<a href="http://www.netvibes.com/?theme=http://www.netvibes.com/themes/xml-dynamic/yann_arthus_bertrand/theme.xml">apply it</a>)</li>
</ul>
<p><em>Caution: Applying one of these themes will replace the current theme.</em></p>
<p>Show us your own themes!</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Building%20your%20own%20animated%20theme%20for%20Netvibes&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F&amp;t=Building%20your%20own%20animated%20theme%20for%20Netvibes" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F&amp;title=Building%20your%20own%20animated%20theme%20for%20Netvibes" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F&amp;title=Building%20your%20own%20animated%20theme%20for%20Netvibes" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F&amp;title=Building%20your%20own%20animated%20theme%20for%20Netvibes" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F&amp;title=Building%20your%20own%20animated%20theme%20for%20Netvibes" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F&amp;title=Building%20your%20own%20animated%20theme%20for%20Netvibes" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F07%2F29%2Fbuilding-your-own-animated-theme-for-netvibes%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2009/07/29/building-your-own-animated-theme-for-netvibes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to integrate Netvibes sharing in your website</title>
		<link>http://dev.netvibes.com/blog/2009/05/18/how-to-integrate-netvibes-sharing-in-your-website/</link>
		<comments>http://dev.netvibes.com/blog/2009/05/18/how-to-integrate-netvibes-sharing-in-your-website/#comments</comments>
		<pubDate>Mon, 18 May 2009 15:43:39 +0000</pubDate>
		<dc:creator>Maurice</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=204</guid>
		<description><![CDATA[Last year, we introduced social features with the &#8220;Ginger&#8221; version of Netvibes. One of them, is the ability for users to share their most interesting links with your all their contacts. Since the launch of the feature, several hundred thousand links have already been publicly shared.
If you&#8217;re running a website, you can get your users [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, we introduced social features with the &#8220;Ginger&#8221; version of Netvibes. One of them, is the ability for users to share their most interesting links with your all their contacts. Since the launch of the feature, several hundred thousand links have already been publicly shared.<br />
If you&#8217;re running a website, you can get your users to easily share your links with their contacts. All you have to do, is build a link with up to 3 GET parameters.</p>
<p>Here is a sample link: <code>http://www.netvibes.com/share?title=Netvibes%20is%20awesome!&amp;url=http%3A//www.netvibes.com/</code></p>
<p>The resource <code>http://www.netvibes.com/share</code> accepts the following parameters:</p>
<ul>
<li><code>title</code> : Title for the shared link (my be URL-encoded);</li>
<li><code>url</code> : The link itself (must be URL-encoded);</li>
<li><code>autoclose</code> : Set it to 1 if you want the popup window to close after submission.</li>
</ul>
<p>To URL-encode your links, you can use the function <code>urlencode</code> in PHP or <code>encodeURIComponent</code> in Javascript.</p>
<p>We tried to make it easy for anyone to integrate those links in any page by keeping it very simple. However, if you&#8217;re looking for turnkey solutions, some universal <a href="http://blog.netvibes.com/?2009/05/18/269-share-your-favorite-web-links-with-your-netvibes-contacts">sharing buttons have already integrated Netvibes</a> and you may use one of them.</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F&amp;t=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F&amp;title=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F&amp;title=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F&amp;title=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F&amp;title=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F&amp;title=How%20to%20integrate%20Netvibes%20sharing%20in%20your%20website" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2009%2F05%2F18%2Fhow-to-integrate-netvibes-sharing-in-your-website%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2009/05/18/how-to-integrate-netvibes-sharing-in-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing (widgets) is caring</title>
		<link>http://dev.netvibes.com/blog/2008/09/03/sharing-widgets-is-caring/</link>
		<comments>http://dev.netvibes.com/blog/2008/09/03/sharing-widgets-is-caring/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:02:07 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ecosystem]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[nyt]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=158</guid>
		<description><![CDATA[We&#8217;ve long said, and proved, that UWA works on all major widget platforms &#8211; you know the drill: Netvibes, Apple Dashboard, iGoogle, Opera, Vista, Live.com&#8230; But there is one more that deserves to be as well known: blog export.
The ability to work on blogs, and for that matter on any website,  has always been part [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve long said, and proved, that UWA works on all major widget platforms &#8211; you know the drill: Netvibes, Apple Dashboard, iGoogle, Opera, Vista, Live.com&#8230; But there is one more that deserves to be as well known: blog export.</p>
<p>The ability to work on blogs, and for that matter on any website,  has always been part of UWA starting with the now-deprecated <a href="http://dev.netvibes.com/doc/howto/widget_export">BlogWidget</a> method. BlogWidget was a nice first try at including UWA widget within the premises of a website, but in the long run was a hassle to instal, and for us it quickly became hard to maintain.</p>
<p>UWA compilers have improved a lot since last year, and the release of the Ecosystem was for us a chance to push further the proverbial envelope of exporting UWA widgets. So we built UWA export right into Ecosystem, and called it Share.</p>
<p><img class="alignright size-full wp-image-159" title="eco-share-nyt" src="http://dev.netvibes.com/blog/wp-content/uploads/eco-share-nyt.png" alt="" width="380" height="234" />Let&#8217;s say you like news so much, you want your website&#8217;s visitors to see our <a href="http://eco.netvibes.com/widgets/203767/new-york-times">New-York Times widget</a> in your sidebar. With the new Share tool, this previously laborious task has gotten very easy: go to the widget&#8217;s Ecosystem page, and click on the Share button, located next to the widget preview, right between the install links for the current 5 support platforms and the Source button, in all its orange glory.</p>
<p>Clicking that link brings you to a whole new tool in Ecosystem, where you can configure the look of the widget for better inclusion in your website. There, you can change the widget&#8217;s title, its height and the color of the header. While make these changes, you can see them live in the preview on the right side of this export tool, and can even update the height manually rather than using the counter.</p>
<p><img class="aligncenter size-full wp-image-160" title="eco-export-config" src="http://dev.netvibes.com/blog/wp-content/uploads/eco-export-config.png" alt="" width="470" height="248" /></p>
<p>Since exported widget do not offer an Edit section (by design), this tools lets you configure the widget&#8217;s preferences directly.</p>
<p><img class="aligncenter size-full wp-image-161" title="eco-export-prefs" src="http://dev.netvibes.com/blog/wp-content/uploads/eco-export-prefs.png" alt="" width="471" height="160" /></p>
<p>Once you are happy with the preview, you can directly grab the HTML code in the section below. As you can see it&#8217;s still pretty close to the old BlogWidget method, but believe me, it really has improved since that first version, the export tool being just the surface of it.</p>
<p>The most advanced among you might even find it cool to dabble with the code directly rather than through the interface&#8230;</p>
<p><a href="http://dev.netvibes.com/blog/wp-content/uploads/eco-export-code.png"><img class="aligncenter size-full wp-image-162" title="eco-export-code" src="http://dev.netvibes.com/blog/wp-content/uploads/eco-export-code.png" alt="" width="470" height="304" /></a></p>
<p>Stick that in your website&#8217;s HTML code, at the right place, upload, reload, and you should new be the proud owner of a UWA widget on your website!</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Sharing%20%28widgets%29%20is%20caring&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F&amp;t=Sharing%20%28widgets%29%20is%20caring" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F&amp;title=Sharing%20%28widgets%29%20is%20caring" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F&amp;title=Sharing%20%28widgets%29%20is%20caring" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F&amp;title=Sharing%20%28widgets%29%20is%20caring" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F&amp;title=Sharing%20%28widgets%29%20is%20caring" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F&amp;title=Sharing%20%28widgets%29%20is%20caring" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F09%2F03%2Fsharing-widgets-is-caring%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2008/09/03/sharing-widgets-is-caring/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Harnessing the Activities Timeline</title>
		<link>http://dev.netvibes.com/blog/2008/07/18/harnessing-the-activities-timeline/</link>
		<comments>http://dev.netvibes.com/blog/2008/07/18/harnessing-the-activities-timeline/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 12:56:02 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=152</guid>
		<description><![CDATA[You might not have noticed it, but in addition to completely revamping our Ecosystem (you didn&#8217;t know? check it out!), we&#8217;ve been silently adding new functionalities here and there, for developers to play with.
One of these &#8220;toys&#8221; is the expanded Timeline Search. As a Netvibes user, you must know about the User Timeline, where a [...]]]></description>
			<content:encoded><![CDATA[<p>You might not have noticed it, but in addition to completely revamping our Ecosystem (you didn&#8217;t know? check it out!), we&#8217;ve been silently adding new functionalities here and there, for developers to play with.</p>
<p>One of these &#8220;toys&#8221; is the expanded Timeline Search. As a Netvibes user, you must know about the User Timeline, where a user can post his good links, his favorite posts or simply his though of the moment, and let all your followers see them.</p>
<p><img class="aligncenter size-full wp-image-153" title="netvibes-activities" src="http://dev.netvibes.com/blog/wp-content/uploads/netvibes-activities.png" alt="" width="500" height="154" /></p>
<p><img class="alignleft size-full wp-image-154" title="widget-mycommunity" src="http://dev.netvibes.com/blog/wp-content/uploads/widget-mycommunity.png" alt="" width="262" height="250" />These three kinds of item can be posted to the timeline, respectively, using the <a href="http://nvmodules.typhon.net/maurice/uwa-starit/">Star-It widget</a> (which uses the new <code>widget.addStar()</code> method, so you can also <a href="http://dev.netvibes.com/blog/2008/04/08/gingers-new-functionalities-for-uwa-developers-part-2/">build starring within you own widgets</a>), via a click on the little star that is displayed by some widgets (one of which is the <a href="http://www.netvibes.com/subscribe.php?url=http://blog.netvibes.com/rss.php">internal feed reader</a>, so that makes it easy for blog posts and podcasts), and the <a href="http://www.netvibes.com/subscribe.php?module=friendActivities">My Community widget</a> (which you can find in the Essential Widget section of the Add Content panel). </p>
<p>It&#8217;s all fine and dandy, but you might think that all this data is only available to logged-in Netvibes users who chose to follow your Universe &#8211; and therefore, quite walled-garden-y for the reste of teh intarwebs. Luckily, there&#8217;s more than that.</p>
<p>When we announced the <a href="http://dev.netvibes.com/doc/api/rest">Netvibes REST API</a> <a href="http://dev.netvibes.com/blog/2008/04/29/new-design-and-uwa-doc-update/">a couple months ago</a>, it already gave a lot of power to developers, like retrieving the whole content of a Netvibes Universe in XML form, but the documentation for the Timeline Search method wasn&#8217;t really complete a the time. We&#8217;ve been working towards improving it, and the result is that you can now easily use the Timeline data just about anywhere, thanks to an expanded set of options.</p>
<p>In short, the expanded Timeline Search makes it possible for anyone to create services or tools based on public Timeline data retrieval! Desktop apps, anyone?</p>
<p><img class="alignright size-medium wp-image-155" title="activities-xml" src="http://dev.netvibes.com/blog/wp-content/uploads/activities-xml.png" alt="" width="240" height="220" />The documentation itself features a handful of ideas already:</p>
<ul>
<li>Need to pull the 100 last public status updates in Atom format? <a href="http://rest.netvibes.com/timeline/search?query=type:status&amp;format=atom&amp;limit=100">You can do it</a>.</li>
<li>Want to know who&#8217;s been mentioning the iPhone 3G lately, and get it in JSON? <a href="http://rest.netvibes.com/timeline/search?query=iphone%203g&amp;format=json">Have a lookee here</a>.</li>
<li>Feel like visiting the recent favorite links of one&#8217;s followers, in XML? <a href="http://rest.netvibes.com/timeline/search?query=followersof:xavier&amp;type:star">Here you go</a>.</li>
<li>Fan of the &#8220;FAIL&#8221; meme, and want to know who&#8217;s been commenting items with &#8220;FAIL&#8221;? <a href="http://rest.netvibes.com/timeline/search?query=comment:fail">Yup, can do</a>.</li>
</ul>
<p>This is just a part of what can be done with the REST API, and an <em>avant-goût</em> of things to come from our recent developments. Until we uncover these, you advise you to have a closer look at all the possibilities of the Netvibes REST API, which can offer a lot more than searching public timelines&#8230;<br />
 </p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Harnessing%20the%20Activities%20Timeline&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F&amp;t=Harnessing%20the%20Activities%20Timeline" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F&amp;title=Harnessing%20the%20Activities%20Timeline" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F&amp;title=Harnessing%20the%20Activities%20Timeline" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F&amp;title=Harnessing%20the%20Activities%20Timeline" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F&amp;title=Harnessing%20the%20Activities%20Timeline" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F&amp;title=Harnessing%20the%20Activities%20Timeline" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F07%2F18%2Fharnessing-the-activities-timeline%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2008/07/18/harnessing-the-activities-timeline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s easy to have a good-looking widget</title>
		<link>http://dev.netvibes.com/blog/2008/06/24/its-easy-to-have-a-good-looking-widget/</link>
		<comments>http://dev.netvibes.com/blog/2008/06/24/its-easy-to-have-a-good-looking-widget/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 11:44:04 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=145</guid>
		<description><![CDATA[On this blog, we&#8217;ve been steadily giving you advices about content and code, two of the main aspects of what makes a good widget in our opinion: content, because a widget is nothing without it ; and code, because that&#8217;s what UWA gets its flexibility and portability from.
It was all content and code, until now: [...]]]></description>
			<content:encoded><![CDATA[<p>On this blog, we&#8217;ve been steadily giving you advices about content and code, two of the main aspects of what makes a good widget in our opinion: content, because a widget is nothing without it ; and code, because that&#8217;s what UWA gets its flexibility and portability from.</p>
<p>It was all content and code, until now: the design part of the widget is when that got little love around here until now, but truly deserve it. Once you have coded your widget and it&#8217;s full of content goodness, the best way to set it apart from other widget that display the same content, is to display it in a more attractive way.</p>
<p>There are many ways to design a better, and we&#8217;re going to explore some of them in this post.</p>
<h3>Re-use your knowledge</h3>
<p>Keep in mind that thanks to UWA being based on well-known web-standards, you can apply your CSS, table and/or font magic on your widget just as easily as you would. From this standpoint, widgets are just smaller websites: you can make use of your usual tricks of the trade, and even CSS hacks if needed, to achieve the look you need.</p>
<p>One thing to remember, though, is that even if your content is displayed in smaller setting that on a good ol&#8217; website, you still don&#8217;t know the width of the container. Not only can the Netvibes user set his page to display widgets in a given number of columns (up to 4 currently), or even resize columns independently , but thanks to the portability of UWA, you widget can find itself displayed through a number of widget platforms, through the browser or on the desktop.<br />
In short: cater for all possible width, and set up your content to display harmoniously from 320 pixels wide to 1280 or more. Use percentages wisely! If you are stuck with fixed width, at least try to keep it centered, so that it looks good even in one column.</p>
<p>From there on, you can apply to your widget all the good advices you might have received from <a href="http://www.sensible.com/buythebook.html">classic web-design books</a>, using the technique you feel more comfortable with: align your form elements and general content so as not to present a mess to your users, <a href="http://en.wikipedia.org/wiki/KISS_principle">KISS</a> (don&#8217;t overwhelm with content), balance graphics and white-space in a legible way, etc.</p>
<h3>Use the available tools</h3>
<p>Users have expectations when browsing online, which are set by mostly habits formed from reading other websites. Consequently, while going with a disruptive look might be tempting in order to get more attention than the other displayed widgets, the end-result will most probably be that your widget will feel out-of-place, or even ugly in comparison to other, better-fitting widgets. Sticking to the rules might therefore be a sound idea.</p>
<p>One set of rules that are easy to follow, is UWA&#8217;s <a href="http://dev.netvibes.com/doc/uwa_templates">templates and controls</a>, a set of CSS conventions and JavaScript object built from the ground up to help your content integrate seamlessly with the Netvibes look-and-feel. More generally, they offer a quick way to get a particular design idea in place, with way less work than if you had to build it all by yourself.</p>
<p>It&#8217;s also important to know that using controls, such as the TabView one, doesn&#8217;t implies that you are stuck with having to deal with them at all times. Remember that the widget&#8217;s content can be entirely built and re-built on demand through JavaScript, and thus you can set up various sections or customize colors, using JavaScript and the DOM. Conditional statements such as <code>if..else</code> or <code>switch..case</code> where created for a reason.</p>
<p>See how the ever-admirable <a href="http://eco.netvibes.com/widgets/203214/rugby-world-cup-2007">Rugby World Cup 2007 widget</a> makes use of tabs only when needed: on loading, it checks wether the hidden &#8220;mode&#8221; preference is set to &#8220;details&#8221;, and displays the content accordingly.</p>
<pre><code>if (widget.getValue('mode') == 'details') {
  RWC.buildTabs();
} else {
  RWC.buildPodium();
}</code></pre>
<p>This means basically that only the podium is displayed on first load (no tabs).</p>
<p><img class="aligncenter size-full wp-image-146" title="rugbywc-modepodium" src="http://dev.netvibes.com/blog/wp-content/uploads/rugbywc-modepodium.png" alt="" width="322" height="183" /></p>
<p>The user can then click a &#8220;switcher&#8221; link, built dynamically using JavaScript and DOM methods &amp; events:</p>
<pre><code>// Switcher
var toggle = widget.createElement('p');
var a = widget.createElement('a');
toggle.className = 'toggle calendar';
a.setText(toggleText);
a.href = '#';
a.onclick = function() { return false; }
var setDetailsMode = function(event) {
  widget.setValue('mode', 'details');
  RWC.buildTabs();
}
toggle.onclick = setDetailsMode.bindAsEventListener(this);
toggle.appendChild(a);</code></pre>
<p>The <code>buildTabs()</code> method then erases the whole podium, and puts the tabs (and inline pager) in place &#8211; along with a bottom switcher link, so that the user can go from one mode to the other.</p>
<p><img class="aligncenter size-full wp-image-148" title="rugbywc-moderesults2" src="http://dev.netvibes.com/blog/wp-content/uploads/rugbywc-moderesults2.png" alt="" width="322" height="212" /></p>
<p>From there, thanks to the flexibility of JavaScript, anything is possible&#8230;</p>
<h3>A subtle image can do a big impression</h3>
<p>Placing your content harmoniously, using the existing templates: it&#8217;s all fine and dandy, but while these are necessary, it doesn&#8217;t make your widget stand out in the crowd. What will make it stand out is graphic design: adding color and/or images. But as explained before, this should be done in light touches, so as not to disrupt the general flow of the page.</p>
<p>Again, the RWC widget is a good example of this, with a non-disturbing crop of grass at the bottom, which helps the widget to go from &#8220;plain&#8221; to &#8220;playful&#8221;.</p>
<p><img class="aligncenter size-full wp-image-149" title="rugbywc-bottomgrass" src="http://dev.netvibes.com/blog/wp-content/uploads/rugbywc-bottomgrass.png" alt="" width="322" height="70" /></p>
<p>Another such example is the recent <a href="http://eco.netvibes.com/widgets/241215/euro2008">Euro2008 widget</a>, which also servers as a great example of some of the ways you can make use of tabs and paging in a widget.</p>
<p><img class="aligncenter size-full wp-image-150" title="euro2008" src="http://dev.netvibes.com/blog/wp-content/uploads/euro2008.png" alt="" width="322" height="290" /></p>
<p>The user-contributed <a href="http://eco.netvibes.com/widgets/240582/travel-guides-by-triptouch">TripTouch widge</a>t also features a light strip of image at the top and 4 photos at the bottom, fine details which help to personalize the widget, and consequently let the user identifying it quicker in his page.</p>
<p><img class="aligncenter size-full wp-image-151" title="triptouch" src="http://dev.netvibes.com/blog/wp-content/uploads/triptouch.png" alt="" width="322" height="399" /></p>
<p>There are many other examples of great-looking widgets in <a href="http://eco.netvibes.com/">Ecosystem</a>. We&#8217;ll make regular posts on widget design and inspiration, so that as to give you fresh ideas and make your widgets look always better.</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=It%27s%20easy%20to%20have%20a%20good-looking%20widget&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F&amp;t=It%27s%20easy%20to%20have%20a%20good-looking%20widget" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F&amp;title=It%27s%20easy%20to%20have%20a%20good-looking%20widget" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F&amp;title=It%27s%20easy%20to%20have%20a%20good-looking%20widget" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F&amp;title=It%27s%20easy%20to%20have%20a%20good-looking%20widget" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F&amp;title=It%27s%20easy%20to%20have%20a%20good-looking%20widget" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F&amp;title=It%27s%20easy%20to%20have%20a%20good-looking%20widget" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F06%2F24%2Fits-easy-to-have-a-good-looking-widget%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2008/06/24/its-easy-to-have-a-good-looking-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Life-cycle of UWA widget development</title>
		<link>http://dev.netvibes.com/blog/2008/05/23/life-cycle-of-uwa-widget-development/</link>
		<comments>http://dev.netvibes.com/blog/2008/05/23/life-cycle-of-uwa-widget-development/#comments</comments>
		<pubDate>Fri, 23 May 2008 09:01:10 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ecosystem]]></category>
		<category><![CDATA[platforms]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[uwa]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=130</guid>
		<description><![CDATA[A question has been recently asked on the Developers Forum, which might warrant a longer answer: &#8220;How should we handle the release of our widget?&#8221;
I&#8217;ll expand my answer into a longer &#8220;development cycle of a UWA widget&#8221; of sort&#8230;
Development
UWA widget should be built by following the documented guidelines - which are also available as a single [...]]]></description>
			<content:encoded><![CDATA[<p>A question has been recently asked <a href="http://dev.netvibes.com/forum/viewtopic.php?id=928">on the Developers Forum</a>, which might warrant a longer answer: &#8220;How should we handle the release of our widget?&#8221;</p>
<p>I&#8217;ll expand <a href="http://dev.netvibes.com/forum/viewtopic.php?pid=3847#p3847">my answer</a> into a longer &#8220;development cycle of a UWA widget&#8221; of sort&#8230;</p>
<h3>Development</h3>
<p>UWA widget should be built by following the <a href="http://dev.netvibes.com/doc/">documented guidelines</a> - which are also available as a single page for those who only want a reference, not the full explanation. The <a href="http://dev.netvibes.com/blog/2007/11/15/preview-the-uwa-cheat-sheet/">UWA cheat-sheet</a> is also a way of having it all at a quick glance.</p>
<p>Always keep in mind <a href="http://dev.netvibes.com/doc/uwa_monopage#things_to_remember">the most important parts</a>, among which those three are make-or-break:</p>
<ul>
<li>UTF-8</li>
<li>Well-formed XML</li>
<li>Netvibes namespace</li>
</ul>
<p><img class="aligncenter size-full wp-image-131" title="uwa-header" src="http://dev.netvibes.com/blog/wp-content/uploads/uwa-header.png" alt="Typical header for a UWA widget" width="412" height="161" /></p>
<h3>Test</h3>
<p>There are a handful of successive ways to test your widget.</p>
<ol>
<li>Offline, by loading the widget file directly in your browser. This is where the JavaScript and CSS emulation files will help you make sure your data is well-displayed.<br />
Also, if you are using Ajax requests, make sure to have a local proxy <a href="http://dev.netvibes.com/doc/uwa_faq#how_to_emulate_the_netvibes_ajax_proxy_on_my_web_server">such as this basic one</a> for local testing. Remember that an XML issue prevents list preferences to be properly displayed in standalone mode.</li>
<li><img class="alignright size-full wp-image-132" title="uwa-listpref-standalone" src="http://dev.netvibes.com/blog/wp-content/uploads/uwa-listpref-standalone.png" alt="What a \" width="363" height="112" />Online, by uploading your widget to a web server (along with it&#8217;s images and the proxy, if needed), loading its URL in your browser, and checking that everything is fine. This is still standalone mode, so list preferences will probably not work, but now that your widget is online, you can test it further thanks to the two buttons located below the widget: the first one adds it to Netvibes, the second one to iGoogle.</li>
<li><img class="alignright size-full wp-image-133" title="netvibes-igoogle-buttons" src="http://dev.netvibes.com/blog/wp-content/uploads/netvibes-igoogle-buttons.png" alt="Buttons to add the widget in Netvibes and iGoogle." width="99" height="58" />Within Netvibes. This is the first online test that should be done, since if it doesn&#8217;t work in Netvibes, there&#8217;s little chance it will elsewhere. Log-in to Netvibes, add the UWA Module from the Essential Widgets menu, and add your widget&#8217;s URL in its preference.<br />
If all goes well, it should display your widget properly. The good thing is that if your XML code is not well-formed, it will tell you where.</li>
<li>Once it works properly in Netvibes, test it elsewhere! Add it to iGoogle, add it to your Opera browser using the <a href="http://dev.netvibes.com/files/opera/UWA-Opera.zip">UWA Opera widget</a>, add it to your Mac OS S Dashboard using the <a href="http://dev.netvibes.com/files/UWA-Widget.wdgt.zip">UWA Dashboard widget</a>! Browse to your Netvibes account <a href="http://iphone.netvibes.com/">from your iPhone</a>!<br />
It works everwhere? Great, go to the next step!<br />
If not, double-check your code, visit the forum, search the <a href="http://dev.netvibes.com/doc/uwa_faq">UWA FAQ</a>, the <a href="http://dev.netvibes.com/doc/howto">how-tos</a> and the <a href="http://dev.netvibes.com/doc/uwa_specification/uwa_issues">known issues</a>&#8230;</li>
<li><img class="size-full wp-image-134 alignright" title="eco-links" src="http://dev.netvibes.com/blog/wp-content/uploads/eco-links.png" alt="Links from Ecosystem to the supported platforms." width="297" height="170" />It&#8217;s time to add your widget to Ecosystem, since this is where you will be able to add and test it with further platforms, once your widget is validated: direct downloads for Windows Vista, Apple Dashboard and Opera; direct links for Netvibes, Windows Live.com and iGoogle&#8230;</li>
</ol>
<p>If all goes well, consider your widget fully tested and ready to launch! Congratulations <img src='http://dev.netvibes.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Release</h3>
<p>Now comes the initial question: how to release a widget? There are many ways to do so, based on the fact that you have two URLs for your widget: its Ecosystem URL (once it is validated), and its direct URL to your server.</p>
<p>In this respect, each situation is unique, and decision should be made according to your own inner methods. We of course advise to give a link the Ecosystem URL, since this is where users are able to add to all present and future supported platforms, with no action from your part &#8211; apart from keeping the widget&#8217;s file on your server.</p>
<p>You may also want to have a more customized page, on your own server. This is possible, as long as you use the links provided by Ecosystem for your widget: each platform compiler is on Ecosystem, and you won&#8217;t be able to propose Vista or Dashboard version without these. Apart from the link, you are free to redesign it as you see fit.</p>
<p>Thirdly, you may just want to offer direct access to the standalone widget on your server, and from there on let the use add to Netvibes or iGoogle if they want to. There again, just relying on the URLs provided by Ecosystem should keep you safe.</p>
<p>Note that once your widget is validated in Ecosystem, it&#8217;s also available with Netvibes internal search engine &#8211; given a few hours to update the cache. So that&#8217;s one less release issue to take care of.</p>
<h3>Update</h3>
<p>Code changes, and so will your widget. But that doesn&#8217;t mean you will have to resubmit your widget to Ecosystem &#8211; or even, to take any action beyond updating your file. Indeed, Ecosystem simply acts as a linker to your widget file on your server: nothing is stored on our side, and so does any instance of your widget on the user&#8217;s page. You are therefore responsible of keeping the file available.</p>
<p>There are two cases of updates:</p>
<ol>
<li>Simply updating the file. New users will automatically get the new version from Ecosystem, and Netvibes users will automatically get the new version too, with their preferences intact. Easiest update path there is&#8230;</li>
<li>Updating the file and moving it to another directory/domain (or just renaming the file). Ecosystem and user&#8217;s pages will still point to the older URL, so you have to make it so this changes. <br />
On Ecosystem&#8217;s side, just go to the widget&#8217;s administration page (in the <em>My Widgets</em> tab at the top), and update its URL accordingly.<br />
Handling existing users is trickier: you have to make them re-install the widget with the new URL. The best way would be to keep the older widget file at the original URL, and add a message to its content letting the user know that an update is available and that they should use it instead &#8211; pointing to the updated Ecosystem page. After some time, you may dispose of the older version/URL when you feel it&#8217;s safe.<br />
If you just change the URL without notification to existing users, understand that you may lose their trust&#8230;</li>
</ol>
<div><img class="aligncenter size-full wp-image-135" title="eco-admin-links" src="http://dev.netvibes.com/blog/wp-content/uploads/eco-admin-links.png" alt="Widget administration links in Ecosystem" width="420" height="100" /></div>
<div style="text-align: center;"><em><small>Admin links for an Ecosystem item: Edit, Delete, Put offline.</small></em></div>
<div>So basically, we advise to keep the widget&#8217;s URL as stable as possible, and failing that, to act as a good service provider would do <img src='http://dev.netvibes.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<h3>Deletion</h3>
<p>Sometimes you don&#8217;t feel like supporting them anymore, or they have been bested by some other widget, or your interests have moved on to other things. While we understand the many reasons involved in the idea of killing a widget, we must urge you to understand that it&#8217;s a loss for any user that came to rely on it daily. Before doing anything irreparable, please consider giving it&#8217;s support to another developer, and letting it be of use to its users, current and future.</p>
<p>If your decision is final, the steps are few. Connect to Ecosystem and simply click the red cross button to delete the associated widget. No new user will be able to use it. For current users, you may choose to keep the widget on your server, since it doesn&#8217;t do much harm there, and just put the widget offline in Ecosystem to prevent further users.<br />
But if you intend to also delete the file, please consider backing it up first (because you never know), and please add a warning message for your users, advising them on finding an alternative, and maybe giving them an ETA.</p>
<h3>Conclusion</h3>
<p>This is just one way of seeing the life-cycle of a widget. Please consider them as best-practice, or even guidelines, but these are not the only way to act, just the one we envision ideally. You will probably build your own life-cycle as you develop more widgets. We just hope this post has been useful to devise your own path.</p>
<p>Don&#8217;t hesitate to let us know about your habits in the comments.</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Life-cycle%20of%20UWA%20widget%20development&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F&amp;t=Life-cycle%20of%20UWA%20widget%20development" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F&amp;title=Life-cycle%20of%20UWA%20widget%20development" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F&amp;title=Life-cycle%20of%20UWA%20widget%20development" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F&amp;title=Life-cycle%20of%20UWA%20widget%20development" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F&amp;title=Life-cycle%20of%20UWA%20widget%20development" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F&amp;title=Life-cycle%20of%20UWA%20widget%20development" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F05%2F23%2Flife-cycle-of-uwa-widget-development%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2008/05/23/life-cycle-of-uwa-widget-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using UWA&#8217;s JSON Feed format</title>
		<link>http://dev.netvibes.com/blog/2008/04/11/using-uwas-json-feed-format/</link>
		<comments>http://dev.netvibes.com/blog/2008/04/11/using-uwas-json-feed-format/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 16:21:49 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[getfeed]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[uwa]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=125</guid>
		<description><![CDATA[UWA provides a fair number of built-in Ajax methods:

UWA.Data.getXmlwhen you want to get XML data (including well-formed XHTML), and be able to parse it using XML&#8217;s DOM properties and methods (parentNode, childNodes, attributes, getElementsByTagName, etc.),
UWA.Data.getTextwhen you just want to get the data in plain text, and maybe parse it using a regexp,
UWA.Data.getJsonwhen you want to safely [...]]]></description>
			<content:encoded><![CDATA[<p>UWA provides a fair number of built-in <a href="http://dev.netvibes.com/doc/uwa_specification/ajax_examples">Ajax methods</a>:</p>
<ul>
<li><code>UWA.Data.getXml</code><br/>when you want to get XML data (including well-formed XHTML), and be able to parse it using XML&#8217;s DOM properties and methods (<code>parentNode</code>, <code>childNodes</code>, <code>attributes</code>, <code>getElementsByTagName</code>, etc.),</li>
<li><code>UWA.Data.getText</code><br/>when you just want to get the data in plain text, and maybe parse it using a regexp,</li>
<li><code>UWA.Data.getJson</code><br/>when you want to safely get JSON data, and parse it using regular JavaScript methods and properties.</li>
<li><code>UWA.Data.getFeed</code><br/>when you want to get a syndication feed (RSS, Atom, anything&#8230;).</li>
<li><code>UWA.Data.request</code><br/>when you want to go one step further (<code>POST</code> request with parameters, authentication, cache handling&#8230;)</li>
</ul>
<p>Among these, one method is very useful for a given purpose, but sometimes misunderstood: <code>UWA.Data.getFeed</code>. This particular method has been built to ease the use of the many variations of syndication feeds into one handy format: our very own <a href="http://dev.netvibes.com/doc/uwa_specification/uwa_json_feed_format">JSON Feed Format</a> &#8211; which is rendered in JSON, as you might have guessed.</p>
<p>By rendering just any feed format into one easily-parseable one, <code>UWA.Data.getFeed</code> relieves developer from the pain of have to deal with the various versions of RSS, for instance.</p>
<p>The part that is not always understood, however, is the resulting JSON format &#8211; the one received in the first argument of the callback method. This format is not a tag-by-tag conversion of the Atom format, for instance, into JSON &#8211; no direct xml2json converter here. </p>
<p>And therefore, developers who are used to deal with feeds do not find their usual tagnames. UWA&#8217;s JSON Feed Format does not have an <code>entry</code> tag for each post, nor a <code>summary</code> tag for a given post&#8217;s content, as in Atom ; likewise, it doesn&#8217;t use the respective RSS2.0&#8217;s equivalent <code>item</code> and <code>description</code>. Instead of that, any feed is rendered with posts available in an <code>items</code> array, and their summary/description tucked in a <code>content</code> variable.</p>
<p>For clarity&#8217;s sake, let&#8217;s make a small comparison table between a selection of equivalent values in RSS 2.0, Atom 1.0 and the JSON Feed Format (from top to bottom):</p>
<ul>
<li>Getting to the first item: <br/>rss-><code>channel-&gt;item[0]</code> <br/><code>feed-&gt;entry[0]</code> <br/><code>feed.items[0]</code></li>
<li>Current item&#8217;s title: <br/><code>item-&gt;title</code> <br/><code>entry-&gt;title</code> <br/><code>item.title</code></li>
<li>Current item&#8217;s content: <br/><code>item-&gt;description</code> <br/><code>entry-&gt;summary</code> <br/><code>item.content</code></li>
<li>Current item&#8217;s permalink: <br/><code>item-&gt;link</code> (or <code>item-&gt;guid</code> with <code>isPermalink</code> attribute set to <code>true</code>) <br/><code>entry-&gt;link</code> <br/><code>item.link</code></li>
<li>Current item&#8217;s date: <br/><code>item-&gt;pubDate</code> <br/><code>entry-&gt;updated</code> <br/><code>item.date</code></li>
<li>Current item&#8217;s enclosure: <br/><code>item-&gt;enclosure</code> <br/><code>item-&gt;link</code> (with <code>rel="enclosure"</code>) <br/><code>item.enclosures[0].url</code> </li>
</ul>
<p>Because of this disparity, some developers have chosen to use <code>UWA.Data.getXml</code> in order to parse the data using XML&#8217;s DOM, and therefore be able to use tag names they know. It works ; however, we feel they&#8217;d be much better of using a data format that is built to be used with JavaScript.</p>
<p>Fortunately, the way to handle feeds using the JSON Feed format <a href="http://dev.netvibes.com/doc/howto/build_a_rss_reader">is documented</a>. Here is the gist of it:</p>
<p>First, we instantiate the JS containing object, with an empty <code>feed</code> variable (that shall later contain the whole JSON data), and we trigger the <code>UWA.Data.getFeed</code> method directly from the <code>widget.onLoad</code> method&#8230;</p>
<pre>
<code>MyWidget = {};
MyWidget.feed = null;

widget.onLoad = function() {
  UWA.Data.getFeed(
    'http://feeds.feedburner.com/NetvibesDevNetBlog'),
    MyWidget.display);
}</code>
</pre>
<p>&#8230;and then, the heart of it all, where we parse the <a href="http://dev.netvibes.com/doc/uwa_specification/uwa_json_feed_format">JSON Feed Format</a>: </p>
<pre>
<code>MyWidget.display = function(feed) {
  if (feed) MyWidget.feed = feed;

  var feedList = widget.createElement('ul');
  feedList.className = 'nv-feedList';

  for(var i=0; i &lt; MyWidget.feed.items.length; i++) {
    var item = MyWidget.feed.items[i];
    var li = widget.createElement('li');

    var a = widget.createElement('a');
    a.href = item.link;
    a.innerHTML = item.title;
    a.title = item.content.stripTags().truncate(255)

    li.appendChild(a);
    feedList.appendChild(li);
  }
  widget.setBody(feedList);
}</code>
</pre>
<p>(<em>notice that we use the <a href="http://dev.netvibes.com/doc/uwa_templates/feed_list">FeedList template</a>, simply by the <code>nv-feedList</code> class-name</em>)</p>
<p>As you can see, it&#8217;s much easier to parse feed data using regular JavaScript code, than applying the tedious and longish XML DOM methods. Have a go at it, and find imaginative ways to use feeds!</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Using%20UWA%27s%20JSON%20Feed%20format&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F&amp;t=Using%20UWA%27s%20JSON%20Feed%20format" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F&amp;title=Using%20UWA%27s%20JSON%20Feed%20format" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F&amp;title=Using%20UWA%27s%20JSON%20Feed%20format" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F&amp;title=Using%20UWA%27s%20JSON%20Feed%20format" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F&amp;title=Using%20UWA%27s%20JSON%20Feed%20format" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F&amp;title=Using%20UWA%27s%20JSON%20Feed%20format" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F11%2Fusing-uwas-json-feed-format%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2008/04/11/using-uwas-json-feed-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ginger’s new functionalities for UWA developers (part 2)</title>
		<link>http://dev.netvibes.com/blog/2008/04/08/gingers-new-functionalities-for-uwa-developers-part-2/</link>
		<comments>http://dev.netvibes.com/blog/2008/04/08/gingers-new-functionalities-for-uwa-developers-part-2/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 10:41:02 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ginger]]></category>
		<category><![CDATA[star]]></category>
		<category><![CDATA[starring]]></category>
		<category><![CDATA[uwa]]></category>
		<category><![CDATA[widget.addStar]]></category>

		<guid isPermaLink="false">http://dev.netvibes.com/blog/?p=118</guid>
		<description><![CDATA[Those of you have chosen to make the switch to Ginger (yay!) instead of staying with the older Coriander version (boo!) are surely now familiar with the Activities tabs, and its sections: My private activity, My public activity, and Friends activity.

The first one lets you keep track of the widgets and feeds you have added/removed [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you have chosen to make the switch to Ginger (yay!) instead of staying with the older Coriander version (boo!) are surely now familiar with the Activities tabs, and its sections: My private activity, My public activity, and Friends activity.</p>
<p><img class="aligncenter size-full wp-image-120" title="Netvibes top-bar" src="http://dev.netvibes.com/blog/wp-content/uploads/nv-topbar.png" alt="" width="364" height="24" /></p>
<p>The first one lets you keep track of the widgets and feeds you have added/removed recently ; the second one gives you the latest links you starred (using the starring functionality of the FeedReader, for instance) ; the third and last one merges all your contacts&#8217; public activities, which means that you can get all the links they recently starred.</p>
<p><img class="aligncenter size-full wp-image-121" title="nvtop-public2" src="http://dev.netvibes.com/blog/wp-content/uploads/nvtop-public2.png" alt="" width="500" height="187" /></p>
<p><em>Above: Public activity</em></p>
<p><img class="aligncenter size-full wp-image-122" title="nvtop-friends2" src="http://dev.netvibes.com/blog/wp-content/uploads/nvtop-friends2.png" alt="" width="500" height="187" /></p>
<p><em>Above: Friends activity </em></p>
<p>This public/private starring functionality gives you a social-bookmarking tool to play with, for your private links or to share with your friends and contacts.</p>
<p>Now you might be telling yourself, &#8220;it&#8217;s all fine and dandy, but it would be even better to be able to star items from my own widget.&#8221; And right you are.</p>
<p>So, without any further ado, here&#8217;s the method to implement, in order to get a URL from your widget, into the user&#8217;s public timeline &#8211; and henceforth, into other users&#8217; &#8220;friends activity&#8221; timeline:</p>
<pre><code>widget.addStar(
  {
  'title':'The title for the starred link',
  'url':'http://www.example.org/',
  'comment':'pre-fill the comment here'
  });</code></pre>
<p>Once this method is triggered, it pops up a window within Netvibes, which lets you specify where you want that link saved (private or public timeline), and add a comment (personal reminder or quick summary for your followers, depending of the context):</p>
<p><img class="aligncenter size-full wp-image-123" title="nv-starring" src="http://dev.netvibes.com/blog/wp-content/uploads/nv-starring.png" alt="" width="500" height="319" /></p>
<p>Once validated, a confirmation windows pops in and fades out, and your link is available in the chosen timeline:</p>
<p><img class="aligncenter size-full wp-image-124" title="nv-starring2" src="http://dev.netvibes.com/blog/wp-content/uploads/nv-starring2.png" alt="" width="500" height="86" /></p>
<p>The new <code>addStar()</code> method is only available starting with the Ginger release of Netvibes, and cannot work from another UWA-supported platform ; so when writing your code, you should pay attention to check if it is indeed available, and work around it if not. For instance, see how the starring-specific <a href="http://nvmodules.typhon.net/maurice/uwa-starit/">Star It!</a> widget is doing it:</p>
<pre>
<code>if (typeof widget.environment.netvibes == "undefined"
  || typeof widget.addStar == "undefined" ) {
  alert('This widget can only be used with Netvibes Ginger');
} else {
  widget.addStar({'title':Star.title, 'url':Star.url});
}</code>
</pre>
<p>If you know how to make use of JavaScript events, this starring functionality can be made to look a lot nicer than a plain HTML form. See for instance the <a href="http://eco.netvibes.com/widgets/205178/ffffound">FFFFOUND widget</a>, from which you can star a picture by clicking on the little yellow star that appears when the mouse rolls over a picture. Read its <a href="http://nvmodules.typhon.net/maurice/uwa-ffffound/">source code</a>. The interesting part is this one:</p>
<pre>
<code>if (!widget.readOnly) {
  if (typeof widget.environment.netvibes == "undefined"
    || typeof widget.addStar == "undefined" ) {
    //cannot star
  } else {
    var span = widget.createElement('span');
    span.className = 'star';
    span.innerHTML = _("Star");
    span.onclick = function(e) {
      var a = this.parentNode.firstChild;
      e.stopPropagation();
      widget.addStar({'title':a.innerHTML, 'url':a.href});
      return false;
    };
    li.appendChild(span);
  }
}</code>
</pre>
<p>Try it out! It&#8217;s really not hard to implement it, and most widget could use it in inventive ways!</p>
<p>Share this post:</p>
<p>	<a rel="nofollow" target="_blank" href="mailto:?subject=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29&amp;body=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F" title="E-mail this story to a friend!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" href="javascript:window.print();" title="Print this article!"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/printer.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Netvibes"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="" title="Twitter"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F&amp;t=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29" title="Facebook"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F&amp;title=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29" title="Digg"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F&amp;title=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29" title="Reddit"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F&amp;title=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29" title="del.icio.us"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F&amp;title=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29" title="blogmarks"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F&amp;title=Ginger%E2%80%99s%20new%20functionalities%20for%20UWA%20developers%20%28part%202%29" title="description"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a><br />
	<a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Fdev.netvibes.com%2Fblog%2F2008%2F04%2F08%2Fgingers-new-functionalities-for-uwa-developers-part-2%2F" title="Wikio"><img src="http://dev.netvibes.com/blog/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.netvibes.com/blog/2008/04/08/gingers-new-functionalities-for-uwa-developers-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
