<?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; java</title>
	<atom:link href="http://www.masteringwave.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masteringwave.com</link>
	<description>Google Wave Made Easy</description>
	<lastBuildDate>Sun, 08 Aug 2010 13:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<cloud domain='www.masteringwave.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>WaveCalender 3: RatingBot</title>
		<link>http://www.masteringwave.com/2009/12/wavecalender-3-ratingbot/</link>
		<comments>http://www.masteringwave.com/2009/12/wavecalender-3-ratingbot/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 11:55:53 +0000</pubDate>
		<dc:creator>Daniel Graversen</dc:creator>
				<category><![CDATA[WaveCalender]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[poll]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/?p=568</guid>
		<description><![CDATA[Rating Bot is a simpel robot which helps with creating voting in best Web 2.0 style where you can vote on each blip. The robot is made by Przemysław Gajda. You can add the robot using the address: rating-bot@appspot.com An example on where the robot has been used is on the picture bellow. The idea [...]


No related posts.

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-3-ratingbot%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F12%2Fwavecalender-3-ratingbot%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p style="margin-top: 0.5em; margin-bottom: 0.5em;"><a href="http://wave-samples-gallery.appspot.com/about_app?app_id=74011">Rating Bot</a> is a simpel robot which helps with creating voting in best Web 2.0 style where you can vote on each blip. The robot is made by Przemysław Gajda. </p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em;">You can add the robot using the address: rating-bot@appspot.com</p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em;">An example on where the robot has been used is on the picture bellow.</p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em;"><img class="alignnone size-full wp-image-569" title="ratingbot" src="http://www.masteringwave.com/wp-content/uploads/2009/12/ratingbot.png" alt="ratingbot" width="483" height="403" /></p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em; text-align: left;">The idea of being able to rate each blip is rather smart. It will make it to vote for ideas described in a full blip. So this links a lot to the <a href="http://www.masteringwave.com/2009/12/wavecalender-2-poll-gadget/">polling </a>gadget from yesterday. It does thou vote for different blips. So this will be use full when you have more to choose from.</p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em; text-align: left;">It is possible for a person only to cast one vote for each blip. The way this has been implemented is by using annotation to store each persons vote. I have always used the Cache storage for handling metadata and then linked it to the wave or blip. But using annotations can make it easier to persist data. Then everything is stored in just one place. It would also be possible for other robots to interact with the data created.</p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em; text-align: left;">You can have a look at the Java code behind the gadget at <a href="http://code.google.com/p/ratingbot/source/browse/trunk/src/pl/pgajda/ratingbot/RatingBotServlet.java">code.google.com</a>. I could learn a little from the way this code is structured.</p>
<p style="margin-top: 0.5em; margin-bottom: 0.5em; text-align: left;">


<p>No related posts.</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-3-ratingbot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blip debug robot</title>
		<link>http://www.masteringwave.com/2009/09/blip-debug-robot/</link>
		<comments>http://www.masteringwave.com/2009/09/blip-debug-robot/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 20:52:40 +0000</pubDate>
		<dc:creator>Daniel Graversen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[annotations]]></category>
		<category><![CDATA[blips]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/2009/09/blip-debug-robot/</guid>
		<description><![CDATA[In the last post I created a screencast of how a debug session, which showed which annotations is created. Now I have posted the robot so it is possible for others to start using the robot. This will allow all users to investigate how the annotations work. I hope it will help you to gain [...]


No related posts.

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%2Fblip-debug-robot%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F09%2Fblip-debug-robot%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>In the <a href="http://www.masteringwave.com/2009/09/google-wave-annotations/">last</a> post I created a screencast of how a debug session, which showed which annotations is created.</p>
<p>Now I have posted the robot so it is possible for others to start using the robot. This will allow all users to investigate how the annotations work. I hope it will help you to gain some more knowledge on how annotations work.</p>
<p>Simply add the robot with the name <a href="mailto:BlipDebug@appspot.com">BlipDebug@appspot.com</a> to you wave, and start modify your application. Just be careful and not add the robot to any large waves. This robot is quite disturbing and should only be used for testing purposes.</p>
<p>The Java code to the robot is in the <a href="http://code.google.com/p/masteringwave/source/browse/">code.google.com</a> repository.</p>
<p>The robot is now approved in the <a href="http://wave-samples-gallery.appspot.com/about_app?app_id=30011">sample gallery</a>.</p>


<p>No related posts.</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/blip-debug-robot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Wave annotations</title>
		<link>http://www.masteringwave.com/2009/09/google-wave-annotations/</link>
		<comments>http://www.masteringwave.com/2009/09/google-wave-annotations/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:44:05 +0000</pubDate>
		<dc:creator>Daniel Graversen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[annotations]]></category>
		<category><![CDATA[blips]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[robots]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/?p=216</guid>
		<description><![CDATA[Annotations (com.google.wave.api.Annotation) is a key concept to understand, when you are developing robots, how should understand the content of a robot. I have created a screencast, where I show how the annotations are changed because of the editing. I have found the following types of annotations. user/d/key identifies that the user is on the blib [...]


No related posts.

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%2Fgoogle-wave-annotations%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F09%2Fgoogle-wave-annotations%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://wave-robot-java-client.googlecode.com/svn/trunk/doc/index.html">Annotations</a> (com.google.wave.api.Annotation) is a key concept to understand, when you are developing robots, how should understand the content of a robot.
</p>
<p>I have created a screencast, where I show how the annotations are changed because of the editing.
</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/shRqsjMPJXc&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/shRqsjMPJXc&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>I have found the following types of annotations.
</p>
<ul>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>user/d/key </strong></span>identifies that the user is on the blib and is in edit mode
</li>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>user/e/key </strong></span>identifies where the users cursor is only the from selection counts.
</li>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>user/r/key </strong></span>identifies the selection the user has created with start and end. The user will still have his curser at a place in the blip.
</li>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>style/fontWeight</strong> identify if the selection is bold</span>
		</li>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>style/textDecoration </strong></span>can be used to add line through<strong><br />
			</strong></li>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>style/color </strong></span>is the color of the selected text<strong><br />
			</strong></li>
<li><span style="color:black; font-family:Arial; font-size:10pt"><strong>lang</strong>  identifies the language of a region. There can be multiply different languages in a blip.</span>
		</li>
</ul>
<p>There are probably a number of different style markings, which you will have to find your self.
</p>
<p>Key is probably a hash of the user address. </p>


<p>No related posts.</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/google-wave-annotations/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Gadget and Robots interaction</title>
		<link>http://www.masteringwave.com/2009/09/gadget-and-robots-interaction/</link>
		<comments>http://www.masteringwave.com/2009/09/gadget-and-robots-interaction/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 20:09:19 +0000</pubDate>
		<dc:creator>Daniel Graversen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[gadget]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/?p=174</guid>
		<description><![CDATA[In some instances you want to have the robots and gadgets to interact. A scenario where it could make sense is, when the user wants information about a site. The page which could be showed could be the sales report of the customer or some other information which is of interest to the participants. This [...]


No related posts.

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%2Fgadget-and-robots-interaction%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F09%2Fgadget-and-robots-interaction%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>In some instances you want to have the robots and gadgets to interact. A scenario where it could make sense is, when the user wants information about a site. The page which could be showed could be the sales report of the customer or some other information which is of interest to the participants.
</p>
<p>This tutorial has basis in the <a href="http://www.masteringwave.com/2009/08/creating-a-simple-inline-gadget-to-show-external-web-applications/">Creating A Simple Inline Gadget To Show External Web Applications</a>, which shows how to inline a page into the a wave using a gadget. There is a robot which creates a form for entering the url of the page. When the user press submit the robot adds a gadget which inline the specified url.
</p>
<p>First the robot which inserts the gadget.
</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;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EmbedUrlRobotServlet <span style="color: #000000; font-weight: bold;">extends</span> AbstractRobotServlet <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</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> URLFIELD <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;URL_FIELD&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; <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; &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; &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; &nbsp; &nbsp; &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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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; 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; &nbsp; &nbsp; &nbsp; &nbsp; textView.<span style="color: #006633;">appendMarkup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p&gt;&lt;b&gt;Inline the url&lt;/b&gt;&lt;/p&gt;<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; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aformview+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FormView</span></a> form <span style="color: #339933;">=</span> textView.<span style="color: #006633;">getFormView</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; form.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> FormElement<span style="color: #009900;">&#40;</span>ElementType.<span style="color: #006633;">INPUT</span>, URLFIELD,<span style="color: #0000ff;">&quot;http://&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; form.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> FormElement<span style="color: #009900;">&#40;</span>ElementType.<span style="color: #006633;">BUTTON</span>, <span style="color: #0000ff;">&quot;submit&quot;</span>, <span style="color: #0000ff;">&quot;INSERT&quot;</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 />
<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%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; &nbsp; &nbsp; &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;">FORM_BUTTON_CLICKED</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aformview+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FormView</span></a> form <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: #006633;">getFormView</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; FormElement urlElement <span style="color: #339933;">=</span> form.<span style="color: #006633;">getFormElement</span><span style="color: #009900;">&#40;</span>URLFIELD<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GadgetView gadgetView<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: #006633;">getGadgetView</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; gadgetView.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Gadget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://pollenvarsel.appspot.com/gadget?url=&quot;</span><span style="color: #339933;">+</span>urlElement.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>
 </p>
<p>The robots listens for two event. First the SELF_ADDED which creates the URL form with a text box and a submit button. When the button is pressed a gadget is inserted in to the Blip, with the url of the gadget + the target URL. Probably something should be performed to ensure that the submitted URL is valid and can be sent as a query parameter. Probably a URL encoding should be performed or save the data in the datastorage.
</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">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> doGet<span style="color: #009900;">&#40;</span>HttpServletRequest req, HttpServletResponse resp<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IOException</span></a> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; resp.<span style="color: #006633;">setContentType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;application/xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aprintwriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PrintWriter</span></a> out<span style="color: #339933;">=</span> resp.<span style="color: #006633;">getWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; out.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;?xml version=<span style="color: #000099; font-weight: bold;">\&quot;</span>1.0<span style="color: #000099; font-weight: bold;">\&quot;</span> encoding=<span style="color: #000099; font-weight: bold;">\&quot;</span>UTF-8<span style="color: #000099; font-weight: bold;">\&quot;</span>?&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;Module&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;ModulePrefs title=<span style="color: #000099; font-weight: bold;">\&quot;</span>inline_external_page<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>400<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>800<span style="color: #000099; font-weight: bold;">\&quot;</span>/&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;Content type=<span style="color: #000099; font-weight: bold;">\&quot;</span>html<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;![CDATA[ &quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; &lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>main<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;!--Main container for the iframe--&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; &lt;iframe name=<span style="color: #000099; font-weight: bold;">\&quot;</span>check<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>check<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>100%<span style="color: #000099; font-weight: bold;">\&quot;</span> src =<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</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><span style="color: #009900;">&#41;</span>req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;url&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>100%<span style="color: #000099; font-weight: bold;">\&quot;</span> frameborder=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;p&gt;Your browser does not support iframes .&lt;/p&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;/iframe&gt; &lt;!-- this is where contents of the links are displayed --&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;/div&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;]]&gt;&lt;/Content&gt;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&lt;/Module&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>The code is the same in the original blog it has just been placed into a servlet, to make it possible to have parameters inside. It just inserts the query parameter into the gadget XML.
</p>
<p>The code can be found at <a href="http://code.google.com/p/masteringwave/source/browse/">code.google.com</a>. </p>


<p>No related posts.</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/gadget-and-robots-interaction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>At-Buddy</title>
		<link>http://www.masteringwave.com/2009/08/at-buddy/</link>
		<comments>http://www.masteringwave.com/2009/08/at-buddy/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 09:58:16 +0000</pubDate>
		<dc:creator>melissa</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.masteringwave.com/?p=145</guid>
		<description><![CDATA[When I was just starting to learn Google Wave Robots, I decided to create a robot that replaces the &#8220;at&#8221; phrase to &#8220;@&#8221; since Google does not allow Danish users to create an &#8220;@&#8221; in the current wave implementation. I&#8217;ll give you a walk-through on how I managed to create the &#8220;at-buddy.&#8221; I started this [...]


No related posts.

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%2F08%2Fat-buddy%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.masteringwave.com%2F2009%2F08%2Fat-buddy%2F&amp;source=masteringwave&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>When I was just starting to learn Google Wave Robots, I decided to create a robot that replaces the &#8220;at&#8221; phrase to &#8220;@&#8221; since Google does not allow Danish users to create an &#8220;@&#8221; in the current wave implementation. I&#8217;ll give you a walk-through on how I managed to create the &#8220;at-buddy.&#8221;</p>
<p>I started this robot using the wave robot tutorial which can be found <a title="here" href="http://code.google.com/apis/wave/extensions/robots/java-tutorial.html">here</a>.</p>
<p>What we need to do is to replace the blip&#8217;s text while the user is typing so we need to register the event &#8220;DOCUMENT_CHANGED&#8221; in the capabilities.xml. For more information regarding capabilities.xml, you can refer to this <a href="http://www.masteringwave.com/2009/08/capabilities-xml/">post</a>.</p>
<p>Once the capabilities are updated, we can now catch the event in our servlet. Let&#8217;s insert this in our &#8220;Process Events&#8221; method.</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 />
<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;">DOCUMENT_CHANGED</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>e.<span style="color: #006633;">getModifiedBy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;at-buddy@appspot.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// get event blip</span><br />
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><br />
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 />
<span style="color: #666666; font-style: italic;">// get blip text and replace (at) to @</span><br />
<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: #006633;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//check if text has an &quot;(at)&quot;</span><br />
<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>match<span style="color: #009900;">&#40;</span>strBlip,<span style="color: #0000ff;">&quot;.*<span style="color: #000099; font-weight: bold;">\\</span>([aA][tT]<span style="color: #000099; font-weight: bold;">\\</span>).*&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #666666; font-style: italic;">//if(strBlip.indexOf(&quot;(at)&quot;)&amp;gt;0)</span><br />
<span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//get the index of the first &quot;(at)&quot;</span><br />
<span style="color: #000066; font-weight: bold;">int</span> index <span style="color: #339933;">=</span> strBlip.<span style="color: #006633;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(at)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//replace &quot;(at)&quot; to @</span><br />
textView.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Range<span style="color: #009900;">&#40;</span>index, index<span style="color: #339933;">+</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;@&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>That&#8217;s it! now you can deploy your robot and try it out.</p>


<p>No related posts.</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/08/at-buddy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

