Jul 2007

26

The Java Community Process(JCP) has recently approved JSR 286: Portlet Specification 2.0 as public review draft and is available for public review. The public review starts from 24 Jul, 2007 and ends 27 Aug, 2007.

 

The specification document and related files are available here.

Nb6

If you where using NetBeans 5.5 previously and then switched to the new NetBeans 6.0 Milestone 10 version, don't be surprised if you don't find the “Portlet Application” option while creating a New Project (after installing the portlet plugin from http://portalpack.netbeans.org/)

In NetBeans 6.0 the Portlet Application is part of the “Web Application”. So what you need to do is to create a “Web Application” and in the wizard under the Frameworks panel select “Portlet Support” to create a Portlet Application.

We now have the JSF Portlet Bridge jars available on the java.net maven2 repository.

If you use Maven2 to build JSF Portlet webapplications, you can reference the JSF Portlet Bridge library in your pom.xml as shown below. After the war is built, it will contain jsf-portlet.jar

So insert the following into your pom.xml --

Under <repositories>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>https://maven2-repository.dev.java.net/nonav/repository</url>
         </repository>       

Under <dependencies>
      <dependency>
            <groupId>com.sun.faces.portlet</groupId>
            <artifactId>jsf-portlet</artifactId>
            <version>1.2.1</version>
            <scope>compile</scope>
      </dependency> 

The current versions are 1.2.1 and 1.1.5

Whenever the new version materializes in the JSF Portlet Bridge Project, it will also be made available via maven2 repository

We've released JSF Portlet Bridge 1.2.1 and 1.1.5. The changelog contains issues resolved as well as any new features added.

If you find any issues or have any feedback for features, etc., please let us know!

To know more about JSF Portlet Bridge, you can read the article JavaServer Faces Technology-Based Portlet Bridge

Click here to join portlets
Click to join portlets

If you are a portlet developer and/or user (or for that matter, in the business of building and/or using the infrastructure that serves as the runtime environment for portlets and more, i.e. portal servers) and are not aware of the Portlets Group at Yahoo!, you should consider checking it out.

The description on the group site states "This group is created with the objective of discussing portlets and related technology, their usability and problems associated with them. Portlets related technologies, standardizations and specifications like JSR 168, Web Services for Remote Portlets (WSRP), and JSR 170 (JCR) are some of the discussion issues. Though there is no restrictions, you can discuss anything related to portlet..", as well as "..Popular open source and commercial portal servers can also be discussed here..".

The group was founded in November 2003 and today has an impressive membership roster of 5800+ individuals.

Here's a new screencast that demonstrates the syndication of Google gadgets from iGoogle to the Sun Portal Server, and also syndication of portlets/channels from the Sun Portal Server to iGoogle. The gadgets are syndicated with the help of the open source Google gadgets wrapper portlet from PALAB. The content from Sun Portal Server is syndicated to iGoogle using a Javascript/AJAX script as discussed in a previous post

Eclipse Portal PackA new version of Eclipse Portal Pack is uploaded on the Eclipse Portalpack site.

To learn how to use this new version to easily add portlet action support to your portlet visit my blog.


Back in January 07, we started a project to support EMC Documentum Enterprise Content Management Portlets in Sun Java System Portal Server 7.1. The portlets in Content Management and Web Publisher categories are pre-packaged Web Development Kit (WDK) components that include Java server pages,  Java classes, and XML files. These portlets  provide core content management and content services for creating, viewing, submitting and publishing various types of content.

eRoom portlets provide a dashboard view into EMC Documentum eRoom and offer the ability to manage multiple project eRooms. 

ECI Services portlet is built using ECI Services framework with adapters to search various repositories, databases and and web sites.

All these portlets are  JSR 168 standard based and customizable. For further details, please visit this link Sun Java System Portal Server Documentum Portlets 

Eclipse Portal PackA new version of Eclipse Portal Pack is uploaded on the Eclipse Portalpack site. I have tried to add support in this version for handling actions in portlets easier. The plugin can be downloaded from the Documents and Files sections of the Eclipse Portalpack site.

View the announcement here and try it out. You can also read more about it and how to use this new version on my personal blog.

The JSF Portlet Bridge Project is making steady progress. Late last year the project released JSF Portlet Bridge 1.2 which enables running JSF 1.2 applications as portlets in the OpenPortal Portlet Container. The project team is currently improving on that implementation.

   I would also like to welcome a new member to the project -- A. Alonso Dominguez, from Social Labs NetSolutions.  He is actively contributing to the implementation of JSR 301 in the project. JSR 301 is the Portlet Bridge Specification for JavaServer Faces Technology. It standardizes the behaviour of bridge implementations to ensure true interoperability for JSF artifacts. See the JSF Portlet Bridge Project for more details.

JSFPortletBridge ProjectThe fifth article of the running series "Open-Source Portal Initiative at Sun" is out on Sun Developer Network -- 

JavaServer Faces Technology-Based Portlet Bridge

In the article, Deepak and Marina describe various aspects about the OpenPortal JSF Portlet Bridge Project which develops the integration library that enables JSF technology-based applications to be run and deployed as JSR168-compliant portlets, including it's design philosophy, the procedure for modifying JSF applications to comply with the JSR168 specification (illustrated via a sample application), and the Portlet Bridge's tag library.

 
Including static content in your Portlet

I wonder if I'm the only one who didn't know how to include and reference static content from a portlet. Recently when writing a portlet I was clueless on what to do when I wanted to include images and a CSS file in my portlet. I figure there might be someone out there who doesn't remember this stuff as well; or may be not. But I'll go ahead and post the technique here anyway.

To include static content in your portlet, just put your files (e.g., images, Javascript files, CSS files) under the portlet web-application root. To reference them in your portlet use the renderRequest.getContextPath() method. For example, you can include a CSS file like this

<link rel="stylesheet" type="text/css" href="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/style.css")%>"/>

renderRequest.getContextPath() returns the web-application path of the Portlet. So for a portlet MyPortlet deployed on your localhost, the method will return http://localhost:80/MyPortlet. Note: Remember to include the following declarations in your page before using the renderResponse object.

<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>


Changing Title of a Portlet

This is quite easy. Just do the following: renderResponse.setTitle("Portlet Title");

There are 4 portal samples available with Portal Server 7.  Here's a quick overview of each sample and pointers to the screencasts available for the samples.

Portal Welcome page

  • The Enterprise Sample is a business portal based on a fictitious company named Adventure Sports Café and showcases key features of the Sun Java™ System Portal Server.  Checkout the screencast
  • The Developer Sample highlights content that would be helpful to a developer trying to understand the inner workings of the Sun Java™ System Portal Server. Checkout the screencast

The fourth sample is the Welcome Sample which is a welcome page that provides a single point of access to the portal samples and pointers to the product documentation and support.

With the advent of portals such as iGoogle, Netvibes, and MS Live, syndication of gadgets/widgets/portlets has become quite the rage. Even enterprise portals such as Websphere and Weblogic have jumped on the bandwagon and now allow running iGoogle gadgets from within their portals. Similarly they also claim to support syndication of their JSR 168 portlets to other portals such as iGoogle.

With the Sun Portal Server we are not far behind. You can easily use a Google gadget portlet wrapper to run Google gadgets in your portal. More about it in a future post. I'll focus on syndication in this post.

Of course we support WSRP that allows syndication of portlets between two WSRP-compliant portals. But portals such as iGoogle and Netvibes don't comply with standards such as JSR 168 or WSRP. They have their own mechanisms for doing things. But no reason to worry. Sun Portal Server by design provides a REST-like interface (please note the usage of "-like" to avoid any confusion) to access the portal components. This interface can be used to create a quick and dirty script to achieve syndication of portlets from the Sun Portal Server to iGoogle or another portal.

Here's a screenshot of the Developer sample of the Sun Portal as it looks in anonymous user mode. Now look at this screenshot of iGoogle with the same portlets running within iGoogle. This was done with a DHTML/Javascript/Ajax combination and is very easy to do. There are however limitations to this approach. The script does not support portlets with multiple page views, and also does not support editing of portlet preferences from iGoogle. There are better ways to achieve syndication and overcome these limitations. I'll cover those in a future post.

Because of the above mentioned limitations I'm reluctant to post the script I used on this blog. But if you are interested then leave a comment or ping me at jai dot suri at sun. I'll send you the script and information about how to use it. 

Sang Shin, from JavaPassion.com, and also a Sun technology evangelist has released a brilliant new tutorial on Building Portlets with Ajax behavior. This tutorial comes with a hands-on lab and covers everything from installing the right plugins in your Netbeans IDE to deploying your portlets in the OpenPortal Portlet Container. A couple of portlets he uses in the lab are from the OpenPortal Portlet Repository.

If you have been waiting for some good information to get your hands dirty with Ajax and Portlets, then it won't get any better than this. And if you happen to build any exciting portlets, be sure to contribute them to the OpenPortal Portlet Repository for others to use!