<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TheUnical Technologies Blog &#187; Portlets</title>
	<atom:link href="http://blog.theunical.com/category/cms/liferay/portlets/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.theunical.com</link>
	<description>TheUnical Technologies Official Blog</description>
	<lastBuildDate>Fri, 30 Jul 2010 03:56:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>REPLAY: Liferay and the Future of Portal Development Thursday, Jan 28 @ 10AM PT/ 1PM ET (GMT-8)</title>
		<link>http://blog.theunical.com/cms/replay-liferay-and-the-future-of-portal-development-thursday-jan-28-10am-pt-1pm-et-gmt-8/</link>
		<comments>http://blog.theunical.com/cms/replay-liferay-and-the-future-of-portal-development-thursday-jan-28-10am-pt-1pm-et-gmt-8/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 02:58:33 +0000</pubDate>
		<dc:creator>Steven Robert</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[LifeRay]]></category>
		<category><![CDATA[Portlets]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=268459</guid>
		<description><![CDATA[Couldn&#8217;t attend the first time? We will be running this webinar again!
Liferay&#8217;s Chief Marketing Officer, Paul Hinz, will review Liferay&#8217;s strategies for open source and impact on the industry. He will discuss key points on the futures of open source, plus Liferay&#8217;s visions for Web, Portal, and Social Collaboration technologies.
Note: Those who registered for our [...]]]></description>
			<content:encoded><![CDATA[<p>Couldn&#8217;t attend the first time? We will be running this webinar again!<br />
Liferay&#8217;s Chief Marketing Officer, Paul Hinz, will review Liferay&#8217;s strategies for open source and impact on the industry. He will discuss key points on the futures of open source, plus Liferay&#8217;s visions for Web, Portal, and Social Collaboration technologies.</p>
<p>Note: Those who registered for our webinar on Jan 21st will not need to re-register. Please use the existing link to the event that was provided in your confirmation and reminder emails.</p>
<p>If you have not registered, please choose your preferred date and time below:<br />
<a href="http://vm-10.liferay.com/emailmarketer/link.php?M=18392&amp;N=3&amp;L=1&amp;F=H" target="_blank">Thursday, Jan 28 @ 10AM PT/ 1PM ET (GMT-8)</a></p>
<p>Register Here : http://vm-10.liferay.com/emailmarketer/link.php?M=18392&amp;N=3&amp;L=1&amp;F=H</p>
<p><a href="http://vm-10.liferay.com/emailmarketer/link.php?M=18392&amp;N=3&amp;L=4&amp;F=H" target="_blank">Thursday, Feb 2 @ 6AM PT/ 9AM ET (GMT -8)</a></p>
<p>Register Here : http://vm-10.liferay.com/emailmarketer/link.php?M=18392&amp;N=3&amp;L=4&amp;F=H</p>
<table border="0" cellspacing="0" cellpadding="0" width="654">
<tbody>
<tr>
<td valign="top">We look forward to seeing you online!<br />
Liferay</p>
<p>Invite a Friend</p>
<p><a href="mailto:?subject=Come%20to%20the%20Liferay%20webinar.%20I%27ll%20be%20attending%20too.&amp;body=I%20signed%20up%20for%20the%20Liferay%20webinar%20and%20I%20think%20you%20should%20attend.%20Liferay%20will%20be%20talking%20about%20The%20Future%20of%20Portal%20Development.%0A%0AHere%27s%20the%20information:%20www.liferay.com/webinar" target="_blank">Tell your colleagues</a> about this webinar.</td>
<td></td>
</tr>
</tbody>
</table>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<img src="http://blog.theunical.com/?ak_action=api_record_view&id=268459&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/cms/replay-liferay-and-the-future-of-portal-development-thursday-jan-28-10am-pt-1pm-et-gmt-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liferay Webinar for January 2010</title>
		<link>http://blog.theunical.com/cms/liferay-webinar-for-january-2010/</link>
		<comments>http://blog.theunical.com/cms/liferay-webinar-for-january-2010/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 09:02:09 +0000</pubDate>
		<dc:creator>Steven Robert</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[LifeRay]]></category>
		<category><![CDATA[OpenSource CMS]]></category>
		<category><![CDATA[Portlets]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/?p=268447</guid>
		<description><![CDATA[Only 2 more days to register for the upcoming webinar!
Kick off 2010 with Liferay&#8217;s senior leaders in a complimentary webinar on Liferay&#8217;s strategies for open source and impact on the industry. This webinar will review key points on the futures of open source, plus Liferay&#8217;s visions for Web, Portal and Social Collaboration technologies. This event [...]]]></description>
			<content:encoded><![CDATA[<p>Only 2 more days to register for the upcoming webinar!</p>
<p>Kick off 2010 with Liferay&#8217;s senior leaders in a complimentary webinar on Liferay&#8217;s strategies for open source and impact on the industry. This webinar will review key points on the futures of open source, plus Liferay&#8217;s visions for Web, Portal and Social Collaboration technologies. This event will <a href="http://vm-10.liferay.com/emailmarketer/link.php?M=18392&amp;N=2&amp;L=2&amp;F=H">benefit</a> everyone from the CxO, IT Manager, to the developer.</p>
<p>Please join us online: Thursday, January 21, 2010 @ 10:00am PST / 1:00pm EST</p>
<p>Register Here :  http://vm-10.liferay.com/emailmarketer/link.php?M=18392&amp;N=2&amp;L=1&amp;F=H</p>
<p>Invite a Friend</p>
<p><a href="mailto:?subject=Come%20to%20the%20Liferay%20webinar.%20I%27ll%20be%20attending%20too.&amp;body=I%20signed%20up%20for%20the%20Liferay%20webinar%20and%20I%20think%20you%20should%20attend.%20Liferay%20will%20be%20talking%20about%20The%20Future%20of%20Portal%20Development.%0A%0AHere%27s%20the%20information:%0A%0AThursday,%20January%2021,%202010%0A10:00am%20PST/1:00pm%20EST%0A%0AIt%27s%20free%20to%20sign%20up%21%0Ahttps://www2.gotomeeting.com/register/484001850">Tell your colleagues</a> about this webinar.</p>
<p>Contact Us</p>
<p>Need help with registration? <a href="mailto:events@liferay.com">Send us an email</a> before Thursday, January 21, and we&#8217;ll be sure to get the dial-in information.</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<img src="http://blog.theunical.com/?ak_action=api_record_view&id=268447&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/cms/liferay-webinar-for-january-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liferay 5.2.3 on external tomcat 6.0 &#8211; Community forums &#8211; Liferay</title>
		<link>http://blog.theunical.com/cms/liferay-5-2-3-on-external-tomcat-6-0-community-forums-liferay/</link>
		<comments>http://blog.theunical.com/cms/liferay-5-2-3-on-external-tomcat-6-0-community-forums-liferay/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 10:06:44 +0000</pubDate>
		<dc:creator>Steven Robert</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[LifeRay]]></category>
		<category><![CDATA[Portlets]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Liferay 5.2.3 on external]]></category>
		<category><![CDATA[tomcat 6.0]]></category>

		<guid isPermaLink="false">http://blog.theunical.com/webservers/tomcat/liferay-5-2-3-on-external-tomcat-6-0-community-forums-liferay/</guid>
		<description><![CDATA[INSTALLING FROM THE LIFERAY WAR FILE
I&#8217;m going to assume that you know how to install tomcat.  If not, you&#8217;ll need to reference the documents on the Apache Tomcat website for assistance with that step, as it is outside the scope of this document.
Make sure your tomcat installation starts and runs before continuing.
Install the Liferay Dependencies bundle in your tomcat [...]]]></description>
			<content:encoded><![CDATA[<h2>INSTALLING FROM THE LIFERAY WAR FILE</h2>
<p>I&#8217;m going to assume that you know how to install tomcat.  If not, you&#8217;ll need to reference the documents on the <a href="http://tomcat.apache.org/tomcat-6.0-doc/appdev/installation.html">Apache Tomcat website</a> for assistance with that step, as it is outside the scope of this document.</p>
<p>Make sure your tomcat installation starts and runs before continuing.</p>
<p>Install the Liferay Dependencies bundle in your tomcat installation first.  This largely involves copying some files into the $tomcat/lib directory.</p>
<p>To install the WAR file, go to your TOMCAT MANANGER and upload the WAR file.   NOTE:  The TOMCAT MANAGER is *not* part of the default TOMCAT package any more.  You will need to install that seperately.</p>
<p>In case you don&#8217;t have the TOMCAT MANAGER installed (part of tomcat) then you will need to deploy it by hand.  You can find<a href="http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html"> more information here</a> on ways to do that.</p>
<p>You may have to stop and restart tomcat in order to get it to unpack the WAR (if you had to deploy by hand)</p>
<p>Once that is done, you will need to change some of the defaults:</p>
<p>1) Moved ROOT.xml to liferay.xml under TOMCAT_HOME\conf\Catalina\localhost<br />
2) Copied all files under TOMCAT_HOME\webapps\ROOT to webapps\mynewdirectory<br />
3) Added entry portal.ctx=/mynewdirectory to portal-ext.properties file (don&#8217;t forget the &#8220;/&#8221;)<br />
4) edit TOMCAT_HOME\conf\Catalina\localhost\liferay.xml : &lt;Context path=&#8221;<strong>/mynewdirectory</strong>&#8221; crossContext=&#8221;true&#8221;&gt;</p>
<h2>INSTALLING LIFERAY FROM THE BUNDLE</h2>
<p>I&#8217;m going to assume that you can adjust the file paths for your Windows machines.  I&#8217;ve only done that on my workstation once.  And as always, any change in OS can result in a change in directions.  This seems to work really well for *nix systems of various flavors.</p>
<ol>
<li>Download and install the SUN-JAVA6 JDK and JRE.  (When we get to performance tuning, you&#8217;ll see why&#8230;)</li>
<li>Install UNZIP since you&#8217;ll need it to unpack the bundle.</li>
<li>Set your environment variables JAVA_HOME and JRE_HOME</li>
<li>Set your hostname to something with a FQDN (Fully Qualified Domain Name).  If you don&#8217;t have one or know what it is, see your Network Administrator.  Domain Names are outside the scope of this document.</li>
<li>Install the database of your choice.</li>
<li>Upload the bundle to your server and move it to /opt (Note: This is *nix specific.  If you&#8217;re on Windows, put it in an out of the way place where it can have plenty of disk space.)  It&#8217;s good system administration practice ot keep it out of /var.  /var is where most logs are written and if that partition fills, your server will fail.  It&#8217;s also good system admistration practice to keep it out of user space (/usr and /home) for security reasons.  Same goes for installing it in / or most of the other partitions.</li>
<li>Unpack the bundle.</li>
<li>Go into /opt/liferaydirectory/tomcat-version/bin and run the startup.sh or startup.bat (on Windows)</li>
<li>Make sure that Liferay starts and runs before trying to edit any of the more advanced configurations.
<ol>
<li>Open a browser and point it to www.myfqdn.com:8080 and make sure that you see the Liferay home page.</li>
</ol>
</li>
</ol>
<img src="http://blog.theunical.com/?ak_action=api_record_view&id=56762&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/cms/liferay-5-2-3-on-external-tomcat-6-0-community-forums-liferay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Portlets for Web Sites With the NetBeans IDE</title>
		<link>http://blog.theunical.com/java/creating-portlets-for-web-sites-with-the-netbeans-ide/</link>
		<comments>http://blog.theunical.com/java/creating-portlets-for-web-sites-with-the-netbeans-ide/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 12:48:00 +0000</pubDate>
		<dc:creator>Steven Robert</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Portlets]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://rachasatish.wordpress.com/2008/06/29/creating-portlets-for-web-sites-with-the-netbeans-ide/</guid>
		<description><![CDATA[A portal is a web page that contains individual and customizable web applications. For example, My Yahoo is a portal page. The portal provides value-added services, such as single sign-on, customization, content aggregation, and localization.
Individual web applications that are added to the portal page are called portlets. A portlet is a Java technology web component [...]]]></description>
			<content:encoded><![CDATA[<div class="Section1"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">A <em><i><span style="font-family:Times New Roman;">portal</span></i></em> is a web page that contains individual and customizable web applications. For example, My Yahoo is a portal page. The portal provides value-added services, such as single sign-on, customization, content aggregation, and localization.</span></span>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Individual web applications that are added to the portal page are called portlets. A <em><i><span style="font-family:Times New Roman;">portlet</span></i></em> is a Java technology web component that is based on the <a href="http://www.jcp.org/en/jsr/detail?id=168" target="_blank">JSR 168</a> specification and <a href="http://www.jcp.org/en/jsr/detail?id=286" target="_blank">JSR 286</a>, which includes Web Service for Remote Portlets (WSRP). Portlets are managed by portlet containers that supply dynamic content. Portals employ portlets as pluggable user-interface components that provide users with desired content such as RSS feeds, mashups of services such as the current weather in a given area, or even static content such as a group of hyperlinks.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">In the past, creating portlets was a complex process. Now, you can quickly and easily create and test portlets using the <a href="http://netbeans.org/" target="_blank">NetBeans IDE 6.0</a> and the <a href="https://portlet-container.dev.java.net/public/Download.html" target="_blank">OpenPortal Portlet Container 2.0 Beta 2</a>. Deploying the portlets onto the server is also simple.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">This article shows you how to create portlets and provide dynamic content through drag-and-drop widgets in the NetBeans IDE. The example portlet in this article uses the <a href="http://jmaki.com/" target="_blank">jMaki</a> Tabbed View widget, pulls in RSS feeds, and uses static links from the <a href="http://java.sun.com/new2java/">New to Java Programming Center</a>.</span></span></p>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">What You Need to Get Started</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">To create and test portlets, you need the following software installed on your computer:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="http://java.sun.com/javase/downloads/?intcmp=1281">Java SE 6</a> or      later</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="http://download.netbeans.org/netbeans/6.0/final/?cid=921887" target="_blank">NetBeans IDE 6.0</a> or later</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="https://portlet-container.dev.java.net/public/Download.html" target="_blank">OpenPortal Portlet Container 2.0 Beta 2</a>, dated 2      January 2008. This is a separate download from the NetBeans IDE.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="https://glassfish.dev.java.net/" target="_blank">GlassFish application server</a>. This is bundled with the      NetBeans IDE 6.0 or later, so you don&#8217;t need to download it      separately.</span></span></li>
</ul>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">For instructions on installing the <a href="https://portlet-container.dev.java.net/public/Download.html" target="_blank">OpenPortal Portlet Container 2.0 Beta 2</a>, see the <a href="https://portlet-container.dev.java.net/public/Download.html#Instructions_to_install_Portlet_" target="_blank">installation page</a>. You must download and install the OpenPortal Portlet Container before you follow the next steps.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The portlet container works similarly to servlet containers. A portlet container does the following:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Provides the runtime environment for portlets</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Manages the life cycle of portlets</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Provides persistent storage for storing portlet      preferences</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Caches the portlets</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Receives requests from the portal to execute      requests on the portlet</span></span></li>
</ul>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Once you have installed the necessary software, start the NetBeans IDE. Next, install the portlet and portlet container plug-ins by following these steps:</span></span></p>
<ol start="1" type="1">
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Go to Tools in the main menu.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Select Plug-ins.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Click on the Available Plug-ins tab.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Check the boxes for Portlets, the OpenPortal      Portlet Container, and jMaki Ajax Support.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Click the Install button and follow the      directions from there. You may need to accept a few licenses before the      installation process can complete.</span></span></li>
</ol>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Lastly, add the OpenPortal Portlet Container server:</span></span></p>
<ol start="1" type="1">
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Go to Tools in the main menu.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Select Servers.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Click on Add Server.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Select OpenPortal Portlet Container 2.0 from the      list.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Click Next.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times Ne
<p>w Roman;font-size:100%;"><span style="font-size:12px;">Use Browse to set the location in which to      install the GlassFish application server. You may need to search your      system separately to discover where the NetBeans IDE installed the      GlassFish application server.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Click OK.</span></span></li>
</ol>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">You are now ready to create a portlet.</span></span></p>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Creating a Portlet Project</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">As you do whenever you create an application in the NetBeans IDE, go to File &gt; New Project, and choose Web &gt; Web Application, then click Next. For the name of this project, type </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code>. In the Server drop-down menu, choose OpenPortal Portlet Container 2.0 Beta, then click Next. In the next screen, check the jMaki Ajax Framework box. In the lower half of the pane, you get a selection of layouts. Scroll to the bottom, and choose No CSS Style.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Lastly, at the top of the screen, check the Portlets Support box. Use the Portlet Version drop-down menu and select 2.0, then check the Create Portlet box. In Portlet Class Name, type </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code>. Note that the project name and the portlet name must be the same. The other fields are filled in automatically. Click Finish.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Because of the way that portlets are set up within the container, you will not need the displayed </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">index.jsp</span></span></code> page. On the left side of the screen, under the Projects tab, you see <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">index.jsp</span></span></code> listed. Right-click on <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">index.jsp</span></span></code> and select Delete. The file you are going to work on is named <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet_view.jsp</span></span></code>. You can find that file by expanding the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">WEB-INF</span></span></code> directory, then the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">jsp</span></span></code> directory. Double-click the file name <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet_view.jsp</span></span></code> The file now opens in the workspace.</p>
<table class="MsoNormalTable" style="width:83px;height:29px;" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="padding:1.5pt;">
<p class="MsoNormal" style="text-align:center;" align="center"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"></span></span></p>
<p class="MsoNormal" style="text-align:center;" align="center"><strong></strong><em><br /></em></p>
</td>
</tr>
</tbody>
</table>
<p><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">How the Java Portlet Works</span></span></b></strong><br />
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Even though all you&#8217;ve done is create a portlet project, the NetBeans IDE has already written an essential class for you. From the Projects tab, expand the Source Packages. Then expand </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">com.text</span></span></code>, and open the file <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet.java</span></span></code> by double-clicking the file name.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code> extends a <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">GenericPortlet</span></span></code> class, which is provided, that implements the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">render()</span></span></code> method and delegates the call to more specific methods to display the portlet based on its mode. Developers can extend <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">GenericPortlet</span></span></code> and implement as many of the following specialized <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">render</span></span></code> methods as are necessary for their portlet:</p>
<ul type="disc">
<li class="MsoNormal"><code><b><span style="font-family:Courier New;font-size:85%;"><span style="font-weight:bold;font-size:10px;">doView()</span></span></b></code>      Called by <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">render()</span></span></code> when the portlet is in View mode.      Intended to contain logic that displays the View page for the portlet.</li>
<li class="MsoNormal"><code><b><span style="font-family:Courier New;font-size:85%;"><span style="font-weight:bold;font-size:10px;">doEdit()</span></span></b></code>      Called by <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">render()</span></span></code> when the portlet is in Edit mode.      Intended to contain logic that displays the Edit page for the portlet.</li>
<li class="MsoNormal"><code><b><span style="font-family:Courier New;font-size:85%;"><span style="font-weight:bold;font-size:10px;">doHelp()</span></span></b></code>      Called by <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">render()</span></span></code> when the portlet is in Help mode.      Intended to contain logic that displays the Help page for the portlet.</li>
</ul>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Notice that the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code> calls these methods, locating the pages for each. In this article, you will put the content of the portlet in the View page through drag-and-drop widgets and some HTML code. But you can extend this <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">GenericPortlet</span></span></code> cl</p>
<p>ass for other portlets. You can also go back later and modify the Edit or Help page. Once you have had a good look at the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code> class, you can close it.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">When you build and run the portlet, the browser will display the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet_view.jsp</span></span></code>. Currently, this page contains only the static text: <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code> &#8211; VIEW MODE. Because it is a <a href="http://java.sun.com/products/jsp/index.jsp">JavaServer Pages (JSP)</a> technology page, you can add any scripts or JSP tag libraries that you wish, and treat it like any other JSP page.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Test your portlet environment now before adding more content: From the main menu, click Build and select Build Main Project. Once the build is successfully completed, go to the main menu and click Run. Select Run Main Project. This takes a little longer as the application server is started, the portlet container is started, and a browser window is opened.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Notice that the portlet project name is the same as the portlet itself. Once you see that your development and testing environments are working properly, you can add content to replace the static text on the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet_view.jsp</span></span></code> page. To see the changes that you make to your portlet, you undeploy and deploy the portlet, as explained in the next section.</p>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Adding Dynamic and Static Content to the Portlet</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Because this portlet will contain several kinds of content, organize the content for a small area on a web page by using tabbed panes. You can choose other types of layouts, of course, but for this example, use the jMaki widget named Tabbed View. On the right side of your screen, notice that you have many available widgets to drag and drop. Check to be sure that the jMaki Yahoo widgets list is expanded .</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Within the workspace page, delete the static text that says </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet - VIEW MODE</span></span></code>. Also, delete the surrounding HTML code for bold: <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;b&gt;&lt;/b&gt;</span></span></code>. Now drag and drop the Tabbed View widget, shown highlighted in white , from the palette onto the page, exactly where you have just deleted text. Once you have dropped the Tabbed View widget onto the page, the following code appears on the page:</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;a:widget name="yahoo.tabbedview"</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">   value="{items:[</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">           {label : 'My Tab', content : 'Some Content'},</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">           {id : 'bar', label : 'My Tab 2', include : 'test.jsp ', lazyLoad : true },</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">           {label : 'My Tab 3', content : 'More Content',  selected : true}</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">          ]</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">         }" /&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The action of dragging and dropping a jMaki widget onto the page causes the creation in the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">resources</span></span></code> directory of all the files necessary to build that widget.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">To get an idea for how this widget works, save the file. Next, right-click the project name in the Projects pane and select Undeploy and Deploy. Once it is built, run the project: Go to the main menu, click Run, and select Run Main Project. When the project runs, your changes appear in the browser window. Click on each of the tabs in the Tabbed View pane. Notice on the tab named My Tab 2 that the file </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">test.jsp</span></span></code> was not loaded. This is only because a <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">test.jsp</span></span></code> had not been created, but it does demonstrate how you call a JSP page to appear in the pane.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">For the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet</span></span></code>, you are going to create new JSP pages that the widget will call. Each of these pages provides the content for each of the tabs. On the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet_view.jsp</span></span></code> page, replace the code shown earlier with the following code:</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;a:widget name="yahoo.tabbedview"</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">   value="{items:[</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">           {id : 'bar', label : 'Popular &amp; New', include : '/New2JavaPortlet/whatsnew.jsp ', selected : true },</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">           { label : 'Java Fundamentals', include : '/New2JavaPortlet/fundamentals.jsp ', lazyLoad : true },</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">           { label : 'Downloads', include : '/New2JavaPortlet/downloads.jsp ', lazyLoad : true },</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">          ]</span></span></pre>
<pre><span style="font-family:Courier New;fon

t-size:85%;"><span style="font-size:10px;">         }" /&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">This code calls three JSP pages: </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">whatsnew.jsp</span></span></code>, <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">fundamentals.jsp</span></span></code>, and <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">downloads.jsp</span></span></code>.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The next step is to create those pages. In the Projects pane, right-click on Web Pages. Then select New, and lastly JSP. Notice that you are saving these pages into the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">Web Pages</span></span></code> directory, not the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">jsp</span></span></code> directory that the portlet container created for the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">New2JavaPortlet_view.jsp</span></span></code>. Any JSP pages that you create must go into the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">Web Pages</span></span></code></p>
<p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Create three JSP pages in this manner, naming them </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">whatsnew</span></span></code>, <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">fundamentals</span></span></code>, and <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">downloads</span></span></code>. The NetBeans IDE automatically adds the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">.jsp</span></span></code> extension, so don&#8217;t include that in the file name.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Next, run Undeploy and Deploy again. Then click on the Run menu, and select Run Main Project. This time, note that the tab names have changed. As you click on each tab name, you get the JSP pages that you just created because of the code you replaced. Open each of these JSP pages — <a href="http://java.sun.com/developer/technicalArticles/tools/nb_portlets/?cid=925028#downloads"><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">downloads.jsp</span></span></code></a>, <a href="http://java.sun.com/developer/technicalArticles/tools/nb_portlets/?cid=925028#fundamentals"><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">fundamentals.jsp</span></span></code></a>, and <a href="http://java.sun.com/developer/technicalArticles/tools/nb_portlets/?cid=925028#whatsnew"><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">whatsnew.jsp</span></span></code></a> — and add content as described in the following subsections.</span></span></p>
<p class="MsoNormal"><a name="downloads"></a><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The </span></span></b></strong><code><b><span style="font-family:Courier New;font-size:85%;"><span style="font-weight:bold;font-size:10px;">downloads.jsp</span></span></b></code><strong><b><span style="font-family:Times New Roman;"> Page</span></b></strong></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">This page contains simple static content, a title, and a list of links. Do not change the first two lines of code that appear at the top of the page:</span></span></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;%@page contentType="text/html"%&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;%@page pageEncoding="UTF-8"%&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">But replace all of the HTML code with the following:</span></span></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;h3&gt;Downloads for New Developers&lt;/h3&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;"> </span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;ul&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://java.sun.com/javase/downloads/i"&gt;Java SE (JDK)&lt;/a&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://www.netbeans.org/"&gt;NetBeans IDE&lt;/a&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://www.mysql.com"&gt;MySQL Database&lt;/a&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;/ul&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><a name="fundamentals"></a><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The </span></span></b></strong><code><b><span style="font-family:Courier New;font-size:85%;"><span style="font-weight:bold;font-size:10px;">fundamentals.jsp</span></span></b></code><strong><b><span style="font-family:Times New Roman;"> Page</span></b></strong></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">This page will provide dynamic content, pulling in an RSS feed. Again, leave the first two lines of code alone, and remove all of the HTML code. Next, from the jMaki Widgets palette on the right side of the display, drag and drop the Block List widget onto the page.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The following code should appear on your page:</span></span></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;a:widget name="jmaki.blockList" value="[</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">{title : 'jMaki Project Home', link : 'https://ajax.dev.java.net', description : 'Where to go for the latest jMaki.' },</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">{title : 'jMaki Widgets Home', link : 'https://widgets.dev.java.net', description : 'The source for the latest jMaki widgets.' },</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">{title : 'jMaki-Charting Home', link : 'https://jmaki-charting.dev.java.net', description : 'Enables complex charts rendered on the client in any modern browser.' }</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">]"  /&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The widget prov</p>
<p>ides placeholder text only. Replace everything with the following code: </span></span></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;h3&gt;Java Technology Fundamentals&lt;/h3&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;"> </span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;a:widget name="jmaki.blockList" service="/xhp?id=rss"  /&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">In order to populate the widget with data from an external service, such as an RSS feed, you must replace the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">value</span></span></code> attribute with <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">service="/xhp?id=rss"</span></span></code>. If any page consists of a jMaki widget, then the jMaki runtime is bundled with the application. The runtime consists of <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">jmaki.xhp.XmlHttpProxyServlet</span></span></code> class that maps to the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">/xhp</span></span></code> URL pattern within the application context.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The identifier or ID specified in the URL, </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">rss</span></span></code>, is configured in a configuration file named <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">xhp.json</span></span></code>. This file consists of a list of default external services that the widgets in a page can access. You can specify each entry in the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">xhp.json</span></span></code> file by using up to five different parameters:</p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">ID: This required parameter is a unique      identifier for the entry.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">URL: This required parameter gives the location      of the external service.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Parameters: These optional parameters specify the      default values passed to the URL.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">API key: This is an optional parameter to invoke      the service with a specific key.</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Stylesheet: This is an optional parameter to      process the response.</span></span></li>
</ul>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Next, you must change the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">xhp.json</span></span></code> file. Go to the Projects tab and expand the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">resources</span></span></code> directory. Double-click the file <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">xhp.json</span></span></code>, and scroll to the bottom of that page. Search for this code in the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">xhp.json</span></span></code> file:</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">{"id": "rss",</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "url":"http://weblogs.java.net/blog/ludo/index.rdf",</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "xslStyleSheet": "rss.xsl"</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  }</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The tag and the default entry tell the jMaki runtime to fetch the RSS feed from </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">http://weblogs.java.net/blog/ludo/index.rdf</span></span></code>, apply the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">rss.xsl</span></span></code> stylesheet — which understands the multiple RSS/Atom formats — to the received response, and convert the data into a common <a href="http://www.json.org/" target="_blank">JavaScript Object Notation (JSON)</a> data format of the type <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">"dataType" : "jMakiRSS"</span></span></code>. The jMaki Block List widget can convert jmakiRSS data to its specific data model.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">But the intention of this article is not to pull in Ludovic Champenois&#8217;s blog. So change the URL of </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">http://weblogs.java.net/blog/ludo/index.rdf</span></span></code> to <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">http://blogs.sun.com/JavaFundamentals/feed/entries/rss</span></span></code>.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Additionally, you will pull in another feed on the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">whatsnew.jsp</span></span></code> page, so change the URL in the code as shown in the following code snippet. The new URL is highlighted in red.</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">{"id": "rss2",</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "url":<code><span style="font-family:Courier New;">"http://blogs.sun.com/new2javaUpdates/feed/entries/rss"</span></code>,</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "xslStyleSheet": "rss.xsl"</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">   }</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Notice that the ID for the second RSS feed to pull in is named </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">rss2</span></span></code>. Notice also that the URL pulls in the blogs from the &#8220;What&#8217;s New&#8221; section of the New to Java  Programming Center. Save the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">xhp.json</span></span></code> file. Because you&#8217;ve added another block of code to pull in the second feed, you must separate the two<br />
with a comma after the closing curly bracket (<code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">}</span></span></code>) of the first block. The following code snippet shows the added comma in red on the fourth line:</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">    {"id": "rss",</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "url":<code><span style="font-family:Courier New;">"http://blogs.sun.com/JavaFundamentals/feed/entries/rss"</span></code>,</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "xslStyleSheet": "rss.xsl"</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">     }<strong><b><span style="font-family:Courier New;"><span>,</span></span></b></strong></span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">    {"id": "rss2″,</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "url":"http://blogs.sun.com/new2javaUpdates/feed/entries/rss",</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">      "xslStyleSheet": "rss.xsl"</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">     }</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><a name="whatsnew"></a><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The </span></span></b></strong><code><b><span style="font-family:Courier New;font-size:85%;"><span style="font-weight:bold;font-size:10px;">whatsnew.jsp</span></span></b></code><strong><b><span style="font-family:Times New Roman;"> Page</span></b></strong></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Go to the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">whatsnew.jsp</span></span></code> page, and delete the HTML code. Add the following static HTML code:</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;h3&gt;What's Popular&lt;/h3&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;"> </span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;ul&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/"&gt;The Java Tutorial&lt;/a&gt;&lt;/li&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://blogs.sun.com/JavaFundamentals/"&gt;Java Technology Fundamentals&lt;/a&gt;&lt;/li&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://blogs.sun.com/CoreJavaTechTips/"&gt;Core Tech Tips&lt;/a&gt;&lt;/li&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://java.sun.com/developer/onlineTraining/tools/netbeans/"&gt;Easy Web Site Creation in the NetBeans IDE&lt;/a&gt;&lt;/li&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">  &lt;li&gt;&lt;a href="http://java.sun.com/javaee/5/docs/tutorial/doc/"&gt;The Java EE 5 Tutorial&lt;/a&gt;&lt;/li&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;/ul&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;"> </span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;h3&gt;What's New&lt;/h3&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Next, from the jMaki Widgets palette on the right side of the display, drag and drop the Block List widget onto the page. Change the code as shown here:</span></span></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;a:widget name="jmaki.blockList" service="/xhp?id=rss2"  /&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Customizing the jMaki Widgets</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">All the files that you need for customizing any of the widgets are available in the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">resources</span></span></code> directory by widget name. In this case, look under <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">jMaki</span></span></code> for the files for the block list. Expand the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">blocklist</span></span></code> directory, and open the file called <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">component.css</span></span></code>.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Change the line that says </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">height : 85px;</span></span></code> to <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">height : 25px;</span></span></code> and save the file.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Next, open the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">component.html</span></span></code> file, and delete the following code from it:</p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:7.5pt;">
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">&lt;br/&gt;</span></span></pre>
<pre><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">@{description}&lt;br/&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">This removes the descriptions from the RSS feeds, leaving only the title as a link. You can also add content, such as a date, by adding it to this file. Now, save all the files, click Undeploy and Deploy, then run the portlet again by clicking on Run in the menu and selecting Run Main Project.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Again, click Undeploy and Deploy. Then click Run the application. You now see the pages that you</p>
<p>&#8216;ve created with the content. Notice also that the block list is taking up a lot of room. You can customize jMaki widgets easily by going to the Projects tab, expanding the resources directory, expanding the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">jMaki</span></span></code> directory and then <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">blockList</span></span></code>. Edit <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">component.css</span></span></code> so that the height is just 25 pixels (<code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">25px</span></span></code>).</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Click Undeploy and Deploy again. When you run the portlet.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Your portlet is now complete. Once the portlet is deployed, users can add the portlet to their portal page and have access to the information they want on their page. You can tailor portlets in many different ways to suit the needs of your web site. The NetBeans IDE provides many widgets that you can drag and drop, but you are not limited by what that palette provides. You can also create your own widgets, or use Java code to create an unlimited number of objects to get the functionality that you want.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The next step is to archive the entire project in a ZIP file and send it to the server administrator. If you are also the server administrator, read the next section.</span></span></p>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Packaging and Deployment</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">The portlet specification specifies the packaging and deployment of portlets as part of standard Web Application Archive (WAR) files that may contain other web components, such as JSP pages and servlets. In addition to the </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">web.xml</span></span></code> deployment descriptor now found in WAR files, the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">portlet.xml</span></span></code> file in the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">WEB-INF</span></span></code> directory descriptor defines all portlets and portlet-related configurations. An XML schema included in the portlet specification <a href="http://www.jcp.org/en/jsr/detail?id=168" target="_blank">JSR 168</a> defines the standard elements for portlet configuration stored in the <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">portlet.xml</span></span></code> file.</p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Each portal-server vendor must provide a tool to parse the portlet descriptor file and deploy the portlet. These tools likely exist in GUI form as well as in command-line form. Developers will be able to integrate the command-line deployment tools with the Apache Ant tool. This creates additional development environment possibilities, because most development tools provide an interface for Apache Ant.</span></span></p>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">To deploy the project onto the server, see the documentation for your portal server for complete details. Most portal servers will allow you to deploy the WAR file, which is located in your project&#8217;s </span></span><code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">dist</span></span></code> directory after you perform a build. Depending on your portal server, this may be deployed by using the Ant command, copying the WAR to your portal <code><span style="font-family:Courier New;font-size:85%;"><span style="font-size:10px;">autodeploy</span></span></code> directory, or using the administrative feature of your portal server.</p>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Summary</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">Now that you have created a portlet, you can create other types of portlets for the portal page for your users. Portlets can include components such as local weather, the latest news, live sports scores, maps, and RSS feeds from other sites. Portlets allow your users to customize the web page to meet their specific needs, and this keeps them coming back to your web site.</span></span></p>
<p class="MsoNormal"><strong><b><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">For More Information</span></span></b></strong></p>
<table class="MsoNormalTable" style="width:100%;" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="padding:0;">
<p class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><img src="image001.gif@01C8D9F3.0B3D34A0" alt=" " border="0" height="4" width="1" /></span></span></p>
</td>
</tr>
</tbody>
</table>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="http://portalpack.netbeans.org/demos/ospc20-nb6-beta1/index.html" target="_blank">Flash Demo Using Portal Pack Plug-ins/Netbeans 6.0 Beta      With OpenPortal Portlet Container</a></span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="http://java.sun.com/developer/technicalArticles/J2EE/sdk_portletcontainer2/">Understanding      the Portlet Container 2.0 Beta Software</a></span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="http://developers.sun.com/portalserver/reference/techart/jsr168/">Introducing      Java Portlet Specifications: JSR 168 and JSR 286</a></span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="http://developers.sun.com/portalserver/reference/techart/jsr168/pb_whitepaper.pdf">Introduction      to JSR 168 — The Java Portlet Specification</a> (PDF)</span></span></li>
<li class="MsoNormal"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;"><a href="https://portlet-repository.dev.java.net/" target="_blank">OpenPortal Portlet Repository</a></span></span></li>
</ul>
<div style="border-style:none none solid;padding:0 0 1pt;">
<p style="border:medium none;padding:0;"><span style="font-family:Times New Roman;font-size:100%;"><span style="font-size:12px;">See Also <a href="http://java.sun.com/developer/technicalArticles/tools/nb_portlets/?cid=925028" target="_blank">http://java.sun.com/devel</p>
<p>oper/technicalArticles/tools/nb_portlets/?cid=925028</a></span></span></p>
</p></div>
<p class="MsoNormal"><span style="font-family:Arial;font-size:85%;color:green;"><span style="font-family:Arial;font-size:10px;color:green;"> </span></span></p>
</p></div>
<img src="http://blog.theunical.com/?ak_action=api_record_view&id=158&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.theunical.com/java/creating-portlets-for-web-sites-with-the-netbeans-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
