<?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>Bandos&#039; Arcade &#187; SOA</title>
	<atom:link href="http://www.nuwanbando.com/tag/soa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nuwanbando.com</link>
	<description>&#34;It&#039;s not about how it is, but how I see it &#34; - Stranger Than Fiction</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Events notification (presentation) using WSO2 technologies</title>
		<link>http://www.nuwanbando.com/2012/01/events-notification-using-wso2-technologies/</link>
		<comments>http://www.nuwanbando.com/2012/01/events-notification-using-wso2-technologies/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 15:49:15 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[eventing]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[pub-sub]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=810</guid>
		<description><![CDATA[The post is about creating a dashboard to display event notifications using few of WSO2 Technologies. Requirement : Capture events from an event sender and display it in a dashboard Used Technologies : WSO2 Enterprise Service Bus, WSO2 Application Server, WSO2 Gadget Server Architecture : In brief, events are generated randomly, ESB will act as an event sink, and it [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2012%2F01%2Fevents-notification-using-wso2-technologies%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2012%2F01%2Fevents-notification-using-wso2-technologies%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The post is about creating a dashboard to display event notifications using few of WSO2 Technologies.</p>
<p><span style="text-decoration: underline;">Requirement</span> : Capture events from an event sender and display it in a dashboard</p>
<p><span style="text-decoration: underline;">Used Technologies</span> : <a href="http://wso2.com/products/enterprise-service-bus/" target="_blank">WSO2 Enterprise Service Bus</a>, <a href="http://wso2.com/products/application-server/" target="_blank">WSO2 Application Server</a>, <a href="http://wso2.com/products/gadget-server/" target="_blank">WSO2 Gadget Server</a></p>
<p><span style="text-decoration: underline;">Architecture</span> : In brief, events are generated randomly, ESB will act as an event sink, and it will publish the events to the subscribed parties (to a service deployed in WSO2 AS). There is a gadget deployed in WSO2 Gadget Server where it will poll the received events from the service periodically.</p>
<p style="text-align: center;"><a href="http://www.nuwanbando.com/wp-content/uploads/2012/01/demo-12.png"><img class="aligncenter  wp-image-819" title="demo-12" src="http://www.nuwanbando.com/wp-content/uploads/2012/01/demo-12.png" alt="" width="538" height="425" /></a></p>
<p style="text-align: left;"><span style="text-decoration: underline;">HOWTO</span> :</p>
<p style="text-align: left;"><span style="text-decoration: underline;">The ESB</span></p>
<p style="text-align: left;">At the ESB end we will have to set up the event sink as following,</p>
<p><script src="https://gist.github.com/1653037.js?file=synapse.xml"></script></p>
<p style="text-align: left;">
<p>Then you need to create a topic in the ESB and subscribe the created service. Steps in doing so is documented <a href="http://docs.wso2.com/display/ESB/Sample+1+Introduction+to+Eventing+and+Event+Mediator" target="_blank">here</a></p>
<p><span style="text-decoration: underline;">The Service</span></p>
<p>A very simple service to accumulate the events (this is not at all production grade, who whats to keep all the event in memory <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p><script src="https://gist.github.com/1653077.js?file=TrafficEventReceiverService.java"></script></p>
<p><span style="text-decoration: underline;">The Client</span></p>
<p>Its too long to post, you can check it at <a href="https://gist.github.com/1653062">https://gist.github.com/1653062</a></p>
<p>You can run the client like &#8220;<em>ant trafficevent -Dtrpurl=http://localhost:8280 -Devent=traffic.is.crazy</em>&#8221;</p>
<p><span style="text-decoration: underline;">The Gadget</span><br />
<script src="https://gist.github.com/1653079.js?file=TrfficEventGadget.xml"></script><br />
<span style="text-decoration: underline;">In Action</span></p>
<p style="text-align: center;"><a href="http://www.nuwanbando.com/wp-content/uploads/2012/01/gs1.png"><img class="aligncenter  wp-image-823" title="gs" src="http://www.nuwanbando.com/wp-content/uploads/2012/01/gs1.png" alt="" width="565" height="466" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2012/01/events-notification-using-wso2-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meet me at WSO2Con 2011</title>
		<link>http://www.nuwanbando.com/2011/08/meet-me-at-wso2con-2011/</link>
		<comments>http://www.nuwanbando.com/2011/08/meet-me-at-wso2con-2011/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 13:30:11 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSO2Con]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=675</guid>
		<description><![CDATA[WSO2Con 2011 is a technical and IT-Biz conference organized by WSO2 inc, and 2011 is its second consecutive time. Last year the conference concluded grandly and it discussed many technical topics such as enterprise computing, cloud, web services security, enterprise data etc. It concluded with a great panel discussion on the topic &#8220;A Walk Down [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2011%2F08%2Fmeet-me-at-wso2con-2011%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2011%2F08%2Fmeet-me-at-wso2con-2011%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://wso2.com/events/wso2con-2011-colombo/" target="_blank">WSO2Con 2011</a> is a technical and IT-Biz conference organized by <a href="http://wso2.com" target="_blank">WSO2 inc</a>, and 2011 is its second consecutive time. Last year the conference concluded grandly and it discussed many technical topics such as enterprise computing, cloud, web services security, enterprise data etc. It concluded with a great panel discussion on the topic &#8220;A Walk Down Memory Lane: XML, Web Services &amp; SOA from 1990 to 2010&#8243; and the panelists were some of the <a href="http://wso2.com/events/wso2con-2010-colombo/abstracts/" target="_blank">renowned personalities</a> in XML Web services space.</p>
<p>So the conference is back this year, and it will be on September 12th to 16th at Waters Edge Colombo, There will be two tutorial sessions (12th and 16th) and the conference will span for three days (13th, 14th and 15th). <a href="http://wso2.com/events/wso2con-2011-colombo/agenda/" target="_blank">The agenda</a> was recently announced officially, and it surely looks interesting. I guess if you are into Distributed Computing, SOA and Cloud this would be the right place to and the event to be apart of.</p>
<p><img class="aligncenter" title="WSO2Conf" src="http://b.content.wso2.com/wp-content/themes/wso2ng-v3/images/wso2con2011-p2-banner.png" alt="WSO2Conf" width="670" height="150" /></p>
<p>Also am quite proud to blog about that I will also be <a href="http://wso2.com/events/wso2con-2011-colombo/speakers#nuwan" target="_blank">one of the speakers</a> in the 2011 conference, The topic I submitted was &#8220;User interfaces in distributed environments&#8221; and later I altered it to &#8220;Users: The SOA Last Mile&#8221; to make it broader.</p>
<p>Main reason for this topic is that I have done some resent work close to the Users of information systems and about delivering information to users effectively and efficiently, I believe I can talk about it, and maybe give some insight about How important the &#8220;Last Mile&#8221; is. Anyhow I don&#8217;t wona write about What I will be talking, coz mainly its still a blank paper for me too <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>So yeah what I wanted to say is that WSO2Con will be happening on September in Colombo, and I have no doubt that it will be one great tech Conf with a great set of talks and workshops, so hope to see you there soon !!!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2011/08/meet-me-at-wso2con-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSO2 Stratos &#8211; A true cloud story</title>
		<link>http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/</link>
		<comments>http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 08:37:15 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[PaaS]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[WSO2 Stratos]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=479</guid>
		<description><![CDATA[Stratos Services Yesterday (1st of June), A little over a 12 developer team at WSO2, took a great middle-ware platform in to the cloud. It&#8217;s not just putting all our server products on an EC2 instance, but embedding all cloud-native features into them. The PaaS (Platform as a Service) is named as WSO2 Stratos, which [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F06%2Fwso2-stratos-a-true-cloud-story%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F06%2Fwso2-stratos-a-true-cloud-story%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div class="mceTemp">
<dl id="attachment_492" class="wp-caption alignleft" style="width: 306px;">
<dt class="wp-caption-dt"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/06/products1.png"><img class="size-full wp-image-492" title="products" src="http://www.nuwanbando.com/wp-content/uploads/2010/06/products1.png" alt="" width="296" height="354" /></a></dt>
<dd class="wp-caption-dd">Stratos  Services</dd>
</dl>
</div>
<p>Yesterday (1st of June), A little over a 12 developer team at WSO2, <a href="http://samisa-abeysinghe.blogspot.com/2010/06/six-weeks-and-12-people-magic.html">took a great middle-ware platform in to the cloud</a>. It&#8217;s not just putting all our server products on an EC2 instance, but embedding all <a href="http://pzf.fremantle.org/2010/05/cloud-native.html">cloud-native</a> features into them. The <a href="http://en.wikipedia.org/wiki/Platform_as_a_service">PaaS</a> (Platform as a Service) is named as WSO2 Stratos, which is based on award winning WSO2 Carbon middle-ware platform. As the Alpha-1 release, Stratos offers number of WSO2 products integrated, namely <a href="http://wso2.com/products/governance-registry">Governance Registry (GREG)</a>, <a href="http://wso2.com/products/identity-server">Identity Server (IS)</a>, <a href="http://wso2.com/products/business-activity-monitor">Business Activity Monitor (BAM)</a>, <a href="http://wso2.com/products/mashup-server">Mashup Server (MS)</a> and <a href="http://wso2.com/products/gadget-server">WSO2 Gadget Server (GS)</a>.</p>
<p>Stratos is also offered as a downloadable version for the private cloud within your enterprise. If you are quite serious about using SOA for your enterprise and do not need to worry about deployment, scalability and server maintenance, Stratos would be the ideal solution for you.</p>
<p><img class="alignnone" src="http://lh6.ggpht.com/_Ni8BgaCmQow/TAUt8ch38JI/AAAAAAAAAUg/C1TTIWkAvco/%5BUNSET%5D.png?imgmax=800" alt="" width="193" height="42" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Scraping &amp; Parsing HTML to XML in Javascript</title>
		<link>http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/</link>
		<comments>http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 19:55:50 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google gadgets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>
		<category><![CDATA[WSO2 Mashup Server]]></category>
		<category><![CDATA[Mashup]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=412</guid>
		<description><![CDATA[Today I was working on a customer POC and happened to create few Google gadgets to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fweb-scraping-parsing-html-to-xml-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fweb-scraping-parsing-html-to-xml-in-javascript%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Today I was working on a customer POC and happened to create few <a href="http://code.google.com/apis/gadgets/">Google gadgets</a> to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling gadget which pushed the search parameters to other two gadgets. The two content gadgets showed UK (1) primary school information and (2) electoral information. The pushed parameter was the postal code of different parts of UK. The <a href="http://www.direct.gov.uk/en/index.htm" target="_blank">direct.gov.uk</a> has a form based implementation of this.</p>
<p><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/Screenshot.png"><img class="size-medium wp-image-413 alignleft" title="Screenshot" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/Screenshot-241x300.png" alt="" width="241" height="300" /></a></p>
<p>The Requirements for the POC was, simple and we already had working samples of <a href="http://wso2.org/library/articles/2010/03/wso2-gadget-server-inter-gadget-communication-pubsub" target="_blank">such a scenario</a> at WSO2 library.</p>
<ol>
<li>Show how one gadget can pass the context to other gadgets</li>
<li>How gadgets can harvest data in various formats (in my previous post I explained on how to get data from RDF endpoints, which are also available in *.gov.uk sites)</li>
</ol>
<p>The building blocks for the implementation was the search url, which was quite straight forward. for all the requests based on postal codes the direct.gov site served in the same manner (because of this important fact, the automation process became trivial). for an instance the url for primary school information retrial was,</p>
<p><a href="http://local.direct.gov.uk/LDGRedirect/LocationSearch.do?LGSL=13&amp;searchtype=1&amp;LGIL=8&amp;Style=&amp;formsub=t&amp;text=SE1+7DU" target="_blank">http://local.direct.gov.uk/LDGRedirect/LocationSearch.do?LGSL=13&amp;searchtype=1&amp;LGIL=8&amp;Style=&amp;formsub=t&amp;text=<strong>SE1+7DU</strong></a></p>
<p>Where the param &#8220;text&#8221; changed according to the postal code. So far everything seemed straight forward, however at implementation, while using <a href="http://code.google.com/apis/gadgets/docs/dev_guide.html">Gadgets API</a> for content retrial, I faced problems in parsing text with javascript. Hence the <a href="http://code.google.com/apis/opensocial/docs/0.7/reference/gadgets.io.html#makeRequest" target="_blank">gadgets.io.makeRequest </a>supported HTML as text and the API method returned the retrieved HTML document as string making it quite impossible to process.</p>
<p>With some thinking and advise, I brought the <a href="http://wso2.com/products/mashup-server/">Mashup Server</a> in to the picture and used it to retrieve the data from the gov site and returned the result in XML format. Using the Mashup Server web scraping seems to be a piece of cake, We created a simple mashup using the scraper host-object and captured the result set in the search result page. The mashup code as follows,</p>
<pre class="js" name="code">
function search(searchUrl) {
	var scraper = new Scraper(
		<config>
		    <var-def name="url">{searchUrl}</var-def>
			<var-def name="response">
			    <xpath expression="//div[@id='bodyContent']//ul[@class='resultsList']/li/a">
				<html-to-xml>
				   <http method='get' url='${url}'/>
				</html-to-xml>
			     </xpath>
			</var-def>
		</config>
	);
	return new XMLList(scraper.response);
}
</pre>
<p>And finally the two gadgets were making service calls to the mashup service and retrieved the data as an XML object, making the data processing painless. The final version at the Gadget Server looked quite appealing.</p>
<div id="attachment_427" class="wp-caption aligncenter" style="width: 829px"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/gs.png"><img class="size-large wp-image-427 " title="gs" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/gs-1024x509.png" alt="WSO2 Gadget Server with UK gov data" width="819" height="407" /></a><p class="wp-caption-text">Gadget Server look - in the end</p></div>
<p>Special thanks goes to <a href="http://ruchirawageesha.blogspot.com/">Ruchira</a> for helping me out with the mashup service <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You can <a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/wso2gs-samples.zip">download</a> the Gadget code and the Mashup service and try the scenario yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mashing up RDF data with WSO2 Mashup Server</title>
		<link>http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/</link>
		<comments>http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 20:27:21 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[Semantic web]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>
		<category><![CDATA[Mashup]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSO2 Mashup Server]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=341</guid>
		<description><![CDATA[Okey so this is the fun part that I promised to write about . I managed to cook up a use-case to demonstrate RDF querying and making use of the semantic data. The data that I am using for querying, is the rdf data sources available in the UK data.gov site. With some analysis I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fmashing-up-rdf-data-with-wso2-mashup-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fmashing-up-rdf-data-with-wso2-mashup-server%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Okey so this is the fun part that I promised to write about <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . I managed to cook up a use-case to demonstrate RDF querying and making use of the semantic data. The data that I am using for querying, is the rdf data sources available in the UK data.gov site. With some analysis I figured out that this task can be fundamentally archived using the combination of Mashup and Gadget Technologies. My choice of tools were <a href="http://wso2.com/products/mashup-server/">WSO2 Mashup Server</a> and <a href="http://wso2.com/products/gadget-server/">WSO2 Gadget Server</a> for their great flexibility and of cause for other obvious reasons <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . However the Mashup Server does not natively support RDF data retrieval, hence I had to do some work to get such functionality integrated. The great fact about the mashup server is its extensibility, the <a href="http://en.wikipedia.org/wiki/WSO2_Mashup_Server">concept of host objects</a> and the ability to write custom host objects and its pluggable nature comes handy in such cases. The high level architecture of what I am trying to achieve is as follows.</p>
<div id="attachment_348" class="wp-caption aligncenter" style="width: 850px"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/rdf.png"><img class="size-full wp-image-348" style="background-color: #ffffff;" title="rdf" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/rdf.png" alt="" width="840" height="262" /></a><p class="wp-caption-text">RDF data retrival with WSO2 Mashup server / WSO2 Gadget Server</p></div>
<p style="text-align: left;">To implement the above architecture with the tools at hand I created a <a href="http://wso2.org/library/tutorials/writing-custom-hostobjectttp://" target="_blank">custom host object</a> that can be plugged to the Mashup Server. When dealing with semantic web related tasks and RDF data handling HP&#8217;s <a href="http://jena.sourceforge.net/" target="_blank">Jena</a> java library comes in handy. With the use of <a href="http://openjena.org/ARQ/">Jena-ARQ</a> (for <a href="http://en.wikipedia.org/wiki/SPARQL" target="_blank">SPARQL</a>) api I managed to get the host object working with few lines of code.</p>
<p style="text-align: left;">
<pre name="code" class="java">.....
            Dataset dataSet = DatasetFactory.create(sparqlObject.rdfDataSource);
            // Create a new query form a given user query
            String queryString = sparqlObject.spaqrlQuery;
            Query query = QueryFactory.create(queryString);
            QueryExecution qe = QueryExecutionFactory.create(query, dataSet);
            ResultSet results = qe.execSelect();
.....
           resultString = ResultSetFormatter.asXMLString(results);
..... OR.....
           ByteArrayOutputStream bos = new ByteArrayOutputStream();
           ResultSetFormatter.outputAsJSON(bos, results);
</pre>
<p style="text-align: left;">With the host object in place, the next task was to create a Mashup in-order to query the rdf data with a given source (EndPoint or data source). The javascript service (Mashup) is created to serve this purpose, where the consumer can specify the RDF endpoint or the data source with the SPARQL query and retrieve the dataset in XML or JSON.</p>
<pre name="code" class="js">.....
function RdfDocQueryService(rdfDataSource, rdfQuery, resultType) {
   var sparqlObj = new SparqlHostObject();
   sparqlObj.rdfDataSource = rdfDataSource;
   sparqlObj.spaqrlQuery = rdfQuery;
   sparqlObj.resultType = resultType;
   return new XML(sparqlObj.getDataFromRdfSource());
}
</pre>
<p>Finally to bind everything together, lets try querying some data. My example usecase is to use the query at <a href="http://blogs.talis.com/n2/archives/836" target="_blank">N2 blog</a> to retrieve traffic monitoring points in UK roads. The query to retrieve the data set as follows,</p>
<pre name="code" class="sql">#List the uri, latitude and longitude for road traffic monitoring points on the M5
PREFIX road:
PREFIX rdf:
PREFIX geo:
PREFIX wgs84:
PREFIX xsd:
SELECT ?point ?lat ?long WHERE {
  ?x a road:Road.
  ?x road:number "A4"^^xsd:NCName.
  ?x geo:point ?point.
  ?point wgs84:lat ?lat.
  ?point wgs84:long ?long.
}
</pre>
<p>To visualize these points I have created a gadget with the aid of Google Maps api. This gadget can be hosted in the Gadget Server, where it can dynamically retrieve traffic monitoring points for each road in the UK and display them in the map as follows.</p>
<p style="text-align: center;">
<div id="attachment_362" class="wp-caption aligncenter" style="width: 841px"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/WSO2-Gadget-Server_1271189245784.png"><img class="size-full wp-image-362" title="WSO2 Gadget Server_1271189245784" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/WSO2-Gadget-Server_1271189245784.png" alt="" width="831" height="414" /></a><p class="wp-caption-text">Traffic points in A4 road, UK</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Authoring, deploying and using XML Gadgets in WSO2 Gadget Server</title>
		<link>http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/</link>
		<comments>http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 11:39:16 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Shindig]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=251</guid>
		<description><![CDATA[We are about to release The long awaited WSO2 Gadget Server within few days of time. These few days I was doing some documentation and content writing about the Gadget Server, Apache Shindig and Google gadgets specification. My 1st article about authoring gadgets is now published on WSO2 Oxygen Tank as a help/Tutorial for Gadget [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fauthoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fauthoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://code.google.com/apis/gadgets/images/landing_07_01_files/gadget_1.gif" alt="" width="100" height="100" /><img style="margin-left: 10px;" src="http://code.google.com/apis/gadgets/images/landing_07_01_files/gadget_2.gif" alt="" width="100" height="100" /><img style="margin-left: 10px;" src="http://code.google.com/apis/gadgets/images/landing_07_01_files/gadget_3.gif" alt="" width="100" height="100" /><a href="http://wso2.com/wp-content/themes/wso2ng-v2/images/logos/gs_logo_h42.gif"><img style="margin-left: 10px;" src="http://wso2.com/wp-content/themes/wso2ng-v2/images/logos/gs_logo_h42.gif" alt="" /></a></p>
<p>We are about to release The long awaited <a href="http://wso2.org/projects/gadget-server" target="_blank">WSO2 Gadget Server</a> within few days of time. These few days I was doing some documentation and content writing about the Gadget Server, Apache Shindig and Google gadgets specification. <a href="http://wso2.org/library/articles/first-step-towards-wso2-gadget-server-authoring-deploying-u++sing-xml-gadgets" target="_blank">My 1st article about authoring gadgets</a> is now published on <a href="http://wso2.org">WSO2 Oxygen Tank</a> as a help/Tutorial for Gadget server users. You can also download the Gadget Server <a href="http://bit.ly/7svU4O" target="_blank">release candidate 2</a> and play with it. Also Paul had written an <a href="http://pzf.fremantle.org/2009/12/portal.html" target="_blank">interesting article</a> about portals and Gadgets Server&#8217;s role.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Shindig talk at Apache Con Asia 09</title>
		<link>http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/</link>
		<comments>http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 09:54:03 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=244</guid>
		<description><![CDATA[As I have mentioned in some previous post, today I did a talk about Apache shindig and its use cases (WSO2 Gadget Server) at Apache Con 09 with my Colleague Tyrell. So without writing about the whole talk let me share the presentation slides. The Talk turned up great, audience were quite interested, too bad [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fapache-shindig-talk-at-apache-con-asia-09%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fapache-shindig-talk-at-apache-con-asia-09%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As I have mentioned in some previous post, today I did a talk about Apache shindig and its use cases (WSO2 Gadget Server) at Apache Con 09 with my Colleague Tyrell. So without writing about the whole talk let me share the presentation slides. The Talk turned up great, audience were quite interested, too bad we had very limited time and missed to do a demo. <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div style="width:425px;text-align:left; margin-left: 60px;" id="__ss_2646975;"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=shindig-apachecon-asia-09-091204001804-phpapp02&#038;stripped_title=shindig-apachecon-asia-09" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=shindig-apachecon-asia-09-091204001804-phpapp02&#038;stripped_title=shindig-apachecon-asia-09" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/nuwanbando">Nuwan Bandara</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The SOA Workshop day</title>
		<link>http://www.nuwanbando.com/2009/09/the-soa-workshop-day/</link>
		<comments>http://www.nuwanbando.com/2009/09/the-soa-workshop-day/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 15:59:48 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=217</guid>
		<description><![CDATA[Today was &#8220;THE Workshop Day&#8221; for WSO2 folks, an event organized by WSO2 with an intention to make an awareness of SOA building blocks. I was (proudly ) among the audience as a WSO2 crew member, listening to all the tech talks of my collogues. It was a great session we had today, starting from [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F09%2Fthe-soa-workshop-day%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F09%2Fthe-soa-workshop-day%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Today was &#8220;THE Workshop Day&#8221; for WSO2 folks, an event organized by <a href="http://wso2.com/">WSO2</a> with an intention to make an awareness of SOA building blocks. I was (proudly <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) among the audience as a WSO2 crew member, listening to all the tech talks of my collogues. It was a great session we had today, starting from <a href="http://pzf.fremantle.org/">Paul&#8217;s</a> introduction to SOA  and until <a href="http://www.asankama.com/">Asanka&#8217;s</a> talk about enterprise SOA pattern&#8217;s. The whole set of talks took me back in time where I was reading about SOA concepts for my bachelor&#8217;s thesis. If I had experienced this workshop then, life would have been much easier <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .</p>
<p>Guys,.. cheers !! for a job well done <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><center><img class="aligncenter size-medium wp-image-218" title="com-workshop-banner" src="http://www.nuwanbando.com/wp-content/uploads/2009/09/com-workshop-banner-300x126.jpg" alt="com-workshop-banner" width="300" height="126" /></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/09/the-soa-workshop-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing custom queries to retrieve data from WSO2 Governance Registry</title>
		<link>http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/</link>
		<comments>http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 11:58:55 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[G-reg]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=176</guid>
		<description><![CDATA[WSO2 Governance Registry is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fcustom-queries-to-retrieve-data-from-wso2-governance-registry%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fcustom-queries-to-retrieve-data-from-wso2-governance-registry%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://wso2.org/projects/governance-registry">WSO2 Governance Registry</a> is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature helps immensely when you use the registry for non-standard tasks. For me I had to do some pagination work for the comments that belongs to a particular resource, hence my approach was to write few custom quires to get the job done. The code is as follows.</p>
<pre name="code" class="java">
	/**
	 * Returns a chunk of comments
	 *
	 * @param resPath	Path to the comment
	 * @param start		The beginning index
	 * @param size		Size of the chunk
	 * @return			an array of comments
	 */
 public Comment[] getCommentSet(String resPath, int start, int size) {
		Registry registry = null;
		try {
			registry = ; // get an instance of the registry 

			Resource comQuery = registry.newResource();

                        // The Sql Statement
			String sql = "SELECT REG_COMMENT_ID FROM REG_RESOURCE_COMMENT RC, REG_RESOURCE R, REG_PATH P WHERE "
					+ "RC.REG_VERSION=R.REG_VERSION AND "
					+ "R.REG_NAME=? AND "
					+ "P.REG_PATH_VALUE=? AND "
					+ "P.REG_PATH_ID=R.REG_PATH_ID LIMIT ?, ?";

			// Set SQL statement as the resource content
                        comQuery.setContent(sql);

                       // Setting the media type and properties
			comQuery.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
			comQuery.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME, RegistryConstants.COMMENTS_RESULT_TYPE);

			registry.put("system/myQueries/query", comQuery);
                 String resourceName = "testResource";
                 String pathToResource = "/system/myResources"

			Map<String, String> params = new HashMap<String, String>();

                        //Setting the parameters
			params.put("1", resourceName);
			params.put("2", pathToResource);
			params.put("3", start);
			params.put("4", size);

                       // Executing the SQL statement
			Collection qResults = registry.executeQuery("system/myQueries/query", params);

			String[] qPaths = (String[]) qResults.getContent();

			Comment[] comments = new Comment[qPaths.length];
                        // Loading the comment data to comment object array
			for (int i = 0; i < qPaths.length; i++) {
				if (registry.resourceExists(qPaths[i])) {
					comments[i] = (Comment) registry.get(qPaths[i]);
				}
			}

			return comments;

		} catch (Exception e) {
			String errorMsg = "Backend server error - could not get comment set";
			log.error(new MyTestException(errorMsg, e));
			return null;
		}

	}
</pre>
<p>Yeah simple as that you get your resources set without much effort. A big thank goes to <a href="http://www.dimuthu.org/">Dimuthu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best of SOA Summer School</title>
		<link>http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/</link>
		<comments>http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 16:07:09 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=160</guid>
		<description><![CDATA[During this entire summer, WSO2 conducted a series of trainings on SOA best practices, How-Tos and trends, titled &#8220;SOA Summer School&#8220;. With the dawn of the autumn the series of online summer classes came to an end. With the popular demand, a 3 hour session is going to be held tomorrow the 13th August summarizing [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fbest-of-soa-summer-school%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fbest-of-soa-summer-school%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>During this entire summer, <a href="http://www.wso2.com" target="_blank">WSO2</a> conducted a series of trainings on SOA best practices, How-Tos and trends, titled &#8220;<a href="http://wso2.org/training/best_soa_summer_school_encore_session" target="_blank">SOA Summer School</a>&#8220;. With the dawn of the autumn the series of online summer classes came to an end. With the popular demand, a 3 hour session is going to be held tomorrow the 13th August summarizing the 8 weeks of lessons and highlighting their key areas.<br/><br />
<img class="aligncenter" title="summer sschool" src="http://wso2.org/files/ot_ss_banner.jpg" alt="" width="608" height="219" /><br/><br />
<img class="size-full wp-image-161 aligncenter" title="Untitled" src="http://www.nuwanbando.com/wp-content/uploads/2009/08/Untitled.png" alt="Untitled" width="640" height="400" /><br/><br />
for a better insight I have attached tomorrow&#8217;s agenda, and it is conducted by <a href="http://samisa-abeysinghe.blogspot.com/">Samisa Abeysinghe</a>, <a href="http://blog.ruwan.org/">Ruwan Linton</a>, <a href="http://psiriwardena.blogspot.com/">Prabath Siriwardena</a>, <a href="http://www.keith-chapman.org/">Keith Chapman</a> and <a href="http://nandikaj.blogspot.com/">Nandika Jayawardena</a>. The online trainings are totally free and any one who is interested in SOA and EA can gain a good knowledge of its dynamics.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

