<?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>Vineet Manohar's blog &#187; web 2.0</title>
	<atom:link href="http://www.vineetmanohar.com/category/tech/web20/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vineetmanohar.com</link>
	<description>Java, Web 2.0 and other Tech topics</description>
	<lastBuildDate>Wed, 14 Jul 2010 07:03:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>What is Google TV &#8230; in 2 minutes</title>
		<link>http://www.vineetmanohar.com/2010/05/what-is-google-tv-in-2-minutes/</link>
		<comments>http://www.vineetmanohar.com/2010/05/what-is-google-tv-in-2-minutes/#comments</comments>
		<pubDate>Fri, 21 May 2010 21:57:03 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=1063</guid>
		<description><![CDATA[Google TV is a Smart TV (or set-top box) which aims to seamlessly combine your Internet and TV experience.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/what-is-google-wave-in-plain-simple-english-in-2-minutes/' rel='bookmark' title='Permanent Link: What is Google Wave: in plain simple English in 2 minutes'>What is Google Wave: in plain simple English in 2 minutes</a></li><li><a href='http://www.vineetmanohar.com/2010/02/what-is-google-buzz/' rel='bookmark' title='Permanent Link: What is Google Buzz?'>What is Google Buzz?</a></li><li><a href='http://www.vineetmanohar.com/2009/06/google-introduces-page-speed/' rel='bookmark' title='Permanent Link: Google introduces Page Speed'>Google introduces Page Speed</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2010/05/what-is-google-tv-in-2-minutes/';
var dzone_title = 'What is Google TV &#8230; in 2 minutes';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p><a href="http://www.google.com/tv/" target="_blank">Google TV</a> is a Smart TV (or set-top box) which aims to seamlessly combine your Internet and TV experience. It runs Android OS, Chrome browser and Flash 10. Third party developers can create interesting applications and make them available to end users via an App marketplace.</p>
<p>Google TV aims to take TV viewing experience to the next level, similar to what smart phones (Android, iPhone) did for phones. The key here, in my opinion, is creating a framework and open up the TV-internet application space to third-party developers.</p>
<h3>Summary</h3>
<ul>
<li>Google TV was <a href="http://www.youtube.com/googledevelopers#p/p/B09682344C2F233B/0/ASZbArr7vdI" target="_blank">announced</a> at <a href="http://code.google.com/events/io/2010/" target="_blank">2010 Google I/O</a>, in stores Fall 2010</li>
<li>Google has partnered with Sony (TVs), Intel (atom processor), Best Buy (sales to end users), Dish Network (Set-top box), Logitech (peripherals) and Adobe (Flash player)</li>
<li>Google TV units will be available (in form of TVs and/or Set-top boxes) this fall, well in time for the Christmas season</li>
<li>Runs Android OS, Chrome Browser, Flash 10</li>
<li>Third party developers can write apps and users can download apps via a Marketplace</li>
<li>End users can surf channels on TV as they normally do, and also access relevant internet related apps like Youtube, Picasa and discover apps written by third party developers</li>
<li>Sign up <a href="https://services.google.com/fb/forms/googletvinfo/" target="_blank">here</a> to receive updates about Google TV</li>
</ul>
<p><object width="425" height="355" type="application/x-shockwave-flash" data="http://www.youtube.com/v/diTpeYoqAhc"><param name="movie" value="http://www.youtube.com/v/diTpeYoqAhc" />This video was embedded using the YouTuber plugin by <a href="http://www.roytanck.com">Roy Tanck</a>. Adobe Flash Player is required to view the video.</object></p>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/what-is-google-wave-in-plain-simple-english-in-2-minutes/' rel='bookmark' title='Permanent Link: What is Google Wave: in plain simple English in 2 minutes'>What is Google Wave: in plain simple English in 2 minutes</a></li><li><a href='http://www.vineetmanohar.com/2010/02/what-is-google-buzz/' rel='bookmark' title='Permanent Link: What is Google Buzz?'>What is Google Buzz?</a></li><li><a href='http://www.vineetmanohar.com/2009/06/google-introduces-page-speed/' rel='bookmark' title='Permanent Link: Google introduces Page Speed'>Google introduces Page Speed</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2010/05/what-is-google-tv-in-2-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cache Java webapps with Squid Reverse Proxy</title>
		<link>http://www.vineetmanohar.com/2010/03/cache-java-webapps-with-squid-reverse-proxy/</link>
		<comments>http://www.vineetmanohar.com/2010/03/cache-java-webapps-with-squid-reverse-proxy/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 00:37:19 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[squid]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=132</guid>
		<description><![CDATA[This article shows you step by step how to cache your entire tomcat web application using Squid reverse Proxy without writing any java code. Cache your entire website as static HTML files stored in memory or disk. This technique is useful to when dynamically generated pages in Java are time and CPU intensive. Ideal scenario is when there are high number of reads and few writes. Caution: do not use this approach to cache secure pages. Read article for full details.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/' rel='bookmark' title='Permanent Link: How to automatically recover Tomcat from crashes'>How to automatically recover Tomcat from crashes</a></li><li><a href='http://www.vineetmanohar.com/2010/03/howto-rotate-tomcat-catalina-out/' rel='bookmark' title='Permanent Link: How to rotate Tomcat catalina.out'>How to rotate Tomcat catalina.out</a></li><li><a href='http://www.vineetmanohar.com/2009/12/publishing-to-maven-central-repo-in-5-steps/' rel='bookmark' title='Permanent Link: Publishing to Maven Central Repo in 5 steps'>Publishing to Maven Central Repo in 5 steps</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2010/03/cache-java-webapps-with-squid-reverse-proxy/';
var dzone_title = 'Cache Java webapps with Squid Reverse Proxy';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>This article shows you step by step how to cache your entire tomcat web application with Squid reverse Proxy without writing any java code.</p>
<h2>What is Squid</h2>
<p><a title="Squid official website" href="http://www.squid-cache.org/" target="_blank">Squid</a> is a free proxy server for HTTP, HTTPS and FTP which saves bandwidth and increases response time by caching frequently requested web pages. While squid can be used as a proxy server when users try to download pages from the internet, it can be also used as a reverse-proxy by putting squid between the user and your webapp. All user requests first hit Squid. If the requested page already exists in Squid&#8217;s cache it is served directly from the cache without hitting your Webapp. If the page does not exist in Squid&#8217;s cache, it is fetched from your web application and stored in the cache for future requests.</p>
<p>Squid reduces hits to your server by caching response pages. You don&#8217;t have to worry about building page level caching in every application that your write, Squid takes care of that part.</p>
<h2>When should I use Squid</h2>
<p>Ideally you should use Squid for pages which have a high ratio of reads to writes. In other words, a page that changes less frequently but is accessed very often. Here are some scenarios:</p>
<ul>
<li>A dynamical web page which displays news and is updated once an hour, and receives hundreds of hits during the hour</li>
<li>A static web page accessed freqently. Squid can give performance boost by caching frequently accessed static web pages in memory</li>
</ul>
<h2>When should I not use Squid</h2>
<p>In most cases, if the request URL is the only factor which determines the response then you can safely use Squid. See more specific examples below:</p>
<ul>
<li>If the entire apps is very dynamic in nature, and the validity of pages changes immediately.</li>
<li>Squid is not suitable for apps which require login. This unfortunately is a large number of applications. Such applications need to resort to back end caching, for example use other caching frameworks like Ehcache to cache re-usable page fragments and/or cache database queries and/or other performance bottlenecks.</li>
<li>Apps which heavily use browser cookies. Squid relies on URLs to cache pages. If the page served is computed from URLs + cookies, then you should not cache those pages in Squid.</li>
</ul>
<h2>How does the overall setup work</h2>
<p><div id="attachment_858" class="wp-caption alignnone" style="width: 484px"><img class="size-full wp-image-858 " title="Apache Squid Tomcat architecture" src="http://www.vineetmanohar.com/wp-content/uploads/2010/02/Apache-Squid-Tomcat-architecture1-e1266359786104.png" alt="Apache Squid Tomcat architecture" width="474" height="568" /><p class="wp-caption-text">Apache Squid Tomcat architecture</p></div><br />
Apache receives requests on port 80. Apache calls Squid with the request. Squid checks its cache to see if it has the response cached from before. If yes and if the response is not expired, it returns the cached response.In this case:</p>
<p>Squid will write the following header to the response:</p>
<pre name="code" class="xml">X-Cache: HIT from www.vineetmanohar.com</pre>
<p>If the response is not found in Squid&#8217;s cache, squid will make a call to Tomcat on port 8082. Tomcat&#8217;s proxy connector is listening on this port. It processes the request and sends the response back to Squid. Squid saves the response in its cache, unless caching is disabled for that URL. Squid returns the final response to Apache which sends the response back to the user.</p>
<h2>What if I don&#8217;t want to use Apache</h2>
<p>Using Apache is not required to use Squid. You can run Squid on port 80, and point your users directly to Squid. If that is the case, skip section one and directly jump to section 2 below.</p>
<h2>Step 1/3: Apache Httpd Config</h2>
<p>If you are using Apache as a front end, you need to instruct Apache to forward requests to Squid at port 3128. See the following code snippet. Change the server name and paths to reflect your real values.</p>
<p>Apache config file:</p>
<pre name="code" class="xml">/etc/httpd/conf/httpd.conf</pre>
<pre name="code" class="xml">&lt;VirtualHost x.x.x.x&gt;
ServerName www.vineetmanohar.com
DocumentRoot /home/webadmin/www.vineetmanohar.com/html
# forward requests to squid running on port 3128
ProxyPass / http://localhost:3128/
ProxyPassReverse / http://localhost:3128/
&lt;/VirtualHost&gt;</pre>
<p>In addition to the above, you also need <strong>mod_proxy</strong> installed. If you see the following in your httpd.conf, you probably already have mod_proxy installed. If you first need to <a href="http://www.google.com/search?q=installing+mod_proxy+apache" target="_blank">install mod_proxy</a>.</p>
<pre name="code" class="xml">LoadModule  proxy_module         modules/mod_proxy.so
LoadModule  proxy_http_module    modules/mod_proxy_http.so</pre>
<h2>Step 2/3: Squid Config</h2>
<p>First make sure that Squid is installed on your server. You can download Squid from <a href="http://www.squid-cache.org/Download/" target="_blank">here</a>.</p>
<p>The squid config file on Linux/Unix is located at this location.</p>
<pre name="code" class="xml">/etc/squid/squid.conf</pre>
<p>The config file is pretty long. Follow these instructions and set the values appropriately.</p>
<pre name="code" class="xml"># leave the port to 3128
http_port 3128

# how much memory cache do you want? depends on how much memory you have on the machine
cache_mem 200 MB

# what's the biggest page that you want stored in memory. If you home page is 100 KB and
# you want it stored in memory, you may set it to a number bigger than that.
maximum_object_size_in_memory 100 KB

# how much disk cache do you want. It is 6400 MB in the following example, change it as per
# your needs. Make sure you have that much disk space free.
cache_dir ufs /var/spool/squid 6400 16 256

# this is probably the most important config section. Here you can configure the cache life for
# each URL pattern. 

# Time is in minutes
# 1 day = 1440, 2 days = 2880, 7 days = 10080, 28 days = 40320

# do not cache url1
refresh_pattern ^http://127.0.0.1:8082/url1/           0     20%    0

# cache url2 for 1 day
refresh_pattern ^http://127.0.0.1:8082/url2/        1440     20%    1440 override-expire override-lastmod reload-into-ims ignore-reload

# cache css for 7 days
refresh_pattern ^http://127.0.0.1:8082/css         10080     20%   10080  override-expire override-lastmod reload-into-ims ignore-reload

# by default cache the whole website for 1 minute
refresh_pattern ^http://127.0.0.1:8082/                0     20%       0 override-expire override-lastmod reload-into-ims ignore-reload

# how long should the errors should be cached for. For example 404s, HTTP 500 errors
negative_ttl 0 seconds

# On which host does tomcat run. Set 127.0.0.1 for localhost
httpd_accel_host 127.0.0.1

# this is the proxy port as defined in Tomcat server.xml. By default it is "8082"
httpd_accel_port 8082

# set this to "on". Read more documentation if you want to change this.
httpd_accel_single_host on

# To access Squid stats via the manager interface, you need to enter a password here
cachemgr_passwd your_clear_text_password all

# Say "off" if you want the query string to appear in the squid logs.
strip_query_terms off</pre>
<h2>Step 3/3: Tomcat Config</h2>
<p>Make sure that the HTTP Proxy Connector is defined in <strong>TOMCAT_HOME/conf/server.xml</strong>.</p>
<pre name="code" class="xml">&lt;Service name="Catalina"&gt;</pre>
<pre name="code" class="xml">&lt;Connector port="8082"
 maxThreads="50" minSpareThreads="5" maxSpareThreads="10"
 enableLookups="false" acceptCount="100" connectionTimeout="20000"
 proxyName="www.vineetmanohar.com"
 compressableMimeType="text/html,text/xml,text/css,text/javascript,text/plain" compression="on"
 proxyPort="80" disableUploadTimeout="true" /&gt;</pre>
<p>If needed, see additional documentation on <a href="http://tomcat.apache.org/tomcat-6.0-doc/proxy-howto.html" target="_blank">Tomcat proxy connector</a>.</p>
<h2>Squid Manager Interface</h2>
<p>You can access the Squid config and stats via the Squid Manger HTTP interface. Make sure that the &#8220;cachemgr.cgi&#8221; file which ships with squid installation is in your cgi-bin directory. More documentation on setting that up <a href="http://www.faqs.org/docs/securing/chap28sec235.html" target="_blank">here</a>.</p>
<p>Once you&#8217;ve set it up, you can access the cache manager via this URL:</p>
<pre name="code" class="xml">http://&lt;hostname&gt;/cgi-bin/cachemgr.cgi</pre>
<p>To continue enter the following values:</p>
<pre name="code" class="xml">Cache host: localhost
Cache port: 3128
Manager name: manager
Password: &lt;the value you entered for "cachemgr_passwd" in squid.conf&gt;</pre>
<ul>
<li><strong>Store Directory Stats</strong> shows you how much disk space is used by the disk cache.</li>
<li><strong>Cache Client List</strong> show you the cache HIT/MISS ratio as %. You should monitor this frequently and tune your cache to get a higher hit %.</li>
</ul>
<h2>Reload Squid Config without restarting</h2>
<p>Edit the squid config using &#8220;vi&#8221; or your favorite editor.</p>
<pre name="code" class="xml">vi /etc/squid/squid.conf</pre>
<p>Once you are done editing, reload the new config without restarting Squid.</p>
<pre name="code" class="xml">/usr/sbin/squid -k reconfigure</pre>
<h2>Clearing Squid Cache</h2>
<p>To clear Squid cache:</p>
<p>1) Set the memory cache to 4 MB (or a lower number)</p>
<pre name="code" class="xml">cache_mem 8 MB</pre>
<p>2) Set the disk cache to 8 MB (or a lower number). The disk cache must be higher that the memory cache.</p>
<pre name="code" class="xml">cache_dir ufs /var/spool/squid 20 16 256</pre>
<p>3) Reload squid config without restart as described in the previous section</p>
<p>4) You may need to wait a few hours for the cache to get cleared. Once the cache is clear, you may restore the previous cache sizes and reload the new config again. You can monitor the cache size through the Squid Manager HTTP interface.</p>
<h2>Bypassing Squid</h2>
<p>If for some reason you need to bypass Squid, reconfigure Apache to directly send requests to Tomcat. Edit the Apache config file <strong>/etc/httpd/conf/httpd.conf</strong></p>
<pre name="code" class="xml"># forward requests directly to Tomcat's proxy connector running on port 8082
ProxyPass        / http://localhost:8082/
ProxyPassReverse / http://localhost:8082/</pre>
<p>You will need to restart Apache after making this change.</p>
<pre name="code" class="xml">/etc/init.d/httpd restart</pre>
<h2>Conclusion</h2>
<p>Squid is a very powerful tool for caching. It is not for all applications. Please examine the need of your application and use squid appropriately. I&#8217;ve used squid for several years for caching the output from a Java data mashup application and am very satisfied with the ease of use and benefits. Hope you found this tutorial useful. Feel free to post a comment or share your experience with squid.</p>
<h2>References</h2>
<p><a title="Squid official website" href="http://www.squid-cache.org/" target="_blank">Squid official website</a></p>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/' rel='bookmark' title='Permanent Link: How to automatically recover Tomcat from crashes'>How to automatically recover Tomcat from crashes</a></li><li><a href='http://www.vineetmanohar.com/2010/03/howto-rotate-tomcat-catalina-out/' rel='bookmark' title='Permanent Link: How to rotate Tomcat catalina.out'>How to rotate Tomcat catalina.out</a></li><li><a href='http://www.vineetmanohar.com/2009/12/publishing-to-maven-central-repo-in-5-steps/' rel='bookmark' title='Permanent Link: Publishing to Maven Central Repo in 5 steps'>Publishing to Maven Central Repo in 5 steps</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2010/03/cache-java-webapps-with-squid-reverse-proxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Maven Docbook for beginners</title>
		<link>http://www.vineetmanohar.com/2010/02/maven-docbook-for-beginners/</link>
		<comments>http://www.vineetmanohar.com/2010/02/maven-docbook-for-beginners/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 23:25:47 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[docbook]]></category>
		<category><![CDATA[docbook-xml]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[mvn]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=865</guid>
		<description><![CDATA[This articles helps you get started with your first Docbook based documentation for your Maven project in 5 minutes. It shows you how to setup pom.xml, write a sample docbook and generate HTML documentation. It also includes references to where you can learn how to write comprehensive Docbook files.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/' rel='bookmark' title='Permanent Link: Tweet your builds with Maven Twitter Plugin'>Tweet your builds with Maven Twitter Plugin</a></li><li><a href='http://www.vineetmanohar.com/2009/04/how-to-auto-generate-maven-plugin-documentation/' rel='bookmark' title='Permanent Link: How to auto-generate Maven plugin documentation'>How to auto-generate Maven plugin documentation</a></li><li><a href='http://www.vineetmanohar.com/2009/10/how-to-automate-project-versioning-and-release-with-maven/' rel='bookmark' title='Permanent Link: How to automate project versioning and release with Maven'>How to automate project versioning and release with Maven</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2010/02/maven-docbook-for-beginners/';
var dzone_title = 'Maven Docbook for beginners';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>Docbook is an XML format generally used for writing technical documentation. Many technical projects have documentation written in Docbook XML and checked in the source control system along with the source code. This makes it easy to ship documentation with the source and lets you keep versions of documentation in sync with the product version. This tutorial shows you how to write your first docbook documentation in a Maven project.</p>
<h3>Write a simple docbook file</h3>
<p>Create the following file:</p>
<pre name="code" class="xml">src/docbkx/test.xml</pre>
<p>A minimal docbook file</p>
<pre name="code" class="xml">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;article xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en"&gt;
  &lt;title&gt;Hello, World&lt;/title&gt;
  &lt;para&gt;My first documentation with Docbook&lt;/para&gt;
 &lt;/article&gt;</pre>
<h3>Generate html documentation</h3>
<h4>Configure pom.xml</h4>
<p>The maven docbook plugin converts your docbook xml file to user friendly documentation in HTML. Add the following plugin declaration to your pom.xml</p>
<pre name="code" class="xml">
&lt;build&gt;
&lt;plugins&gt;
&lt;plugin&gt;
 &lt;groupId&gt;com.agilejava.docbkx&lt;/groupId&gt;
 &lt;artifactId&gt;docbkx-maven-plugin&lt;/artifactId&gt;
 &lt;dependencies&gt;
  &lt;dependency&gt;
   &lt;groupId&gt;org.docbook&lt;/groupId&gt;
   &lt;artifactId&gt;docbook-xml&lt;/artifactId&gt;
   &lt;version&gt;4.4&lt;/version&gt;
   &lt;scope&gt;runtime&lt;/scope&gt;
  &lt;/dependency&gt;
 &lt;/dependencies&gt;

 &lt;executions&gt;
  &lt;execution
   &lt;phase&gt;pre-site&lt;/phase&gt;
   &lt;goals&gt;
    &lt;goal&gt;generate-html&lt;/goal&gt;
   &lt;/goals&gt;
  &lt;/execution&gt;
 &lt;/executions&gt;
&lt;/plugin&gt;</pre>
<h3>Run the plugin</h3>
<p>The above config runs the plugin in pre-site phase, and will automatically be called when you run mvn site. You can use the following command to manually run the plugin for purpose of testing:</p>
<pre name="code" class="css">mvn pre-site</pre>
<p>This simple config scans the <strong>src/docbkx</strong> directory and produces the html documentation in <strong>target/docbkx/html</strong> directory. You should see the following output file:</p>
<pre name="code" class="css">target/docbkx/html/test.html</pre>
<p><img src="http://www.vineetmanohar.com/wp-content/uploads/2010/02/first-docbook-file-300x276.png" alt="First docbook generated HTML" title="first-docbook-file" width="300" height="276" class="size-medium wp-image-878" /></p>
<h3>More plugin options</h3>
<p>The plugin goal used above <em>generate-html</em> converts the docbook xml to html. There are advanced options to configure the CSS/XSLT used. Also, there are other goals available to generate documentation in more formats including pdf. Here&#8217;s the reference page for plugin documentation.</p>
<ul>
<li><a href="http://docbkx-tools.sourceforge.net/docbkx-maven-plugin/plugin-info.html" target="_blank">Docbkx Maven plugin options</a></li>
</ul>
<h3>Learning Docbook format</h3>
<p>Now that you are able to create a sample docbook and publish it, you might want to learn the Docbook format itself. Here are some links that should help you get started:</p>
<ul>
<li><a href="http://www.docbook.org/docs/howto/#schemas">Download</a> the schemas for docbook to get validation and auto-completion in your XML editor</li>
<li><a href="http://www.docbook.org/tdg5/en/html/docbook.html" target="_blank"><em>DocBook 5: The Definitive Guide</em> (online HTML)</a></li>
</ul>
<h3>FAQ</h3>
<ol>
<li><strong>Are there other docbook plugins for Maven?</strong> Yes, there are a few other plugins. However, this one seems to be the easiest to use. See more info <a href="http://code.google.com/p/docbkx-tools/" target="_blank">here</a>.</li>
</ol>
<h3>References</h3>
<ul>
<li><a title="Official Docbkx Plugin page" href="http://docs.codehaus.org/display/MAVENUSER/Docbkx+Maven+Plugin" target="_blank">Maven Docbkx Plugin at CodeHaus</a></li>
<li><a href="http://www.docbook.org/" target="_blank">Official Docbook page</a></li>
</ul>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 449px; width: 1px; height: 1px;">http://opensource.bureau-cornavin.com/crash-course/en/index.htmlThis</div>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/' rel='bookmark' title='Permanent Link: Tweet your builds with Maven Twitter Plugin'>Tweet your builds with Maven Twitter Plugin</a></li><li><a href='http://www.vineetmanohar.com/2009/04/how-to-auto-generate-maven-plugin-documentation/' rel='bookmark' title='Permanent Link: How to auto-generate Maven plugin documentation'>How to auto-generate Maven plugin documentation</a></li><li><a href='http://www.vineetmanohar.com/2009/10/how-to-automate-project-versioning-and-release-with-maven/' rel='bookmark' title='Permanent Link: How to automate project versioning and release with Maven'>How to automate project versioning and release with Maven</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2010/02/maven-docbook-for-beginners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Google Buzz?</title>
		<link>http://www.vineetmanohar.com/2010/02/what-is-google-buzz/</link>
		<comments>http://www.vineetmanohar.com/2010/02/what-is-google-buzz/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 20:13:14 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google buzz]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=846</guid>
		<description><![CDATA[Google Buzz is yet another way to share photos, status updates, videos, news and more with friends and family. The best part is that it lets you start with your existing Gmail contacts...


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/what-is-google-wave-in-plain-simple-english-in-2-minutes/' rel='bookmark' title='Permanent Link: What is Google Wave: in plain simple English in 2 minutes'>What is Google Wave: in plain simple English in 2 minutes</a></li><li><a href='http://www.vineetmanohar.com/2009/04/writing-java-hello-world-for-google-app-engine/' rel='bookmark' title='Permanent Link: Writing Java Hello World for Google app engine'>Writing Java Hello World for Google app engine</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2010/02/what-is-google-buzz/';
var dzone_title = 'What is Google Buzz?';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p><strong>Google Buzz</strong> is yet another way to share photos, status updates, videos, news and more with friends and family.</p>
<p>Buzz is part of Gmail, so unlike other social networking sites where you have to build your community from scratch, Buzz lets you start from your existing Gmail contacts. If you&#8217;re not already on Gmail then it makes it less attractive to try it, in my opinion.</p>
<p>Buzz also shows you activities from Picasa, Google Reader, Flickr and Twitter so you can see all of that in one place.</p>
<p>There is no need to register, download or setup anything. Buzz is automatically available from your Gmail. Just go to your Gmail and you should see  a new &#8216;Buzz&#8217; link under your &#8216;Inbox&#8217; in the left hand pane. Buzz is being rolled out so if you don&#8217;t see the &#8216;Buzz&#8217; link, you don&#8217;t have it yet.</p>
<p>The buzz official website is: <a href="http://buzz.google.com">http://buzz.google.com</a>. Here&#8217;s the official intro video from Google.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/yi50KlsCBio&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/yi50KlsCBio&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/what-is-google-wave-in-plain-simple-english-in-2-minutes/' rel='bookmark' title='Permanent Link: What is Google Wave: in plain simple English in 2 minutes'>What is Google Wave: in plain simple English in 2 minutes</a></li><li><a href='http://www.vineetmanohar.com/2009/04/writing-java-hello-world-for-google-app-engine/' rel='bookmark' title='Permanent Link: Writing Java Hello World for Google app engine'>Writing Java Hello World for Google app engine</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2010/02/what-is-google-buzz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publishing to Maven Central Repo in 5 steps</title>
		<link>http://www.vineetmanohar.com/2009/12/publishing-to-maven-central-repo-in-5-steps/</link>
		<comments>http://www.vineetmanohar.com/2009/12/publishing-to-maven-central-repo-in-5-steps/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 23:09:22 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[maven central repo]]></category>
		<category><![CDATA[mvn]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=680</guid>
		<description><![CDATA[If you need to share your Maven artifacts with the world, you too can publish it on the official Maven repo! Let others discover your artifacts without any repository configuration. This article is intended to be a practical, step by step and easy to follow tutorial to publish your artifacts to the central repo.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2010/06/getting-started-with-nexus-maven-repo-manager/' rel='bookmark' title='Permanent Link: Getting started with Nexus Maven Repo Manager'>Getting started with Nexus Maven Repo Manager</a></li><li><a href='http://www.vineetmanohar.com/2009/10/how-to-automate-project-versioning-and-release-with-maven/' rel='bookmark' title='Permanent Link: How to automate project versioning and release with Maven'>How to automate project versioning and release with Maven</a></li><li><a href='http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/' rel='bookmark' title='Permanent Link: Tweet your builds with Maven Twitter Plugin'>Tweet your builds with Maven Twitter Plugin</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2009/12/publishing-to-maven-central-repo-in-5-steps/';
var dzone_title = 'Publishing to Maven Central Repo in 5 steps';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p><strong>Maven Central Repo</strong> is the official Maven repository where all &#8220;official&#8221; jars are published. It is also known as the &#8220;<strong>central</strong>&#8221; repo and is part of the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Super_POM">super pom.xml</a> which is implicitly included by every Maven project. The URL of the Maven Central Repo is <a href="http://repo1.maven.org/maven2/">http://repo1.maven.org/maven2/</a>.</p>
<p>If you need to share your Maven artifacts with the world, <strong>you too</strong> can publish it on the official Maven repo! Let others discover your artifacts without any repository configuration. This article is intended to be a practical, step by step, easy to follow tutorial to publish your artifacts to the central repo.</p>
<h2>Step 1: pom.xml configuration</h2>
<ul>
<li><strong>Required elements:</strong> These elements must be present in your pom.xml: modelVersion, groupId, artifactId, packaging, name, version, description, url, licenses, scm url, dependencies</li>
<li><strong>No &lt;repositories&gt; or &lt;pluginRepositories&gt; tag allowed. </strong>All you dependencies must be present in the central repo.</li>
<li><strong>Choose a groupId that you own</strong>. Most common way to do this is to have control over the domain name corresponding to your groupId. For example, if your groupId is <em>com.vineetmanohar</em> then your must own or have control over the domain name <em>vineetmanohar.com</em>. This is required as maven will only download artifacts for a groupId from the corresponding domain.</li>
<li><strong>You can only publish releases, not snapshots.</strong></li>
</ul>
<h2>Step 2: Create your domain repo</h2>
<p>This assumes that you have a hosted server somewhere which runs apache (or similar web server to host static files), and describes how to create a repo using by defining an path in a apache virtual server. If you have root access to the machine, Login as root and create a new user called &#8216;repo&#8217;</p>
<pre name="code" class="css">
 # adduser repo
 # su - repo
</pre>
<p>As the repo user and create the repo directories.</p>
<pre name="code" class="css">
# su - repo
$ cd /home/repo
$ chmod 755 .
$ mkdir -p html/releases html/snapshots</pre>
<p>Now map this directory to apache</p>
<p>Map /home/repo/html/ to http://repo.&lt;your domain&gt;.com</p>
<p>Edit the /etc/httpd/conf/httpd.conf file and add the following mapping. Change IP address and server name as applicable. Remember that server name must match or should be a sub-domain of your groupId.</p>
<pre name="code" class="css"> &lt;VirtualHost 215.12.34.111:80&gt;
  &lt;Directory /home/repo/html&gt;
   Options +Indexes
   AllowOverride Limit
  &lt;/Directory&gt;

  ServerName repo.vineetmanohar.com
  DocumentRoot /home/repo/html
  CustomLog "/home/repo/access_log" "combined"
  ErrorLog "/home/repo/error_log"
  SuexecUserGroup repo repo
 &lt;/VirtualHost&gt;</pre>
<p>Restart apache</p>
<pre name="code" class="css">/etc/init.d/httpd restart</pre>
<h2>Step 3: Publish artifacts to your repo</h2>
<p>Add a &lt;distributionManagement&gt; section to your pom.xml. Here&#8217;s an <a href="http://code.google.com/p/maven-twitter-plugin/source/browse/trunk/pom.xml" target="_blank">example</a>, change it to reflect your server names and paths.</p>
<pre name="code" class="css">&lt;distributionManagement&gt;
 &lt;repository&gt;
   &lt;id&gt;vineetmanohar-release-repo&lt;/id&gt;
   &lt;name&gt;vineetmanohar.com Release Repo&lt;/name&gt;
   &lt;url&gt;scp://repo.vineetmanohar.com/home/repo/html/releases/&lt;/url&gt;
 &lt;/repository&gt;

 &lt;snapshotRepository&gt;
   &lt;id&gt;vineetmanohar-snapshot-repo&lt;/id&gt;
   &lt;name&gt;vineetmanohar.com Snapshot Repo&lt;/name&gt;
   &lt;url&gt;scp://repo.vineetmanohar.com/home/repo/html/snapshots/&lt;/url&gt;
 &lt;/snapshotRepository&gt;
&lt;/distributionManagement&gt;</pre>
<p>Once you are ready to release, change your pom.xml version to a non-SNAPSHOT version, e.g. 0.0.1. Remember that if your version is a non-SNAPSHOT version, you cannot have any SNAPSHOT dependencies either, that&#8217;s just a universal maven rule.</p>
<p>Now deploy your version to your release repo.</p>
<pre name="code" class="css">mvn deploy</pre>
<p>If you use <strong>scp</strong> to deploy (as in the example above) you will be asked to enter your password. Alternatively you can configure to <a href="http://www.vineetmanohar.com/2009/07/17/howto-ssh-without-password/" target="_blank">SSH without password</a>.</p>
<p>PS: Alternatively you can automatically increment version and deploy automatically by using the <a href="http://www.vineetmanohar.com/2009/10/23/how-to-automate-project-versioning-and-release-with-maven/" target="_blank">Maven Release plugin</a>.</p>
<h2>Step 4: Give permission to Maven to access your repo</h2>
<p>The simplest way is to authorize Maven by adding its private key to your repo&#8217;s authorized ssh keys. Make sure that the permissions are set as described below.</p>
<pre name="code" class="css"># su - repo
$ mkdir -p .ssh
$ chmod 700 .ssh
$ cd .ssh
$ vi authorized_keys
&lt;paste maven's public key in file authorized keys&gt;
$ chmod 400 authorized_keys</pre>
<p>Copy the contents of <a href="http://www.ibiblio.org/maven/id_dsa.pub" target="_blank">Maven&#8217;s public key</a> and paste it in /home/repo/.ssh/authorized_keys</p>
<h2>Step 5: Submit a request to the Maven folks</h2>
<p>You have your artifacts published in a public repo and Maven has the permission to rsync your repo over SSH. All you need to do now is to submit a request to Maven to add your server to the list of servers they sync with.</p>
<p>Open an account at <a href="http://jira.codehaus.org">http://jira.codehaus.org</a>, if you don&#8217;t have one already. Once you have created an account, submit your request <a href="http://jira.codehaus.org/secure/CreateIssue.jspa?pid=10367&amp;issuetype=5" target="_blank">here</a>.</p>
<p>Here is an <a href="http://jira.codehaus.org/browse/MAVENUPLOAD-2664" target="_blank">example request</a> that I submitted. It took them 7 days to close the ticket, so be patient. After the ticket has been closed, it might take half a day for the servers to gets sync&#8217;d, after which I could see my artifacts appear <a href="http://repo1.maven.org/maven2/com/vineetmanohar/" target="_blank">here</a>.</p>
<h2>Reference</h2>
<ul>
<li><a href="http://maven.apache.org/guides/mini/guide-central-repository-upload.html">Maven&#8217;s Official and comprehensive Guide to Central Repository Upload</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2010/06/getting-started-with-nexus-maven-repo-manager/' rel='bookmark' title='Permanent Link: Getting started with Nexus Maven Repo Manager'>Getting started with Nexus Maven Repo Manager</a></li><li><a href='http://www.vineetmanohar.com/2009/10/how-to-automate-project-versioning-and-release-with-maven/' rel='bookmark' title='Permanent Link: How to automate project versioning and release with Maven'>How to automate project versioning and release with Maven</a></li><li><a href='http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/' rel='bookmark' title='Permanent Link: Tweet your builds with Maven Twitter Plugin'>Tweet your builds with Maven Twitter Plugin</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2009/12/publishing-to-maven-central-repo-in-5-steps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tweet your builds with Maven Twitter Plugin</title>
		<link>http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/</link>
		<comments>http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:01:18 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[java twitter]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[maven plugin]]></category>
		<category><![CDATA[mvn]]></category>
		<category><![CDATA[pom.xml]]></category>
		<category><![CDATA[settings.xml]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter client]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=621</guid>
		<description><![CDATA[Maven Twitter Plugin lets you send Twitter status updates from Maven, without writing any Java code. It increases communication between Project owners and Project users by automatically tweeting build and release status via Twitter. 


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/10/how-to-automate-project-versioning-and-release-with-maven/' rel='bookmark' title='Permanent Link: How to automate project versioning and release with Maven'>How to automate project versioning and release with Maven</a></li><li><a href='http://www.vineetmanohar.com/2009/04/how-to-auto-generate-maven-plugin-documentation/' rel='bookmark' title='Permanent Link: How to auto-generate Maven plugin documentation'>How to auto-generate Maven plugin documentation</a></li><li><a href='http://www.vineetmanohar.com/2009/05/maven-cargo-jboss/' rel='bookmark' title='Permanent Link: Maven Cargo JBoss'>Maven Cargo JBoss</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/';
var dzone_title = 'Tweet your builds with Maven Twitter Plugin';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<h3>Introduction</h3>
<p>Maven Twitter Plugin lets you send Twitter status updates from Maven, without writing any Java code. It increases communication between Project owners and Project users by automatically tweeting build and release status via Twitter.</p>
<h3>Configuration</h3>
<h4>1. Add Plugin repository to your  &lt;build&gt; &lt;plugins&gt; section in pom.xml</h4>
<p>You need to add this to your list of existing plugin repositories.</p>
<pre name="code" class="xml">&lt;pluginRepository&gt;
 &lt;id&gt;vineetmanohar-release-repo&lt;/id&gt;
 &lt;name&gt;Vineet Manohar Release Repo&lt;/name&gt;
 &lt;url&gt;http://repo.vineetmanohar.com/releases&lt;/url&gt;
&lt;/pluginRepository&gt;</pre>
<h4>2. Add your twitter username, password to your ~/.m2/settings.xml file</h4>
<p>For security reasons, it is recommended that you put your twitter username and password in your local settings file.</p>
<pre name="code" class="xml">&lt;settings&gt;
 &lt;profiles&gt;
  &lt;profile&gt;
   &lt;id&gt;default&lt;/id&gt;
   &lt;activation&gt;
    &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
   &lt;/activation&gt;
   &lt;properties&gt;
    &lt;twitterUsername&gt;your twitter username&lt;/twitterUsername&gt;
    &lt;twitterPassword&gt;your twitter password&lt;/twitterPassword&gt;
   &lt;/properties&gt;
  &lt;/profile&gt;
 &lt;/profiles&gt;
&lt;/settings&gt;</pre>
<h3>Usage</h3>
<h4>Add the Twitter plugin to your  &lt;build&gt; &lt;plugins&gt; section in pom.xml</h4>
<p>Define the plugin as shown in example below.</p>
<pre name="code" class="xml">&lt;build&gt;
 ...
 &lt;plugins&gt;
  &lt;plugin&gt;
   &lt;groupId&gt;com.vineetmanohar&lt;/groupId&gt;
   &lt;artifactId&gt;maven-twitter-plugin&lt;/artifactId&gt;
   &lt;version&gt;0.1&lt;/version&gt;
   ...
  &lt;/plugin&gt;
&lt;/plugins&gt;</pre>
<p>Now add one &lt;execution&gt; block to the above, for every Tweet you want to send per build. The &lt;twitterStatus&gt; config element defines your Twitter message and will be executed in the phase specified by the &lt;phase&gt; subelement.</p>
<pre name="code" class="xml">&lt;execution&gt;
 &lt;phase&gt;...&lt;/phase&gt;
 &lt;configuration&gt;
   &lt;twitterStatus&gt;...&lt;/twitterStatus&gt;
 &lt;/configuration&gt;
&lt;/execution&gt;</pre>
<p>You can define as many blocks as you want.</p>
<h3>Example</h3>
<p>This example send 2 tweets: one in the &#8220;test&#8221; phase and the other in the &#8220;deploy&#8221; phase.</p>
<pre name="code" class="xml">&lt;plugin&gt;
 &lt;groupId&gt;com.vineetmanohar&lt;/groupId&gt;
  &lt;artifactId&gt;maven-twitter-plugin&lt;/artifactId&gt;
  &lt;version&gt;0.1&lt;/version&gt;
  &lt;executions&gt;
   &lt;!-- phase: test --&gt;
   &lt;execution&gt;
    &lt;id&gt;test-passed&lt;/id&gt;
    &lt;configuration&gt;
     &lt;!-- anything you want, upto 140 chars --&gt;
     &lt;twitterStatus&gt;My first tweet from using #maven twitter plugin&lt;/twitterStatus&gt;
    &lt;/configuration&gt;
    &lt;phase&gt;test&lt;/phase&gt;
    &lt;goals&gt;
     &lt;goal&gt;tweet&lt;/goal&gt;
    &lt;/goals&gt;
   &lt;/execution&gt;

   &lt;!-- phase: deploy --&gt;
   &lt;execution&gt;
    &lt;configuration&gt;
     &lt;!-- Tell your users that the project is deployed --&gt;
     &lt;twitterStatus&gt;Version ${project.versionId} of XYZ deployed&lt;/twitterStatus&gt;
    &lt;/configuration&gt;
    &lt;id&gt;deploy&lt;/id&gt;
    &lt;phase&gt;deploy&lt;/phase&gt;
    &lt;goals&gt;
     &lt;goal&gt;tweet&lt;/goal&gt;
    &lt;/goals&gt;
   &lt;/execution&gt;
  &lt;/executions&gt;
&lt;/plugin&gt;</pre>
<h3>FAQ</h3>
<h4>What can I put under the &lt;twitterStatus&gt; element</h4>
<ul>
<li>static text</li>
<li>You can be creative and put variables related to your project. ${project} maps to the Maven Project <a href="http://maven.apache.org/ref/2.1.0/maven-model/apidocs/org/apache/maven/model/Model.html" target="_blank">Model</a>. Examples are ${project.groupId}, ${project.artifactId}, etc</li>
<li>You can put hash tags by simply putting # before a word</li>
<li>You can put @usernames directing the message to a specific twitter account</li>
<li>You resolved twitter message, after resolving any ${vars}, should be maximum 140 chars</li>
</ul>
<h4>What happens if I send multiple message with the same text</h4>
<ul>
<li>Twitter seems to ignore status updates if there is not status change from your.</li>
</ul>
<h4>What happens if my &lt;twitterStatus&gt; is more than 140 characters</h4>
<p>The current version does not check for length and will send your message to Twitter. Twitter will respond with an error.</p>
<h4>Does this plugin support URL shortening?</h4>
<p>Version 0.1 does not support URL shortening.</p>
<h4>Does maven execution stop if the Twitter Plugin fails</h4>
<p>No. All errors are logged, but no Exception is thrown.</p>
<h4>Is there a limit to how many messages I can send?</h4>
<p>Yes. Twitter has a rate limit of 150 message per hour. See <a href="http://apiwiki.twitter.com/Rate-limiting" target="_blank">details</a>.</p>
<h4>What are all the different Maven phases</h4>
<p>Here&#8217;s Maven&#8217;s <a href="http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference" target="_blank">documentation</a> on Phases</p>
<h3>Reference</h3>
<ul>
<li><a href="http://code.google.com/p/maven-twitter-plugin/">Source Code at Google Code</a></li>
<li><a href="http://repo.vineetmanohar.com/releases/com/vineetmanohar/maven-twitter-plugin/">Plugin binaries</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/10/how-to-automate-project-versioning-and-release-with-maven/' rel='bookmark' title='Permanent Link: How to automate project versioning and release with Maven'>How to automate project versioning and release with Maven</a></li><li><a href='http://www.vineetmanohar.com/2009/04/how-to-auto-generate-maven-plugin-documentation/' rel='bookmark' title='Permanent Link: How to auto-generate Maven plugin documentation'>How to auto-generate Maven plugin documentation</a></li><li><a href='http://www.vineetmanohar.com/2009/05/maven-cargo-jboss/' rel='bookmark' title='Permanent Link: Maven Cargo JBoss'>Maven Cargo JBoss</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2009/11/tweet-your-builds-with-maven-twitter-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Customizing Yahoo! Grids CSS, for beginners</title>
		<link>http://www.vineetmanohar.com/2009/11/customizing-yahoo-grids-css-for-beginners/</link>
		<comments>http://www.vineetmanohar.com/2009/11/customizing-yahoo-grids-css-for-beginners/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 00:59:21 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css grids]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[yahoo grid]]></category>
		<category><![CDATA[yui]]></category>
		<category><![CDATA[yui2]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=602</guid>
		<description><![CDATA[Yahoo! Grid CSS system is an easy way to create an HTML document with a desired page width and a secondary column which works out of the box. YUI Grid comes with 4 built-in page widths and 6 template presets. This article shows you how to create a custom page width and a custom secondary column width.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/' rel='bookmark' title='Permanent Link: What is OpenID and how can I use it?'>What is OpenID and how can I use it?</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2009/11/customizing-yahoo-grids-css-for-beginners/';
var dzone_title = 'Customizing Yahoo! Grids CSS, for beginners';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<h3>Overview</h3>
<p>Yahoo! Grid CSS system is an easy way to create an HTML document with a desired page width and a secondary column which works out of the box. YUI Grid comes with four built-in page widths and six built-in template presets. This article shows you how to create a custom page width and a custom secondary column width.</p>
<h3>Yahoo! Grid Page structure</h3>
<p>The overall structure of a HTML document using yahoo grid is as follows:</p>
<pre name="code" class="html">&lt;html&gt;
 &lt;head&gt;
  &lt;link href="http://yui.yahooapis.com/2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css" rel="styleSheet" type="text/css" /&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;div id="doc" class="yui-t1"&gt;
    &lt;div id=”hd”&gt;&lt;/div&gt;&lt;!-- header --&gt;
    &lt;div id=”bd”&gt;&lt;/div&gt;&lt;!-- body --&gt;
    &lt;div id=”ft”&gt;&lt;/div&gt;&lt;!-- footer --&gt;
  &lt;/div&gt;
 &lt;/body&gt;
&lt;/html&gt;</pre>
<h4>Page Width</h4>
<p>You can control the overall width of the page using the id of the outermost div (&lt;div id=&#8221;doc&#8221;, in the above example). There are 4 pre-defined doc ids:</p>
<ul>
<li><strong>doc</strong>: 750px</li>
<li><strong>doc2</strong>: 950px</li>
<li><strong>doc3</strong>: 100%</li>
<li><strong>doc4</strong>: 974px</li>
</ul>
<p><strong>Customizing the Page Width</strong></p>
<p>To create your custom page width, say 800px, add the following in your CSS</p>
<pre name="code" class="css">#doc20 {
 width:61.538em; /* 800/13 */
 *width:60em; /* for I.E. 800/13.3333 */
}</pre>
<p>Then use this as your main document wrapper:</p>
<pre name="code" class="html">&lt;div id="doc20"&gt;
  &lt;div id=”hd”&gt;&lt;/div&gt; &lt;!-- header --&gt;
  ...</pre>
<h4>Secondary column width with built-in templates</h4>
<p>You can add a secondary column by simply nesting 2 blocks, &lt;div class=&#8221;yui-b&#8221;&gt;,  under &#8220;bd&#8221;. You need to indicate which block is the main block by wrapping it in &lt;div id=&#8221;yui-main&#8221;&gt;.</p>
<pre name="code" class="html">&lt;div id="bd"&gt;
  &lt;!-- main block --&gt;
  &lt;div id="yui-main"&gt;
    &lt;!-- main block --&gt;
    &lt;div class="yui-b"&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;!-- secondary column --&gt;
  &lt;div class="yui-b"&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>The secondary column width and position can be controlled by the class of the &lt;div id=&#8221;doc&#8221; class=&#8221;template preset goes here&#8221;&gt; tag.</p>
<p>There are 6 built-in template presets.</p>
<ul>
<li><strong>.yui-t1 </strong>- Two columns, narrow on left, 160px</li>
<li><strong>.yui-t2</strong> &#8211; Two columns, narrow on left, 180px</li>
<li><strong>.yui-t3</strong> &#8211; Two columns, narrow on left, 300px</li>
<li><strong>.yui-t4</strong> &#8211; Two columns, narrow on right, 180px</li>
<li><strong>.yui-t5</strong> &#8211; Two columns, narrow on right, 240px</li>
<li><strong>.yui-t6</strong> &#8211; Two columns, narrow on right, 300px</li>
</ul>
<p>For example:</p>
<pre name="code" class="html">&lt;div id="doc" class="yui-t1"&gt;</pre>
<p>results in a secondary column, narrow on left, 160px.</p>
<h4>Customizing the secondary column width</h4>
<p>Say you want to create a new template</p>
<ul>
<li><strong>.yui-t20</strong> &#8211; Two columns, narrow on right, 120px</li>
</ul>
<p>You can achieve this by including the following in your CSS (after the YUI grids CSS).</p>
<pre name="code" class="css">.yui-t20 {
  margin:auto;
  text-align:left;
}
.yui-t20 .yui-b {
  float:right;
  width:9.2308em;
  *width:9em;
}
.yui-t20 #yui-main {
  float: left;
  margin-right: -25em;
}
.yui-c20 #yui-main .yui-b {
  margin-right: 10.2308em;
  *margin-right: 10em;
}</pre>
<p><strong>How is the calculation done?</strong></p>
<p>For all browsers, width in px / 13</p>
<pre name="code" class="css">width:9.2308em; /* 120/13 */</pre>
<p>For I.E. star width in px / 13.33</p>
<pre name="code" class="css">*width:9em; /* for I.E. 120/13.33 */</pre>
<p>For all browsers, right margin is width + 1em</p>
<p>For secondary column on left, change right and left appropriately.</p>
<h3>References</h3>
<ul>
<li><a href="http://developer.yahoo.com/yui/grids/" target="_blank">YUI2 Grid CSS Official documentation</a></li>
<li><a href="http://yuiblog.com/assets/pdf/cheatsheets/css.pdf">Yahoo CSS, Reset, Base, Fonts, and Grids Cheatsheet</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/' rel='bookmark' title='Permanent Link: What is OpenID and how can I use it?'>What is OpenID and how can I use it?</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2009/11/customizing-yahoo-grids-css-for-beginners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is OpenID and how can I use it?</title>
		<link>http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/</link>
		<comments>http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 04:47:14 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firefox plugin]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[gmail openid]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google openid]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[seatbelt]]></category>
		<category><![CDATA[what is openid]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress openid]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[yahoo openid]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=425</guid>
		<description><![CDATA[This article shows you how to get started with OpenID. If you use Gmail, Yahoo, Blogger, Wordpress, AOL and many other services - you already have an OpenID. It also explains how to use your homepage as your OpenID using a delegate meta tag. Finally, there are links for Java libraries which you can use if you want to OpenID enable your Java application.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/what-is-google-wave-in-plain-simple-english-in-2-minutes/' rel='bookmark' title='Permanent Link: What is Google Wave: in plain simple English in 2 minutes'>What is Google Wave: in plain simple English in 2 minutes</a></li><li><a href='http://www.vineetmanohar.com/2009/06/google-introduces-page-speed/' rel='bookmark' title='Permanent Link: Google introduces Page Speed'>Google introduces Page Speed</a></li><li><a href='http://www.vineetmanohar.com/2009/04/writing-java-hello-world-for-google-app-engine/' rel='bookmark' title='Permanent Link: Writing Java Hello World for Google app engine'>Writing Java Hello World for Google app engine</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/';
var dzone_title = 'What is OpenID and how can I use it?';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<h3>What is OpenID, in simple English</h3>
<p>OpenID is a single login that you can use across many websites on the internet. With OpenID, you no longer need to create a username/password when registering on a new website. You can simply use your existing OpenID.</p>
<h3>Using OpenID</h3>
<div id="attachment_451" class="wp-caption alignright" style="width: 307px"><img class="size-full wp-image-451" title="OpenId login" src="http://www.vineetmanohar.com/wp-content/uploads/2009/08/openid.png" alt="OpenId Login" width="297" height="284" /><p class="wp-caption-text">OpenId Login</p></div>
<p>Using an OpenID to login to a website is similar to the notion of showing your driver&#8217;s license at the box office when picking up tickets or showing your driver&#8217;s license at the airport security to prove your identity. OpenID is a single digital identity that <strong>you</strong> own. You present it when logging in to a website or at a blog post when submitting a comment.</p>
<p><strong>You can only use OpenID on Websites which accept OpenID.</strong> Look for the OpenID symbol or text like &#8220;Login using an OpenID&#8221; as shown in the image on the right.</p>
<h3>How does OpenID work?</h3>
<ol>
<li>You get an OpenID with one of the providers (more on this in the next section). Your OpenID is a short URL, for example mine is <b>http://www.vineetmanohar.com</b></li>
<li>You go to a website which accepts OpenID, for example, <a href="http://stackoverflow.com/users/login?returnurl=%2f">Stack Overflow</a></li>
<li>You enter your OpenID and hit <strong>Login</strong></li>
<li>Your are redirected back to your OpenID provider&#8217;s website. You login there using your login/password that you setup in step 1. After logging in, you are automatically redirected back to website X where you came from.</li>
<li>When you land on website X, you should be logged in.</li>
<li>You can repeat the same procedure for website Y. Note that login/password only occurs on your OpenID provider&#8217;s website, so you only need to remember one login/password.</li>
</ol>
<h3>How to get an OpenID</h3>
<p><strong>You probably already have an OpenID.</strong> Most email/blog service providers already give you an OpenID. Here is a list of OpenIDs associated with popular services:</p>
<ul>
<li><strong>Google or Gmail</strong>: https://www.google.com/accounts/o8/id</li>
<li><strong>AOL or AIM:</strong> openid.aol.com/<strong>yourname</strong></li>
<li><strong>Yahoo!:</strong>: https://me.yahoo.com/<strong>yourname</strong>
<ol>
<li>you need to first enable this feature on <a href="http://openid.yahoo.com/">Yahoo&#8217;s OpenID page</a></li>
<li>Yahoo! does not recommend using your yahoo login as your openID as it reveals your email address. You can change it to a longer cryptic string like https://me.yahoo.com/<strong>notyourname</strong></li>
<li>When asked for OpenID you can just type: <strong>yahoo.com</strong>. The website will redirect you to Yahoo! where you can login with your Yahoo! login/password.</li>
</ol>
</li>
<li><strong>My Space</strong>: www.myspace.com/<em>username</em></li>
<li><strong>Blogger: </strong> <em>blogname</em>.blogspot.com</li>
</ul>
<p>Here&#8217;s an extensive <a href="http://en.wikipedia.org/wiki/List_of_OpenID_providers">List of OpenID providers</a></p>
<h3>Your OpenID is your identity, so choose one carefully</h3>
<p>Although you can sign up with any OpenID provider, you should think of it as your identity. In my opinion, good choices might be either your email provider, like Google, Yahoo or AOL, or your blog.</p>
<p>If you can&#8217;t decide which one to go with, go with the one where you are logged in most of the time. This could be your email provider or your social networking site. The advantage with this option is that you are probably logged in to your provider most of the time, you will not be asked to login when signing in to a third party site using OpenID.</p>
<h3>Use your WordPress powered website or blog as your OpenID</h3>
<p>If you have a WordPress powered blog or website, you can use it as your OpenID. You need to install the <a href="http://wordpress.org/extend/plugins/openid/">OpenID plugin for WordPress</a>. After the <a href="http://wordpress.org/extend/plugins/openid/installation/">installation</a> is complete:</p>
<ul>
<li>Use your blog URL as your OpenID when logging in to other websites. For example, I can use my blog address as my OpenID: <strong>http://www.vineetmanohar.com</strong>, in which case I am redirected back to my blog which logs me in, and then redirects me back to the website where I came from.</li>
<li>You can login to your blog using OpenID instead of your WordPress login/password.</li>
<li>Visitors to your blog can leave comments using their OpenID. If you are reading this blog and have an OpenID, you can leave comments at the bottom of this page using your OpenID.</li>
</ul>
<h3>How to use your Vanilla HTML homepage as your OpenID</h3>
<p>You need to put two meta tags in the <head> </head> section of your HTML.</p>
<pre name="code" class="html">&lt;link rel="openid.server" href="http://&lt;openid provider server url&gt;"&gt;
&lt;link rel="openid.delegate"  href="http://&lt;your openid with this provider&gt;"&gt;</pre>
<p>You will need the server url for your OpenId provider. Here are some server URLs.</p>
<ul>
<li><strong>AOL/AIM:</strong> https://api.screenname.aol.com/auth/openidServer</li>
<li><strong>LiveJournal:</strong> http://www.livejournal.com/openid/server.bml</li>
<li><strong>MyOpenID:</strong> http://www.myopenid.com/server</li>
<li><strong>VeriSign:</strong> https://pip.verisignlabs.com/server</li>
<li><strong>Vox:</strong> http://www.vox.com/services/openid/server</li>
<li><strong>myvidoop: </strong><a href="https://myvidoop.com/help/what-is-delegation">See this page</a></li>
</ul>
<p>If you want to use delegation and your provider is not listed above, then check on your provider&#8217;s website or simply ask them. </p>
<p>This approach gives you more flexibility. With delegation, you can later change providers but continue to use your home page URL as your OpenID.</p>
<h3>Seatbelt: a Firefox extension for Verisign OpenID accounts</h3>
<p>If you chose Verisign as your OpenID provider, you can use the <a href="https://pip.verisignlabs.com/seatbelt.do">Seatbelt extension</a> for Firefox. It automatically logs you in to any page which accepts OpenID.</p>
<h3>Developers: how to add OpenID support on your site</h3>
<p>When implementing a new website, consider adding OpenID support for new users. This article explains <a href="http://www.plaxo.com/api/openid_recipe">how to OpenID-enable your website</a>.</p>
<p>Here&#8217;s a <a href="http://code.google.com/p/openid4java/">Java library for OpenID</a></p>
<h3>References</h3>
<ul>
<li><a href="http://openid.net/">OpenID official site</a></li>
</ul>
<h3>Leave a Comment using your OpenID</h3>
<p>The comment section of this page accepts OpenID login. Try out your new OpenID by leaving a comment below!</p>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/what-is-google-wave-in-plain-simple-english-in-2-minutes/' rel='bookmark' title='Permanent Link: What is Google Wave: in plain simple English in 2 minutes'>What is Google Wave: in plain simple English in 2 minutes</a></li><li><a href='http://www.vineetmanohar.com/2009/06/google-introduces-page-speed/' rel='bookmark' title='Permanent Link: Google introduces Page Speed'>Google introduces Page Speed</a></li><li><a href='http://www.vineetmanohar.com/2009/04/writing-java-hello-world-for-google-app-engine/' rel='bookmark' title='Permanent Link: Writing Java Hello World for Google app engine'>Writing Java Hello World for Google app engine</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>First look at Selenium Inspector</title>
		<link>http://www.vineetmanohar.com/2009/07/first-look-at-selenium-inspector/</link>
		<comments>http://www.vineetmanohar.com/2009/07/first-look-at-selenium-inspector/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 18:58:20 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[selenese]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[selenium ide]]></category>
		<category><![CDATA[selenium inspector]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=404</guid>
		<description><![CDATA[Last week, Team Dev released Selenium Inspector - an Java API wrapper over the existing Selenium Java API. This article compares the same program written in 3 different ways: Selenese (HTML) using Selenium IDE, in Java using Selenium Java API and in Java using Selenium Inspector API.
<!--more-->


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/the-plugin-orgcodehausmojoselenium-maven-plugin-does-not-exist-or-no-valid-version-could-be-found/' rel='bookmark' title='Permanent Link: The plugin &#8216;org.codehaus.mojo:selenium-maven-plugin&#8217; does not exist or no valid version could be found'>The plugin &#8216;org.codehaus.mojo:selenium-maven-plugin&#8217; does not exist or no valid version could be found</a></li><li><a href='http://www.vineetmanohar.com/2010/05/2-ways-to-convert-java-map-to-string/' rel='bookmark' title='Permanent Link: 2 ways to convert Java Map to String'>2 ways to convert Java Map to String</a></li><li><a href='http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/' rel='bookmark' title='Permanent Link: What is OpenID and how can I use it?'>What is OpenID and how can I use it?</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2009/07/first-look-at-selenium-inspector/';
var dzone_title = 'First look at Selenium Inspector';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>Last week, Team Dev released Selenium Inspector &#8211; a Java API wrapper over the existing Selenium Java API. Note that Selenium Inspector API does not replace the Selenium Java API, you can use both at the same time! This article compares the same program written in 3 different ways: Selenese (HTML) using Selenium IDE, in Java using Selenium Java API and in Java using Selenium Inspector API.</p>
<h3>The Test</h3>
<p>The test goes to google.com and searches for the keyword &#8220;yahoo&#8221;. It then makes sure that the link &#8220;Yahoo!&#8221; appears in the search results.</p>
<h3>Approach 1: Using Selenium IDE</h3>
<pre name="code" class="html">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head profile="http://selenium-ide.openqa.org/profiles/test-case"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;link rel="selenium.base" href="" /&gt;
&lt;title&gt;helloworld&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table cellpadding="1" cellspacing="1" border="1"&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;td rowspan="1" colspan="3"&gt;helloworld&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;openAndWait&lt;/td&gt;
            &lt;td&gt;http://www.google.com&lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;assertElementPresent&lt;/td&gt;
            &lt;td&gt;q&lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;type&lt;/td&gt;
            &lt;td&gt;q&lt;/td&gt;
            &lt;td&gt;yahoo&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;clickAndWait&lt;/td&gt;
            &lt;td&gt;btnG&lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;assertElementPresent&lt;/td&gt;
            &lt;td&gt;link=Yahoo!&lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Approach 2: Using Selenium API</h3>
<pre name="code" class="java">import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.server.SeleniumServer;

import com.thoughtworks.selenium.DefaultSelenium;

public class HelloWorldSeleniumTestCase {
    private static DefaultSelenium selenium;
    private static SeleniumServer seleniumServer;

    @BeforeClass
    public static void setUp() throws Exception {
        seleniumServer = new SeleniumServer();
        seleniumServer.start();

        selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com");
        selenium.start();
    }

    @Test
    public void testHelloWorld() {
        selenium.open("http://www.google.com");
        Assert.assertTrue(selenium.isElementPresent("q"));

        selenium.type("q", "yahoo");
        selenium.click("btnG");

        selenium.waitForPageToLoad("30000");

        // assert that the search box remembers the query
        Assert.assertEquals("yahoo", selenium.getValue("q"));

        // assert that you find the expected link in results
        Assert.assertTrue(selenium.isElementPresent("link=Yahoo!"));
    }

    @AfterClass
    public static void tearDown() {
        selenium.stop();
    }
}</pre>
<h3>Approach 3: Using Selenium Inspector API</h3>
<p>You need  junit 4.5 to run. If you are using Junit 4.3 or lower, you will get the following error.</p>
<pre name="code" class="java">Caused by: java.lang.ClassNotFoundException: org.junit.runners.BlockJUnit4ClassRunner
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)</pre>
<h4>JUnit code</h4>
<pre name="code" class="java">import org.junit.BeforeClass;
import org.junit.Test;
import org.seleniuminspector.ElementByLocatorInspector;
import org.seleniuminspector.ElementInspector;
import org.seleniuminspector.SeleniumFactory;
import org.seleniuminspector.SeleniumHolder;
import org.seleniuminspector.SeleniumTestCase;
import org.seleniuminspector.SeleniumWithServerAutostartFactory;
import org.seleniuminspector.ServerLoadingMode;
import org.seleniuminspector.html.InputInspector;

public class HelloWorldSeleniumInspectorTestCase extends SeleniumTestCase {
    @BeforeClass
    public static void initSeleniumFactory() {
        SeleniumHolder seleniumHolder = SeleniumHolder.getInstance();
        SeleniumFactory factory = new SeleniumWithServerAutostartFactory(4444, "*firefox", "http://www.google.com");
        seleniumHolder.setSeleniumFactory(factory);
    }

    @Test
    public void submitData() {
        openAndWait("http://www.google.com/");

        InputInspector inputField = new InputInspector("q");
        inputField.assertElementExists();

        inputField.type("yahoo");
        getSelenium().click("btnG");

        ServerLoadingMode.getInstance().waitForLoad();

        // assert that the search box remembers the query
        inputField.assertValue("yahoo");

        // assert that you find the expected link in results
        ElementInspector elementInspector = new ElementByLocatorInspector("link=Yahoo!");
        elementInspector.assertElementExists();
    }
}</pre>
<h3>Comparison</h3>
<p>Selenium API is action oriented, various actions that you can perform with the selenium API. There is a roughly one to one mapping of Selenium IDE commands and Selenium Java API. However, Selenium Inspector is based around objects called &#8220;Inspectors&#8221;. Inspectors are objects that inspect a specific things of the page, e.g. InputInspector which inspects an input field. Inspector then provide you with easy high level api. For example Input Inspector provides the following high level commands:</p>
<h4>Class InputInspector</h4>
<table border="1" cellspacing="0" cellpadding="3" width="100%">
<tbody>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span><code>d</code></span></td>
<td><code><strong>assertValue</strong>(java.lang.String value)</code> &#8211; Assert that the input has the given value</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code> boolean</code></span></td>
<td><code><strong>disabled</strong>()</code> &#8211; Assert that the input is disabled</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code> java.lang.String</code></span></td>
<td><code><strong>name</strong>()</code> &#8211; Get the name of the input</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code> java.lang.String</code></span></td>
<td><code><strong>type</strong>()</code> &#8211; Get the type of the input</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code> void</code></span></td>
<td><code><strong>type</strong>(java.lang.String text)</code> &#8211; Type of given text in the input</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code> void</code></span></td>
<td><code><strong>typeKeys</strong>(java.lang.String text)</code> &#8211; Type the given keys in the input</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code> java.lang.String</code></span></td>
<td><code><strong>value</strong>() - Get the value of the input</code></td>
</tr>
</tbody>
</table>
<p>The idea is to provide easy to functions in addition to the existing Selenium Java API.</p>
<p>Some of the other inspectors are:</p>
<ul>
<li><strong><a title="class in org.seleniuminspector" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/ElementInspector.html">ElementInspector</a></strong> &#8211; This is the base class for most of the other Inspectors. The purpose of ElementInspector is to provide easy means for inspecting client-side DOM elements in Selenium functional tests. An instance of ElementInspector is bound to a specific DOM node that is specified during the  element&#8217;s creation.</li>
<li><strong>ElementByExpressionInspector</strong> &#8211;  Defines an inspector for an element retrieved with an associated script. Note that like for Selenium.getEval method,  the script runs in context of &#8220;selenium&#8221; object. Use &#8220;window&#8221; to refer to the tested window.</li>
<li><strong>ElementByLocatorInspector</strong> &#8211; Inspects an element by the specified Selenium locator.</li>
<li><strong>ElementByReferenceInspector</strong> &#8211;  Inspects the same element as the associated element inspector. This class is mainly useful for extending by other  specialized inspectors to provide a flexible way of referring to other elements. Some of the available extensions are <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/InputInspector.html">InputInspector</a>, <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/LiInspector.html">LiInspector</a>, <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/TableInspector.html">TableInspector</a>, <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/TableRowInspector.html">TableRowInspector</a>, <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/TableSectionInspector.html">TableSectionInspector</a>, <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/TextAreaInspector.html">TextAreaInspector</a>, <a title="class in org.seleniuminspector.html" href="http://seleniuminspector.org/documentation/apiReference/org/seleniuminspector/html/UlInspector.html">UlInspector</a></li>
<li><strong>Other inspectors</strong> &#8211; DocumentInspector, TableCellInspector, TableColumnInspector, SubElementByPathInspector, SubElementByExpressionInspector, WindowInspector</li>
<li><strong>JSF inspectors</strong> &#8211; the Selenium Inspector websites talked about <a href="http://openfaces.org/downloads/">OpenFaces Inspectors</a> — a package of selenium inspectors created for easier testing of OpenFaces JSF components. I haven&#8217;t taken a look at it but I think the idea is to encapsulate and reuse JSF input specific behavior in a [Inspector] class and reuse!</li>
</ul>
<h3>Conclusion</h3>
<p>Inspectors try to provide high level functionality to various elements in the page to provide ease of use and facilitate code reuse!</p>
<h3>Reference</h3>
<p><a href="http://seleniuminspector.org/" target="_blank">Official Selenium Inspector website</a></p>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/06/the-plugin-orgcodehausmojoselenium-maven-plugin-does-not-exist-or-no-valid-version-could-be-found/' rel='bookmark' title='Permanent Link: The plugin &#8216;org.codehaus.mojo:selenium-maven-plugin&#8217; does not exist or no valid version could be found'>The plugin &#8216;org.codehaus.mojo:selenium-maven-plugin&#8217; does not exist or no valid version could be found</a></li><li><a href='http://www.vineetmanohar.com/2010/05/2-ways-to-convert-java-map-to-string/' rel='bookmark' title='Permanent Link: 2 ways to convert Java Map to String'>2 ways to convert Java Map to String</a></li><li><a href='http://www.vineetmanohar.com/2009/08/what-is-openid-and-how-can-i-use-it/' rel='bookmark' title='Permanent Link: What is OpenID and how can I use it?'>What is OpenID and how can I use it?</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2009/07/first-look-at-selenium-inspector/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Amazon adds SimpleDB Support in AWS Toolkit for Eclipse</title>
		<link>http://www.vineetmanohar.com/2009/07/amazon-adds-simpledb-support-in-aws-toolkit-for-eclipse/</link>
		<comments>http://www.vineetmanohar.com/2009/07/amazon-adds-simpledb-support-in-aws-toolkit-for-eclipse/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 15:32:31 +0000</pubDate>
		<dc:creator>vineet</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[simpledb]]></category>

		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=396</guid>
		<description><![CDATA[Today Amazon announced support for SimpleDB in their AWS Toolkit for Eclipse. One of the nice features is 'SQL scrapbook' which gives a textarea to write SQL and run it against your database. You get syntax highlighting, autocompletion of table names, column names etc.


Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/04/writing-java-hello-world-for-google-app-engine/' rel='bookmark' title='Permanent Link: Writing Java Hello World for Google app engine'>Writing Java Hello World for Google app engine</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.vineetmanohar.com/2009/07/amazon-adds-simpledb-support-in-aws-toolkit-for-eclipse/';
var dzone_title = 'Amazon adds SimpleDB Support in AWS Toolkit for Eclipse';
var dzone_blurb = '';
var dzone_style = '1';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>Today Amazon announced support for SimpleDB in their AWS Toolkit for Eclipse. According to Amazon, they have &#8220;<em>&#8230; added support for Amazon SimpleDB, so you can administer your Amazon SimpleDB data without writing a single line of code. By extending the Eclipse Data Tools Project, the AWS Toolkit for Eclipse provides a graphical interface that makes it easy to manage your Amazon SimpleDB domains, items, and attributes.</em>&#8221;</p>
<p>This <a href="http://media.amazonwebservices.com/videos/eclipse-sdb-management-video.html">screencast</a> by shows you how to visually edit, query and administer your SimpleDB using the eclipse plugin. One of the nice features is &#8216;SQL scrapbook&#8217; which gives a textarea to write SQL and run it against your database. You get syntax highlighting, autocompletion of table names, column names etc.</p>
<p>If you have an Amazon Simple DB account and do not use AWS toolkit, you can get it from <a href="http://aws.amazon.com/eclipse/">http://aws.amazon.com/eclipse/</a>.</p>


<p>Related posts:<ol><li><a href='http://www.vineetmanohar.com/2009/04/writing-java-hello-world-for-google-app-engine/' rel='bookmark' title='Permanent Link: Writing Java Hello World for Google app engine'>Writing Java Hello World for Google app engine</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vineetmanohar.com/2009/07/amazon-adds-simpledb-support-in-aws-toolkit-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
