<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tech Blog- Java, J2EE, Ajax, Web Technologies</title>
	<atom:link href="http://manjul.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://manjul.wordpress.com</link>
	<description>~~~ Share and explorE ~~~</description>
	<lastBuildDate>Tue, 01 Feb 2011 05:41:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='manjul.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tech Blog- Java, J2EE, Ajax, Web Technologies</title>
		<link>http://manjul.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://manjul.wordpress.com/osd.xml" title="Tech Blog- Java, J2EE, Ajax, Web Technologies" />
	<atom:link rel='hub' href='http://manjul.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Hibernate First Tutorial</title>
		<link>http://manjul.wordpress.com/2011/01/28/hibernate_first_tutorial/</link>
		<comments>http://manjul.wordpress.com/2011/01/28/hibernate_first_tutorial/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 19:01:14 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[Java and J2EE]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Hibernate architecture]]></category>
		<category><![CDATA[hibernate simple tutorial]]></category>
		<category><![CDATA[Hibernate Tutorial]]></category>
		<category><![CDATA[JTA Example]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/?p=96</guid>
		<description><![CDATA[Hibernate First Tutorial 1.Introduction 2.Hibernate Architecture 3.Main Components of Hibernate 4.Hibernate Configuration 5.Hibernate Mapping File 6.Mapping Association 7.Basic API&#8217;s 8.Hibernate Data source properties 9.Complete Example 1: Hibernate Introduction: While today&#8217;s applications are designed using Object Oriented Approach. As the business data is stored in the databases and applications create/fetches/update and remove these data for the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=96&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><strong>Hibernate First Tutorial</strong></p>
<p><strong><br />
1.Introduction</strong></p>
<p><strong>2.Hibernate Architecture</strong></p>
<p><strong>3.Main Components of Hibernate</strong></p>
<p><strong>4.Hibernate Configuration</strong></p>
<p><strong>5.Hibernate Mapping File</strong></p>
<p><strong>6.Mapping Association</strong></p>
<p><strong>7.Basic API&#8217;s</strong></p>
<p><strong>8.Hibernate Data source properties</strong></p>
<p><strong>9.Complete Example</strong></p>
<p><strong>1: Hibernate Introduction:</strong></p>
<p>While today&#8217;s applications are designed using Object Oriented Approach. As the business data is stored in the databases and applications create/fetches/update and remove these data for the business purposes. . Since both data storage and data handling are wast domain, over the period of time they are many vendors have provided mechanism for data data storage like oracle, db2 etc.. and similarly many application development technologies have enhanced theirs capabilities like J2EE,.Net etc.</p>
<p>The basic concept in Object Oriented approach is we consider the solution by identifying different Objects involved in the applications. Where as in case of Data bases there have evolved concept of RDBMS where data is stored in the Relational databases in tables and records. And application developer has to play the role of bridging this gap of data stored in tables and creating objects to be used in the object oriented programming. Developers has to write this data plumbing code as well as data processing code.</p>
<p>Hibernate came up with the solution of bridging this gap and providing all the necessary arrangements through which developer can just configure the required database and tables and later Hibernate will take care of data management work and developer just need to concentrate on data processing i.e. their application programming. Hibernates main advantage is the mapping of Objects data model with the corresponding table, developer do not need to bother about transforming data bases data in to objects. Object creation updation and persistence work will be done by hibernate.</p>
<p><strong>2: Hibernate Architecture</strong></p>
<p>Hibernate architecture is explained in the given figure below. Hibernates persistence layer lies between the data base layer and the application layer.</p>
<p>Figure1:</p>
<div id="attachment_113" class="wp-caption aligncenter" style="width: 310px"><a href="http://manjul.files.wordpress.com/2011/01/hb_arc_12.jpg"><img class="size-medium wp-image-113" title="Hibernate Architecture" src="http://manjul.files.wordpress.com/2011/01/hb_arc_12.jpg?w=300&#038;h=178" alt="Hibernate Architecture" width="300" height="178" /></a><p class="wp-caption-text">Hibernate Architecture</p></div>
<p>&nbsp;</p>
<p><strong> Detailed Architecture</strong></p>
<p>Second figure explains the details architecture with all the components. Session Factory is singleton object for every databases. For every connection there will be a session created by this session factory, which can internally create mutiple transaction bases on the requirement.</p>
<p>Figure 2:</p>
<div id="attachment_114" class="wp-caption aligncenter" style="width: 310px"><a href="http://manjul.files.wordpress.com/2011/01/hb_arc_21.jpg"><img class="size-medium wp-image-114" title="Hibernate Detailed Architecture" src="http://manjul.files.wordpress.com/2011/01/hb_arc_21.jpg?w=300&#038;h=223" alt="Hibernate Detailed Architecture" width="300" height="223" /></a><p class="wp-caption-text">Hibernate Detailed Architecture</p></div>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><strong> </strong></span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><strong>3: Main Components of Hibernate</strong></span></p>
<p style="margin-bottom:0;font-weight:normal;"><span style="font-family:Verdana, sans-serif;">Basic building blocks of the hibernate application are listed below:</span></p>
<p style="margin-bottom:0;font-weight:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-weight:normal;"><strong><span style="font-family:Verdana, sans-serif;">3.1 SessionFactory org.hibernate.SessionFactory</span></strong></p>
<p style="margin-bottom:0;font-weight:normal;"><strong><span style="font-family:Verdana, sans-serif;"> </span></strong>T<span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;">his is a thread safe singleton immutable object of the database mapping. There is only one connection factory for each database. Its a factory for the hibernate session and it also maintains the second level cache between the application and database at the process level. </span></span></p>
<p style="margin-bottom:0;font-weight:normal;"><span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;"> </span></span><span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;">Usage example:&lt;to be added&gt;</span></span></p>
<p style="margin-bottom:0;font-weight:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-weight:normal;"><span style="font-family:Verdana, sans-serif;"><strong>3.2 Session org.hibernate.Session</strong></span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;">This is single threaded an short lived object represents the conversation between the application and the database or persistence store. This is the wrapper over sql connection and works as the factory for the org.hibernate.Transaction. It mentains the first level cache of the application&#8217;s persistent object and collections. This cache is used while looking for the object using object id or while navigating the object graph.</span></span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;">Usage example:&lt;to be added&gt;</span></span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;"> </span></span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><strong><span style="font-family:Verdana, sans-serif;">3.3 ConnectionProvider org.hibernate.connection.ConnectionProvider</span></strong></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">This is optional and not directly exposed to the application developer, it represents the pool of connections. If require developer can implement this.</span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><strong><span style="font-family:Verdana, sans-serif;">3.4 TransactionFactory org.hibernate.TransactionFactory</span></strong></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><span style="font-weight:normal;">This is connection factory for the org.hibernate.Transaction, this is also not exposed to the developer but if require developer can implement this.</span></span></p>
<p style="margin-bottom:0;"><strong> </strong></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><strong><span style="font-family:Verdana, sans-serif;">3.5 Transaction org.hibernate.Transaction</span></strong></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">This is a single threaded short lived object use by the application to specify the atomicity of the work. It abstract the application from underlying jdbc/JTA implementation. Hibernate Session can maintaine more than one transaction also at a time.</span></p>
<p style="margin-bottom:0;"><strong> </strong></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><strong><span style="font-family:Verdana, sans-serif;">3.6 Persistent Object </span></strong></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">These are short lived business object represent the persistence state. They are associated with exactly one hibernate session. Once the session is closed they are free to used by the any layer of the application.</span></p>
<p style="margin-bottom:0;"><strong> </strong></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><strong><span style="font-family:Verdana, sans-serif;">3.7 Transient and Detached Object </span></strong></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">These are those instance of the persistence java classes whose objects are not yet associated or loaded with the session. They may have been instantiated by the application but not yet been associated with the hibernate session.</span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><strong>4: Hibernate Configuration File</strong></span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">This is the file where we specify the database level configuration. This file is read while application loads and then hibernate creates the connection pool with the specified database as per the specification. It also consist of entire set of mapping of Java Objects and Database tables.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">Org.hibernate.cfg.Configuration object represent the entire set of mapping.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">Configuarion and Sessionfactory objects:</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">SessionFactory factory = new Configuration.configure().buildSessionFactory();</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> </span><span style="font-family:Verdana, sans-serif;">Hibernate allows one Session factory for every database. Though it allows multiple session factory for more than one databases.</span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">This is a simple example of the hibernate configuration file.</span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;">&lt;?xml version=&#8217;1.0&#8242; encoding=&#8217;utf-8&#8242;?&gt;</p>
<p style="margin-bottom:0;">&lt;!DOCTYPE hibernate-configuration PUBLIC&#8221;-//Hibernate/Hibernate Configuration DTD//EN&#8221;</p>
<p style="margin-bottom:0;">&#8220;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&#8221;&gt;</p>
<p style="margin-bottom:0;">&lt;hibernate-configuration&gt;</p>
<p style="margin-bottom:0;">&lt;session-factory&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;hibernate.connection.driver_class&#8221;&gt;com.mysql.jdbc.Driver</p>
<p style="margin-bottom:0;">&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;hibernate.connection.url&#8221;&gt;jdbc:mysql://localhost:3306/mysql</p>
<p style="margin-bottom:0;">&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;hibernate.connection.username&#8221;&gt;root&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;hibernate.connection.password&#8221;&gt;root&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;hibernate.connection.pool_size&#8221;&gt;10&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;show_sql&#8221;&gt;true&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;dialect&#8221;&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;hibernate.hbm2ddl.auto&#8221;&gt;update&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;!&#8211; Mapping files &#8211;&gt;</p>
<p style="margin-bottom:0;">&lt;mapping resource=&#8221;contact.hbm.xml&#8221;/&gt;</p>
<p style="margin-bottom:0;">&lt;/session-factory&gt;</p>
<p style="margin-bottom:0;">&lt;/hibernate-configuration&gt;</p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><strong>5: Hibernate Mapping File</strong></span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">We specify individual mapping for each database table. Mapping is declared between class with a table and respective column with the attributes of the class.</span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">Mapping can be defined in following ways:</span></p>
<ol>
<p style="margin-bottom:0;"><em><span style="font-family:Verdana, sans-serif;">-Using Java 5 Annotations</span></em></p>
<p style="margin-bottom:0;"><em><span style="font-family:Verdana, sans-serif;">-Using Hibernate legacy XML file.</span></em></p>
</ol>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><strong>5.1 Mapping using Java Annotation</strong></span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">Simple example of hibernate configuration using Annotation, here we can see we are explicitly specifying the mapping in the bean file itself using java 5 annotation.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><span style="font-family:Verdana, sans-serif;"> </span></span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">import javax.persistence.Column;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">import javax.persistence.Entity;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">import javax.persistence.Id;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">import javax.persistence.Table;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">@Entity</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">@Table(name = &#8220;contact&#8221;)</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">public class Contact implements Serializable {</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> public Contact() {</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> }</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> @Id</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> @Column(name = &#8220;id&#8221;)</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> Integer id;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> @Column(name = &#8220;firstName&#8221;)</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> String firstName;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> public Integer getId() {</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> return id;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> }</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> public void setId(Integer id) {</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> this.id = id;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> }</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> public String getName() {</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> return firstName;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> }</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> public void setName(String name) {</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> this.firstName = name;</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"> }</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><br />
</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">}</span></p>
<p style="margin-bottom:0;margin-left:.51in;">&nbsp;</p>
<p style="margin-bottom:0;margin-left:.51in;"><span style="color:#7f0055;font-family:'Courier New', monospace;font-size:xx-small;"><strong><br />
</strong></span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;"><strong>5.2 Using Hibernate legacy XML file.</strong></span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">The traditional way of declaring the mapping is the hibernate configuration file and we can see in this example how we declare the same mapping by XML file.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Verdana, sans-serif;">This is the most simple and popular way of declaring the mapping, we can also specify the mapping between come other class and table in the same file or we can maintain separate mapping file for each table.</span></p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;">&lt;?xml version=&#8221;1.0&#8243;?&gt;</p>
<p style="margin-bottom:0;">&lt;!DOCTYPE hibernate-mapping PUBLIC</p>
<p style="margin-bottom:0;">&#8220;-//Hibernate/Hibernate Mapping DTD 3.0//EN&#8221;</p>
<p style="margin-bottom:0;">&#8220;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&#8221;&gt;</p>
<p style="margin-bottom:0;">&lt;hibernate-mapping&gt;</p>
<p style="margin-bottom:0;">&lt;class name=&#8221;roseindia.tutorial.hibernate.Contact&#8221; table=&#8221;CONTACT&#8221;&gt;</p>
<p style="margin-bottom:0;">&lt;id name=&#8221;id&#8221; type=&#8221;long&#8221; column=&#8221;ID&#8221; &gt;</p>
<p style="margin-bottom:0;">&lt;generator class=&#8221;assigned&#8221;/&gt;</p>
<p style="margin-bottom:0;">&lt;/id&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;firstName&#8221;&gt;</p>
<p style="margin-bottom:0;">&lt;column name=&#8221;FIRSTNAME&#8221; /&gt;</p>
<p style="margin-bottom:0;">&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;lastName&#8221;&gt;</p>
<p style="margin-bottom:0;">&lt;column name=&#8221;LASTNAME&#8221;/&gt;</p>
<p style="margin-bottom:0;">&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;property name=&#8221;email&#8221;&gt;</p>
<p style="margin-bottom:0;">&lt;column name=&#8221;EMAIL&#8221;/&gt;</p>
<p style="margin-bottom:0;">&lt;/property&gt;</p>
<p style="margin-bottom:0;">&lt;/class&gt;</p>
<p style="margin-bottom:0;">&lt;/hibernate-mapping&gt;</p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><em>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.article to be completed soon !</em></p>
<p style="margin-bottom:0;">&nbsp;</p>
<div id="_mcePaste" class="mcePaste" style="position:absolute;width:1px;height:1px;overflow:hidden;top:0;left:-10000px;">﻿</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=96&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2011/01/28/hibernate_first_tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>

		<media:content url="http://manjul.files.wordpress.com/2011/01/hb_arc_12.jpg?w=300" medium="image">
			<media:title type="html">Hibernate Architecture</media:title>
		</media:content>

		<media:content url="http://manjul.files.wordpress.com/2011/01/hb_arc_21.jpg?w=300" medium="image">
			<media:title type="html">Hibernate Detailed Architecture</media:title>
		</media:content>
	</item>
		<item>
		<title>Drill Down Pivot Table in Adobe Flex</title>
		<link>http://manjul.wordpress.com/2009/09/15/drill-down-pivot-table-in-adobe-flex/</link>
		<comments>http://manjul.wordpress.com/2009/09/15/drill-down-pivot-table-in-adobe-flex/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 04:57:53 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Utilities & Tools]]></category>
		<category><![CDATA[Adobe flex Drill Down Pivot Table]]></category>
		<category><![CDATA[Clickable Pivot table]]></category>
		<category><![CDATA[Drill Down Pivot Table in Adobe Flex]]></category>
		<category><![CDATA[Drill Down Pivot Table in Flex]]></category>
		<category><![CDATA[Drilldown pivot table]]></category>
		<category><![CDATA[Dynamic Pivot table]]></category>
		<category><![CDATA[Dynamic Pivot table in Flex]]></category>
		<category><![CDATA[Expandable Pivot table]]></category>
		<category><![CDATA[Expandable Pivot table in Adobe Flex]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/?p=63</guid>
		<description><![CDATA[This has been a very demanding feature among most of the business users to display drill down Pivot Table. In our previous blog we have gone through about how to create a Pivot Table. Drill down Pivot table enable you to click on any cell and it would display the full result set for that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=63&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This has been a very demanding feature among most of the business users to display drill down Pivot Table. In our previous blog we have gone through about how to create a Pivot Table. Drill down Pivot table enable you to click on any cell and it would display the full result set for that summary data.</p>
<table border="1" width="100%">
<tbody>
<tr>
<td width="100%">
<a href="http://manjul.wordpress.com/2009/09/12/create-pivot-table-in-adobe-flex/"><br />
Previous blog: How to create simple pivot table.</td>
<p></a><br />
</tr>
<tr>
<td width="100%"><a href="http://manjul.webs.com/htmls/html_simplePivot.html">Experience Previous Example </a></td>
</tr>
<tr>
<td width="100%"><a href="http://manjul.webs.com/flexsrc/simplePivot.mxml">Download the Code</a></td>
</tr>
</tbody>
</table>
<p><strong>Creating Drill Down Pivot Table:  </strong>                                                                                                                                                                                                                                                     We can devide the work in four following logical sections. Each one has its own specific purpose.   </p>
<p><strong>1: Adding event listener on Cell Click.</strong></p>
<p><strong>2: Fetching Selected Cell information on Cell Click.</strong></p>
<p><strong>3: Make another service call for this selected information.</strong></p>
<p><strong>4: Display the received drilled data in a grid\popup window or anyother option of your choice.</strong></p>
<p><strong></strong> </p>
<p><strong>1: Adding event listener on cell click:</strong></p>
<p>We know that in flex OLAPDataGrid is the UI component to display the Pivot table and OLAPCube is the model object which holds information of Pivot Dimentions.</p>
<p>&lt;mx:OLAPDataGridFONT-SIZE: 10pt; COLOR: #990000; FONT-FAMILY: &#8216;Courier New&#8217;&#8221;&gt;myOLAPDG&#8221;  defaultCellString=&#8221;" visible=&#8221;true&#8221; itemClick=&#8221;olapClick(event)&#8221; selectionMode=&#8221;multipleCells&#8221; allowMultipleSelection=&#8221;false&#8221; dataProvider=&#8221;{dataSet}&#8221;      /&gt;  </p>
<p>OLAPData grid is very much similar to the dataGrid component. Default grid allows you to select a row at a time, so you will have to specify that your selection usnit is Cell by setting property selectionMode=”multipleCell”.</p>
<p>We can add an event listener by setting it’s itemClick property by specifying a event listener function. You can also do this by using AddEventListener api at on page load. Other properties you see in code snippet are the normal we can specify with any normal pivot table always like dataprovider etc.                                   </p>
<p><strong>2: Fecthing cell data on cell click.</strong><br />
We have written a function by name olapClick and calling the same on pivot click, now lets look into this fucntion. Main job of this fucntion is to findout the clicked cell and its correcponding Row and Column field name and it’s value.</p>
<p>function olapClick(event:ListEvent){<br />
pvtSlectedColNo = event.columnIndex -1 ; // row count starts from 0 , but colum starts from 1<br />
pvtSelectedRowNo = event.rowIndex;<br />
pivotRowField = &#8220;EMPLOYEE&#8221;;<br />
pivotRowFieldDim = &#8220;EMPLOYEEDim&#8221;;<br />
pivotColField = &#8220;DATE&#8221;;<br />
pivotColFieldDim = &#8220;DATEDim&#8221;;</p>
<p>var op:OLAPAxisPosition = myOLAPDG.selectedItem as OLAPAxisPosition;<br />
var pivotData:OLAPResult= myOLAPDG.dataProvider as OLAPResult;<br />
var cell:OLAPCell = pivotData.getCell(pvtSelectedRowNo,pvtSlectedColNo) as OLAPCell;<br />
var axis:IOLAPResultAxis = pivotData.getAxis(1) as IOLAPResultAxis;<br />
var dim:IOLAPDimension = myMXMLCube.findDimension(pivotColFieldDim) as IOLAPDimension;<br />
var att:IOLAPAttribute = dim.findAttribute(pivotColField) as IOLAPAttribute;<br />
var rowList:IList = att.children;<br />
var temp:IOLAPMember = rowList[pvtSlectedColNo];<br />
pivotColSelected = temp.displayName<br />
var colList:Array = myOLAPDG.columns;<br />
dim = myMXMLCube.findDimension(pivotRowFieldDim) as IOLAPDimension;<br />
att = dim.findAttribute(pivotRowField) as IOLAPAttribute;<br />
var rowList:IList = att.children;<br />
var temp:IOLAPMember = rowList[pvtSelectedRowNo];<br />
pivotRowSelected = temp.displayName</p>
<p>Alert.show(pivotDataSet+pivotRowField+pivotRowSelected);<br />
Alert.show(tempData+pivotColField+pivotColSelected);<br />
setDrillData();<br />
}</p>
<p>In this function we have tried to fetch the value of selectedRow , selectedColumn, and selected Cell data. Later this value would be used for expandable report or view. We can use this piece of information to make another AJAX call by httpService request and once we receive the resultset of the second call we can populate this drilled down information in any other grid or popup window.</p>
<p>yet to write on last two sections&#8230;</p>
<table border="1" width="100%">
<tbody>
<tr>
<td width="100%"><a href="http://manjul.webs.com/htmls/html_drillDownPivot.html"><strong>Experience Drill Down Pivot Table </strong></a></td>
</tr>
<tr>
<td width="100%"><a><strong>Download the Code</strong></a></td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=63&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2009/09/15/drill-down-pivot-table-in-adobe-flex/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
		<item>
		<title>Create Pivot Table in Adobe Flex</title>
		<link>http://manjul.wordpress.com/2009/09/12/create-pivot-table-in-adobe-flex/</link>
		<comments>http://manjul.wordpress.com/2009/09/12/create-pivot-table-in-adobe-flex/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 18:29:10 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Adobe Flex Pivot Table]]></category>
		<category><![CDATA[Adobe Flex Pivot Table example]]></category>
		<category><![CDATA[Adobe Flex Pivot Table tutorial]]></category>
		<category><![CDATA[Creating Pivot in Adobe Flex]]></category>
		<category><![CDATA[Dynamic Pivot table Example]]></category>
		<category><![CDATA[Dynamic Pivota table]]></category>
		<category><![CDATA[Flash Pivot Table]]></category>
		<category><![CDATA[Flex Pivot]]></category>
		<category><![CDATA[Flex Pivot Table]]></category>
		<category><![CDATA[Flex Pivot table example]]></category>
		<category><![CDATA[OLAP Table]]></category>
		<category><![CDATA[OLAPDataGrid Example]]></category>
		<category><![CDATA[OLAPGrid]]></category>
		<category><![CDATA[Pivot]]></category>
		<category><![CDATA[Pivot table]]></category>
		<category><![CDATA[Pivot table Example in Flex]]></category>
		<category><![CDATA[Pivot table in Flex]]></category>
		<category><![CDATA[Pivot Table Tutorial]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/?p=44</guid>
		<description><![CDATA[Pivot Table Basic Inroduction: Pivot table is a very useful tool for data anlysis in multiple dimention. This is one of the most usefull utility in Excel file to transform the tabular data into more useful and analyticl fashion. We can see below in s simple usecase how we can transform tabular data in to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=44&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#800000;">Pivot Table Basic Inroduction:</span></strong></p>
<p>Pivot table is a very useful tool for data anlysis in multiple dimention. This is one of the most usefull utility in Excel file to transform the tabular data into more useful and analyticl fashion. We can see below in s simple usecase how we can transform tabular data in to pivot table view.</p>
<p>Suppose we have given this source data, it would be little difficult to analys the day basis cost analysis for the employees.</p>
<p><img class="aligncenter size-full wp-image-54" title="pvt1" src="http://manjul.files.wordpress.com/2009/09/pvt12.jpg?w=574&#038;h=203" alt="pvt1" width="574" height="203" /> </p>
<p> </p>
<p>Better solution is to transfor the given tabulare data into Pivot table for the given dimentions.</p>
<p>Pivot View: </p>
<p><img class="aligncenter size-full wp-image-56" title="pvt1form" src="http://manjul.files.wordpress.com/2009/09/pvt1form3.jpg?w=576&#038;h=183" alt="pvt1form" width="576" height="183" /></p>
<p><span style="color:#800000;"><strong>Creating Pivot in Adobe Flex:</strong></span></p>
<p><strong>Working with DataGrid comonent.</strong></p>
<p>Adobe flex provides us many wiidgets and components for data presenation and data visualisation like table, grid, progressbas, list, pivot table, charts etc&#8230;</p>
<p>Befor going into pivot table, it is desired that developer should be comfortable with datagrid component of flex. </p>
<p>To read more on adobe flex datagrid follow adobe live docs, it is explained in detail there:</p>
<p><a href="http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html">http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html</a></p>
<p>We will cover a small overview of datagrid comonent.</p>
<p><strong>DataGrid definition in MXML part:</strong></p>
<p>&lt;mx:DataGrid id=&#8221;myDataGrid&#8221; dataProvider=&#8221;{pivotDataSet}&#8221; &gt;<br />
 &lt;mx:columns&gt;<br />
       &lt;mx:DataGridColumn headerText=&#8221;EMPLOYEE&#8221; ataField=&#8221;EMPLOYEE&#8221; /&gt;<br />
       &lt;mx:DataGridColumn headerText=&#8221;DATE&#8221; dataField=&#8221;DATE&#8221;/&gt;<br />
  &lt;mx:DataGridColumn headerText=&#8221;COST&#8221; dataField=&#8221;COST&#8221;/&gt;<br />
  &lt;mx:DataGridColumn headerText=&#8221;AMOUNT&#8221; dataField=&#8221;AMOUNT&#8221;/&gt;<br />
 &lt;/mx:columns&gt;<br />
&lt;/mx:DataGrid&gt; </p>
<p>Those who has worked datagrid would be familiar that we need to define a data provide for this grid and need to populate data through this data provider.</p>
<p>Filling data in dataprovider, we can have a httpService ajax call to fetch data from the servers and load into this data provider. We are not going in that topic as it is a separate section, so we assume that user has written required code to lad data into data provider.Looking at the abstract view of onDataReceive function, which you call upon receiving data from the httpService request.</p>
<p>private function onDataRcv(event:ResultEvent):void<br />
{<br />
 //fetch data from the result set data, as per your return value</p>
<p>//data structure<br />
   gridData = dataRcvdFromResulSet;<br />
} </p>
<p>Having code ready till this level we assume that you datagrid is created and data is also populated.</p>
<p><span style="color:#800000;"><strong>Creating Pivot Table:</strong></span></p>
<p>Pivot table compponent has two associated objects.</p>
<ol>
<li><strong>OLAPDataGrid:</strong> This object is used to display pivot table on your page, just like dataGrid component.</li>
</ol>
<p>&lt;mx:OLAPDataGrid id=&#8221;myOLAPDG&#8221;  temClick=&#8221;olapClick(event)&#8221;<br />
selectionMode=&#8221;multipleCells&#8221; allowMultipleSelection=&#8221;false&#8221;/&gt;</p>
<p><strong>   2.   OLAPCube:</strong> Main object, like a model and holds full pivot defenition, inculuding pivot dimentions and hierarchy.</p>
<p><span style="font-size:x-small;color:#0000ff;"> </span></p>
<p>  &lt;mx:OLAPCube name=&#8221;FlatSchemaCube&#8221;<br />
        dataProvider=&#8221;{pivotDataSet}&#8221;<br />
        id=&#8221;myMXMLCube&#8221;<br />
        complete=&#8221;runPvtQuery();&#8221;&gt;<br />
    <br />
        &lt;mx:OLAPDimension name=&#8221;EMPLOYEEDim&#8221;&gt;<br />
            &lt;mx:OLAPAttribute name=&#8221;EMPLOYEE&#8221; dataField=&#8221;EMPLOYEE&#8221;/&gt;<br />
            &lt;mx:OLAPHierarchy name=&#8221;EMPLOYEEHier&#8221; hasAll=&#8221;true&#8221;&gt;<br />
                &lt;mx:OLAPLevel attributeName=&#8221;EMPLOYEE&#8221;/&gt;<br />
            &lt;/mx:OLAPHierarchy&gt;<br />
        &lt;/mx:OLAPDimension&gt;<br />
   <br />
        &lt;mx:OLAPDimension name=&#8221;PRODUCTDim&#8221;&gt;<br />
            &lt;mx:OLAPAttribute name=&#8221;PRODUCT&#8221; dataField=&#8221;PRODUCT&#8221;/&gt;<br />
            &lt;mx:OLAPHierarchy name=&#8221;PRODUCTHier&#8221; hasAll=&#8221;true&#8221;&gt;<br />
                &lt;mx:OLAPLevel attributeName=&#8221;PRODUCT&#8221;/&gt;<br />
            &lt;/mx:OLAPHierarchy&gt;<br />
        &lt;/mx:OLAPDimension&gt;</p>
<p>        &lt;mx:OLAPDimension name=&#8221;DATEDim&#8221;&gt;<br />
            &lt;mx:OLAPAttribute name=&#8221;DATE&#8221; dataField=&#8221;DATE&#8221;/&gt;<br />
            &lt;mx:OLAPHierarchy name=&#8221;DATEHier&#8221; hasAll=&#8221;true&#8221;&gt;<br />
                &lt;mx:OLAPLevel attributeName=&#8221;DATE&#8221;/&gt;<br />
            &lt;/mx:OLAPHierarchy&gt;<br />
        &lt;/mx:OLAPDimension&gt;<br />
   <br />
        &lt;mx:OLAPMeasure name=&#8221;AMOUNT&#8221;<br />
            dataField=&#8221;AMOUNT&#8221;<br />
            aggregator=&#8221;SUM&#8221;/&gt;<br />
    &lt;/mx:OLAPCube&gt;</p>
<p> </p>
<p><strong> 3:   runPvtQuery:</strong>  If you see in the above OLAPCude defenition, a function is specified on creation complete = runPvtQuery. Since we have already specified the dataStructure of the Pivot table and if you notice we have also specified the data source also, then what does this function do?.</p>
<p>This functions job is to run a query on this cube for the specified data set to fetch the desired out put.  You can imagine a group by kind of SQL query which gives you data in grouped format, this is also doing something like that.</p>
<p>private function runPvtQuery():void {<br />
            var cube:IOLAPCube = myMXMLCube;<br />
            var query:IOLAPQuery = getQuery(cube);<br />
            var token:AsyncToken = cube.execute(query);<br />
            token.addResponder(new AsyncResponder(showResult, showFault));<br />
}</p>
<p> <strong>4:   getQuery():</strong> getQuery function actually performs the query on the given data set on the basis of specified dimensions. We cann see here that we have specifed row domension as EMPLOYEE and column dimension as DATE, so it will rearrand the data for the given dimensions and return the data set which can be feeded to the OLAPDataGrid.</p>
<p> private function getQuery(cube:IOLAPCube):IOLAPQuery {<br />
     var rwId = “EMPLOYEE”;<br />
     var rwDim = “EMPLOYEEDim”;<br />
     var colId = “DATE”;<br />
     var colDim = “DATEDim”;<br />
     var query:OLAPQuery = new OLAPQuery;<br />
     var rowQueryAxis:IOLAPQueryAxis = query.getAxis    (OLAPQuery.ROW_AXIS);<br />
    var RowSet:OLAPSet = new OLAPSet;<br />
    RowSet.addElements(cube.findDimension(rwDim).findAttribute(rwId).children);<br />
   rowQueryAxis.addSet(RowSet);<br />
   var colQueryAxis:IOLAPQueryAxis = query.getAxis (OLAPQuery.COLUMN_AXIS);        <br />
   var DATESet:OLAPSet= new OLAPSet;<br />
    DATESet.addElements(cube.findDimension(colDim).findAttribute(colId).children);<br />
   colQueryAxis.addSet(DATESet);<br />
   return query;      <br />
  }</p>
<p> </p>
<table width="100%" border="1">
<tr>
<td width="100%">
<a href="http://manjul.webs.com/htmls/html_simplePivot.html"> <strong>Experience this Example </strong></a>
</td>
</tr>
<tr>
<td width="100%">
<a href="http://manjul.webs.com/flexsrc/simplePivot.mxml"><strong>Download the Code</strong></a>
</td>
</tr>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=44&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2009/09/12/create-pivot-table-in-adobe-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>

		<media:content url="http://manjul.files.wordpress.com/2009/09/pvt12.jpg" medium="image">
			<media:title type="html">pvt1</media:title>
		</media:content>

		<media:content url="http://manjul.files.wordpress.com/2009/09/pvt1form3.jpg" medium="image">
			<media:title type="html">pvt1form</media:title>
		</media:content>
	</item>
		<item>
		<title>Multithreading in Java</title>
		<link>http://manjul.wordpress.com/2009/09/03/multithreading/</link>
		<comments>http://manjul.wordpress.com/2009/09/03/multithreading/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 18:30:03 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[Java and J2EE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Multithreading]]></category>
		<category><![CDATA[Multithreading]]></category>
		<category><![CDATA[Synchronization]]></category>
		<category><![CDATA[Thread synchronization.]]></category>
		<category><![CDATA[Threads]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/?p=39</guid>
		<description><![CDATA[Java Multithreading <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=39&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Multithreading</strong></p>
<p>Usually a program has logic to execute and some objects or data to modify. In a single threaded system program executes in a sequence line by line. Multithreaded system can allow multiple threads to execute a program parallel in multiple instances. If there is any part of code dealing with the object data modification, there is no guarantee that it will not be attempted any more than one thread at a time.</p>
<p>Now there a need to make sure that such kind of code should be executed exclusively. To achieve this in Java we a concept of LOCK. Using Lock mechanism thread holds complete hold on an object and object is also can not be access any other thread except the thread holding that lock. Lock is an object level control and one thread only can hold it at a time.</p>
<p><strong>Synchronized</strong>: We have to specify about the piece of code in a program which should be run exclusively. It could be a code segment or a complete function. Synchronised can be used in following ways:</p>
<p>Function level synchronise will fetch a lock on the object, this function is defined in.</p>
<p>1)  synchronised function updateTotal(){</p>
<p>..</p>
<p>..</p>
<p>}</p>
<p>2)  a block of code can also be defined as synchronised with an specified object, to capture a lock control on. </p>
<p>function updateTotal(){</p>
<p>..</p>
<p>..</p>
<p>Synchronised(this){</p>
<p>                ..</p>
<p>..</p>
<p>                }</p>
<p>}</p>
<p> </p>
<p><strong>Thread Sates or Life cycle</strong>. Thread follwos a life cycle, which starts from the threation till it is destroyed.</p>
<p> <img class="aligncenter size-full wp-image-41" title="multith" src="http://manjul.files.wordpress.com/2009/09/multith.jpg?w=378&#038;h=289" alt="multith" width="378" height="289" /></p>
<p><strong>New State</strong>: This is the first state when thread object is created. Thread will be in this state untill the run method is not called of.</p>
<p><strong>Runnable:</strong> Once the run method is called, thread goes in the runnble state.  While it is in a runnable state it is eligible to get process time to execute its part. Process though will keep disributing the time among all the active threads. Thread can also move to waiting state due to two reasons. 1 Timed waiting 2: Object waiting. Threads not in runnable states do not get process time.</p>
<p><strong>TimedWaiting</strong>: Tread is forced to wait for some period of time may be by using Thread.sleep method. It will automatically come back to runnable state once specifiled time is over.</p>
<p><strong>ObjectWaiting:</strong> Some time a thread need a lock on a object and that object is being used bus another prohram or thread, in this case thread will wait for this object untill the object is not free. Some time this can cause a deadlock schenario if there is a possiblility that threads are using same objects in multiple situations and if the program is not designed properly.</p>
<p> </p>
<p><strong>Inter Thread Communication</strong>: When threads are trying to access a common object and that is bieng used by another thread. Theres has to be some way to notify the waiting threads once that object becomes free. This is achieved by wait,notify, notifyAll machanism. Wait and Notify is a machanism by which we can send signals between the thread when some specific condition is met.</p>
<p>Live Example:<br />
======================================<br />
package corejava.threads;</p>
<p>import java.util.ArrayList;<br />
import java.util.Random;</p>
<p>class Pool{<br />
	ArrayList pool = new ArrayList();<br />
	int maxSize=10;<br />
	public synchronized String popItem(){<br />
		if(this.pool.size() = maxSize){<br />
			System.out.println(&#8220;List Full !&#8221; + this.pool.size());<br />
			try {<br />
				wait();<br />
			} catch (InterruptedException e) {<br />
				// TODO Auto-generated catch block<br />
				e.printStackTrace();<br />
			}<br />
		}<br />
		notify();<br />
		pool.add(item);<br />
	}</p>
<p>}</p>
<p>class Supplier extends Thread{<br />
	Pool poolSet;<br />
	public Supplier(Pool poolSet) {<br />
		this.poolSet = poolSet;<br />
		this.setName(&#8220;Supplier&#8221;);<br />
	}<br />
	public void run() {<br />
		while(true){<br />
			String rand = new Random().toString();<br />
			System.out.println(this.getName()+&#8221; Adding &#8221; + rand);<br />
			poolSet.pushItem(rand);<br />
			try {<br />
				Thread.sleep(1000);<br />
			} catch (InterruptedException e) {<br />
				e.printStackTrace();<br />
			}<br />
		}</p>
<p>	}</p>
<p>}</p>
<p>class Consumer extends Thread{<br />
	Pool poolSet;<br />
	public Consumer(Pool poolSet) {<br />
		this.poolSet = poolSet;<br />
		this.setName(&#8220;Consumer&#8221;);<br />
	}<br />
	public void run() {<br />
		while(true){</p>
<p>			System.out.println(this.getName()+&#8221; Read: &#8221; + poolSet.popItem());</p>
<p>			try {<br />
				Thread.sleep(10000);<br />
			} catch (InterruptedException e) {<br />
				e.printStackTrace();<br />
			}<br />
		}</p>
<p>	}</p>
<p>}</p>
<p>public class TestThread {<br />
	public static void main(String[] args){<br />
		Pool mypool = new Pool();<br />
		Supplier sup = new Supplier(mypool);<br />
		Consumer con = new Consumer(mypool);</p>
<p>		con.start();<br />
		sup.start();</p>
<p>	}<br />
}</p>
<p>======================================</p>
<p>Above Example demonstrate three classes Pool , Consumer and Supplier as all are part defined under the main program so that class Consumer and Supplier have direct access to the object of Class Pool.</p>
<p>Otherwise if they are we can also pass PoolC class object to Consumer and Supplies class constructor if they are not under a same class.</p>
<p><strong>Notify() and NotifyAll():</strong> It’s a good question to ask that what’s difference between notify() and notifyAll() methos. Notify() method will send a signal to one of the thread waiting for the same object (this may depend on any criteria like thread priprity or it can also be random). Whereas notifyAll() will send signal to all the threads who are waiting for that object and then it is upto the processor which therads it allows to execute.</p>
<p> </p>
<p><strong>Sleep() method:</strong> Sleep method is a static method and called from the Thread class directly. Thread.sleep(100) and it throws intereuptException, so you have to catch it also.</p>
<p><strong>wait() method:</strong> Wait is the method of Object class and should always be called from the synchronised block of code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=39&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2009/09/03/multithreading/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>

		<media:content url="http://manjul.files.wordpress.com/2009/09/multith.jpg" medium="image">
			<media:title type="html">multith</media:title>
		</media:content>
	</item>
		<item>
		<title>Create Dynamic PDF from Java Appplication</title>
		<link>http://manjul.wordpress.com/2009/06/08/create-dynamic-pdf-from-java-appplication/</link>
		<comments>http://manjul.wordpress.com/2009/06/08/create-dynamic-pdf-from-java-appplication/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 17:29:32 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[Programing &  Scripting]]></category>
		<category><![CDATA[Create PDF in J2EE]]></category>
		<category><![CDATA[Create PDF in JAVA Application]]></category>
		<category><![CDATA[Dynamic PDF]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/?p=30</guid>
		<description><![CDATA[Article is Under Writing.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=30&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Article is Under Writing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=30&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2009/06/08/create-dynamic-pdf-from-java-appplication/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
		<item>
		<title>Generate and Send an Excel file from J2EE WebApplication</title>
		<link>http://manjul.wordpress.com/2008/12/06/generate-and-send-an-excel-file-from-j2ee-webapplication/</link>
		<comments>http://manjul.wordpress.com/2008/12/06/generate-and-send-an-excel-file-from-j2ee-webapplication/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 13:01:55 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[TechBlog]]></category>
		<category><![CDATA[Utilities & Tools]]></category>
		<category><![CDATA[download excel]]></category>
		<category><![CDATA[dynamic serverside excel]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/?p=15</guid>
		<description><![CDATA[simple explenatery artile, but you can do more out of it once you start understanding that.  
feel free to contact me manjulx@gmail.com.
- Manjul<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=15&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"><strong><span style="font-family:Verdana;"><span style="font-size:small;"><span style="color:#0000ff;">Generating Excel file in J2EE Server.</span></span></span></strong></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">This article is written to describe a simple way of generating an Excel file in Java. We will be using an open source Java Excel API  ( jxl </span><a href="http://jexcelapi.sourceforge.net/"><span style="font-size:small;">http://jexcelapi.sourceforge.net/</span></a><span style="font-size:small;"> ) to dynamically generate an excel file and reading and modifying an existing excel file.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">Using this technology we can directly generate an Excel file on the fly on a user request.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">In a typical web application a user can request for an excel sheet based report from a web based application. </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">With the proper integration of this API and the server side backend data layer, we can transform the fetched data into an excel sheet. Later this excel sheet can be sent to client side using proper http response header information.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">To begin with the application we need to download the jxl.jar file and put it under the project folder.  To download go to the URL: </span><a href="http://sourceforge.net/"><span style="font-size:small;">http://sourceforge.net</span></a><span style="font-size:small;">, and under File section you have a link to download the required jar files.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">Code side view: </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">We may need following classes depending on our need:</span></span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">1)</span></strong></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.Workbook;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.format.Colour;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.format.UnderlineStyle;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.Label;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.Number;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.WritableCellFormat;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.WritableFont;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.WritableSheet;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.WritableWorkbook;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.WriteException;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">import</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> jxl.write.biff.RowsExceededException;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">2) Create workflow object:</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;background:silver;color:black;font-family:Verdana;">WritableWorkbook</span><span style="font-size:10pt;color:black;font-family:Verdana;">  </span><span style="font-size:10pt;background:silver;color:#0000c0;font-family:Verdana;">wrtWorkbook</span><span style="font-size:10pt;color:black;font-family:Verdana;"> = Workbook.<em>createWorkbook</em>(</span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">File(</span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">“MyExcel.xls”</span><span style="font-size:10pt;color:black;font-family:Verdana;">));</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">WritableSheet </span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">sheet1</span><span style="font-size:10pt;color:black;font-family:Verdana;"> ;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">This function will create a writable workBook object. We can specify the location of the Excel file otherwise it will create in the current running folder. Later using defined API’s we can add worksheets on this workbook. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Note in case on reading excel sheet, we need to create WorkBook class </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Object not WritableWorkBook.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">3) Create worksheet :</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">sheet1</span><span style="font-size:10pt;color:black;font-family:Verdana;"> = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">this</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;">.</span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">wrtWorkbook</span><span style="font-size:10pt;color:black;font-family:Verdana;">.createSheet(“Sheet1”,0);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">params: sheetname and location.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Here we have created a worksheet for the workbook, minimum one worksheet is required for a workbook to write some data in it. Like an Excel file one workbook can also contain more that one Sheet.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">4) Adding cells :</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">sheet1</span><span style="font-size:10pt;color:black;font-family:Verdana;">.addCell(number);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Once the sheet object is created, we will use following API to write data in the specified cells. Here we are giving very simple demonstration but if require it also supports various kind of formatting.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">To add number </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Number number = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> Number(</span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">colIndex</span><span style="font-size:10pt;color:black;font-family:Verdana;">, </span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">rowIndex</span><span style="font-size:10pt;color:black;font-family:Verdana;">, num);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">sheet1</span><span style="font-size:10pt;color:black;font-family:Verdana;">.addCell(number);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">To add string </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Label label = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> Label(</span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">colIndex</span><span style="font-size:10pt;color:black;font-family:Verdana;">, </span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">rowIndex</span><span style="font-size:10pt;color:black;font-family:Verdana;">, str);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">sheet1</span><span style="font-size:10pt;color:black;font-family:Verdana;">.addCell(label);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">5) Formatted Data</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">We can also specify specific format by using defined format classes:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">WritableFont times10font = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> WritableFont(WritableFont.</span><em><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">TIMES</span></em><span style="font-size:10pt;color:black;font-family:Verdana;">, 10, WritableFont.</span><em><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">NO_BOLD</span></em><span style="font-size:10pt;color:black;font-family:Verdana;">, </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">false</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;">, UnderlineStyle.</span><em><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">NO_UNDERLINE</span></em><span style="font-size:10pt;color:black;font-family:Verdana;">, Colour.</span><em><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">BROWN</span></em><span style="font-size:10pt;color:black;font-family:Verdana;">);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;background:silver;color:black;font-family:Verdana;">WritableCellFormat</span><span style="font-size:10pt;color:black;font-family:Verdana;"> times10format = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> <span style="background:silver;">WritableCellFormat</span> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Label label = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> Label(</span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">colIndex</span><span style="font-size:10pt;color:black;font-family:Verdana;">, </span><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">rowIndex</span><span style="font-size:10pt;color:black;font-family:Verdana;">, str, times10format );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">6) Closing Worksheet</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">wrtWorkbook</span><span style="font-size:10pt;color:black;font-family:Verdana;">.write(); this function will write sheet into workBook</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000c0;font-family:Verdana;">wrtWorkbook</span><span style="font-size:10pt;color:black;font-family:Verdana;">.close();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-family:Verdana;"><span style="font-size:small;"><span style="color:#0000ff;">Sending an Excel file along with the HTTP Response.</span></span></span></strong></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;">In a typical J2EE web application an http Request is processed in doGet\doPost method and a response is generated and send back to the client. We need to set response header to provide specific information about the content it carrying, so that browser can automatically detect the compatible application to open that.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">resp.setHeader(</span><span style="font-size:10pt;color:#2a00ff;font-family:Verdana;">&#8220;Cache-Control&#8221;</span><span style="font-size:10pt;color:black;font-family:Verdana;">, </span><span style="font-size:10pt;color:#2a00ff;font-family:Verdana;">&#8220;max-age=30&#8243;</span><span style="font-size:10pt;color:black;font-family:Verdana;">);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">resp.setContentType(</span><span style="font-size:10pt;color:#2a00ff;font-family:Verdana;">&#8220;application/vnd.ms-excel&#8221;</span><span style="font-size:10pt;color:black;font-family:Verdana;">);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">application/vnd.ms-excel defines that it is an excel spreadsheet application.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">We can defile to send content in inline format or as an attachment.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">resp.setHeader(</span><span style="font-size:10pt;color:#2a00ff;font-family:Verdana;">&#8220;Content-disposition&#8221;</span><span style="font-size:10pt;color:black;font-family:Verdana;">,</span><span style="font-size:10pt;color:#2a00ff;font-family:Verdana;">&#8220;inline; filename=MyExcel.xls</span><span style="font-size:10pt;color:black;font-family:Verdana;">);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">here using java.io API’s we will write Excel file content in the response object. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">ServletOutputStream sos = response.getOutputStream();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">FileInputStream fio = </span><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">new</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;"> FileInputStream(</span><span style="font-size:10pt;color:#2a00ff;font-family:Verdana;">&#8220;./&#8221;</span><span style="font-size:10pt;color:black;font-family:Verdana;"> + “MyExcel.xls”);</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;"> </span></strong></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;color:#7f0055;font-family:Verdana;">while</span></strong><span style="font-size:10pt;color:black;font-family:Verdana;">((c = fio.read()) != -1) {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">          sos.write(c);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">And that’s all. Its all set and Please go and receive the Excel file in the client’s browser.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Regards</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:black;font-family:Verdana;">Manjul </span><span style="font-family:Verdana;"><span style="font-size:small;"><strong> </strong></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Verdana;"><span style="font-size:small;"> </span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=15&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2008/12/06/generate-and-send-an-excel-file-from-j2ee-webapplication/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
		<item>
		<title>WEB 2.0 &#8211; AJAX</title>
		<link>http://manjul.wordpress.com/2007/09/20/web-20-ajax-2/</link>
		<comments>http://manjul.wordpress.com/2007/09/20/web-20-ajax-2/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 17:57:34 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
		
		<guid isPermaLink="false">http://manjul.wordpress.com/2007/09/20/web-20-ajax-2/</guid>
		<description><![CDATA[Introduction to …•         WEB 2.0           •         Why AJAX•         RICH Internet Application•         DOJO•         JSON •         Web 2.0, pronounced “web two point oh” , a phrase coined by O’Reilly Media in 2003•         Second generation of web-based communities and hosted service•         Internet Usage is drastically changed•         Which facilitate collaboration and sharing between users •         Such as social-networking sites,wikis and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=13&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:9pt;font-family:Verdana;">Introduction to …</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">WEB 2.0<span>           </span></span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Why </span><span style="font-size:9pt;font-family:Verdana;">AJAX</span><span style="font-size:9pt;font-family:Verdana;"></span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">RICH Internet Application</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">DOJO</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">JSON</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><em><span style="font-size:9pt;font-family:Verdana;">Web 2.0</span></em><span style="font-size:9pt;font-family:Verdana;">, pronounced “web two point oh” </span><span style="font-size:9pt;font-family:Verdana;">, a phrase coined by O’Reilly Media in 2003</span><u><span style="font-size:9pt;font-family:Verdana;"></span></u><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Second generation of web-based communities and hosted service</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Internet Usage is drastically changed</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Which facilitate collaboration and sharing between users </span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Such as social-networking sites,wikis and folksonomies</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">User is part of Application Life Cycle</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform</span><span style="font-size:9pt;font-family:Verdana;"></span><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">Characteristics of &#8220;Web 2.0&#8243;</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">“Network as platform”</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Users owning the data on a site and exercising control over that data.</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">An architecture of participation that encourages users to add value to the application as they use it.</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">A rich, interactive, user-friendly interface based on Ajax or similar frameworks.</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Some social-networking aspects</span><span style="font-size:9pt;font-family:Verdana;"></span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">Technology Overview<span>  </span>“Web 2.0”</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Rich Internet Application techniques, optionally Ajax based</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">CSS</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Semantically valid HTML markup and the use of microformats</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Syndication and aggregation of data in RSS/Atom</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Clean and meaningful URLs</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Use of Open source software either completely or partially</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Weblog publishing</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"></span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Mashup</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">AJAX</span></em></strong><strong><em><span style="font-size:9pt;font-family:Verdana;"> – The Detail…</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Allows user to continue interacting with web page while waiting for data to be returned</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Page can be updated without refreshing browser</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Results in a better user experience</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">There are </span><span style="font-size:9pt;font-family:Verdana;">AJaX</span><span style="font-size:9pt;font-family:Verdana;"> libraries that reduce the amount of JavaScript code that must be written</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Not dependent on any language or data structure</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Works with XHTML and JAVAScript</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Dynamic display an interaction using the Document Object model</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Asynchronous data retrieval using XMLHttpRequest</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Javascript binding Every thing together</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">XMLHttpRequest</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">JavaScript XMLHttpRequest object</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">With this object, your JavaScript can trade data with a web server, without reloading the page</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Allows HTTP Request to be sent from JavaScript code</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">HTTPResponse are processed by the handler functions, in the client side</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Browser dependent </span><span style="font-size:9pt;font-family:Verdana;"> </span><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">XMLHttpRequest Object Properties</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">readyState</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– 0 = UNINITIALIZED; open not yet called</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– 1 = LOADING; send for request not yet called</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– 2 = LOADED; send called, headers and status are available</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– 3 = INTERACTIVE; downloading response,</span><span style="font-size:9pt;font-family:Verdana;"><span>                                    </span>responseText only partially set</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– 4 = COMPLETED; finished downloading response</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">responseText</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– response as text; null if error occurs or ready state &lt; 3</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">responseXML</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– response as DOM Document object; null if error occurs or ready state &lt; 3</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">status </span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– integer status code</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">statusText </span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– string status</span><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">XMLHttpRequest Object Methods</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"></span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Basic methods</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span>– open(method, url[, async]) – initializes a new HTTP request</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>• method can be &#8220;GET&#8221;, &#8220;POST&#8221;, &#8220;PUT&#8221; or &#8220;DELETE&#8221;</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>• url must be an HTTP URL (start with &#8220;http://&#8221;)</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>• async is a boolean indicating whether request should be sent asynchronously</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>– defaults to true</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span>– send(body) – sends HTTP request</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span>-<span>  </span>abort() – called after send() to cancel request </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span></span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Header methods</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span>– void<span>    </span>setRequestHeader(name, value)</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span>– String getResponseHeader(name)</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>Returns the string value of a single header label </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>            </span>– String getAllResponseHeaders()</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>Returns a string where “header: value” pairs are delimited by carriage returns</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"> </span><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">Rich Internet Applications (RIA)</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Unlike traditional web applications centered all activity around a client-server architecture with a thin client</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Web applications that have the features and functionality similar to desktop applications</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Run in a Web browser, or do not require software installation</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Intermediate layer of code, often called a client engine, between the user and the server</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Features:</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Richer.</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-More responsive</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Client/Server balance</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Asynchronous communication</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Network efficiency and more…</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Tools:</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-JavaScript</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Adobe Flash</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Microsoft Silverlight</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Sun Microsystem JavaFX</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>-Java Applets and more…</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">DOJO</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"></span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Dojo is an Open Source DHTML toolkit written in JavaScript</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Designed to ease the rapid development of JavaScript- or Ajax-based applications and web sites</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Dojo provides to make your web sites more usable, responsive, and functional</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Provides API for Event system, I/O APIs, and generic language enhancement</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">You can use the Dojo build tools to write command-line unit-tests for your JavaScript code</span><span style="font-size:9pt;font-family:Verdana;"></span><span style="font-size:9pt;font-family:Verdana;"> </span><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">DOJO Features</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"></span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Widgets: Dojo widgets are prepackaged components of JavaScript code, HTML markup and CSS style declarations that can be used to enrich websites with various interactive features that work across browsers: ex : Menus, tabs etc</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Asynchronous communication</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Dojo provides an abstracted wrapper “dojo.io.bind”</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">JavaScript programming</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Packaging system: Packaging system to facilitate modular development of functionality in individual packages and sub-packages</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Dojo File Upload</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Client-side data storage: In addition<span>  </span>to cookies Dojo also provides a local, client-side storage abstraction named Dojo Storage</span><span style="font-size:9pt;font-family:Verdana;"></span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">JSON</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"></span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">JSON (JavaScript Object Notation) is a lightweight data-interchange format. </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Generic Data Structure for data exchange between client and server.</span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><span style="font-size:9pt;font-family:Verdana;">Text format that is completely language independent but uses conventions that are familiar to programmers of most of the languages, including C, C++, C#, Java, JavaScript, Perl, Python etc.</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">Client Side JSON </span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"><span>  </span></span></strong><span style="font-size:9pt;font-family:Verdana;">Creating the JSON string.</span><span style="font-size:9pt;font-family:Verdana;"><span>  </span>var myJSONObject = {&#8220;bindings&#8221;: [</span><span style="font-size:9pt;font-family:Verdana;"><span>        </span>{"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"},</span><span style="font-size:9pt;font-family:Verdana;"><span>        </span>{"ircEvent": "PRIVMSG", "method": "deleteURI", "regex": "^delete.*"},</span><span style="font-size:9pt;font-family:Verdana;"><span>        </span>{"ircEvent": "PRIVMSG", "method": "randomURI", "regex": "^random.*"}<span>   </span>] };<span>                                                                                                                           </span>myJSONObject.bindings[0].method // &#8220;newURI&#8221; </span><span style="font-size:9pt;font-family:Verdana;">. Fetching the JSON Value retrieved from Server<span>                                                                    </span>var myObject = eval(&#8216;(&#8216; + myJSONtext + &#8216;)&#8217;);</span><span style="font-size:9pt;font-family:Verdana;"> </span><strong><span style="font-size:9pt;font-family:Verdana;"> </span></strong><span style="font-size:9pt;font-family:Wingdings;"><span>§<span style="font:7pt 'Times New Roman';">          </span></span></span><strong><em><span style="font-size:9pt;font-family:Verdana;">Server Side JSON</span></em></strong><strong><span style="font-size:9pt;font-family:Verdana;"></span></strong><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">JSON is supported by most of the server side language JAVA, ASP, PHP etc.</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Creating a JSON Object</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>JSONObject<span>  </span>jObj = new JSONObject();</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>jObj.put(“key”, value);</span><span style="font-size:9pt;font-family:Verdana;"><span>•<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;font-family:Verdana;">Retrieve JSON data from the Client</span><span style="font-size:9pt;font-family:Verdana;"><span>             </span>String jsonStr = request.getParameter(“actionString”);</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>JSONObject jobj = (JSONObject)JSONValue.parse(jsonStr);</span><span style="font-size:9pt;font-family:Verdana;"><span>                        </span>String actionName = jobj.get(“key”);</span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"> </span><span style="font-size:9pt;font-family:Verdana;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/manjul.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/manjul.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=13&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2007/09/20/web-20-ajax-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
		<item>
		<title>Maftoon&#8230;.tempted</title>
		<link>http://manjul.wordpress.com/2006/11/07/maftoon/</link>
		<comments>http://manjul.wordpress.com/2006/11/07/maftoon/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 11:47:19 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
		
		<guid isPermaLink="false">http://manjul.wordpress.com/2006/11/07/maftoon/</guid>
		<description><![CDATA[Us-zindagi sai kare hum kya gila &#8230; jisne aapko dia hai humse mila&#8230;.. &#8212;- choti bate iskadar tum kia na karo&#8230; zindagi mai dosto pe shakk kia na karo&#8230; dosti to nam hai jine ka pyare&#8230;. is.me marene marne ki bate kia na karo&#8230; &#8212;- Kuch shiquawe kuch shiquayat ..ke bahane hi shi.. Tum yaad [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=9&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Us-zindagi sai kare hum kya gila &#8230;<br />
jisne aapko dia hai humse mila&#8230;..</p>
<p>&#8212;-</p>
<p>choti bate iskadar tum kia na karo&#8230;<br />
zindagi mai dosto pe shakk kia na karo&#8230;<br />
dosti to nam hai jine ka pyare&#8230;.<br />
is.me marene marne ki bate kia na karo&#8230;<br />
&#8212;-</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"><span style="color:#008000;">Kuch shiquawe kuch shiquayat ..ke bahane hi shi..</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"><span style="color:#008000;">Tum yaad to karo iss rah gujaar ko kabhee…</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"><span style="color:#008000;">Jubaan to se falsafe to hardum hi sune hai humne&#8230;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:Verdana;"><span style="color:#008000;">Inn aankho se bhi…. karo bayan is dil ko kabhi….</span></span></p>
<p style="margin-bottom:0;"> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/manjul.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/manjul.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=9&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2006/11/07/maftoon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
		<item>
		<title>Last Dipawali &#8230;.when we were in school.</title>
		<link>http://manjul.wordpress.com/2006/10/17/last-dipawali-when-we-were-in-school/</link>
		<comments>http://manjul.wordpress.com/2006/10/17/last-dipawali-when-we-were-in-school/#comments</comments>
		<pubDate>Tue, 17 Oct 2006 06:45:00 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
		
		<guid isPermaLink="false">http://manjul.wordpress.com/2006/10/17/last-dipawali-when-we-were-in-school/</guid>
		<description><![CDATA[  Last Dipawali &#8230;.when we were in school . Today is 17th October just three days are left for our grand celebration Diwali.  We are so exited about going home and meet our neighbors and friends .     I can easily differentiate the changes , taking place in our mind with the time and surrounding&#8230; I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=8&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p style="margin-bottom:0;">Last Dipawali &#8230;.when we were in school .</p>
<p style="margin-bottom:0;">Today is 17<sup>th</sup> October just three days are left for our grand celebration Diwali.  We are so exited about going home and meet our neighbors and friends .     I can easily differentiate the changes , taking place in our mind with the time and surrounding&#8230;</p>
<p style="margin-bottom:0;">I remember those days when we were in schools&#8230;.Diwali celebration was like :</p>
<p style="margin-bottom:0;">We started making plans for diwali from more one month before. After leaving from the schools we used to see the market ..not one but 10 times before the final day. We started making string of light bulbs called “Jhalars” from a month back so that at the end time we can decorate fully and better than our last years competitors. As days were coming close we also have to go to the tailors to get our dress ready and fighting with parents for not taking us for our shopping. We also had to do some home-work, as a team member of our PM &#8230;I means our mom , she was keep on asking have you cleaned that corner , have you brought that “saman” goods. We also had to go for bringing diwali sweets and “namkeens”.</p>
<p style="margin-bottom:0;">Finally its a time of going to market and purchase crackers,&#8230;. again we got less money, we need more and mom is saying why are you wasting that much of money in crackers but thanks god dad is with us . So we used to go with him and after bringing them, and did not forget to put them in sun-light so that in the night they will give more sound output. Finally diwali evening has come and parents are calling us from ground floor room to come down and do the pooja , I am calling my brother to come down and he is busy in lightening the crackers with his friends. Ok he came and pooja is started (it took around 1 hour ) after that we lighten the whole home with small light lamps ( I specially like this particular part of diwali very much) . Oh god what happened to this “Jhalar” its not working now we need to check it again&#8230;after some trouble finally it was started blinking. Now we are going for crackers my brother has already cracked half of his&#8230; and now asking mines&#8230;I used to give him bombs and rockets coz I like to see them from distant place but flower pot “anar” and fire wheel charkhee is still my unfavorite one.</p>
<p style="margin-bottom:0;">We also had to go to our neighbor&#8217;s home to wish them happy diwaali and eat sweets and namkeens though most of the things are similar . Now lets take dinner and watch tv till late night ( usually diwali night all the channels showed a block buster movie) and then finally go to sleep.</p>
<p style="margin-bottom:0;">Sweet Dreams&#8230;&#8230;. becous these are only DREAMS now&#8230;..!</p>
<p style="margin-bottom:0;">&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/manjul.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/manjul.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=8&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2006/10/17/last-dipawali-when-we-were-in-school/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
		<item>
		<title>RFID Radio Frequency Identification.</title>
		<link>http://manjul.wordpress.com/2006/10/12/rfid-radio-frequency-identification-2/</link>
		<comments>http://manjul.wordpress.com/2006/10/12/rfid-radio-frequency-identification-2/#comments</comments>
		<pubDate>Thu, 12 Oct 2006 09:52:22 +0000</pubDate>
		<dc:creator>manjul</dc:creator>
				<category><![CDATA[TechBlog]]></category>

		<guid isPermaLink="false">http://manjul.wordpress.com/2006/10/12/rfid-radio-frequency-identification-2/</guid>
		<description><![CDATA[What is RFID . Radio Frequency Identification (RFID) is an radio waves sensor technology, relying on storing and remotely retrieving data using devices called RFID tags readers. An RFID tag is a small chip that can be attached to an object it could be a simple box or an animal, or person for the purpose [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=6&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>What is RFID .</h3>
<p style="margin-bottom:0;">Radio Frequency Identification (RFID) is an radio waves sensor technology, relying on storing and remotely retrieving data using devices called RFID tags readers. An RFID tag is a small chip that can be attached to an object it could be a simple box or an animal, or person for the purpose of identification using radio waves. Chip-based RFID tags contain silicon chip and antenna. Passive tags require no internal power source, whereas active tags require a power source.<br />
Types of RFID tags<br />
<strong>Passive</strong><br />
Passive RFID tags have no internal power supply. A minute electrical current is induced in the small circuit as it is brought in the special magnetic region, generated by the tag Reader. This small power is sufficient to em-mite the response signals. Which can be traced by the Reader.</p>
<p style="margin-bottom:0;"><strong>Active</strong><br />
Unlike passive RFID tags, active RFID tags have their own internal power source which is used to power any ICs that generate the outgoing signal. Active tags are typically much more reliable than passive tags due to the ability for active tags to conduct a &#8220;session&#8221; with a reader. They are more reliable in magnetic field ore naturally challenged region.</p>
<p><strong>The RFID system</strong><br />
An RFID system may consist of several components: tags, tag readers, edge servers, middleware ( eg. Sun Java System RFID Software, IBM RFID Middle-ware), and enterprise application software.<br />
The purpose of an RFID system is to enable data to be transmitted by a mobile device, called a tag, which is read by an RFID reader and processed according to the needs of a particular application. The data transmitted by the tag may provide identification or location information, or specifics about the product tagged, such as price, color, date of purchase, etc. RFID is being so popular because its ability to track moving objects. As the technology is refined, it is being used in different areas like asset tracking, transportation, inventory management, defense, health care etc. ..</p>
<p style="margin-bottom:0;">&nbsp;</p>
<h3 class="post-title"> 	   	 How to develope a RFID prototype application</h3>
<p>To develope a RFID prototype, companies like Java, IBM , sybase are we provideing their middleware . Sun has its SUN RFID 1.3 package , similarly IBM is also providing a framework to develope, test and deploy a rfis solution. IBM provides a architecture comprising Device developer kit ( will be used to develope edge controller which will controll rfid related hardware), RFID premises server which works between edge controler and your enterprise application.</p>
<p>feel free to ask more queries\details on RFID :<br />
manjulx@gmail.com</p>
<p style="margin-bottom:0;">&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/manjul.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/manjul.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/manjul.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/manjul.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/manjul.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/manjul.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/manjul.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/manjul.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/manjul.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/manjul.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=manjul.wordpress.com&amp;blog=470929&amp;post=6&amp;subd=manjul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://manjul.wordpress.com/2006/10/12/rfid-radio-frequency-identification-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bf6b39bf09e65789ec5a33521b1fc3be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Manjul</media:title>
		</media:content>
	</item>
	</channel>
</rss>
