Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article



In recent years, Web portals have risen in popularity as a way of aggregating, organizing, and presenting content in a highly uniform, customizable, and personalized way.

As the technologies that enable the creation and management of these Web portals have evolved, it is not only information content that is being offered, but application functionality as well. With application functionality making its way to the Web portal, a whole new dilemma arises as developers attempt to adapt their application functionality to the characteristics and behavior of the Web portal.

Portal Concepts
In the simplest terms, a portal is a Web site that provides content and application functionality in a way that is both useful and meaningful to the end user. It also serves some purpose from the portal provider's perspective, whether it is a public portal trying to attract Web traffic to a site or an enterprise desiring to provide a central location for employees to obtain company information. Portals have evolved to enable the ability not only to provide a unified look and feel to the entire site, but to apply personalization and customization to the content. In this way, a person who accesses a portal and logs in with a predefined user name and password can customize not only what portal content is displayed for them, but how that content is displayed.

Most portals and portal frameworks contain the concept of a "portlet" as a window to a specific set of content within the overall context of the portal page. Portlets generally support the ability to customize the information displayed within this window. From the perspective of the portal framework, portlets tend to look and behave much the same as individual windows running in any windows-based operating system. They can be minimized, maximized, and rearranged to suit the individual portal user. From the developer perspective, a portlet is really a piece of code that plugs into a generalized framework. Different portal frameworks implement the concept of a portlet differently. In some cases, the portlet is a collection of JSP pages. In other cases, a special type of class may implement certain interfaces. Regardless of how it is implemented, the portlet is generally responsible for presenting a specific set of content that may be tailored to a user's preferences. The portal framework handles the infrastructure services, such as providing the overall presentation of the selected portlets, user management, security, and personalization.

A Developer's Approach
When you think about adapting an existing application, it's important to understand that typical Web applications don't necessarily map easily to a portal paradigm. This is especially true for Web applications with multipage interactions, and is due to the fundamental difference in navigation behavior inside a portlet as compared to a traditional Web application or Web page. In a traditional Web page, a user would typically select a link on the page presented in the browser, which would lead to another HTTP request returning a completely new page of content. By contrast, the goal of a portlet within a portal is more to present to the user the impression that the contents of only that one portlet are changing. This presents a distinct challenge to developers who typically have designed their Web application navigation as a set of URL links that invoke JSPs, Java servlets, or even static HTML pages. Now they must think about how to specify navigation, not in the context of the Web application, but from the perspective of the overall portal.

In order to present to the user the appearance that only the portlet they are interacting with is changing, it is necessary to use functionality that allows the portal framework to intercept the result of URL invocations and redirect them to the portlet making the invocation. In BEA WebLogic Portal, a mechanism called Webflow can be used to define the flow of events that take place between components of the Web application. These Webflows effectively take the place of actual URLs in the execution of the various actions within the application. What follows is an example of how we adapted a Web application called "QuizGame" into an existing portal domain running on BEA WebLogic Portal.

The QuizGame application is a demo Web application built using a combination of a single controller servlet, a number of Enterprise JavaBeans, and a single JavaServer Page for handling the generation of the presentation. Figure 1 represents the architecture of this application.

In order to adapt the QuizGame Web application to WebLogic Portal, three key steps need to take place.

1.   The Web application components must be added to the portal Web application.
This includes the EJBs and WAR file containing the controller servlet and other helper classes used by the Web application. In WebLogic Portal, the portal itself is implemented as a sophisticated Web application. Within the portal Web application, a subdirectory is defined where the different portlets are stored. The portlets are typically JSPs connected together through the definition of Webflow events. Any servlets and helper classes should be stored in the typical Java Webapp structure with exploded individual classes stored under the "classes" directory and classes packaged in JAR files stored under the "lib" directory. In addition, servlets and the components they reference must be registered with the Web application by adding them to the Web.xml file. Once the portlet is created in the next step, the JSP files should be stored in the portlet-specific directory. These files will be adapted in the final step.

2.   A new portlet must be created and added to the existing portal domain E-Business Control Center (EBCC).
This portlet will contain the pages representing the view for the Web application being added. Once the portlet itself is created, a Webflow needs to be defined to represent the interactions between the various components of the presentation. The events defined within this Webflow will replace the actual URLs previously defined in the QuizGame application. Figure 2 shows an example of the Webflow created in the EBCC.

Figure 2 shows two kinds of elements. Presentation nodes represent various kinds of presentation components, such as static HTML pages, Java servlets, or JSPs. These presentation nodes can have a user-friendly name, but must reference the actual component or page. The Webflow events are shown as arrows and represent invocations between the various presentation components. These events can be given user-defined names.

3.   The URLs defined in the original Web application must be replaced with a special URL built from the Webflow events defined in the EBCC.
Due to how the QuizGame application was built, the URLs were largely contained in the output JSP. Changing these URLs in the JSP files is an easy task due to the availability of a helper TagLib. Listings 1 and 2 show how to replace a URL invocation to the DemoControllerServlet with the equivalent Webflow invocation to the same servlet. Listing 1 shows a traditional form with a URL invocation to the DemoControllerServlet as the action. Listing 2 shows the use of the event "QGControllerServlet.event" to represent the same request using a Webflow event. This was one of the events defined between the Index_html presentation node and the DemoControllerServlet presentation node in the EBCC Webflow designer tool.

These three steps will enable the application to run within the overall portal and behave correctly throughout the execution of the application. This is accomplished without significantly changing the look or actual behavior of the application. The main difference is that now the QuizGame application is simply one portlet window within the greater portal presentation.

Once the application has been successfully portalized, additional enhancements can be made, such as adding the ability to customize properties of the game through an edit page. This shouldn't be considered the end of the process, but simply the first step in integrating an application into the portal. BEA WebLogic Portal provides more sophisticated mechanisms for controlling the flow and behavior of the application through the use of pipeline components and processor components.

The use of these types of components can replace the need for the servlet and JSPs and enable better flow control and access to other portal features, such as security and personalization. At the same time, they still allow the ability to reuse the existing business logic components, such as EJBs.

Developing Portal-Ready Applications
Up to this point, this article has discussed portalization from the perspective of moving existing application functionality to a portal framework. If you are creating a new Web application, a number of techniques can be used to make the application more portal ready.

Tip 1: Use a Model-View-Control Architecture
The Model-View-Control (MVC) architecture is a way of grouping application functionality into three distinct categories, each serving a specific role in the overall application. The objective of using an architecture such as MVC is to allow the ability to isolate each of these functions so that it is possible to make changes to one component without significantly impacting the others. For example, a change may be made to the view aspect of an application without requiring any changes to either the model or the control modules.

This architecture provides a distinct advantage in portalization. MVC-based applications can be more easily adapted to a portal by simply making changes to the view and possibly the control code. Even if there is a certain business logic associated with the application, this can often be left untouched if it is not tightly woven into the view and control components. More specifically, an application can be adapted to the portal by first only changing the view. These changes are often superficial in order to adapt to a different form factor than may have been used for a browser. Then the control module can be modified or even replaced to suit the needs of navigation within the context of the portal.

Tip 2: Use XML to Represent Content
In Web applications, XML is often used as a client-neutral way of describing what will be presented. XML coupled with transformation technologies such as XSLT allows the ability to delay the decision of how to present the content until the last stages of processing. Delaying this decision allows you to tailor the presentation of the content in very client-specific ways.

In the context of adapting functionality to portals, this allows the ability to contain the definition of how the content is presented to a single mechanism, such as XSLT and the corresponding stylesheets. Doing this makes it easier to change the presentation and navigation parts of the application without significantly impacting other parts of the application. In order to use XML in this way, the code responsible for controlling the behavior and interaction should be made to return XML rather than presentation-specific content such as HTML.

