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
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
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...
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.
Imagine if you will, a retail floor so densely packed with sensors that they can pick up the movements of insects scurrying across a store aisle. Or a component of a piece of factory equipment so well-instrumented that its digital twin provides resolution down to the micrometer.
In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, provided an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settle...
BnkToTheFuture.com is the largest online investment platform for investing in FinTech, Bitcoin and Blockchain companies. We believe the future of finance looks very different from the past and we aim to invest and provide trading opportunities for qualifying investors that want to build a portfolio in the sector in compliance with international financial regulations.
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...
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
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...
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
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...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
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 ...
We are given a desktop platform with Java 8 or Java 9 installed and seek to find a way to deploy high-performance Java applications that use Java 3D and/or Jogl without having to run an installer. We are subject to the constraint that the applications be signed and deployed so that they can be run in a trusted environment (i.e., outside of the sandbox). Further, we seek to do this in a way that does not depend on bundling a JRE with our applications, as this makes downloads and installations rat...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
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 ...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
The IoT Will Grow: In what might be the most obvious prediction of the decade, the IoT will continue to expand next year, with more and more devices coming online every single day. What isn’t so obvious about this prediction: where that growth will occur. The retail, healthcare, and industrial/supply chain industries will likely see the greatest growth. Forrester Research has predicted the IoT will become “the backbone” of customer value as it continues to grow. It is no surprise that retail is ...