<?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>Mastering WAVE &#187; xml</title>
	<atom:link href="http://www.masteringwave.com/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masteringwave.com</link>
	<description>Google Wave Made Easy</description>
	<lastBuildDate>Wed, 07 Jul 2010 10:17:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='www.masteringwave.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>WaveCalender 14: Wave Extension Installer XML file creator</title>
		<link>http://www.masteringwave.com/2009/12/wavecalender-14-wave-extension-installer-xml-file-creator/</link>
		<comments>http://www.masteringwave.com/2009/12/wavecalender-14-wave-extension-installer-xml-file-creator/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 11:29:20 +0000</pubDate>
		<dc:creator>Daniel Graversen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WaveCalender]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[installer]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/?p=640</guid>
		<description><![CDATA[
			
				
			
		
After a while of strenuous coding and testing, the developer is ready to make his/her work public. But one obstacle still remains for the developer and that is to make the Wave extension Installer.

The Wave extension installer is important as this simplifies the task in installing the app on wave. Because the developer aims his/her [...]


Related posts:<ol><li><a href='http://www.masteringwave.com/2009/12/wavecalender-13-magic-8-ball/' rel='bookmark' title='Permanent Link: WaveCalender 13: Magic 8 Ball'>WaveCalender 13: Magic 8 Ball</a> <small> Struggling with decisions in life? Dilemmas? Wondering what the...</small></li>
<li><a href='http://www.masteringwave.com/2009/12/wavecalender-5-tic-tac-toe/' rel='bookmark' title='Permanent Link: WaveCalender 6: Tic tac toe'>WaveCalender 6: Tic tac toe</a> <small> The Tic Tac Toe game by Sung Wu, is...</small></li>
<li><a href='http://www.masteringwave.com/2009/10/installing-extensions-in-wave/' rel='bookmark' title='Permanent Link: Installing extensions in Wave'>Installing extensions in Wave</a> <small> Extensions are an easy way to distribute you Wave...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></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.masteringwave.com%2F2009%2F12%2Fwavecalender-14-wave-extension-installer-xml-file-creator%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F12%2Fwavecalender-14-wave-extension-installer-xml-file-creator%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>After a while of strenuous coding and testing, the developer is ready to make his/her work public. But one obstacle still remains for the developer and that is to make the Wave extension Installer.
</p>
<p>The Wave extension installer is important as this simplifies the task in installing the app on wave. Because the developer aims his/her work for the public to use, the developer should make everything easy for the users to install and use his/her app. Imagine if you have to make your users learn a scripting language before they can use your app, chances are your users may grow tired of it and may missed the chance of using your app.
</p>
<p><img src="http://www.masteringwave.com/wp-content/uploads/2009/12/121209_1624_WaveCalende2.png" alt=""/>
	</p>
<p>The Wave Extension Installer XML File Creator is an app specifically designed for developers to simplify their work on creating Wave Extension Installers. This app is built on Flex and using the wave-as-client ActionScript Library for Flex. This is a nice app to use for first time developers and to some because after all those strenuous coding and testing, developers may get lazy to create the wave extension installer. With this app, all you have to do is fill out the form, click &#8220;Done&#8221;, and copy the generated XML content. Just remember the app is bigger than a regular size blip so you may have to maximize your wavelet to fully view the app.
</p>
<p>You can try out the app in this gadget XML URL: <a href="http://wave-as-client.googlecode.com/svn/trunk/example/wave_install_creator/web/wave_install_creator.xml"><span style="font-size:7pt">http://wave-as-client.googlecode.com/svn/trunk/example/wave_install_creator/web/wave_install_creator.xml</span></a>
	</p></p>


<p>Related posts:<ol><li><a href='http://www.masteringwave.com/2009/12/wavecalender-13-magic-8-ball/' rel='bookmark' title='Permanent Link: WaveCalender 13: Magic 8 Ball'>WaveCalender 13: Magic 8 Ball</a> <small> Struggling with decisions in life? Dilemmas? Wondering what the...</small></li>
<li><a href='http://www.masteringwave.com/2009/12/wavecalender-5-tic-tac-toe/' rel='bookmark' title='Permanent Link: WaveCalender 6: Tic tac toe'>WaveCalender 6: Tic tac toe</a> <small> The Tic Tac Toe game by Sung Wu, is...</small></li>
<li><a href='http://www.masteringwave.com/2009/10/installing-extensions-in-wave/' rel='bookmark' title='Permanent Link: Installing extensions in Wave'>Installing extensions in Wave</a> <small> Extensions are an easy way to distribute you Wave...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.masteringwave.com/2009/12/wavecalender-14-wave-extension-installer-xml-file-creator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add-Robot</title>
		<link>http://www.masteringwave.com/2009/09/add-robot/</link>
		<comments>http://www.masteringwave.com/2009/09/add-robot/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 10:50:00 +0000</pubDate>
		<dc:creator>joemer</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[datastorage]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/?p=168</guid>
		<description><![CDATA[
			
				
			
		
    A robot which can stores user favorite robots using the JDO data store and add them automatically to the wavelet when it was added as participant.

The basic features of this are to add, delete and view.  When the user enter the command &#8220;#add.robots.save&#8221;
		it&#8217;s save all the current robots in the wavelet and automatically list [...]


Related posts:<ol><li><a href='http://www.masteringwave.com/2009/09/gadget-and-robots-interaction/' rel='bookmark' title='Permanent Link: Gadget and Robots interaction'>Gadget and Robots interaction</a> <small> In some instances you want to have the robots...</small></li>
<li><a href='http://www.masteringwave.com/2009/08/at-buddy/' rel='bookmark' title='Permanent Link: At-Buddy'>At-Buddy</a> <small> When I was just starting to learn Google Wave...</small></li>
<li><a href='http://www.masteringwave.com/2010/03/google-wave-robot-and-gadget-interaction/' rel='bookmark' title='Permanent Link: Google Wave Robot and gadget interaction'>Google Wave Robot and gadget interaction</a> <small> With the new Robot API version 2 is it...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></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.masteringwave.com%2F2009%2F09%2Fadd-robot%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F09%2Fadd-robot%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>    A robot which can stores user favorite robots using the JDO data store and add them automatically to the wavelet when it was added as participant.
</p>
<p>The basic features of this are to add, delete and view.  When the user enter the command &#8220;#add.robots.save&#8221;<strong><br />
		</strong>it&#8217;s save all the current robots in the wavelet and automatically list the current favorite robots. And when users enter &#8220;<span style="font-size:12pt">#add.robots.delete&lt;space&gt;&lt;robotname&gt;&#8221; </span>it will delete that specific robot in the favorite.
</p>
<p><img src="http://www.masteringwave.com/wp-content/uploads/2009/09/090109_1049_AddRobot1.png" alt=""/>
	</p>
<p style="text-align: center">Add Robots Samples
</p>
<p>
 </p>
<p><strong>This Is How We Do It<br />
</strong></p>
<p>    First Create an app engine project name AddRobot and setup the environment for JDO and Robots
</p>
<p>    It is easier if you&#8217;re going to use eclipse with Google plug-in cause some configuration there is auto generated.
</p>
<p>To set up Wave Robots refer to:
</p>
<p>http://code.google.com/apis/wave/extensions/robots/java-tutorial.html
</p>
<p>To set up JDO refer to:
</p>
<p>http://code.google.com/appengine/docs/java/gettingstarted/usingdatastore.html
</p>
<p>    Now we are ready, after setting up the environment. We have to create a datastore where we can save our favorite robots. Be sure that you already have PersistenceManagerFactory (Refer to JDO site above). Now let&#8217;s Create a new class named Robots with properties id, username and robotname with a private identifier and should be annotated with @Persistent to tell DataNucleus to store them as properties of objects in the App Engine datastore. And id should be annotated with @PrimaryKey to set id as primary key. It should be look like this:
</p>
<p><div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.google.addrobots.jdo</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.IdGeneratorStrategy</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.IdentityType</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.PersistenceCapable</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.Persistent</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.PrimaryKey</span><span style="color: #339933;">;</span><br />
@PersistenceCapable<span style="color: #009900;">&#40;</span>identityType <span style="color: #339933;">=</span> IdentityType.<span style="color: #006633;">APPLICATION</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Robots<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; @PrimaryKey<br />
&nbsp; &nbsp; @Persistent<span style="color: #009900;">&#40;</span>valueStrategy <span style="color: #339933;">=</span> IdGeneratorStrategy.<span style="color: #006633;">IDENTITY</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Along+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Long</span></a> id<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; @Persistent<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> userName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; @Persistent<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> robotsName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> Robots<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> userName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> robotsName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">userName</span> <span style="color: #339933;">=</span> userName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">robotsName</span> <span style="color: #339933;">=</span> robotsName<span style="color: #339933;">;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Along+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Long</span></a> getId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> id<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> getUserName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> userName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setUserName<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> userName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">userName</span> <span style="color: #339933;">=</span> userName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> getRobotsname<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> robotsName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setRobotsname<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> robotsName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">robotsName</span> <span style="color: #339933;">=</span> robotsName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
</p>
<p>    Now let&#8217;s begin with the robot, create a servlet let say&#8221; <span style="color:black; font-family:Courier New; font-size:10pt"><span style="background-color:silver">AddRobbotServlet</span>&#8220;</span> that extends the AbstractRobotServlet class (from the com.google.wave.api package) and implement the method processEvents() which accepts a RobotMessageBundle object. As the first functionality of add-robot is to add automatically all the favorite robot to the wavelet, so we need to implement the condition if bundle.wasSelfAdded(). If that returns true it will automatically add all favorite robots as participants of the wavelet, it should be like this:
</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.google.addrobots</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Iterator</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.PersistenceManager</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.Query</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.addrobots.jdo.PMF</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.addrobots.jdo.Robots</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.wave.api.*</span><span style="color: #339933;">;</span><br />
<br />
@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;serial&quot;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> processEvents<span style="color: #009900;">&#40;</span>RobotMessageBundle bundle<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; Wavelet wavelet <span style="color: #339933;">=</span> bundle.<span style="color: #006633;">getWavelet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> creator <span style="color: #339933;">=</span> wavelet.<span style="color: #006633;">getCreator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>bundle.<span style="color: #006633;">wasSelfAdded</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Search if theres existing favorites robots and add it to participants</span><br />
&nbsp; &nbsp; PersistenceManager pm <span style="color: #339933;">=</span> PMF.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPersistenceManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; Query query <span style="color: #339933;">=</span> pm.<span style="color: #006633;">newQuery</span><span style="color: #009900;">&#40;</span>Robots.<span style="color: #000000; font-weight: bold;">class</span>,<span style="color: #0000ff;">&quot;userName == userNameParam&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;query.<span style="color: #006633;">declareParameters</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;String userNameParam&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;List<span style="color: #339933;">&lt;</span>Robots<span style="color: #339933;">&gt;</span> bots<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>Robots<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span> query.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>creator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>bots.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Robots r <span style="color: #339933;">:</span> bots<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wavelet.<span style="color: #006633;">addParticipant</span><span style="color: #009900;">&#40;</span>r.<span style="color: #006633;">getRobotsname</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; pm.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Blip blip <span style="color: #339933;">=</span> wavelet.<span style="color: #006633;">appendBlip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TextView textView <span style="color: #339933;">=</span> blip.<span style="color: #006633;">getDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//append new string to blip for confirmation</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textView.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Favorite Robots has been added as participant&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>    Then for the other adding and deleting command, we need to get what the users input in the blip so we need to use the event type blip submitted. Now we need to compare that words that the user enters on the blip. So were going to create again a condition filtering if the user input if #add-robots.save or #add-robots.delete in the blip. If the user enter #add-robots.save all the robots in the wavelet will be save as favorite that would be look like this:
</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aevent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Event</span></a> e <span style="color: #339933;">:</span> bundle.<span style="color: #006633;">getEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> EventType.<span style="color: #006633;">BLIP_SUBMITTED</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//get event blip</span><br />
&nbsp; &nbsp; Blip blip <span style="color: #339933;">=</span> e.<span style="color: #006633;">getBlip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; TextView textView <span style="color: #339933;">=</span> blip.<span style="color: #006633;">getDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//get blip text</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> strBlip <span style="color: #339933;">=</span> e.<span style="color: #006633;">getBlip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> delimiter <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> temp <span style="color: #339933;">=</span> strBlip.<span style="color: #006633;">split</span><span style="color: #009900;">&#40;</span>delimiter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <br />
<span style="color: #666666; font-style: italic;">//#add-robots.save ivoked</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#add-robots.save&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span> temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;#add-robots.save&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//delete existing robot first before adding new list</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//query to search robots</span><br />
PersistenceManager pm <span style="color: #339933;">=</span> PMF.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPersistenceManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; Query query <span style="color: #339933;">=</span> pm.<span style="color: #006633;">newQuery</span><span style="color: #009900;">&#40;</span>Robots.<span style="color: #000000; font-weight: bold;">class</span>,<span style="color: #0000ff;">&quot;userName == userNameParam&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; query.<span style="color: #006633;">declareParameters</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;String userNameParam&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; List<span style="color: #339933;">&lt;</span>Robots<span style="color: #339933;">&gt;</span> bots<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>Robots<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span> query.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>creator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>bots.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Robots g <span style="color: #339933;">:</span> bots<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//delete robots</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pm.<span style="color: #006633;">deletePersistent</span><span style="color: #009900;">&#40;</span>g<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">//get all participant</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Alist+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">List</span></a> participant <span style="color: #339933;">=</span> wavelet.<span style="color: #006633;">getParticipants</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//get robot from participant check if with a host of appspot.com</span><br />
&nbsp; &nbsp; List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> appspot <span style="color: #339933;">=</span> getAllAppspot<span style="color: #009900;">&#40;</span>participant<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; textView.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//save List to JDO</span><br />
textView.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;All Robots here has been Saved To Favorites <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> bot <span style="color: #339933;">:</span> appspot<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
Robots rob <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Robots<span style="color: #009900;">&#40;</span>creator,bot<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pm.<span style="color: #006633;">makePersistent</span><span style="color: #009900;">&#40;</span>rob<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textView.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span>bot<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pm.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>    Notice that we use Java String method split to get what the input we need from the blip. And notice also that we delete first all existing favorite robot before we add a new favorite, you can create other logic for that but for me that is much easier. Now for deleting our unwanted robot, we will again get the user input and compare if the input #add.robots.delete&lt;space&gt;&lt;robotname&gt; then that specific robot with that name will be deleted. Now let&#8217;s continue with the code:
</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#add-robots.delete&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span> temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;#add-robots.delete&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
PersistenceManager pm <span style="color: #339933;">=</span> PMF.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPersistenceManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; Query query <span style="color: #339933;">=</span> pm.<span style="color: #006633;">newQuery</span><span style="color: #009900;">&#40;</span>Robots.<span style="color: #000000; font-weight: bold;">class</span>,<span style="color: #0000ff;">&quot;userName=='&quot;</span><span style="color: #339933;">+</span>creator<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;' &amp;&amp; robotsName=='&quot;</span><span style="color: #339933;">+</span>temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; List<span style="color: #339933;">&lt;</span>Robots<span style="color: #339933;">&gt;</span> bots<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>Robots<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span> query.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>wavelet.<span style="color: #006633;">getCreator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>bots.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Robots g <span style="color: #339933;">:</span> bots<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">//delete robots</span><br />
pm.<span style="color: #006633;">deletePersistent</span><span style="color: #009900;">&#40;</span>g<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wavelet.<span style="color: #006633;">removeParticipant</span><span style="color: #009900;">&#40;</span>temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; textView.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; textView.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span>temp<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; Has Been Deleted&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #666666; font-style: italic;">//some additional code here for other function</span><br />
<span style="color: #009900;">&#125;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; <br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Now that&#8217;s it, we are finish with the robot servlet. Just read the code comments for its purpose. So it&#8217;s time to create a Servlet Mapping,  you have to map this servlet to the URL path /_wave/robot/jsonrpc, edit the file war/WEB-INF/web.xml so that it looks like this:
</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #00bbdd;">&lt;!DOCTYPE web-app PUBLIC</span><br />
<span style="color: #00bbdd;"> &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;</span><br />
<span style="color: #00bbdd;"> &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;web-app</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/javaee&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> <br />
&nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Servlets --&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AddRobots<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.google.addrobots.AddRobbotServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AddRobots<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/_wave/robot/jsonrpc<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>    And finally This robot needs a configuration file where we can configure the robot capability . From the Package Explorer, create a new folder named war/_wave/, then inside this folder create a file named capabilities.xml with the following contents:
</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;w:robot</span> <span style="color: #000066;">xmlns:w</span>=<span style="color: #ff0000;">&quot;http://wave.google.com/extensions/robots/1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;w:capabilities<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;w:capability</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;BLIP_SUBMITTED&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/w:capabilities<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;w:version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/w:version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/w:robot<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>    As you can see, we use special event BLIP_SUBMITTED.  This work whenever a blip is submitted so our robot can respond to this wave events. Now were done we can test now our robot, you can test your new robot by deploying it to App Engine, then adding it to a wave. Please refer again to the site above.</p>


<p>Related posts:<ol><li><a href='http://www.masteringwave.com/2009/09/gadget-and-robots-interaction/' rel='bookmark' title='Permanent Link: Gadget and Robots interaction'>Gadget and Robots interaction</a> <small> In some instances you want to have the robots...</small></li>
<li><a href='http://www.masteringwave.com/2009/08/at-buddy/' rel='bookmark' title='Permanent Link: At-Buddy'>At-Buddy</a> <small> When I was just starting to learn Google Wave...</small></li>
<li><a href='http://www.masteringwave.com/2010/03/google-wave-robot-and-gadget-interaction/' rel='bookmark' title='Permanent Link: Google Wave Robot and gadget interaction'>Google Wave Robot and gadget interaction</a> <small> With the new Robot API version 2 is it...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.masteringwave.com/2009/09/add-robot/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