The focus in defining the presentation should be defining the basic presentation constructs, such as tables, forms, fields, etc. The explicit definition of things like fonts and background and foreground colors can defeat the ability to personalize the portlet to the overall portal color schemes and font styles.

Tip 3: Prepare to Leverage the Portal Security Mechanisms
Portal security is a fairly complex topic and not within the scope of this article except as it may affect the individual applications being adapted to the portal. One key benefit of a portal is the ability to sign on once to enable access to the applications offered within that portal - often referred to as "single sign-on." For applications that will be hosted in the same middleware infrastructure as the portal framework, it is much easier to leverage the same security mechanisms. Many portals use a standard HTTP cookie to store session information. In order to enable the ability to have single sign-on, it is important that all applications share the same session information within the portal. The WebLogic Portal TagLib provides a number of helpful utility methods for assisting the portlet in obtaining and sharing session information from the portal Web application perspective.

Be careful in building a Web application not to define a unique security scheme. Rather, the Web application should leverage the existing infrastructure mechanisms as much as possible. For example, most J2EE-based application servers support a number of security mechanisms for propagating user authentication and authorization information to the various components. Typically, portals that are built on top of a J2EE application server will leverage these same mechanisms. For applications that aren't colocated with the portal framework, it's often necessary to build bridging interfaces that can map the portal-specific security mechanisms to those of the application being adapted to the portal.

This article discussed an approach for enabling an existing application to be adapted to a Web portal. In doing so, the goal has been to provide the necessary concepts and developer tips to enable a developer to plan for and ultimately perform the portalization. You should note that moving an existing Web application to a portal doesn't have to take place all at once. It can be a multiphase process. The first phase is to present the existing content or functionality from within the portal. Once this is accomplished, the application will need to be better integrated with the portal so that it can leverage the portal navigation, personalization, and security mechanisms. The final phase is to enhance the personalization capabilities of the application by providing an edit page for allowing users to predefine values, such as their player ID and whether they prefer to have their top scores show.

More Stories By Mark Secrist

Mark is a senior constultant for the HP Developer Resource Organization with 10+ years experience involving distributed object technologies and building n-tier, web-based applications. He currently consults with enterprise customers on J2EE & web services development. Mark also has published technical white
papers on J2EE, mobile and web services development.

Comments (0)

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.

@ThingsExpo Stories
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
"Evatronix provides design services to companies that need to integrate the IoT technology in their products but they don't necessarily have the expertise, knowledge and design team to do so," explained Adam Morawiec, VP of Business Development at Evatronix, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Digital Transformation (DX) is not a "one-size-fits all" strategy. Each organization needs to develop its own unique, long-term DX plan. It must do so by realizing that we now live in a data-driven age, and that technologies such as Cloud Computing, Big Data, the IoT, Cognitive Computing, and Blockchain are only tools. In her general session at 21st Cloud Expo, Rebecca Wanta explained how the strategy must focus on DX and include a commitment from top management to create great IT jobs, monitor ...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
Recently, WebRTC has a lot of eyes from market. The use cases of WebRTC are expanding - video chat, online education, online health care etc. Not only for human-to-human communication, but also IoT use cases such as machine to human use cases can be seen recently. One of the typical use-case is remote camera monitoring. With WebRTC, people can have interoperability and flexibility for deploying monitoring service. However, the benefit of WebRTC for IoT is not only its convenience and interopera...
Product connectivity goes hand and hand these days with increased use of personal data. New IoT devices are becoming more personalized than ever before. In his session at 22nd Cloud Expo | DXWorld Expo, Nicolas Fierro, CEO of MIMIR Blockchain Solutions, will discuss how in order to protect your data and privacy, IoT applications need to embrace Blockchain technology for a new level of product security never before seen - or needed.
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
"Digital transformation - what we knew about it in the past has been redefined. Automation is going to play such a huge role in that because the culture, the technology, and the business operations are being shifted now," stated Brian Boeggeman, VP of Alliances & Partnerships at Ayehu, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...