| By Julien Viet, Roy Russo | Article Rating: |
|
| October 22, 2005 06:00 PM EDT | Reads: |
51,052 |
Portlet Modes
Portlet mode functionality allows a portlet to display different information depending on which mode the user is interested in (the same can be said for window states, covered later). The portlet mode names given are rather obvious to anyone reading them as to what their function should be. Using a generic example of a WeatherPortlet, we can speculate on the definitions for each of the default modes covered in the specification:
- VIEW - doView(): Generates a content fragment displaying weather from NOAA.
- EDIT - doEdit(): Allows a user to modify his or her preferences, say, forcing the portlet to only show the weather in Miami, FL, USA.
- HELP - doHelp(): Displays a help HTML fragment with instructions on how to use the portlet.
Window States
Window states control how much space any portlet takes up on any given page. They function when the portlet container passes the user's desired window state to the portlet. The portlet can then modify the fragment of data to display or even change the window state while processing the action request. The use of custom window states, much like custom portlet modes, is briefly mentioned in the specification and implemented by some vendors. Much like custom portlet modes, the portlet descriptor must be modified to use the custom-window-state element. Window states are briefly explained below. Note that not all portal vendors translate the specification in the same way, leaving much of the window mode behavior up to the portal implementation:
- NORMAL: This portlet has a limited space and is probably sharing a page with other portlets.
- MINIMIZED: In this state, a portlet renders no output, or very little content.
- MAXIMIZED: Normally, this state implies that the portlet will take up all the viewable area on the page. Often, it's the only portlet displayed on that page.
- Interportlet-communication (IPC), allowing communication between portlets on events
- Portlet filters, which are similar to servlet filters
- Portlet markup extensions, where a portlet will be able to modify the markup outside of the markup fragment
- WSRP (Web Services for Remote Portlets) specification: WSRP (www.oasis-open.org/committees/download.php/3343/ oasis-200304-wsrp-specification-1.0.pdf) allows for the creation of a distributed portal infra-structure. This facilitates WSRP-compliant portals being able to display portlets from another WSRP-compliant portal.
- JCR (Java Content Repository, JSR 170) specification: Adoption of this specification seems to be universal in the portal space. It seeks to provide a common API to content repositories; allows for architecture-agnosticism; and features support for versioning, locking, transactions, and searching, among other things.
- Framework support: Facilitates the use of existing Web application frameworks to be leveraged in portlet development, such as JSF/My Faces, Struts, and Spring MVC. Figure 5 shows Sun's JSF CarDemo application running as a MyFaces portlet inside of JBoss Portal.
Now we must answer the question: "Are portals the magic bullet of Web application development?" To answer this question, you must look at the functional specification for the particular application being developed. Simply because you are developing a Web application doesn't mean you need to build or implement an existing portal. However, if your application specifications call for implementing some of the following, it would be wise to heavily consider using a portal:
- Single sign-on
- Personalization
- Content management
- User and role management
- Security and permissions management
My proposed Web application requires some of the features commonly found in portals; should I just develop my own proprietary architecture in-house then?
What we have found in the past when development teams create systems such as these, they tend to cobble in random odds and ends to fill the requirements listed with little consideration given to how all these disjointed parts will work together - if the component will be maintained in the future, will there be someone responsible for keeping up with the particular component, or if support outside of a mailing list is even offered for that particular component. During the development of JBoss Portal, we stayed away from creating what we refer to as a "Frankenstein Project" and leveraged technologies that were proven in production environments (see Figure 6) and supported in-house by the lead developers. This philosophy aided us in identifying problems when they popped up, and having the knowledge on-staff to deal with them. How comfortable are you allowing your developers to pick and choose random components from the Internet and glue them together? Leveraging portal software to handle the heavy lifting and intricacies of a Web application's development allows developers to concentrate on portlet development, which is probably the integral part of the business anyway.
Published October 22, 2005 Reads 51,052
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Julien Viet
Julien Viet is lead developer at JBoss Inc.
More Stories By Roy Russo
Roy Russo is a developer at JBoss Inc.
![]() |
Subbu Allamaraju 10/25/05 03:34:29 PM EDT | |||
The article is full of spin with few new ideas or material. Portals are not new. They have been around for quite a while. Even the Java Portlet API is now two years old. These authors seem to have woken up to portals and portlets just now. The authors claim that "portals have been touted as the magic bullet of web application development" for "scalable, flexible, and pluggable software components". This is an over-statement, and things like scalability and flexibility are not automatically achieved by just emplyoing any arbitrary portal. Although the authors say that you "must have a solid understanding" of portals and the underlying technologies, they don't do much to provide such a "solid understanding". |
||||
![]() |
Java Developer's Journal News Desk 10/22/05 06:15:29 PM EDT | |||
Java/ J2EE: Are Portals the 'Magic Bullet' of Web Application Development? When speaking of Web application development today, it's difficult to ignore the overwhelming influence of the Portlet Specification (JSR-168). Even before the specification was formally finalized by the expert group, the Java world saw older CMS application implementing it and new portal software arrivals in the market. The proverbial 'gold rush' to develop new applications as portlets, refactor existing applications to comply with the specification, and deploy new Web sites on portal software is not without good reason. The Java community was lacking a unifying specification in the Web tier, where all previous work could be brought together and leveraged, removing the tedious tasks developers once had to endure when creating most common Web applications. |
||||
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Industry Experts Discuss the State of Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- It's the Java vs. C++ Shootout Revisited!
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer Aid Campaign for the Typhoon Ondoy Victims
- Cloud Computing Can Revitalize Your Career as Software Developer
- A Brief History of Cloud Computing
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Industry Experts Discuss the State of Cloud Computing
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Performance Tuning Essentials for Java
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- It's the Java vs. C++ Shootout Revisited!
- The End of IT 1.0 As We Know It Has Begun
- My Thoughts on Ulitzer
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?

































