Deploying portlets on OpenPortal Portlet Container
By karthiksudarshan on Aug 02, 2007
Quite a few people have been posting queries about deploying JSR-168 portlets on the OpenPortal Portlet Container. I would like to elaborate on the various ways to deploy portlets on the OpenPortal Portlet Container now. Before you read further, you would need the OpenPortal Portlet Container to be installed. The installation instructions on the site are quite easy to follow and you should be up and running in a few minutes.
There are now officially 3 different ways to deploy a JSR-168 portlet on the OpenPortal Portlet Container:
- Using the "Admin" tab in the Portlet Container Driver GUI, for web based interface.
- Using the ANT task, for command line interface.
- Using the autodeploy functionality, for a drag and drop interface :).
1. Portlet Container Driver "Admin" tab:
After installing the Portlet Container, you can access the Portlet Container Driver at http://localhost:8080/portletdriver/dt (assuming default values for the host and server port). To deploy a portlet follow these steps :
- Click on the Admin tab
- Under the "Deploy a Portlet" section, click on the "Browse" button.
- An explorer window is opened, using which select your Portlet war file.
- Click on the "Deploy" button.
- A message will be displayed indicating the success/failure of the deployment.
Please note that a successful deployment means that the Portlet Container has been able to register the details, but it would take a brief amount of time for the war to be deployed on to the application server (based on the time in seconds set for the auto deployment to kick in. By default this is small, and it should be done in 3-5 seconds).
2. ANT task / CLI
An ANT task is provided, for command line interface, to deploy portlets. You can invoke this task and pass the various parameters expected and the deployment will be done in a jiffy :). The following commands do the trick:
- cd $PC_INSTALL_DIR/bin (PC_INSTALL_DIR = GLASSFISH_HOME/domains/domain1/portlet-container)
- ant -Dportlet-war=<portlet-war-file-path>deploy-portlet
Well that's that really!
3. Auto-deploying portlets
This is the easiest option of the three to use. Just copy your portlet war file to the $PC_INSTALL_DIR/autodeploy directory. As simple as that, and it will deploy your portlet! Please make sure that the server is running :)
So go ahead create those portlets (check out the Portal Pack Project for really cool and easy to use Netbeans plugin for creating Portlets) and deploy it on the OpenPortal Portlet Container and start using them.
PS: There is another way to deploy your portlets using Netbeans, and it is part of the Portal Pack Project and the site has screencasts on using the plugin to develop and deploy portlets.