Oracle9iAS Web Cache Sample - Personalized Portal

This document is organized into following sub-sections :

Overview of the Sample Application

Oracle9iAS Web Cache Sample - Personalized portal is a customizable portal developed to demonstrate JESI (Edge Server Includes for Java) and Oracle9iAS Web Cache. The application loads both the versions of the personalized portal page, which uses Oracle9iAS Web Cache and the personalized portal page which does not use Oracle9iAS Web Cache. The time taken to load these two versions of the portal page are captured, maintained and a performance graph is generated for all the requests made.

The application displays a login screen at the beginning, to fetch the personal profile of the user whose information is stored in the database. If the user does not have a valid login name, the user can sign up to the system. Sigining up, creates a login name and a default profile with default customization for the user.

The personalized portal page aggregates contents from different content providers as customized by the user. The various categories of information available to the user for customization are

    • Stocks
    • Weather
    • News
    • Horoscope and
    • a Todo task list.
In each of these categories, the user can customize the information that is required. For example, in the Stocks category, the user can choose the list of stock symbols that he/she would be interested in. Similarly, the list of news topics in the news category, the list of cities for weather information in the weather category and the list of sun sign in the horoscope category. The user can customize each of these categories by pressing the 'Edit' button displayed on top of each category. The customized profile for each user will be saved in the database and used while displaying the content for the user.

The user can customize the appearance of each of the category of information. Typically, they are:

    • The heading of the category
    • The foreground and background color of the heading
    • Color of the content foreground and background
    • The border color
    • The refresh rate for this category.
The refresh rate specifies the time for which the information should be cached in Oracle9iAS Web cache.

The customize link on the main portal page, displays customizable options of the main page. The user can select a title for his/her page, color for the heading and content, user's first name and last name. The user can also customize the page layout of his/her portal page. The portal page is divided into 3 columns. The user can specify the columns to which their category of information should get into. If the user is not interested in any particular category of information, they can choose to remove that particular category.

Role of Oracle9iAS Web Cache

This section describes the role of Oracle9iAS Web Cache, in the cached version of this personalized portal application. Each of the category of information displayed in the portal page is a fragment, which we call as a 'category fragment'. The main personalized portal page displayed to the user is a template which consists of these fragments. Each of the category fragment is broken into sub fragments. For example, each of the stock symbol information within the stock category is a sub fragment. The category fragment is cached for every user, since its appearance changes for every user. The sub fragments carry the same information for every user and they are cached at global level and these sub fragments are available to all users. The expiration time of the category fragment, the refresh rate, is customizable for every user. And the expiration of the sub fragments can be set at the application level.

The time stamp is displayed for every category, which indicates when the content was actually generated. When the particular category of information for the user is fetched from the cache, the time stamp displayed in the sample version with cache will vary with the sample version that does make us of cache. This indicates that the content was generated some time earlier. The update link at the end of each category invalidates that particular category of information alone in the cache and would aggregrate all the other content from the cache itself. This is to ensure that the response time is quicker even when some fragments in the page has been invalidated.

When the user customizes a category of information, only that particular category is invalidated in the cache version of the application. So, the next request for the portal page has to fetch this information alone and all the other categories of information will be fetched from the cache itself. This can be checked by customizing the layout of the page or by customizing any category information. The application without cache, would have taken a longer time to fetch the data since even for a small change like this, the page has to be built all over from scratch. This includes aggregrating the content from all content providers and assembling them.

Oracle9iAS Web Cache ensures scalability for an increasing user base by caching frequently requested data in the cache and serving the users from the cache itself.  For example, if the stock symbol ORCL is requested by many users, this quote sub fragment will be requested only once from the application server and will be cached to serve subsequent requests. This reduces the load on the server.

To check the cache contents in the Oracle9iAS Web Cache, click the View Cache Contents link in the main portal page or use Oracle9iAS Web Cache Admin tool.

Screen shots of the Sample Application

Figure 1. Personalized Portal Page for user Scott

The page is split into two parts, the top portion with the version of the application using Oracle9iAS Web Cache and the bottom portion with the version of the application without Oracle9iAS Web Cache. With Oracle9iAS Web Cache, the time taken to display the content is 21.53 seconds. The page on the bottom pane as mentioned earlier does not use cache, hence takes 53.06 seconds. The time taken is more because this version without cache aggregrates content from various content providers for each request.

Figure 2. Customizing the Page Layout for user Scott.

This figure below displays the customizable page for the user Scott. The page contains various options allowing the users to customize their portal.

Figure 3. Personalized Portal Page for user Scott after changing the page layout

The figure displays the page after its layout had been changed. The cache version of the application has to change only the template, and the content is aggregrated from the cache itself. The application version without cache has to aggregate the content from the content providers. The time taken by the cache version & non-cache version is displayed in the screen shot.

Figure 4. Oracle9iAS Web Cache Performance Graph for Scott Portal Page.

The figure below shows the graph for the requests made by user Scott .


 

Version dependencies

This sample application has been tested against the Oracle9iAS Containers for Java 9.0.2.0 and Oracle9iAS Web Cache Release 9.0.2

Installation and Configuration

Refer to Install.html for step-by-step instructions on copying files, installing packages, and other configurations to successfully run the sample.
 
 
 
Directory Filename Description
doc\ Readme.html This file 
Install.html This file has instructions required to install the software and run this sample.
code\oracle\otnsamples\webcachemyportal\ ConnectionParams.java This java file stores the database connection parameters, Oracle9iAS Web Cache Server parameters, Oracle9iAS parameters, Application specific parameters.
MyPortalBean.java This Bean contains the business logic of the system.
Appearance.java This class is the java object represenstaion of user customized appearance.
public_html\ CachedHoroscope.jsp This JSP is the Horoscope fragment.
CachedNews.jsp This JSP is the News fragment
CachedStocks.jsp This JSP is the Stocks fragment.
CachedTodo.jsp This JSP is the Todo task fragment.
CachedWeather .jsp This JSP is the Weather fragment.
CustomizeContent.jsp This JSP customize fragment appearance, content, layout and other customizable things.
EditTodo.jsp This JSP Add/edit/delete Todo task for the user.
Invalidate.jsp This JSP invalidates the category fragment of the user.
Login.jsp This JSP is the login page of the system.
Signup.jsp This JSP allows user to signup to the system.
Start.jsp This JSP starts the request to both with cache and without cache version of the portal page.
Main.jsp This JSP is the template for the portal page.
Calendar.js This javascript displays calendar.
barchart.js This javascript handles drawing bar graphs.
colorpicker.java This is color picker applet.
images This directory holds images used in the system.
/other tables.sql SQL script, which creates tables and populates these tables for the application.
/ MyPortal.jpr JDeveloper Project File
MyPortal.jws JDeveloper WorkSpace File
MyPortal.deploy Deployment File


Please enter your comments about this sample in the OTN Sample code discussion forum.
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy