Tuesday Jun 19, 2007

The Sun Java System Portal Server 7.x (Now Open Portal) /Open Portal Portlet Container enables JSR 168 portlets to communicate with each other through custom portlet eventing. The new Portal Pack 1.3 Beta for NetBeans 5.5/5.5.1 has a new feature IPC Story Board. Interportlet Communication Story Board(aka "IPC Story Board") provides a visual way of wiring(linking) portlets to listen each other's events. Then these portlet applications can be deployed and tested on Open Portal Portlet Container/Sun Java System Portal Server 7.x which are supported by the Portal Pack.


This blog is intended to help portlet developers to get acquainted with the new IPC Story Board feature in the Portal Pack.

[Read More]

Tuesday May 29, 2007

The Portal Pack 2.0 preview is now available for download here. Though in this version there are no functional changes in the serverplugin modules, but there are some changes in the portlet builder (Generic Portlets) module. Unlike earlier version, in this version of the Portal Pack, there is no separate "Portlet Application" project type. In this version Portlet application is supported through web framework. So  "Portlet Support" can be added to a new/existing web application  through web framework. In other word you can say an existing/new web application can be extended to support Portlets inside it. To know how to create portlet application in this version click here

Thursday May 17, 2007

In my last blog, I had mentioned about the IPC Story Board which is an upcoming feature in the next version of the Portal Pack. In brief IPC Story Board in Portal Pack will help developers to implement Inter Portlet Communication/Eventing in their portlets in a visual manner.  More importantly it also generates most of the eventing related code automatically for you. In my last demo I had also linked to a screen cast which gives an idea how this IPC Story Board will work in future. But now there is a new flash demo available which shows a full functional IPC Story Board in action. This feature will be supported in the next version of the Portal Pack for NetBeans 5.5/5.5.1. The new binaries are not yet available on the Portal Pack project site, but those will be available very soon. In this flash demo I have created a simple shopping cart portlet application using Portal Pack + NetBeans 5.5 with IPC Story Board support. The application developed using IPC Story Board can be deployed/run on Open Portal Portlet Container / Sun Java System Portal Server 7.x . The future version of the IPC Story Board will also be supporting  JSR-286 portlet eventing.


If you are interested to see the fully functional IPC Story Board in action then check this screencast


Let me know if you have any suggestions & feedbacks or you want to see any new features in the Portal Pack. 


 

Tuesday May 08, 2007

Now a days I am working on some new features for Portal Pack. One of the features I am working on is "IPC Story Board"  for Eventing. Portal Pack IPC Story board will be useful for all portlet developers who want to make their portlets consume events thrown by other portlets. Though  eventing is not part of the current portlet specification, but it will be part of the next portlet specification. IPC Story board will be providing drag and drop support where the developers will be able to drag and drop their portlets and then visually wire them with each other. If you want to see an early preview of IPC Story board in the Portal Pack then check this small flash demo

Saturday Mar 31, 2007

This blog will help

  • All new portlet developers who don't know how to start writing portlets and test them
  • Developers looking for open source softwares to develop and test their portlets
  • Developers looking for an integrated portlet development environment

You can use the Java EE Tools Bundle U3 Preview which comes with pre-configured GlassFish appserver, Open Source Portlet Container and NetBeans IDE with Portal Pack Plug-ins to start portlet development.

But Alternatively if you want to use latest versions of mentioned components to set up your portlet development environment then go through this blog. 

The following open source components are required to set up your portlet development environment

  1. Glassfish Application Server
  2. Open Source Portlet Container
  3. NetBeans 5.5/5.5.1 Beta IDE
  4. Portal Pack Plug-ins

1. GlassFish Application Server

GlassFish is an open source application server. Download the latest version of GlassFish Application server from here.  GlassFish installation is very easy. Just follow the steps mentioned here

2. Open Source Portlet Container

The Open Source Portlet Container  is an Enterprise Class Open Source Portlet Container which is free and available for download here. This can be used to deploy/test your JSR 168 portlets. To install Open Source Portlet Container on the GlassFish AppServer run the following command which opens an GUI installer. The whole installation process completes within a few seconds

java -jar portlet-container-configurator.jar

Alternatively you can check installation instructions here 

3. NetBeans IDE 5.5 and above

Download and Install NetBeans IDE from https://www.netbeans.org 

4. Portal Pack Plug-ins

The Portal Pack NetBeans Plug-ins for Portlet development is  available in NetBeans 5.5 Beta Auto Update Center.

But if you want to try latest version of Portal Pack Plug-ins then download them from here . You can find the installation instructions for the plug-ins in download page.

As all of the above components are installed and configured properly, you can now start your portlet development. You can check user guides and documents available in portal pack doc page. If you want a short/quick tutorial on Portlet development using Portal Pack check this.





Wednesday Mar 14, 2007

The Portal Pack 1.1 Plug-ins (NetBeans Portlet Plug-in) are now available in the Java EE 5 Tools Bundle Update 3 Preview. The Java EE 5 Tools Bundle is a complete,developer-friendly environment with all necessary runtimes installed
and fully configured to start portlet application development.

The Java EE 5 Tools Bundle includes following fully configured and ready to use components for Portlet Application development:

Detail list of components in Java EE 5  Tools bundle  can be found here. Check Deepak's blog to know more about Portlet Container 1.0 .

Note: Incase you are already using Portal Pack Plug-ins in your NetBeans IDE, you can update to the latest version of Portal Pack plug-ins.The latest version of the Portal Pack  plug-ins are available for download here.

Some highlights of this release are

  • Supports all features supported by Portal Pack 1.0.
  • Some critical bug fixes.
  • Supports to create a new Portlet Application from existing sources.

Here are the links to the resources and docs for Portal Pack 1.1 Plug-ins (Netbeans Portlet Plugin)

Wednesday Feb 21, 2007

Portal Pack Portlet Plugins are now also available at NetBeans Auto Update Center Beta. To install/update latest version of these plugins 

> Go to Tools > Update Center menu of NetBeans 5.5 IDE

> Select "NetBeans Auto Update Center Beta" check box in the list of update centers

> Click Next

The following modules of Portal Pack are required for Portlet Development support in NetBeans IDE

  • Generic Portlets - This module provides wizard based supports to create JSR 168 based portlet applications.
  • OpenSource PC - This module provides support to deploy/undeploy portlet applications on Portlet Container available on http://portlet-container.dev.java.net or bundled with Java EE SDK
  • Sun Java System Portal Server 7.x - This module provides support to deploy/undeploy portlet application on Sun Java System Portal Server 7.x
  • Base PSFramework - This is a library module which is required for the above two server plug-ins modules.

The same modules are also available as a zip archive at http://portalpack.netbeans.org/download.html
 

Saturday Feb 17, 2007

Check out updated Portal Pack flash demos at  http://portalpack.netbean.org

These flash movies show all the new features supported by Portal Pack plug-ins for Sun Java Systems Portal Server 7.x

Wednesday Feb 07, 2007

This blog describes how you can debug a portlet application while you are using NetBeans 5.5 IDE + Portal Pack plug-in for portlet development.

This blog assumes that you are using 

Though Portal Pack plugin starts the Glassfish server automatically from NetBeans IDE, but currently it doesn't starts the server in debug mode. Using the following approach you can quickly debug your portlet application.

Set Debug mode for GlassFish Application Server

  1. Open NetBeans IDE
  2.  I am assuming that you have already added a Portlet Container instance in your NetBeans IDE
  3. Go to Runtime window . Right click on Servers > Open Source Portlet Container instance.
  4. Click "Start" to start the server.
  5. When the server is started properly. Open http://localhost:4848 in your browser.
  6. Login to GlassFish Admin Console as "admin" (default password is "adminadmin")
  7. Go to the "Application Server" page .
  8. Select the JVM Settings tab and the General option.
  9. Check the Debug Enabled box.
  10. Check debug port (default value is 9010)
  11. Select the Save button.
  12. Now  restart  the  server through  the NetBeans IDE  by the same way  you had started the server.

Configure debugger in NetBeans IDE

  1. Go to Run > Attach Debugger menu in title menu bar of NetBeans IDE.
  2.  It will pop-up a dialog box.
  3. Select Debugger as "JPDA Debugger"
  4. Select Connector as "SocketAttach"
  5. Give your machine host. (example, localhost)
  6. Give debug port no. (Default, 9010).
  7. Click Ok
  8. Now the debugger will be attached to the application server's debug port
You are now ready to debug your portlet application. Add break point in your portlet java file and start debugging. All of the above configuration steps are required once.

 

 


Friday Dec 15, 2006

The NetBeans Portlet Plugin  is now available for download which  includes a plugin for the Portlet Container 1.0 Beta component bundled with the Java Application Platform SDK Update 2 release. Read about Java Application Platform SDK Update2 release here. To download the Java Application Platform SDK Update 2 click here.

Portlet Container 1.0 Beta, an Enterprise Class Portlet Container implementation is derived from the open source project on https://portlet-container.dev.java.net.

As a plugin for NetBeans IDE 5.5 and above, current release of NetBeans Portlet Plugin helps developers to develop, deploy and test portlets on the Portlet Container 1.0 Beta component that is part of the Java Application Platform SDK U2 from their NetBeans IDE. NetBeans Portlet Plugin makes portlet development as easy as writing a normal Java application, with all the features of portlets made available to you at the click of a mouse.

Some highlights of this plugin are


  • Provides wizard based support to create a JSR-168 based generic portlet application.

  • Generates deployment descriptor automatically.

  • Provides support to specify different portlet modes while a new portlet  is added.

  • Portlet deployment/undeployment support on the Portlet Container 1.0 Beta component.

  • Provides support to view output of a single portlet

  • Provides support to launch admin tool directly from NetBeans IDE.

  • Provides support to start and stop Portlet Container 1.0 Beta from NetBeans IDE.

Here are the links to the resources and docs for Netbeans Portlet Plugin

Visit the NetBeans Portlet Plugin home page for future releases and announcements.

 

