<?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>Share your knowledge</title>
	<atom:link href="http://zubairwiki.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zubairwiki.wordpress.com</link>
	<description>No dead-end for Knowledge......</description>
	<lastBuildDate>Tue, 22 Feb 2011 18:50:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zubairwiki.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Share your knowledge</title>
		<link>http://zubairwiki.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zubairwiki.wordpress.com/osd.xml" title="Share your knowledge" />
	<atom:link rel='hub' href='http://zubairwiki.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Playing with Hooks</title>
		<link>http://zubairwiki.wordpress.com/2010/02/23/playing-with-hooks/</link>
		<comments>http://zubairwiki.wordpress.com/2010/02/23/playing-with-hooks/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 09:39:34 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Liferay]]></category>
		<category><![CDATA[Hook]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=127</guid>
		<description><![CDATA[Here I would like to explain about Hooks Plugin in liferay to customize property files , Jsp files &#38; Listeners. 1. Hook Folder Structure a. Go to plugins/hooks create a folder with any name. eg test-hook b. Go to test-hook create folder docroot and build.xml file with this content. &#60;project name=&#8221;hook&#8221; basedir=&#8221;.&#8221; default=&#8221;deploy&#8221;&#62; &#60;import file=&#8221;../build-common-hook.xml&#8221;&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=127&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here I would like to explain about Hooks Plugin in liferay to customize property files , Jsp files &amp; Listeners.</p>
<p><span style="color:#0000ff;"><span style="text-decoration:underline;"><strong>1. Hook Folder Structure</strong></span></span></p>
<p><strong>a.</strong> Go to<strong> plugins/hooks</strong> create a folder with any name. eg <strong>test-hook</strong></p>
<p><strong> b.</strong> Go to <strong>test-hook</strong> create folder docroot and<strong> build.xml</strong> file with this content.</p>
<p style="padding-left:60px;"><strong>&lt;project name=&#8221;hook&#8221; basedir=&#8221;.&#8221; default=&#8221;deploy&#8221;&gt;<br />
&lt;import file=&#8221;../build-common-hook.xml&#8221;&gt;<br />
&lt;/project&gt;</strong></p>
<p><strong>c.</strong> Go to<strong> test-hook/docroot</strong> create folder with name <strong>WEB-INF.</strong><br />
<strong>d.</strong> Now under <strong>WEB-INF</strong> create a file<strong> liferay-hook.xml </strong>with below content:</p>
<p style="padding-left:30px;"><strong>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE hook PUBLIC &#8220;-//Liferay//DTD Hook 5.11.0//EN&#8221; &#8220;http://www.liferay.com/dtd/liferay-hook_5_2_2.dtd&#8221;&gt;</strong></p>
<p style="padding-left:30px;"><strong>&lt;hook&gt;<br />
&lt;custom-jsp-dir&gt;/WEB-INF/jsps<br />
&lt;/hook&gt; </strong></p>
<p><strong>e</strong>. Create foler <strong>jsps</strong> under <strong>WEB-INF</strong><br />
<strong>f.</strong> Under <strong>jsps</strong> create folders <strong>html/portlet/&lt;portlet_name&gt;/xxx.jsp</strong></p>
<p style="padding-left:60px;"><strong><span id="more-127"></span></strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><span style="color:#0000ff;"><span style="text-decoration:underline;"><strong>2.  Customize JSP files</strong></span></span></p>
<p>After creating the hook structure using above steps,</p>
<p><strong>a)</strong> Under <strong>portlet_name</strong> create the same structure for the page which we want to modify.</p>
<p>Eg. If you want to modify the<strong> full_content.jsp </strong>inside <strong>assetPublisher </strong>portlet, path should be:</p>
<p><strong>html/portlet/asset-publisher/display/full_content.jsp</strong></p>
<p><strong>b) </strong>Just give <strong>System.out.println(&#8220;Hooks customization&#8221;) </strong> inside that jsp file</p>
<p><strong>c)</strong> <strong>ant deploy</strong> under<strong> plugins/hook</strong>.</p>
<p><strong>d)</strong> Make sure that changes is affected in the server.</p>
<p style="padding-left:60px;"><!--more-->&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><span style="text-decoration:underline;"><span style="color:#0000ff;"><strong>3. Customize Property file</strong></span></span></p>
<p>if you want to override portal-ext.properties file, just follow these steps</p>
<p><strong>a)</strong> add the entry for property file inside <strong>liferay-hook.xml</strong>,</p>
<p>&lt;hook&gt;<br />
<span style="color:#800080;"><strong>&lt;portal-properties&gt;portal.properties&lt;/portal-properties&gt;</strong></span><br />
&lt;custom-jsp-dir&gt;/custom-jsp&lt;/custom-jsp-dir&gt;<br />
&lt;/hook&gt;</p>
<p><strong>b)</strong> add any property inside <strong>portal.properties</strong> (<strong> test-hook/docroot/WEB-INF/src</strong>)</p>
<p><strong>c)</strong> <strong>ant deploy</strong> under<strong> plugins/hook</strong>.</p>
<p><strong>d)</strong> Validate the changes</p>
<p style="padding-left:60px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><span style="text-decoration:underline;"><span style="color:#0000ff;"><strong>4. Customize Model Listener</strong></span></span></p>
<p>If you want to customize the any Model Listerner, you can follow these steps.</p>
<p><span style="text-decoration:underline;">For Eg,</span></p>
<p>If  you click <strong>Article</strong> Title from Asset Publisher portlet, one count views will be stored in <strong>TagsAsset</strong> table.<br />
I want to do some changes in <strong>TagsAssetListener</strong></p>
<p><strong>a)</strong><strong> </strong>set this property in this path, <strong>docroot/WEB-INF/src/portal.properties </strong></p>
<p><strong>value.object.listener.com.liferay.portlet.tags.model.TagsAsset</strong><strong> =      com.liferay.portlet.tags.model.TagsAssetListener</strong></p>
<p><strong>b) </strong>create <strong>TagsAssetListener.java</strong> in this path<strong> docroot/WEB-INF/src/com/liferay/portlet/Tags/Model</strong></p>
<p><em> ( Copy this model class from Liferay Portal Source)</em></p>
<p><em><span style="text-decoration:underline;"><strong>TagsAssetListener.java</strong></span><br />
</em></p>
<p style="text-align:left;"><strong> </strong>package com.liferay.portlet.tags.model;</p>
<p>import com.liferay.portal.model.BaseModelListener;<br />
import com.liferay.portal.servlet.filters.cache.CacheUtil;<br />
import com.liferay.portlet.tags.util.TagsUtil;</p>
<p>import com.liferay.portal.model.BaseModel;</p>
<p>import com.uson.stat.model.AssetAccess;<br />
import com.uson.stat.model.impl.AssetAccessImpl;</p>
<p>public class TagsAssetListener extends BaseModelListener&lt;TagsAsset&gt; {</p>
<p>public void onAfterUpdate(TagsAsset tagsAsset) {<br />
System.out.println(&#8220;Asset Id : &gt;&gt;&gt;&gt;&gt; &#8221; + tagsAsset.getAssetId());<br />
System.out.println(&#8220;User Id :  &gt;&gt;&gt;&gt;&gt; &#8221; + tagsAsset.getUserId());<br />
System.out.println(&#8220;Total Views : &gt;&gt;&gt;&gt;&gt; &#8221; + tagsAsset.getViewCount());<br />
}<br />
}</p>
<p style="text-align:left;">c) <strong>ant deploy</strong> under<strong> plugins/hook</strong>.</p>
<p style="text-align:left;">d) Validate this by accessing one journal content article.</p>
<p style="text-align:left;"><!--more--></p>
<p style="text-align:left;">if you have any comments/query, you can shed you lights on this</p>
<p style="text-align:left;">
<p style="text-align:left;"><strong>- Gnaniyar Zubair</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=127&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2010/02/23/playing-with-hooks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>Create Struts Action Portlet in Plugin Enviroinment</title>
		<link>http://zubairwiki.wordpress.com/2009/09/10/create-struts-action-portlet-in-plugin-enviroinment/</link>
		<comments>http://zubairwiki.wordpress.com/2009/09/10/create-struts-action-portlet-in-plugin-enviroinment/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 06:22:16 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Liferay]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=121</guid>
		<description><![CDATA[Step 1. Go to Command Prompt inside Plugin: Plugin&#62;Portlets&#62; Execute the create.bat file with your portlet name as follows: project\plugin\portlets&#62;create.bat sample-struts-plugin &#8220;Sample Struts Plugin Portlet&#8221; Step 2: Folder with name sample-struts-plugin-portlet will be created in ur portlets folder. Verify it. Go to ur portlet folder and edit the liferay-portlet.xml file by adding the following after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=121&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 1.</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Go to Command Prompt  inside Plugin:</p>
<p style="margin-bottom:0;"><em>Plugin&gt;Portlets</em>&gt;</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Execute the <strong>create.bat</strong> file with your portlet name as follows:</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em>project\plugin\portlets</em>&gt;<span style="color:#800000;"><strong>create.bat sample-struts-plugin &#8220;Sample Struts Plugin Portlet&#8221;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 2:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Folder with name <strong>sample-struts-plugin-portlet</strong> will be created in ur portlets folder. Verify it.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Go to ur portlet folder and edit the <strong>liferay-portlet.xml </strong>file by adding the following after <strong>&lt;icon/&gt;</strong></p>
<p style="margin-bottom:0;">\portlets\sample-struts-plugin-portlet\docroot\WEB-INF\<strong>liferay-portlet.xml</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;struts-path&gt;sample/struts/plugin&lt;/struts-path&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 3:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Go to ur portlet folder and edit the <strong>portlet.xml</strong> file by changing the following tags..</p>
<p style="margin-bottom:0;">(\portlets\sample-struts-plugin-portlet\docroot\WEB-INF\<strong>portlet.xml</strong>)</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>Replace</strong> ,</p>
<p style="margin-bottom:0;"><strong>&lt;portlet-class&gt;com.sample.jsp.portlet.JSPPortlet&lt;/portlet-class&gt;</strong></p>
<p style="margin-bottom:0;">with</p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;portlet-class&gt;com.liferay.portlet.StrutsPortlet&lt;/portlet-class&gt;</strong></span></p>
<p style="margin-bottom:0;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p style="margin-bottom:0;">And <strong>replace,</strong></p>
<p style="margin-bottom:0;text-align:left;"><strong>&lt;init-param&gt;</strong></p>
<p style="margin-bottom:0;text-align:left;"><strong> &lt;name&gt;view-jsp&lt;/name&gt;</strong></p>
<p style="margin-bottom:0;text-align:left;"><strong> &lt;value&gt;/view.jsp&lt;/value&gt;</strong></p>
<p style="margin-bottom:0;text-align:left;"><strong> &lt;/init-param&gt;</strong></p>
<p style="margin-bottom:0;">with</p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;init-param&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;name&gt;view-action&lt;/name&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;value&gt;/sample/struts/plugin/view&lt;/value&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/init-param&gt; </strong></span></p>
<p style="margin-bottom:0;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p style="margin-bottom:0;">and <strong>ADD,</strong></p>
<p style="margin-bottom:0;"><strong>&lt;supports&gt;</strong></p>
<p style="margin-bottom:0;"><strong> &lt;mime-type&gt;text/html&lt;/mime-type&gt;</strong></p>
<p style="margin-bottom:0;"><strong> <span style="color:#800000;">&lt;portlet-mode&gt;view&lt;/portlet-mode&gt;</span></strong></p>
<p style="margin-bottom:0;"><strong> &lt;/supports&gt;</strong></p>
<p style="margin-bottom:0;"><strong><br />
</strong></p>
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 4:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Go to ur WEB-INF folder &amp; create <strong>struts-config.xml</strong> like this</p>
<p style="margin-bottom:0;">( \portlets\sample-struts-plugin-portlet\docroot\WEB-INF\<strong>struts-config.xml)</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;!DOCTYPE struts-config PUBLIC &#8220;-//Apache Software Foundation//DTD Struts Configuration 1.2//EN&#8221; &#8220;http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd&#8221;&gt;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;struts-config&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;action-mappings&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;action path=&#8221;/sample/struts/plugin/view&#8221; type=&#8221;com.xyz.action.SampleStrutsAction&#8221; &gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;forward name=&#8221;portlet.sample.struts.view&#8221; path=&#8221;portlet.sample.struts.view&#8221; /&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/action&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/action-mappings&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;controller processorClass=&#8221;org.apache.struts.tiles.TilesRequestProcessor&#8221;&gt;&lt;/controller&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;message-resources parameter=&#8221;content.test.Language&#8221;&gt;&lt;/message-resources&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;plug-in className=&#8221;org.apache.struts.tiles.TilesPlugin&#8221;&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;set-property property=&#8221;definitions-config&#8221; value=&#8221;/WEB-INF/tiles-defs.xml&#8221;&gt;&lt;/set-property&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;set-property property=&#8221;moduleAware&#8221; value=&#8221;true&#8221;&gt;&lt;/set-property&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;set-property property=&#8221;definitions-parser-validate&#8221; value=&#8221;true&#8221;&gt;&lt;/set-property&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/plug-in&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/struts-config&gt;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 5:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Go to ur WEB-INF folder &amp; create <strong>tiles-defs.xml</strong> like this</p>
<p style="margin-bottom:0;">(\portlets\sample-struts-plugin-portlet\docroot\WEB-INF\<strong>tiles-defs.xml</strong>)</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;!DOCTYPE tiles-definitions PUBLIC &#8220;-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN&#8221; &#8220;http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd&#8221;&gt;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;tiles-definitions&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;!&#8211; Sample Struts Plugin &#8211;&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;definition name=&#8221;portlet.sample.struts.view&#8221; path=&#8221;/struts/jsp/view.jsp&#8221;&gt;&lt;/definition&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> </strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> </strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/tiles-definitions&gt;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 6:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Goto  ur <strong>WEB-INF\src\com\xyz\action</strong>\ folder &amp; create <strong>SampleStrutsAction.java insie:</strong></p>
<p style="margin-bottom:0;">(\portlets\sample-struts-plugin-portlet\docroot\<strong>WEB-INF\src\com\xyz\action\</strong> )</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>package com.xyz.action;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import javax.portlet.PortletConfig;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import javax.portlet.RenderRequest;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import javax.portlet.RenderResponse;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import org.apache.struts.action.ActionForm;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import org.apache.struts.action.ActionForward;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import org.apache.struts.action.ActionMapping;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> import com.liferay.portal.struts.PortletAction;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> public class SampleStrutsAction extends PortletAction{</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> </strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> public ActionForward render(ActionMapping mapping, ActionForm form,</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> PortletConfig portletConfig, RenderRequest renderRequest,</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> RenderResponse renderResponse) throws Exception {</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> System.out.println(&#8220;SampleStrutsAction render()..&#8221;);</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> return mapping.findForward(&#8220;portlet.sample.struts.view&#8221;);</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> }</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> </strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> }</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 7:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Goto  ur <strong>WEB-INF</strong> folder &amp; edit <strong>web.xml :</strong></p>
<p style="margin-bottom:0;">( \portlets\sample-struts-plugin-portlet\docroot\WEB-INF\<strong>web.xml</strong> )</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;!DOCTYPE web-app PUBLIC &#8220;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&#8221; &#8220;http://java.sun.com/dtd/web-app_2_3.dtd&#8221;&gt;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;web-app&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;listener&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;listener-class&gt;com.liferay.portal.kernel.spring.context.PortletContextLoaderListener&lt;/listener-class&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/listener&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;servlet&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;servlet-name&gt;PortletActionServlet&lt;/servlet-name&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;servlet-class&gt;com.liferay.portal.struts.PortletActionServlet&lt;/servlet-class&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;init-param&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;param-name&gt;config&lt;/param-name&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/init-param&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;/servlet&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;servlet-mapping&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;servlet-name&gt;PortletActionServlet&lt;/servlet-name&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;url-pattern&gt;/portlet_action/*&lt;/url-pattern&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/servlet-mapping&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/web-app&gt;</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 8:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Go to ur docroot folder &amp; create  <strong>META-INF\context.xml</strong> like this</p>
<p style="margin-bottom:0;">(\portlets\sample-struts-plugin-portlet\docroot\<strong>META-INF\context.xml </strong>)</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="color:#800000;"><strong>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;Context&gt;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;Loader </strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> loaderClass=&#8221;com.liferay.support.tomcat.loader.PortalClassLoader&#8221;</strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> /&gt; </strong></span></p>
<p style="margin-bottom:0;"><span style="color:#800000;"><strong> &lt;/Context&gt; </strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 9:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">create <strong>view.jsp</strong> file inside :</p>
<p style="margin-bottom:0;">(\sample-struts-plugin-portlet\docroot\<strong>html\struts\jsp\view.jsp</strong>)</p>
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong>Step 10:</strong></span></p>
<p style="margin-bottom:0;">Inside  plugins&gt;portlets<strong>&gt;build-common.xml</strong><span style="text-decoration:underline;"><strong><br />
</strong></span></p>
<p style="margin-bottom:0;">Replace this,</p>
<p style="margin-bottom:0;">&lt;fileset dir=&#8221;${project.dir}/lib&#8221; includes=&#8221;activation.jar,jsp-api.jar,mail.jar,servlet-api.jar&#8221; /&gt;</p>
<p style="margin-bottom:0;">with,</p>
<p style="margin-bottom:0;"><strong>&lt;fileset dir=&#8221;${project.dir}/lib&#8221; includes=&#8221;*.jar&#8221; /&gt;</strong></p>
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><span style="color:#ff6600;"><strong> File Structure:</strong></span></span></p>
<p style="margin-bottom:0;"><a href="http://zubairwiki.files.wordpress.com/2009/09/file-structure-for-plugin.jpg"><img class="aligncenter size-full wp-image-122" title="file structure for plugin" src="http://zubairwiki.files.wordpress.com/2009/09/file-structure-for-plugin.jpg?w=342&#038;h=487" alt="file structure for plugin" width="342" height="487" /></a></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="text-decoration:underline;"><strong> </strong></span></p>
<p><strong> </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=121&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/09/10/create-struts-action-portlet-in-plugin-enviroinment/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>

		<media:content url="http://zubairwiki.files.wordpress.com/2009/09/file-structure-for-plugin.jpg" medium="image">
			<media:title type="html">file structure for plugin</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript To accept only alphapets</title>
		<link>http://zubairwiki.wordpress.com/2009/06/29/javascript-to-accept-only-alphapets/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/29/javascript-to-accept-only-alphapets/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 10:35:02 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=113</guid>
		<description><![CDATA[This javascript is used to accept only alphapets value in text box. Coding: &#60;input onkeyup=&#8221;validateAlphapets(this, &#8221;)&#8221; ruleset=&#8221;[^a-z]&#8221; /&#62; &#60;script type=&#8221;text/javascript&#8221;&#62; function validateAlphapets(element, replacement) { if(! element) element = window.event.srcElement; element.value = element.value.replace(new   RegExp(element.getAttribute(&#8216;ruleset&#8217;), &#8216;gi&#8217;), replacement); } &#60;/script&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=113&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This javascript is used to accept <strong>only </strong><strong>alphapets </strong><strong>value</strong> in text box.</p>
<p><strong> </strong></p>
<p><span style="text-decoration:underline;"><strong>Coding:</strong></span></p>
<p>&lt;input <strong>onkeyup</strong>=&#8221;<strong>validateAlphapets(this, &#8221;)&#8221; ruleset=&#8221;[^a-z]</strong>&#8221; /&gt;</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>function <strong>validateAlphapets</strong>(element, replacement) {</p>
<p>if(! element)</p>
<p>element = window.event.srcElement;</p>
<p>element.value = element.value.replace(new   RegExp(element.getAttribute(&#8216;ruleset&#8217;), &#8216;gi&#8217;), replacement);</p>
<p>}</p>
<p>&lt;/script&gt;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=113&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/29/javascript-to-accept-only-alphapets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript To Accept Only Numeric</title>
		<link>http://zubairwiki.wordpress.com/2009/06/29/javascript-to-accept-only-numeric/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/29/javascript-to-accept-only-numeric/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 10:30:18 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=111</guid>
		<description><![CDATA[This javascript is used to accept only numeric value in text box. Coding : &#60;input type=&#8221;text &#8220;   onKeyPress=”return alfanumaricVal(event)”  name=&#8221;amount&#8221; /&#62; &#60;script type=&#8221;text/javascript&#8221;&#62; function alfanumaricVal(e) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); keychar = keychar.toLowerCase(); // control keys if ((key==null) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=111&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This javascript is used to accept <strong>only numeric value</strong> in text box.</p>
<p><span style="text-decoration:underline;"><strong>Coding :</strong></span></p>
<p>&lt;input type=&#8221;text &#8220;   onKeyPress=”<strong>return alfanumaricVal(event)</strong>”  name=&#8221;amount&#8221; /&gt;</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>function alfanumaricVal(e) {</p>
<p>var key;</p>
<p>var keychar;</p>
<p>if (window.event)</p>
<p>key = window.event.keyCode;</p>
<p>else if (e)</p>
<p>key = e.which;</p>
<p>else</p>
<p>return true;</p>
<p>keychar = String.fromCharCode(key);</p>
<p>keychar = keychar.toLowerCase();</p>
<p>// control keys</p>
<p>if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )</p>
<p>return true;</p>
<p>// numbers</p>
<p>else if (((&#8220;0123456789&#8243;).indexOf(keychar) &gt; -1))</p>
<p>return true;</p>
<p>else</p>
<p>return false;</p>
<p>}</p>
<p>&lt;/script&gt;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=111&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/29/javascript-to-accept-only-numeric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>Struts Portlet with DataBase interaction</title>
		<link>http://zubairwiki.wordpress.com/2009/06/29/struts-portlet-with-database-interaction/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/29/struts-portlet-with-database-interaction/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 10:04:41 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Liferay]]></category>
		<category><![CDATA[portlet]]></category>
		<category><![CDATA[struts portlet]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=105</guid>
		<description><![CDATA[The goal of this post is to add Database interaction to the Struts Portlet. Steps  Involved: 1. Create Folder structure in ext-impl and ext-web 2. Create your table structure in service.xml 3. Generate Service and Persistence Layer Classes with Ant’s Build-Service 4.  Copy auto-generated MySQL table  into database. 5.  Create the Struts Action Portlet 6.  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=105&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:left;">
<p>The goal of this post is to <strong>add Database interaction</strong> to the Struts Portlet.</div>
<p><span style="text-decoration:underline;"><strong>Steps  Involved:</strong></span></p>
<p>1. Create Folder structure in <strong>ext-impl </strong>and <strong>ext-web</strong></p>
<p>2. Create your table structure in <strong>service.xml</strong></p>
<p>3. Generate Service and Persistence Layer Classes with Ant’s <strong>Build-Service</strong></p>
<p>4.  Copy auto-generated<strong> MySQL </strong>table  into database.</p>
<p>5.  Create the Struts Action Portlet</p>
<p>6.  Update Service Layer Files</p>
<p>7.   <strong>JSP /</strong> <strong>Java action file </strong>updation.</p>
<p><span style="text-decoration:underline;"><strong>1. Folder Structure:</strong></span></p>
<p>Java Fiels &gt;&gt;&gt;&gt;&gt;&gt;&gt;  <strong>ext-impl/src/com/testing/portlet/company</strong></p>
<p>Jsp Files  &gt;&gt;&gt;&gt;&gt;&gt;&gt;   <strong>ext-web/docroot/html/testing/company</strong></p>
<p><span style="text-decoration:underline;"><strong>2.  Service.xml </strong></span><br />
(create this file under &#8220;<em>/ext/ext-impl/src/com/testing/portlet/company</em>&#8220;)</p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;!DOCTYPE service-builder PUBLIC &#8220;-//Liferay//DTD Service Builder 5.2.0//EN&#8221; &#8220;http://www.liferay.com/dtd/liferay-service-builder_5_2_0.dtd&#8221;&gt;</p>
<p>&lt;service-builder package-path=&#8221;com.testing.portlet.company&#8221;&gt;<br />
&lt;namespace&gt;MyCompany&lt;/namespace&gt;</p>
<p>&lt;entity name=&#8221;MyCompany&#8221;   local-service=&#8221;true&#8221;  remote-service=&#8221;true&#8221;   table=&#8221;my_company&#8221;&gt;<br />
&lt;column name=&#8221;companyId&#8221; type=&#8221;long&#8221; primary=&#8221;true&#8221; /&gt;</p>
<p>&lt;!&#8211; basic Info &#8211;&gt;</p>
<p>&lt;column name=&#8221;companyName&#8221; type=&#8221;String&#8221; /&gt;</p>
<p>&lt;column name=&#8221;address&#8221; type=&#8221;String&#8221; /&gt;</p>
<p>&lt;column name=&#8221;startDate&#8221; type=&#8221;Date&#8221; /&gt;</p>
<p>&lt;column name=&#8221;annualIncome&#8221; type=&#8221;float&#8221; /&gt;</p>
<p>&lt;column name=&#8221;stockQty&#8221; type=&#8221;double&#8221; /&gt;</p>
<p>&lt;column name=&#8221;active&#8221;  type=&#8221;int&#8221; /&gt;</p>
<p>&lt;!&#8211; Finder Method for companyName  Info &#8211;&gt;<br />
&lt;finder name=&#8221;Name&#8221; return-type=&#8221;FAIRDEALCompany&#8221;&gt;<br />
&lt;finder-column name=&#8221;companyName&#8221; /&gt;<br />
&lt;/finder&gt;</p>
<p>&lt;reference package-path=&#8221;com.liferay.counter&#8221; entity=&#8221;Counter&#8221; /&gt;</p>
<p>&lt;/entity&gt;</p>
<p>&lt;exceptions&gt;<br />
&lt;exception&gt;NoSuchMyCompany&lt;/exception&gt;<br />
&lt;/exceptions&gt;<br />
&lt;/service-builder&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>3. Run </strong><strong>build-service with &#8220;</strong><strong>service.xml&#8221;  as argument</strong></span></p>
<blockquote><p>a. go to   <strong>&#8220;/ext/ext-impl&#8221;</strong></p>
<p>b. execute   &#8220;<strong>ant build-service -Dservice.file=src/com/testing/portlet/company/service.xml</strong>&#8220;</p>
<p>c. make sure the build is successful</p>
<p>d. confirm all the<strong> service layer files</strong> are generated as per the Spring/Hibernate framework. check under</p>
<p><strong>ext/ext-impl/src/com/testing/portlet/company<br />
ext/ext-service/src/com/testing/portlet/company</strong></p></blockquote>
<p><span style="text-decoration:underline;"><strong>4.   Copy the table  &#8220;my_company.sql&#8221;</strong></span></p>
<p>copy the <strong>my_company.sql</strong> file from <strong>ext/sql/portal_tables</strong> and past it to database &#8220;<strong>lportal</strong>&#8220;.</p>
<p>To run the SQL directly, you&#8217;ve to go to mysql prompt by giving   &#8220;<strong>mysql -u root lportal</strong>&#8220;</p>
<blockquote><p>create table my_company (<br />
companyId LONG not null primary key,<br />
companyName VARCHAR(75) null,<br />
address  VARCHAR(75),<br />
startDate DATE null,<br />
annualIncome DOUBLE,<br />
stockQty DOUBLE,<br />
active_ INTEGER,<br />
);</p></blockquote>
<p><span style="text-decoration:underline;"><strong>5. Create Struts Action Portlet</strong></span></p>
<blockquote><p><span style="text-decoration:underline;"><strong>5.1 portlet-ext.xml</strong></span></p>
<p>&lt;portlet&gt;<br />
&lt;portlet-name&gt;MyCompany&lt;/portlet-name&gt;<br />
&lt;display-name&gt;My Company&lt;/display-name&gt;<br />
&lt;portlet-class&gt;com.liferay.portlet.StrutsPortlet&lt;/portlet-class&gt;<br />
&lt;init-param&gt;<br />
&lt;name&gt;view-action&lt;/name&gt;<br />
&lt;value&gt;<strong>/testing/company/view</strong>&lt;/value&gt;<br />
&lt;/init-param&gt;<br />
&lt;expiration-cache&gt;0&lt;/expiration-cache&gt;<br />
&lt;supports&gt;<br />
&lt;mime-type&gt;text/html&lt;/mime-type&gt;<br />
&lt;/supports&gt;<br />
&lt;resource-bundle&gt;com.liferay.portlet.StrutsResourceBundle&lt;/resource-bundle&gt;<br />
&lt;security-role-ref&gt;<br />
&lt;role-name&gt;power-user&lt;/role-name&gt;<br />
&lt;/security-role-ref&gt;<br />
&lt;security-role-ref&gt;<br />
&lt;role-name&gt;user&lt;/role-name&gt;<br />
&lt;/security-role-ref&gt;<br />
&lt;/portlet&gt;</p>
<p><span style="text-decoration:underline;"><strong>5.2. liferay-portlet-ext.xml</strong></span></p>
<p>&lt;portlet&gt;<br />
&lt;portlet-name&gt;<strong>MyCompany</strong>&lt;/portlet-name&gt;<br />
&lt;struts-path&gt;<strong>testing/company</strong>&lt;/struts-path&gt;<br />
&lt;use-default-template&gt;false&lt;/use-default-template&gt;<br />
&lt;/portlet&gt;</p>
<p><span style="text-decoration:underline;"><strong>5.3. liferay-display.xml</strong></span></p>
<p>&lt;portlet id=”<strong>MyCompany</strong>” /&gt;</p>
<p>inside,</p>
<p>&lt;category name=”<strong>category.MyCompany</strong>“&gt;</p>
<p><span style="text-decoration:underline;"><strong>5.4. struts-config.xml</strong></span></p>
<p>&lt;action path=&#8221;<strong>/testing/company/process</strong>&#8220;   type=&#8221;<strong>com.testing.portlet.company.action.ProcessMyCompanyAction</strong>&#8220;&gt;<br />
&lt;forward name=&#8221;<strong>testing.company.view</strong>&#8220;    path=&#8221;<strong>testing.company.view</strong>&#8221; /&gt;<br />
&lt;/action&gt;</p>
<p><span style="text-decoration:underline;"><strong>5.5. tiles-defs.xml</strong></span></p>
<p>&lt;definition name=&#8221;<strong>testing.company.view</strong>&#8221; extends=&#8221;portlet&#8221;&gt;<br />
&lt;put name=&#8221;portlet_content&#8221; value=&#8221;/testing/company/view.jsp&#8221; /&gt;<br />
&lt;/definition&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>6.  Update Service Layer  Files:</strong></span></p>
<p><strong> </strong><span style="text-decoration:underline;"><strong> add this method in</strong><strong> <span style="color:#008000;">MyCompanyLocalServiceImpl.java</span> which is autogenerated</strong></span> ( in this path: <em>com/testing/portlet/company/service/</em>)</p>
<blockquote><p>public MyCompany getCompanyName(String companyName) throws SystemException, PortalException{<br />
return MyCompanyUtil.findByName(companyName);<br />
}</p></blockquote>
<p><em> <span style="text-decoration:underline;">import these files:</span></em></p>
<blockquote><p>import com.testing.portlet.company.service.persistence.MyCompanyUtil;<br />
import com.liferay.portal.PortalException;<br />
import com.liferay.portal.SystemException;</p></blockquote>
<p>then give <strong>ant build-service </strong>inside <strong>ext-impl</strong></p>
<p><span style="text-decoration:underline;"><strong>7.  Update / Create these Jsp / Java Files:</strong></span></p>
<p>(jsp files path: <em><strong><strong>ext-web/docroot/html/testing/company)</strong></strong></em></p>
<p><span style="text-decoration:underline;"><strong>a. view.jsp</strong></span></p>
<blockquote>
<p style="text-align:left;">&lt;%@ include file=&#8221;/html/testing/company/init.jsp&#8221; %&gt;</p>
<p>&lt;div id=&#8221;MYCOMPANY&#8221;&gt;<br />
&lt;%<br />
String PAGE = (String) request.getAttribute(&#8220;PAGE&#8221;);<br />
System.out.println(&#8220;PAGE value is &gt;&gt;&gt;&gt;&#8221; + PAGE);</p>
<p>%&gt;</p>
<p>&lt;div id=&#8221;MYCOMPANY_CONTENT&#8221;&gt;<br />
&lt;jsp:include page=&#8221;&lt;%= PAGE %&gt;&#8221; /&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>&lt;% SessionMessages.clear(request); %&gt;</p></blockquote>
<p style="text-align:left;"><span style="text-decoration:underline;"><strong>a. add_company.jsp</strong></span></p>
<blockquote>
<p style="text-align:left;">&lt;%@ include file=&#8221;/html/testing/company/init.jsp&#8221; %&gt;</p>
<p>&lt;form action=&#8221;" method=&#8221;post&#8221; name=&#8221;&lt;portlet:namespace /&gt;fm&#8221;    id=&#8221;&lt;portlet:namespace /&gt;fm_id&#8221;&gt;</p>
<p>&lt;table width=&#8221;100%&#8221;&gt; &lt;tr&gt;<br />
&lt;%if(SessionMessages.contains(session,&#8221;Added&#8221;)){%&gt;<br />
&lt;td height=&#8221;15px&#8221;&gt;<br />
&lt;div&gt;<br />
&lt;liferay-ui:message key=&#8221;Record Added Successfully&#8221; /&gt;<br />
&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;% } %&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;/table&gt;</p>
<p>&lt;table width=&#8221;100%&#8221;   style=&#8221;border:1px solid lightblue&#8221;    align=&#8221;center&#8221;&gt;</p>
<p>&lt;tr &gt;<br />
&lt;td&gt; Company Name: &lt;%=star%&gt;&lt;/td&gt;<br />
&lt;td colspan=&#8221;3&#8243;&gt; &lt;input style=&#8221;width:60%&#8221; type=&#8221;text&#8221; id=&#8221;&lt;portlet:namespace /&gt;<strong>companyName</strong>&#8221;   name=&#8221;&lt;portlet:namespace /&gt;<strong>companyName</strong>&#8220;&gt; &lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p>&lt;tr class=&#8217;portlet-section-alternate results-row alt&#8217;&gt;<br />
&lt;td&gt; <strong>Address</strong>: &lt;/td&gt;<br />
&lt;td colspan=&#8221;7&#8243;&gt; &lt;input style=&#8221;width:60%&#8221; type=&#8221;text&#8221; id=&#8221;&lt;portlet:namespace /&gt;<strong>address</strong>&#8221;   name=&#8221;&lt;portlet:namespace /&gt;address&#8221;&gt; &lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p style="text-align:left;">&lt;tr class=&#8217;portlet-section-alternate results-row alt&#8217;&gt;<br />
&lt;td&gt;<strong> </strong>e<strong> Start Date</strong>: &lt;/td&gt;<br />
&lt;td colspan=&#8221;7&#8243;&gt; &lt;input style=&#8221;width:60%&#8221; type=&#8221;text&#8221;   id=&#8221;&lt;portlet:namespace /&gt;<strong>startDate</strong>&#8221;   name=&#8221;&lt;portlet:namespace /&gt;<strong>startDate</strong>&#8220;&gt; &lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p style="text-align:left;">&lt;tr class=&#8217;portlet-section-alternate results-row alt&#8217;&gt;<br />
&lt;td&gt; <strong>Annual Income</strong>: &lt;/td&gt;<br />
&lt;td colspan=&#8221;7&#8243;&gt; &lt;input style=&#8221;width:60%&#8221; type=&#8221;text&#8221; id=&#8221;&lt;portlet:namespace /&gt;<strong>annualIncome</strong>&#8221;   name=&#8221;&lt;portlet:namespace /&gt;<strong>annualIncome</strong>&#8220;&gt; &lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p style="text-align:left;">&lt;tr class=&#8217;portlet-section-alternate results-row alt&#8217;&gt;<br />
&lt;td&gt;<strong> Stock Qty:</strong> &lt;/td&gt;<br />
&lt;td colspan=&#8221;7&#8243;&gt; &lt;input style=&#8221;width:60%&#8221; type=&#8221;text&#8221;  id=&#8221;&lt;portlet:namespace /&gt;<strong>stockQty</strong>&#8221;   name=&#8221;&lt;portlet:namespace /&gt;<strong>stockQty</strong>&#8220;&gt; &lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p style="text-align:left;">&lt;tr class=&#8217;portlet-section-alternate results-row alt&#8217;&gt;<br />
&lt;td&gt; <strong>Active </strong>: &lt;/td&gt;<br />
&lt;td colspan=&#8221;7&#8243;&gt; &lt;input style=&#8221;width:60%&#8221; type=&#8221;text&#8221; id=&#8221;&lt;portlet:namespace /&gt;active&#8221;   name=&#8221;&lt;portlet:namespace /&gt;<strong>active</strong>&#8220;&gt; &lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p style="text-align:left;">&lt;tr&gt;</p>
<p style="text-align:left;">&lt;td colspan=&#8221;2&#8243; align=&#8221;center&#8221;&gt;<br />
&lt;input type=&#8221;<strong>submit</strong>&#8221; value=&#8221;Submit&#8221;    id=&#8221;&lt;portlet:namespace /&gt;<strong>submit</strong>&#8220;/&gt; &amp;nbsp; &amp;nbsp;</p>
<p style="text-align:left;">&lt;input type=&#8221;button&#8221;  value=&#8221;Cancel&#8221; onclick=&#8221;addCompany()&#8221; id=&#8221;&lt;portlet:namespace /&gt;Cancel&#8221; &gt;</p>
</blockquote>
<blockquote>
<p style="text-align:left;">&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;/table&gt;</p></blockquote>
<p style="text-align:left;"><span style="text-decoration:underline;"><strong>b. company.jsp</strong></span> ( javascript file)</p>
<blockquote>
<p style="text-align:left;">
<p>&lt;script language=&#8221;Javascript&#8221;&gt;<br />
jQuery(document).ready(function() {<br />
jQuery.metadata.setType(&#8220;attr&#8221;, &#8220;validate&#8221;);<br />
var validator = jQuery(&#8220;#&lt;portlet:namespace/&gt;fm_id&#8221;).validate({<br />
rules: {<br />
&lt;portlet:namespace/&gt;companyName:{<br />
required:true,<br />
maxlength:75<br />
}<br />
},<br />
messages: {<br />
&lt;portlet:namespace/&gt;companyName:&#8221;Enter Valid Company Name &#8220;,<br />
},<br />
errorPlacement: function(error, element) {<br />
error.appendTo(element.parent());<br />
},<br />
submitHandler: function() {<br />
SubmitForm(document.&lt;portlet:namespace /&gt;fm, &#8216;&lt;portlet:actionURL windowState=&#8221;&lt;%= WindowState.NORMAL.toString() %&gt;&#8221;&gt;&lt;portlet:param name=&#8221;struts_action&#8221; value=&#8221;<strong>/testing/company/process</strong>&#8220;/&gt;&lt;portlet:param name=&#8221;<strong>CMD</strong>&#8221; value=&#8221;<strong>add</strong>_<strong>company</strong>&#8221; /&gt;&lt;/portlet:actionURL&gt;&#8217;, &#8216;<strong>MYCOMPANY</strong>&#8216;, false);<br />
},<br />
success: function(label) {<br />
label.html(&#8220;&amp;nbsp;&#8221;).addClass(&#8220;checked&#8221;);<br />
}<br />
});<br />
});<br />
&lt;/script&gt;</p></blockquote>
<p style="text-align:left;"><span style="text-decoration:underline;"><strong>c. init.jsp</strong></span></p>
<p style="text-align:left;"><span style="text-decoration:underline;"><strong><br />
</strong></span></p>
<blockquote>
<p style="text-align:left;">&lt;%@ include file=&#8221;/html/common/init.jsp&#8221; %&gt;</p>
<p style="text-align:left;">&lt;%&#8211; Add these jquery plugins &#8211;%&gt;</p>
<p style="text-align:left;">&lt;script src=&#8221;/html/js/jquery/jquery.metadata.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p style="text-align:left;">&lt;script src=&#8221;/html/js/jquery/jquery.delegate.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p style="text-align:left;">&lt;script src=&#8221;/html/js/jquery/jquery.validate.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;/html/js/jquery/jquery.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p style="text-align:left;">&lt;%@ include file=&#8221;/html/testing/company/company.jsp&#8221; %&gt;</p>
<p>&lt;%<br />
PortletPreferences prefs = renderRequest.getPreferences();<br />
PortletSession pses = renderRequest.getPortletSession();<br />
Calendar cal = Calendar.getInstance();<br />
themeDisplay.setIncludeCalendarJs(true);<br />
%&gt;</p></blockquote>
<p style="text-align:left;">
<p style="text-align:left;">(java files path: <em><strong><strong>ext-impl/src/</strong></strong></em><strong>com/testing/portlet/company/action/ProcessMyCompanyAction.java</strong><em><strong><strong>)</strong></strong></em></p>
<p style="text-align:left;"><em><strong><strong><span style="text-decoration:underline;"><strong>d. ProcessMyCompanyAction.java</strong></span></strong></strong></em></p>
<p style="text-align:left;">import these files :</p>
<blockquote>
<p style="text-align:left;">import com.liferay.portal.kernel.servlet.SessionMessages;<br />
import com.liferay.portal.kernel.util.ParamUtil;<br />
import com.liferay.portal.kernel.util.Validator;<br />
import com.liferay.portal.struts.PortletAction;<br />
import com.liferay.portlet.ActionRequestImpl;<br />
import com.liferay.portlet.ActionResponseImpl;</p>
<p style="text-align:left;">import com.liferay.counter.service.CounterServiceUtil;</p>
</blockquote>
<blockquote>
<p style="text-align:left;">import com.liferay.portal.kernel.util.Validator</p>
<p style="text-align:left;">import org.apache.commons.logging.Log;<br />
import org.apache.commons.logging.LogFactory;<br />
import org.apache.struts.action.ActionForm;<br />
import org.apache.struts.action.ActionMapping;</p>
<p style="text-align:left;">import javax.portlet.ActionRequest;<br />
import javax.portlet.ActionResponse;<br />
import javax.portlet.PortletConfig;<br />
import javax.portlet.PortletSession;<br />
import javax.portlet.PortletURL;<br />
import javax.servlet.http.HttpServletRequest;<br />
import javax.servlet.http.HttpSession;</p>
<p style="text-align:left;">import com.testing.portlet.company.model.MyCompany;<br />
import com.testing.portlet.company.service.MyCompanyLocalServiceUtil;<br />
import com.testing.portlet.company.service.MyCompanyServiceUtil;</p>
<p style="text-align:left;">
<p style="text-align:left;">public class ProcessMyCompanyAction extends PortletAction {<br />
private static Log log = LogFactory.getLog(ProcessMyCompanyAction.class);</p>
<p>public void <strong>processAction</strong>(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest req,<br />
ActionResponse res) throws Exception {</p>
<p>PortletURL url = ((ActionResponseImpl) res).createRenderURL();<br />
url.setParameter(&#8220;struts_action&#8221;, &#8220;/testing/company/view&#8221;);<br />
String cmd = ParamUtil.getString(req,&#8221;CMD&#8221;);<br />
HttpServletRequest httpReq = ((ActionRequestImpl) req).getHttpServletRequest();<br />
PortletSession ses = req.getPortletSession();<br />
HttpSession httpSession = httpReq.getSession();</p>
<p>log.info(&#8220;ProcessMyCompanyAction CMD Value &gt;&gt; &#8220;+cmd);<br />
Date date = new Date();</p>
<p>MyCompany company = null;<br />
long companyId = 0;<br />
// company Name Duplicate Verification<br />
String companyName = ParamUtil.getString(req,&#8221;companyName&#8221;);<br />
String findCompanyName = &#8220;&#8221;;<br />
try {<br />
company = MyCompanyLocalServiceUtil.getCompanyName(companyName);<br />
findCompanyName = company.getCompanyName();<br />
}catch(Exception e) {<br />
log.info(&#8220;CompanyName Not EXIST&#8221;);<br />
}<br />
log.info(&#8220;companyName&#8221; + companyName);<br />
log.info(&#8220;findCompanyName&#8221; + findCompanyName);</p>
<p>if (Validator.isNotNull(<strong>cmd</strong>) &amp;&amp; cmd.equalsIgnoreCase(&#8220;<strong>add</strong>_<strong>company</strong>&#8220;)) {</p>
<p>if (Validator.isNull(findCompanyName)) {<br />
// set all fields into database<br />
companyId = CounterServiceUtil.increment();<br />
company = MyCompanyLocalServiceUtil.createMyCompany(companyId);<br />
company.setCompanyName(ParamUtil.getString(req,&#8221;companyName&#8221;));<br />
company.setActive(ParamUtil.getInteger(req,&#8221;active&#8221;));<br />
company.setAddress(ParamUtil.getString(req,&#8221;address&#8221;));<br />
company.setAnnualIncome(ParamUtil.getDouble(req,&#8221;annualIncome&#8221;));<br />
company.setStockQty(ParamUtil.getString(req,&#8221;stockQty&#8221;));<br />
company.setStartDate(ParamUtil.getString(req,&#8221;startDate&#8221;));</p>
<p>MyCompanyLocalServiceUtil.updateMyCompany(company);<br />
SessionMessages.add(httpReq, &#8220;Added&#8221;);<br />
} else {<br />
SessionMessages.add(httpReq, &#8220;DuplicateCompanyName&#8221;);<br />
}</p></blockquote>
<blockquote>
<p style="text-align:left;">res.sendRedirect(url.toString());<br />
}</p>
<p>}</p></blockquote>
<p style="text-align:left;"><span style="text-decoration:underline;"><strong>e. ViewMyCompanyAction.java</strong></span></p>
<blockquote>
<p style="text-align:left;">public class <strong>ViewMyCompanyAction </strong>extends PortletAction{</p>
<p>private static Log log = LogFactory.getLog(ViewMyCompanyAction.class);</p>
<p style="text-align:left;padding-left:30px;">public ActionForward render(<br />
ActionMapping mapping, ActionForm form, PortletConfig portletConfig,<br />
RenderRequest req, RenderResponse res)<br />
throws Exception {</p>
<p style="text-align:left;padding-left:60px;">HttpServletRequest httpReq = ((RenderRequestImpl) req).getHttpServletRequest();<br />
PortletSession ses = req.getPortletSession();<br />
HttpSession httpSession = httpReq.getSession();<br />
String cmd = ParamUtil.getString(req,&#8221;CMD&#8221;);<br />
req.setAttribute(&#8220;PAGE&#8221;, &#8220;/html/testing/company/add_company.jsp&#8221;);<br />
return mapping.findForward(&#8220;testing.portlet.company.view&#8221;);</p>
<p style="text-align:left;padding-left:30px;">}<br />
}</p></blockquote>
<p style="text-align:left;padding-left:30px;">import these files:</p>
<blockquote>
<p style="text-align:left;padding-left:30px;">import org.apache.commons.logging.Log;<br />
import org.apache.commons.logging.LogFactory;<br />
import org.apache.struts.action.ActionForm;<br />
import org.apache.struts.action.ActionForward;<br />
import org.apache.struts.action.ActionMapping;</p>
<p style="text-align:left;padding-left:30px;">import com.liferay.portlet.RenderRequestImpl;</p>
<p style="text-align:left;padding-left:30px;">import javax.portlet.PortletConfig;<br />
import javax.portlet.PortletSession;<br />
import javax.portlet.RenderRequest;<br />
import javax.portlet.RenderResponse;<br />
import javax.servlet.http.HttpServletRequest;<br />
import javax.servlet.http.HttpSession;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=105&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/29/struts-portlet-with-database-interaction/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>Struts Portlet with Action in Liferay 5.2.x</title>
		<link>http://zubairwiki.wordpress.com/2009/06/29/struts-portlet-with-action-in-liferay-5-2-x/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/29/struts-portlet-with-action-in-liferay-5-2-x/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 07:22:08 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Liferay]]></category>
		<category><![CDATA[struts portlet]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=100</guid>
		<description><![CDATA[Here i  am pointing out  Struts Portlet with Action classes. To create this portlet, just take the same procedure from my last post  &#8220;Simple Struts Portlet in Liferay 5.2.x&#8221; Everything is same as i mentioned in last post but you need to update the below  files only. 1. struts-config.xml (add a new actionfile  &#8221; AddDetailsAction.java&#8221; in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=100&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here i  am pointing out  Struts Portlet with Action classes.</p>
<p>To create this portlet, just take the same procedure from my last post  <a class="wp-caption" href="http://zubairwiki.wordpress.com/2009/06/29/simple-struts-portlet-in-liferay-5-2-x/" target="_blank"><strong>&#8220;Simple Struts Portlet in Liferay 5.2.x&#8221;</strong></a></p>
<p>Everything is same as i mentioned in last post but you need to update the below <strong> files</strong> only.</p>
<p><span style="text-decoration:underline;"><strong>1. struts-config.xml</strong></span></p>
<p><em>(add a new actionfile  <strong>&#8221; AddDetailsAction.java&#8221;</strong> in this path : </em><em><strong>com/testing/portlet/mystrutsportlet/action</strong>)</em></p>
<blockquote><p>&lt;action path=&#8221;<strong><em>/testing/mystrutsportlet/add_details</em></strong>&#8221; type=&#8221;<strong><em>com.testing.portlet.mystrutsportlet.action.AddDetailsAction</em></strong>&#8220;&gt;<br />
&lt;forward name=&#8221;<strong>testing.mystrutsportlet.view</strong>&#8221; path=&#8221;<strong>testing.mystrutsportlet.view</strong>&#8221; /&gt;<br />
&lt;forward name=&#8221;<strong>testing.mystrutsportlet.<em> </em>success</strong>&#8221; path=&#8221;<strong>testing.mystrutsportlet.<em> </em>success</strong>&#8221; /&gt;<br />
&lt;forward name=&#8221;<strong>testing.mystrutsportlet.failure</strong>&#8221; path=&#8221;<strong>testing.mystrutsportlet.failure</strong>&#8221; /&gt;<br />
&lt;/action&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2. tiles-defs.xml</strong></span></p>
<p>(add two more definitions)</p>
<blockquote>
<pre>&lt;definition name=<strong>testing.mystrutsportlet.view</strong>" extends="portlet"&gt;
 &lt;put name="portlet_content" value="<strong>/testing/mystrutsportlet/view</strong>.<strong>jsp</strong>" /&gt;
 &lt;/definition&gt;

&lt;definition name=<strong>testing.mystrutsportlet.success</strong>" extends="portlet"&gt;
 &lt;put name="portlet_content" value="<strong>/testing/mystrutsportlet/success.jsp</strong>" /&gt;
 &lt;/definition&gt;
<pre>&lt;definition name=<strong>testing.mystrutsportlet.failure</strong>" extends="portlet"&gt;</pre>
<p>&lt;put name="portlet_content" value="<strong>/testing/mystrutsportlet/failure.jsp</strong>" /&gt;<br />
&lt;/definition&gt;</pre>
</blockquote>
<p><span style="text-decoration:underline;"><strong>3. init.jsp</strong></span></p>
<blockquote><p>&lt;%@ include file=&#8221;/html/portlet/init.jsp&#8221; %&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>4. view.jsp</strong></span></p>
<blockquote><p>(modify this file)</p>
<p>&lt;%@ include file=&#8221;/html/portlet/testing/mystrutsportlet/init.jsp&#8221; %&gt;</p>
<p>&lt;%<br />
PortletURL actionURL = renderResponse.createActionURL();<br />
actionURL.setWindowState(WindowState.MAXIMIZED);<br />
<strong><span style="color:#008000;">actionURL</span></strong>.setParameter(&#8220;struts_action&#8221;, &#8220;<strong>/testing/mystrutsportlet/add_details</strong>&#8220;);<br />
%&gt;</p>
<p>Add a Details :<br />
&lt;br/&gt;</p>
<p>&lt;form action=<span style="color:#008000;"><strong>&#8220;&lt;%= actionURL.toString() %&gt;</strong></span>&#8220;  method=&#8221;<span style="color:#008000;"><strong>POST</strong></span>&#8220;  name=&#8221;&lt;portlet:namespace /&gt;fm&#8221;&gt;</p>
<p>Name:  &lt;input type=&#8221;text&#8221;  name=&#8221;&lt;portlet:namespace /&gt;<strong>name</strong>&#8221; /&gt;&lt;br/&gt;&lt;br/&gt;</p>
<p>&lt;input type=&#8221;submit&#8221;  value=&#8221;Submit&#8221;/&gt;<br />
&lt;/form&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>5. success.jsp</strong></span></p>
<blockquote><p>&lt;%@ include file=&#8221;/html/portlet/testing/mystrutsportlet/init.jsp&#8221; %&gt;<br />
&lt;%<br />
String name = request.getParameter(&#8220;name&#8221;);<br />
%&gt;</p>
<p>&lt;table align=&#8221;center&#8221; cellspacing=&#8221;10&#8243; cellpadding=&#8221;3&#8243;&gt;<br />
&lt;tr&gt;<br />
&lt;td style=&#8221;font-weight:bold&#8221;&gt;Name : &lt;/td&gt;<br />
&lt;td&gt;&lt;%= name%&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>6. failure.jsp</strong></span></p>
<blockquote><p>&lt;%@ include file=&#8221;/html/portlet/testing/mystrutsportlet/init.jsp&#8221; %&gt;<br />
&lt;font color=&#8221;red&#8221;&gt;Error in page&#8230;&lt;/font&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>7. AddDetailsAction.java</strong></span></p>
<p><em>(location: ext/ext-impl/src/com/testing/mystrutsportlet/action/AddDetailsAction.java)</em></p>
<blockquote><p>package com.testing.mystrutsportlet.action;</p>
<p>import javax.portlet.ActionRequest;<br />
import javax.portlet.ActionResponse;<br />
import javax.portlet.PortletConfig;<br />
import javax.portlet.RenderRequest;<br />
import javax.portlet.RenderResponse;</p>
<p>import org.apache.struts.action.ActionForm;<br />
import org.apache.struts.action.ActionForward;<br />
import org.apache.struts.action.ActionMapping;</p>
<p>import com.liferay.portal.struts.PortletAction;<br />
import com.liferay.portal.kernel.util.Validator;</p>
<p>public class <strong>AddDetailsAction </strong>extends PortletAction {</p>
<p>public void <strong>processAction</strong>(<br />
ActionMapping mapping, ActionForm form, PortletConfig config,<br />
ActionRequest req, ActionResponse res)<br />
throws Exception {</p>
<p>String name= req.getParameter(&#8220;name&#8221;);</p>
<p>if (Validator.isNull(name)) {<br />
setForward(req, &#8220;<strong>testing.mystrutsportlet.<em> </em></strong><strong>failure</strong>&#8220;);<br />
} else {<br />
setForward(req, &#8220;<strong>testing.mystrutsportlet.<em> </em>success</strong>&#8220;);<br />
}<br />
}</p>
<p>public ActionForward <strong>render</strong>(ActionMapping mapping, ActionForm form,<br />
PortletConfig config, RenderRequest req, RenderResponse res)<br />
throws Exception {<br />
if (getForward(req) != null &amp;&amp; !getForward(req).equals(&#8220;&#8221;)) {<br />
return mapping.findForward(getForward(req));<br />
} else {<br />
return mapping.findForward(&#8220;<strong>testing.mystrutsportlet.<em> view</em></strong>&#8220;);<br />
}<br />
}<br />
}</p>
<p style="text-align:center;"><strong><span style="color:#008000;">You have successfully created Struts Portlet with Action class.</span></strong></p>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=100&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/29/struts-portlet-with-action-in-liferay-5-2-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple Struts Portlet in Liferay 5.2.x</title>
		<link>http://zubairwiki.wordpress.com/2009/06/29/simple-struts-portlet-in-liferay-5-2-x/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/29/simple-struts-portlet-in-liferay-5-2-x/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 06:36:53 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Liferay]]></category>
		<category><![CDATA[struts portlet]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=95</guid>
		<description><![CDATA[Struts portlets are based on the Struts framework, which is an implementation of the Model-View-Controller (MVC) architecture. The MVC architecture provides a model for separating the different components and roles of the application logic. This development framework helps you create portlets that are easier to maintain over time. You have to follow the same procedure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=95&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Struts portlets</strong> are based on the Struts framework, which is an implementation of the Model-View-Controller (<strong>MVC</strong>) architecture.</p>
<p>The MVC architecture provides a model for separating the different components and roles of the application logic. This development framework helps you create portlets that are easier to maintain over time.</p>
<p>You have to follow the same procedure and file structures as i mentioned in <a class="wpGallery" href="http://zubairwiki.wordpress.com/2009/06/29/create-jsp-portlet-in-liferay-5-2-x/" target="_blank">my last post</a> to create the Struts portlet in Liferay.</p>
<h2><span style="text-decoration:underline;"><span style="color:#008000;">I. Development</span></span></h2>
<p><span style="text-decoration:underline;"><strong>1.1 portlet-ext.xml</strong></span></p>
<blockquote><p>&lt;portlet&gt;<br />
&lt;portlet-name&gt;<strong>MYSTRUTSPORTLET</strong>&lt;/portlet-name&gt;<br />
&lt;display-name&gt;My Struts Portlet&lt;/display-name&gt;<br />
&lt;portlet-class&gt;com.liferay.portlet.StrutsPortlet&lt;/portlet-class&gt;<br />
&lt;init-param&gt;<br />
&lt;name&gt;view-action&lt;/name&gt;<br />
&lt;value&gt;<strong>/testing/mystrutsportlet/view</strong>&lt;/value&gt;<br />
&lt;/init-param&gt;<br />
&lt;expiration-cache&gt;0&lt;/expiration-cache&gt;<br />
&lt;supports&gt;<br />
&lt;mime-type&gt;text/html&lt;/mime-type&gt;<br />
&lt;/supports&gt;<br />
&lt;resource-bundle&gt;com.liferay.portlet.StrutsResourceBundle&lt;/resource-bundle&gt;<br />
&lt;security-role-ref&gt;<br />
&lt;role-name&gt;power-user&lt;/role-name&gt;<br />
&lt;/security-role-ref&gt;<br />
&lt;security-role-ref&gt;<br />
&lt;role-name&gt;user&lt;/role-name&gt;<br />
&lt;/security-role-ref&gt;<br />
&lt;/portlet&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2.2. liferay-portlet-ext.xml</strong></span></p>
<blockquote><p>&lt;portlet&gt;<br />
&lt;portlet-name&gt;<strong>MYSTRUTSPORTLET</strong>&lt;/portlet-name&gt;<br />
&lt;struts-path&gt;<strong>testing/mystrutsportle</strong>t&lt;/struts-path&gt;<br />
&lt;use-default-template&gt;false&lt;/use-default-template&gt;<br />
&lt;/portlet&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2.3. liferay-display.xml</strong></span></p>
<blockquote><p>&lt;portlet id=&#8221;<strong>MYSTRUTSPORTLET</strong>&#8221; /&gt;</p>
<p>inside,</p>
<p>&lt;category name=&#8221;<strong>category.example</strong>&#8220;&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2.4. struts-config.xml</strong></span></p>
<blockquote><p>&lt;action path=&#8221;<strong>/testing/mystrutsportlet/view</strong>&#8221; forward=&#8221;<strong>portlet.testing.mystrutsportet.view</strong>&#8221; /&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2.5. tiles-defs.xml</strong></span></p>
<blockquote><p>&lt;definition name=&#8221;<strong>portlet.testing.mystrutsportlet.view</strong>&#8220;  extends=&#8221;portlet&#8221;&gt;</p>
<pre>&lt;put name="portlet_content" value="<strong>/portlet/testing/mystrutsportlet/view.jsp</strong>" /&gt;</pre>
<p>&lt;/definition&gt;</p></blockquote>
<p>(create the following two jsp files under &#8220;<em>/ext/ext-web/docroot/html/portlet/testing/mystrutsportlet</em>&#8220;)</p>
<p><span style="text-decoration:underline;"><strong>2.6. init.jsp</strong></span></p>
<p>&lt;%@ include file=&#8221;/html/portlet/init.jsp&#8221; %&gt;<br />
&lt;p&gt;Add commonly used variables and declarations here!&lt;/p&gt;</p>
<p><span style="text-decoration:underline;"><strong>2.7. view.jsp</strong></span></p>
<blockquote><p>&lt;%@ include file=&#8221;/html/portlet/testing/mystrutsportlet/init.jsp&#8221; %&gt;<br />
Welcome to My first Simple Struts Portlet!</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2.8 Language-ext.properties</strong></span></p>
<p>Add a entry,</p>
<blockquote><p>
javax.portlet.title.MYSTRUTSPORTLET= MY STRUTS PORTLET</p></blockquote>
<p>You have successfully created Struts Portlet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=95&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/29/simple-struts-portlet-in-liferay-5-2-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>Create JSP Portlet in Liferay 5.2.X</title>
		<link>http://zubairwiki.wordpress.com/2009/06/29/create-jsp-portlet-in-liferay-5-2-x/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/29/create-jsp-portlet-in-liferay-5-2-x/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 05:58:49 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[Liferay]]></category>
		<category><![CDATA[Jsp Portlet]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=90</guid>
		<description><![CDATA[A Portlet is a  Web component that processes requests and generates dynamic content. A portlet is a reusable building block for easily publishing information and applications. Here i am giving the step by step code snippets for creating simple Jsp portlet in Liferay Enviroinment. To create simple JSP portlet , We need atleast 3 xml [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=90&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A Portlet is a  Web component that processes requests and generates dynamic content.<em> </em></p>
<p>A <em>portlet</em> is a reusable building block for easily publishing information and applications.</p>
<p>Here i am giving the step by step code snippets for creating simple Jsp portlet in <a href="www.liferay.com"><a class="wp-caption" href="http://www.liferay.com" target="_blank"><strong>Liferay</strong></a><strong> </strong></a>Enviroinment.</p>
<p>To create simple JSP portlet , We need atleast <strong>3 xml files</strong> and <strong>1 jsp</strong> file.<br />
[the xml files are located under "<strong>ext/ext-web/docroot/WEB-INF</strong>"]<br />
<strong>1. portlet-ext.xml<br />
2. liferay-portlet-ext.xml<br />
3. liferay-display.xml<br />
4. view.jsp</strong></p>
<h2><span style="text-decoration:underline;"><span style="color:#008000;"><strong>I .  Development </strong></span></span></h2>
<p><em>In this xml file, we have to define portlet name and </em><em>portlet class ..etc&#8230;</em></p>
<p><span style="text-decoration:underline;"><strong>1.portlet-ext.xml </strong></span> (ext/ext-web/docroot/WEB-INF)</p>
<blockquote><p>&lt;portlet&gt;</p>
<p>&lt;<strong>portlet-name</strong>&gt;MYPORTLET&lt;/<strong>portlet-name</strong>&gt;<br />
&lt;display-name&gt;My Portlet&lt;/display-name&gt;<br />
&lt;portlet-class&gt;<strong>com.liferay.util.bridges.jsp.<span style="color:#008000;">JSPPortlet</span></strong>&lt;/portlet-class&gt;</p>
<p>&lt;init-param&gt;<br />
&lt;name&gt;view-jsp&lt;/name&gt;<br />
&lt;value&gt;<strong>/html/testing/myportlet/view.jsp</strong>&lt;/value&gt;<br />
&lt;/init-param&gt;<br />
&lt;expiration-cache&gt;0&lt;/expiration-cache&gt;<br />
&lt;supports&gt;<br />
&lt;mime-type&gt;text/html&lt;/mime-type&gt;<br />
&lt;/supports&gt;<br />
&lt;resource-bundle&gt;com.liferay.portlet.StrutsResourceBundle&lt;/resource-bundle&gt;<br />
&lt;security-role-ref&gt;<br />
&lt;role-name&gt;power-user&lt;/role-name&gt;<br />
&lt;/security-role-ref&gt;<br />
&lt;/portlet&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>2. liferay-portlet-ext.xml </strong></span> (ext/ext-web/docroot/WEB-INF)</p>
<p><em>We should register that portlet in liferay using this xml file.</em></p>
<blockquote><p>&lt;liferay-portlet-app&gt;<br />
//register portlet in liferay<br />
&lt;portlet&gt;<br />
&lt;<strong>portlet-name</strong>&gt;MYPORTLET&lt;/<strong>portlet-name</strong>&gt;<br />
&lt;/portlet&gt;<br />
&lt;/liferay-portlet-app&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>3. liferay-display.xml</strong></span> (ext/ext-web/docroot/WEB-INF)</p>
<p><em>this xml file defines Under which category our portlet should be displayed</em></p>
<blockquote><p>&lt;display&gt;<br />
// under which category our portlet shoud display in Add Content&#8230;<br />
&lt;category name=&#8221;category.myportlet&#8221;&gt;<br />
&lt;portlet id=&#8221;<strong>MYPORTLET</strong>&#8220;&gt;&lt;/portlet&gt;<br />
&lt;/category&gt;</p>
<p>&lt;/display&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>4. view.jsp </strong></span><strong> </strong></p>
<p><em>(create this file under &#8220;ext/ext-web/docroot/html/testing/myportlet&#8221; )<br />
</em></p>
<blockquote><p>&lt;h2&gt; Welcome to my first Jsp portlet &lt;/h2&gt;</p></blockquote>
<h2><span style="color:#008000;"><span style="text-decoration:underline;">II .  Deploy : </span></span></h2>
<p>Give &#8220;<strong>ant deploy</strong>&#8220;  inside  <strong>ext</strong> or <strong>ext-web</strong>. Start the server and make sure that your portlet is created.</p>
<p>your <strong>portlet title</strong> will disply like this:<strong> javax.portlet.title.MYPORTLET</strong></p>
<p>go to <strong><em> ext/ext-impl/src/content/language-ext.properties</em></strong> file</p>
<p>add this entry:</p>
<blockquote><p><strong> javax.portlet.title.MYPORTLET</strong> = <strong>MY JSP PORTLET</strong></p></blockquote>
<p>then again <strong>ant deploy</strong> and start the server.</p>
<p>Now, You have sucessfully created Jsp Portlet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=90&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/29/create-jsp-portlet-in-liferay-5-2-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery DatePicker</title>
		<link>http://zubairwiki.wordpress.com/2009/06/26/jquery-datepicker/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/26/jquery-datepicker/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 10:25:07 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[datepicker]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=86</guid>
		<description><![CDATA[A  jQuery plugin that attaches a popup calendar to your input fields or shows an inline calendar for selecting individual dates or date ranges. Required Files : Douwnload Zip file of  : jquery.datepick.js  &#38;  jquery.datepick.css  &#38; images include these 2 files in Html page: &#60;script src=&#8221;jquery.datepicker.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62; &#60;script src=&#8221;jquery.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62; Example: 1 &#60;script type=&#8221;text/javascript&#8221;&#62; jQuery(function() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=86&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A  jQuery plugin that attaches a popup calendar to your input fields or shows an 	inline calendar for selecting individual dates or date ranges.</p>
<p><span style="text-decoration:underline;"><strong>Required Files : </strong></span>Douwnload Zip file of  :</p>
<p><a href="http://plugins.jquery.com/files/jquery.datepick.package-3.6.1.zip"><strong>jquery.datepick.js  &amp;  jquery.datepick.css  &amp; images</strong></a></p>
<p><strong><span style="text-decoration:underline;"><em>include these 2 files in Html page:</em></span></strong></p>
<h5>&lt;script src=&#8221;<strong>jquery.datepicker.js</strong>&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</h5>
<h5>&lt;script src=&#8221;<strong>jquery.js</strong>&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</h5>
<p><span style="text-decoration:underline;"><strong>Example: 1<br />
</strong></span><br />
&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<blockquote><p>
jQuery(function() {<br />
jQuery(&#8220;#datepicker&#8221;).datepicker();<br />
});</p></blockquote>
<p>&lt;/script&gt;</p>
<p>&lt;div class=&#8221;demo&#8221;&gt;</p>
<p>&lt;p&gt;Date: &lt;input id=&#8221;<strong>datepicker</strong>&#8221; type=&#8221;text&#8221;&gt;&lt;/p&gt;</p>
<p>&lt;/div&gt;</p>
<p><span style="text-decoration:underline;"><strong>Example : 2</strong></span></p>
<p style="text-align:center;"><span style="text-decoration:underline;"><strong>Start Date &#8211; End Date</strong></span></p>
<p>&lt;script&gt;</p>
<blockquote><p>
jQuery(function() {</p>
<p>jQuery(&#8216;<strong>selector</strong>&#8216;).datepick();<br />
jQuery(&#8216;#<strong>startDatepicker</strong>,#<strong>endDatepicker</strong>&#8216;).datepick({beforeShow: customRange,<br />
showOn: &#8216;both&#8217;, buttonImageOnly: true, buttonImage: &#8216;calendar.gif&#8217;});<br />
});<br />
function customRange(input) {<br />
return {minDate: (input.id == &#8220;<strong>endDatepicker</strong>&#8221; ?<br />
jQuery(&#8220;#<strong>startDatepicker</strong>&#8220;).datepick(&#8220;<strong>getDate</strong>&#8220;) : null),<br />
maxDate: (input.id == &#8220;<strong>startDatepicker</strong>&#8221; ?<br />
jQuery(&#8220;#<strong>endDatepicker</strong>&#8220;).datepick(&#8220;<strong>getDate</strong>&#8220;) : null)};<br />
}</p></blockquote>
<p>&lt;/script&gt;</p>
<p>&lt;p&gt;&lt;span class=&#8221;<strong>demoLabel</strong>&#8220;&gt;Date range with separate fields:&lt;/span&gt;<br />
&lt;input type=&#8221;text&#8221; size=&#8221;10&#8243;  id=&#8221;<strong>startDatepicker</strong>&#8220;/&gt; to<br />
&lt;input type=&#8221;text&#8221; size=&#8221;10&#8243;  id=&#8221;<strong>endDatepicker</strong>&#8220;/&gt;&lt;/p&gt;</p>
<p><span style="text-decoration:underline;"><strong>Note:</strong></span></p>
<p>If you want to get the data when date is clicked instead of button, add below  <strong>onSelect </strong>Method.</p>
<blockquote><p>jQuery(&#8216;#datepicker&#8217;).datepick({</p>
<p>showOn: &#8216;both&#8217;, buttonImageOnly: true, buttonImage: &#8216;calendar-green.gif &#8216;,<br />
<strong>onSelect: function()<br />
{<br />
getInvoiceByDate(jQuery(&#8216;#openBillsDate&#8217;).val());<br />
} ,</strong><br />
showStatus : true</p>
<p>});</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=86&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/26/jquery-datepicker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery Loading Indicator</title>
		<link>http://zubairwiki.wordpress.com/2009/06/26/jquery-page-loading-indicator/</link>
		<comments>http://zubairwiki.wordpress.com/2009/06/26/jquery-page-loading-indicator/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 08:02:57 +0000</pubDate>
		<dc:creator>Gnaniyar Zubair</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[loading image]]></category>

		<guid isPermaLink="false">http://zubairwiki.wordpress.com/?p=82</guid>
		<description><![CDATA[This spinner animation ( loading indicator) is used for loading a small animated indicator  while page  is  loading or any action performed. busy.js 1.21 allows you to add/remove loading indicators to html elements (or viewport) on your webpages . Demonstration  (Click to see what cvi_busy_lib.js can do ) Required Files :   Download Zip files of  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=82&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This spinner animation ( loading indicator) is used for loading a small animated indicator  while page  is  loading or any action performed.</p>
<p><a href="http://www.netzgesta.de/busy/busy.zip"><strong>busy.js 1.21</strong></a> allows you to add/remove loading indicators to html elements (or viewport) on your webpages .</p>
<address><a href="http://www.netzgesta.de/busy/click.html">Demonstration  (Click to see what cvi_busy_lib.js can do )</a></address>
<address>
</address>
<address> </address>
<address><span style="text-decoration:underline;"><strong>Required Files</strong></span> :   Download Zip files of  <a href="http://www.netzgesta.de/busy/busy.zip">cvi_busy_lib.js</a></address>
<address> </address>
<address><span style="text-decoration:underline;"><strong>Example:1</strong></span></address>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;  src=&#8221;cvi_busy_lib.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.js&#8221;&gt;&lt;/script&gt;</p></blockquote>
<p>&lt;button onclick=&#8221;<strong>block_viewport()</strong>;&#8221;&gt;&lt;big&gt;Viewport&lt;/big&gt;&lt;/button&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;</p>
<blockquote><p>var xval, tval, bval, rval, lval;<br />
function <strong>block_viewport() </strong>{<br />
xval=getBusyOverlay(&#8216;viewport&#8217;,{color:&#8217;lightgrey&#8217;,    opacity:0.75, text:&#8217;loading&#8230;&#8217;, style:&#8217;text-shadow: 0 0 3px   black;font-weight:bold;font-size:16px;color:white&#8217;},{color:&#8217;#ff0&#8242;, size:100, type:&#8217;o'});<br />
if(xval) {var c=0,t=100;<br />
xval.ntime=window.setInterval(function() {<br />
xval.settext(&#8216;viewport: loading&#8230;&#8217;+c+&#8217;%'); c++;<br />
if(c&gt;t) {window.clearInterval(xval.ntime); xval.remove();}<br />
},50);<br />
}<br />
}</p></blockquote>
<p>&lt;/script&gt;</p>
<p><span style="text-decoration:underline;"><strong>Example : 2</strong></span></p>
<blockquote><p><strong><span style="color:#888888;">(Click to add overlay and click again to remove.)</span></strong></p>
<p>&lt;div id=&#8221;<strong>top</strong>&#8220;  <strong>onclick</strong>=&#8221;<span style="color:#888888;">try {tval.remove(); tval=&#8221;;}catch(e) {tval=getBusyOverlay(this,{color:&#8217;blue&#8217;,opacity:0.25});}</span>&#8220;&gt;</p>
<p>&lt;p&gt;Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Defacto lingo est igpay atinlay. Marquee selectus non provisio incongruous feline nolo contendre.&lt;/p&gt;<br />
&lt;/div&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>Example : 3</strong></span></p>
<blockquote><p>
&lt;div id=&#8221;<strong>left</strong>&#8220;  onclick=&#8221;<span style="color:#888888;">try {lval.remove(); lval=&#8221;;}catch(e) {lval=getBusyOverlay(this,{color:&#8217;black&#8217;, opacity:0.5, text:&#8217;loading&#8217;, style:&#8217;text-decoration:blink;font-weight:bold;font-size:12px;color:white&#8217;},{color:&#8217;#fff&#8217;, size:128, type:&#8217;o'});}</span>&#8220;&gt;</p>
<p>&lt;p&gt;&lt;img src=&#8221;images/spam.jpg&#8221; align=&#8221;left&#8221; alt=&#8221;0&#8243; /&gt;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.&lt;/p&gt;</p>
<p>&lt;p&gt;Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Defacto lingo est igpay atinlay. Marquee selectus non provisio incongruous feline nolo contendre.&lt;/p&gt;<br />
&lt;p&gt;Gratuitous octopus niacin, sodium glutimate. Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.&lt;/p&gt;<br />
&lt;/div&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>Example : 4</strong></span></p>
<p><span style="text-decoration:underline;"><strong><br />
</strong></span></p>
<blockquote><p><span style="text-decoration:underline;"><strong> </strong></span> &lt;div id=&#8221;<strong>right</strong>&#8221; onclick=&#8221;<span style="color:#888888;">try {rval.remove(); rval=&#8221;;}catch(e) {rval=getBusyOverlay(this,{color:&#8217;white&#8217;, opacity:0.5},{color:&#8217;#00f&#8217;, size:32, type:&#8217;c', iradius:10, weight:6});}</span>&#8220;&gt;</p>
<p>&lt;p&gt;Gratuitous octopus niacin, sodium glutimate. Quote meon an estimate et non interruptus stadium.&lt;/p&gt;<br />
&lt;p&gt;Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.&lt;/p&gt;<br />
&lt;/div&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>Example : 5</strong></span></p>
<p><span style="text-decoration:underline;"><strong><br />
</strong></span></p>
<blockquote><p>&lt;div id=&#8221;<strong>bottom</strong>&#8221; onclick=&#8221;<span style="color:#888888;">try {bval.remove(); bval=&#8221;;}catch(e) {bval=getBusyOverlay(this,{color:&#8217;green&#8217;,opacity:0.25});}</span>&#8220;&gt;</p>
<p>&lt;p&gt;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.&lt;/p&gt;<br />
&lt;/div&gt;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zubairwiki.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zubairwiki.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zubairwiki.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zubairwiki.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zubairwiki.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zubairwiki.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zubairwiki.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zubairwiki.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zubairwiki.wordpress.com&amp;blog=8120034&amp;post=82&amp;subd=zubairwiki&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zubairwiki.wordpress.com/2009/06/26/jquery-page-loading-indicator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bad422631c11bddf946f74350efc950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Zubair</media:title>
		</media:content>
	</item>
	</channel>
</rss>
