Welcome!

Adobe Flex Authors: Liz McMillan, RealWire News Distribution, Maureen O'Gara, Yakov Fain, Keith Swenson

Related Topics: AJAX & REA, Java, Adobe Flex

AJAX & REA: Article

A New Way to Look at Portals

This portal framework provides full support for AJAX-type message processing

Portlet Window
The portlet window provides the face of a Web application in the portlet container. On portlet instantiation after downloading the portlet module from the container server, this window connects to the Web server, which the portlet depends on for data, and then shows the portlet UI populated with data from the server. This window has common icon buttons: setting, help, minimize, maximize, and restore. The portlet window and its views are shown in Figure 5.


The settings button has a simple menu to configure and print the portlet. On clicking “Configure,” the portlet window changes its state and shows the configuration screen for the portlet as shown in Figure 5. The view can be set back to “Data View” by again clicking “Configure” and choosing “Data View” from the menu choices.

The portlet window contains the portlet and draws different states of the portlet. To provide the basic content of the portlet rendered inside the portlet window, the portlet needs to implement the IPortlet interface. A simple IPortlet definition is shown below:

public interface IPortlet
           {
                       function get shortTitle():String;
                       function get isFlipping():Boolean;
                       function doFlip():void;
                       function getPrintView():Container;
                       function isPortletAccessible(IPortalUser user):void;
            }

Deploying Portlets to a Portal Container
Portlets are deployed to portal container as Flex modules. The module contains the Flex UI of the portlet in a IPortlet implementation. The main module inside the portlet also needs to implement the IPortletModule interface so that the actual IPortlet implementation present in the portlet module can be easily loaded. 

            public interface IPortletModule
            {
                        function getPortlet():IPortlet;
            }

To make the module smaller in size, the link report of the container may be referred during compilation. To deploy the portlet module in the container, the portlet module needs to be uploaded to the deploy folder of the container with the configuration details provided in an XML file. Depending on the server-side implementation, hot-deploy also may be done.

Cross-Platform Portlet Support
The Flex container discussed here can host portlets running on any back-end data. The only requirement is the crossdomain.xml file that needs to be present in the server from where the portlet is getting data, with an entry exposing the container root URL. Flex portlets written on J2EE, .NET, Web services, or any other custom back end can readily be hosted in the Flex container.

A Simple Implementation
In this section I explain a simple implementation with the features described in the previous section. For brevity I won’t discuss every detail here, but just try to clarify the basic infrastructure and concepts. Refer to Figure 6 for more details


In Figure 6, the bottom section shows the detailed view of the portlet container with real Flex classes that may be used to build the container functionality. In the top section the service interfaces, which need to be implemented to complete the portal container functionality, are shown. The persistence and authentication requirements for the Flex portal container are based on interfaces so that any type of server implementation (HTTP/SOAP) is possible. The source code for the interfaces can be found in the annexure-1.

Conclusion
This article provides just a cursory look at the Flex portal container. The detailed implementation and architecture details can not be covered in one article. I have already done a basic implementation of the Flex portal container; please refer to reference section for more details. Depending on the response to this article, I can start an open source project sharing my code and, with active participation from the community, build a full-fledged Flex portal container. The only flip side to this approach is that the Web application needs to be written in Flex to get any benefit from this portal container. The non-Flex JSP/ASP-based Web application won’t benefit without a Flex-based rewrite of the application.

This Flex-based portlet technology will definitely provide the infrastructure to host Flex-based content from different applications in a common container. It will enable maximum code reuse and easy deployment. For Web services, a Flex-based portal container can provide reusable UI for easy deployment in any Flex portal container. It can definitely solve the issue faced in contemporary enterprises whether to host portlets from cross-platform portal implementations.

References
Introducing Java Portlet Specifications: JSR 168 and JSR 286
http://developers.sun.com/portalserver/reference/techart/jsr168/

JSR 286: Portlet Specification 2.0
www.jcp.org/en/jsr/detail?id=286

JSR 301: Portlet Bridge Specification for JavaServer Faces
www.jcp.org/en/jsr/detail?id=301

Using Flex in a Portal
http://www.adobe.com/devnet/flex/articles/flex_portals_04.html

Open Portal, Portal Container Project
https://portlet-container.dev.java.net/

More Stories By Indroniel Deb Roy

Indroniel Deb Roy works as an UI Architect for BlueCoat Systems.He has more than 10 years of development experience in the fields of J2EE and Web Application development. In his past he worked in developing web applications for Oracle, Novell, Packeteer, Knova etc. He has a passion for innovation and works with various Web2.0 & J2EE technologies and recently started on Smart Phone & IPhone Development.

More Stories By Alex Nhu

Alex Nhu works as a manager, UI Development at Packeteer Inc. He has more than 11 years of work experience designing and architecting complex server-side J2EE and XML applications. He loves developing Web applications with Flex now after getting a taste of developing UI using other RIA platforms.

Comments (9) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
srinuguda 08/21/09 12:46:00 AM EDT

Hi,

Kindly post the some sample on portlet implementation in flex.

Regards,

Lord1984 03/13/09 11:59:40 AM EDT

Hi,

very good article...

When you talk about portlet window you mean that portlet window is a mx panel and it contains a module, is it true?
how to achieve direct module to module communication?

Where download the source?

thanks.

sreiner 11/09/08 07:12:47 PM EST

Is the source available? The link mentioned in the feedback only runs a demo (with no flex "view src"). The article mentioned "source code for the interfaces can be found in the annexure-1". Thanks.

Indroniel Deb Roy 04/03/08 07:04:27 AM EDT

Try the following URL:
http://www.portalcontainer.com/portalcontainer

Sujit Reddy G 03/31/08 04:02:04 AM EDT

This is a awesome idea. The link is broken. can you please post the URL to the implementation.

Indroniel Deb Roy 12/20/07 06:22:09 AM EST

Here is the link to a basic flex container implementation showing some portlets based on the Amazon Web Service.

http://www.portalcontainer.com/portalcontainer/pc.html

Indroniel Deb Roy 12/18/07 06:24:21 PM EST

I got a preliminary version of the Flex Container up and running with stuff discussed in the article with some sample portlets. I will post the URL soon, so that everyone can get a feel of it!

Andrea Bosio 12/01/07 04:28:58 AM EST

Great article and excellent idea! Our company could be very interested and actively involved in this open source porject. At the moment we are setting up and deploing Liferay Portals as intranet system to our customers. Please contact me if you decide to start the project or if you are looking for partners.

Luke 11/23/07 07:26:33 AM EST

Excellent overview article. We're looking at Flex as a portal/portlet technology for the next overhaul of our intranet system, I would be very keen to be involved in a dedicated container. Please let me know if you decide to post this as an open source project.