Tuesday Nov 07, 2006

A new open source project called "portalpack" has been created on netbeans.org. As a plugin to Netbeans IDE 5.5 and above, this module will provide full portlet developement life cycle inside Netbeans IDE. Now portlet developer can develope, deploy and test their portlet application inside Netbeans IDE. Initially it will support Sun Java System Portal Server 7.x and Sun Open Source Portlet Container. Check out online flash demo at http://portalpack.netbeans.org to findout various features of new portalpack plugin. Downloadable binaries and sources for this plugin will be added very soon to netbeans.org.

Wednesday Oct 25, 2006

Recently I was trying to use "jMaki" for some demo application. I found it quite simple and useful. For those who are not aware of "jMaki", here's a brief description about the project "jMaki"

"jMaki is an opensource project in java.net. It is a framework that provides a standard way for designing or creating reusable AJAX-enabled widgets and the services needed to back those widgets. The framework includes a simple widget API that you can use to create new widgets or wrap existing widgets from widget libraries such as those from Dojo, Yahoo UI Widgets, Google, Abobe Spry, or Scriptaculous."

The current version of jMaki has some widgets which are wrapper of ajax libraries like Google Map, Yahoo Geocoder, Dojo clock and Dojo editor etc. You can use those widgets in your web application easily using jmaki api. There is a Netbeans plugin for jmaki available on java.net. This plugin can be used for automatic code generation by doing just drag and drop of widgets.
If you want to try jmaki quickly then try this plugin.

Before adding any widgets to your jsp page, you have to add a taglib declaration at the top of your jsp. Here's the code for the taglib declaration

<%@ taglib prefix="a" uri="http://java.sun.com/jmaki" %>

Here's the sample code to show a yahoo calendar in your jsp. Just add this below line in your jsp and you will be able to see a yahoo calendar in your jsp page.

For flickr Search add

args="{
topic:'flickrSearch',
columns:3,
count:9
}"
service="xhp"/>

Event handling is the best thing I like most in jmaki. jmaki provides api for handling events between multiple different widgets. It follows the subscriber/publisher model to handle events. And the best part is it's totally a client side api and the eventing works totally in client side through java script. So it's fast and doesn't have any serverside dependency. So if you have multiple widgets in a page and if you want to make those widgets to interact with each other without any code dependency, then you can make a widget to publish an event so that all subscribed widgets can listen that event and acts appropriately. Let me explain how it actually works.

A widget can publish an event just by using publish() in jmaki javascript api. Usually widget publishes to a topic with a particular name. The widgetA can publish a event by adding the following code

jmaki.publish("topicA", response.someobject);

where topicA is the topic name.

Now all other interested widgets can subscribe to this topicA to listen the event. This can be done by the following code

jmaki.subscribe("topicA", listener);

where "listener" is a javascript function which is called whenever a widget A publishes an event on topicA.

So if you have three widgets in a jsp page let's say widgetA, widgetB, widgetC. And widgetB and widgetC work depending on the state of the widgetA. Then widgetA can publishes a event whenever it's state changed and widgetB,widgetC can listen that events and works appropriately.

I also tried to use these jmaki widgets in portlet environment inside portlets. It worked after a few customization steps. Also the eventing things worked between multiple portlets where each portlet contains a different widget.
I will post the steps to use jmaki in portlet enviroment in a separate blog soon.

Here's the link for jmaki home page

https://ajax.dev.java.net

Tuesday Oct 17, 2006

Recently I had a requirement where I needed to bundle my application in to a single jar file. Here single jar file means to bundle everything (including util jars) into a single jar file, so that any one can run that jar file by “java –jar “ option or using other options. Bundling application into single jar file also makes the distribution process easier. Initially I was thinking it’s not a big deal and just setting the classpath in jar’s manifest file would be fine.

Here’s required structure of the jar file

- single.jar

 ---util
   ---- util1.jar
   ---- util2.jar

 ---Application.jar
 ---META-INF

Then I added a classpath entry in manifest for all utility jars. But that didn’t work. After some googling I came to know that classpath mentioned in the manifest is checked and loaded from file system not from the content of the jar. So the class loader checks for util1.jar and util2.jar inside util directory in the filesystem not inside the jar. So we can’t solve this problem by mentioning the class path in manifest.

As I didn’t have any solution for it, after some google search I found an open source tool “one-jar” which actually describes how to load utility jars inside main jar file. In brief One-JAR uses a custom classloader called JarClassLoader to load information from the single jar file and it has it’s classes to control bootstrap process. If you are interested to know how it works, then here is the link

http://one-jar.sourceforge.net/

Friday Aug 18, 2006

A very good article which explains how to migrate from EJB 2.x application to EJB 3.0. If you are interested to know about it go through this article


http://www.javaworld.com/javaworld/jw-08-2006/jw-0814-ejb-p2.html

Tuesday Jul 18, 2006

Are you interested to know about EJB 3.0 ? A free PDF of Mastering EJB 3.0 is available on theserverside.com. Check this link to download the PDF

http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss