Back from JavaOne Russia 2013

I just get back from JavaOne Russia that was held in Moscow 23-24 April 2013. JavaOne Russia is the biggest Java Conferences in Eastern Europe. The conference organization was great and there were a lot of attendees in the conference sessions.
I had the chance to present “JSF Mashups in Action” in 24 April:

"JSF Mashups in Action" session

“JSF Mashups in Action” session

I would really like to thanks all the attendees of my session, they really made the session very interactive. I also appreciate the nice feedback that I got either verbally or from the tweets about the session:
Tweets

I uploaded my JavaOne Russia 2013 session in speakerdeck.com, It is attached below:

Have a nice time

Speaking in JavaOne Russia 2013

JavaOne Russia

JavaOne Russia

The next Wednesday, Apr 24, 16:45 – 17:45, I will be speaking in JavaOne Russia about [CON1112] JSF Mashups in Action. The session will be practical, I will talk about Mashup development, common Mashup scenarios, and the current challenges of developing Mashups. I will explain how to utilize the JSF powerful component-oriented architecture and its 2.x Ajax capabilities in order to overcome most of these challenges for creating rich Mashups. In the session, I will build many interactive Web 2.0 Mashups to show how it is possible to create rich Mashups in the JavaServer Faces world with the least required Java and JavaScript code. I wish that all of you will enjoy the session. My session will be held in San Francisco Hall, Crocus Expo International Exhibition Center, Moscow:
http://eng.crocus-expo.ru/exhibitioncenter/aboutcenter.php.

Personally, it is my first time to visit Moscow, beside enjoying technical stuff, I would like to visit some tourist places in Moscow such as kremlin and Moscow Red square and may be other interesting places, any suggestions 🙂 ?

I really wish to see all of you there in JavaOne Russia!

Parsing ATOM/RSS feeds from JavaScript code using Dojo

One of the most common requirements is to parse RSS and ATOM feeds from the JavaScript code. In this post, I show you how to parse both RSS and ATOM feeds from your JavaScript code using Dojo.

Parsing ATOM feed

The next code listing is an example which loads and parses the ATOM feed from the "atom.xml" file that contains an ATOM XML.

<script type="text/javascript">
dojo.addOnLoad(function() {
	  var resultPanelID = "resultPanel";
	  
	  // Parse ATOM feed
	  dojo.xhrGet({
	     url: "atom.xml",
	     preventCache: true,
	     handleAs: "xml",
 	     load: function(xmlDoc, ioArgs){		 
	         var i = 0;
	         var output = "";
	      
	         var node = xmlDoc.getElementsByTagName("feed").item(0);
	     
	         if (node == null) {
		         console.debug("ATOM XML format is corrupted ...");		    	     
	    	     return;
	         }
	     
	         var entriesLength = node.getElementsByTagName("entry").length;
	     
			 for (i = 0; i < entriesLength; ++i) {
				var entry = node.getElementsByTagName('entry').item(i);
			 	
				var title = entry.getElementsByTagName('title').item(0).firstChild.data;
			 	var published = entry.getElementsByTagName('published').item(0).firstChild.data;			
			 	var summary = entry.getElementsByTagName('summary').item(0).firstChild.data;
			 	var link = entry.getElementsByTagName('link').item(0).getAttribute("href");
			 	
				output += '<hr><p><a target="_blank" href="' + link +'">' + title + '</a><br/>' + 
					      '<span class="smaller">' + published + '</span><br/>' + 
					      summary +
					      '</p>';
			 }
			 
		     document.getElementById(resultPanelID).innerHTML = output; 	    	
         },
         error: function(error, ioArgs){		         
	         dojo.byId(resultPanelID).innerHTML = "Error loading atom feed";
	         console.debug("failed xhrGet for ATOM URL: ", error, ioArgs);	         
    	 }
	});
});	
</script>

<div id="resultPanel"></div>

The code listing gets all the <entry> elements in the ATOM feed then gets some of the child elements of the <entry> element which are the <title>, <published>, <summary>, and <link> elements and then displays their values in the "resultPanel" DIV element.

Parsing RSS feed

The next code listing is an example which loads and parses the RSS feed from the "rss.xml" file that contains an RSS XML.

<script type="text/javascript">
dojo.addOnLoad(function() {
	  var resultPanelID = "resultPanel";
	  
	  // Parse Rss Feed
	  dojo.xhrGet({
	     url: "rss.xml",
	     preventCache: true,
	     handleAs: "xml",
	     load: function(xmlDoc, ioArgs){		 
	         var i = 0;
	         var output = "";
	      
	         var node = xmlDoc.getElementsByTagName("channel").item(0);
	     
	         if (node == null) {
		         console.debug("RSS XML format is corrupted ...");	  		    	     
	    	     return;
	         }
	     
	         var entriesLength = node.getElementsByTagName("item").length;
			 
			 for (i = 0; i < entriesLength; ++i) {
				var entry = node.getElementsByTagName('item').item(i);
			 	
				var title = entry.getElementsByTagName('title').item(0).firstChild.data;
			 	var published = entry.getElementsByTagName('pubDate').item(0).firstChild.data;			
			 	var description = entry.getElementsByTagName('description').item(0).firstChild.data;
			 	var link = entry.getElementsByTagName('link').item(0).firstChild.data;
			 	
				output += '<hr><p><a target="_blank" href="' + link +'">' + title + '</a><br/>' + 
					      '<span class="smaller">' + published + '</span><br/>' + 
					      description +
					      '</p>';
			 }
			 	
		     document.getElementById(resultPanelID).innerHTML = output; 	    	
       },
       error: function(error, ioArgs){	         
	         dojo.byId(resultPanelID).innerHTML = "Error loading Rss feed";
	         console.debug("failed xhrGet for Rss URL: ", error, ioArgs);	  	         
  	   }	  
	});
});	
</script>

<div id="resultPanel"></div>

The code listing gets all the <item> elements in the RSS feed then gets some of the child elements of the <item> element which are the <title>, <pubDate>, <description>, and <link> elements and then displays their values in the "resultPanel" DIV element.