Oracle9iAS Web Cache - Order Entry System
Table Of Contents
Oracle9iAS
Web Cache improves the scalability, performance and availability of e-business
Web sites. Unlike legacy cache servers which only handle static data, Oracle9iAS
Web Caching technology accelerates the delivery of both static and dynamically
generated web content, thereby improving response times for feature rich
pages.
Order
Entry System
The Order Entry System allows tracking of orders made by the customers.
The users of this system are customers and employees. The system
maintains product information, order information, customer and employee
information in the database. The user of this system, employee/customer
has to login into the system using the unique identifier given to them.
When the customer logs into the system, a product catalog is shown to them.
This page allows them to add products into the Shopping cart, view more
information about the product, view customer information and order items
in the cart. The system also displays the list of top 5 products on the
left hand side of the screen. The top 5 products is determined by the total
number of orders received for the product from all the customers. A greeting
message "Welcome <username>" is also displayed in this page. The product
catalog has "More Info" and "Add to Cart" links for each product. The "More
Info" link gives a detailed information about the product. "Add to Cart"
link adds the product to the Shopping Cart. The product catalog lists the
orderable products only. (orderable products has product_status value "orderable").
When 'order items' button is clicked, all the items in the cart are ordered
and the cart is reset.
The employees in the system can add/ modify/ remove products in the system.
Similar to the Customer, when the employee logs into the system a greeting
message is displayed. The product catalog consisting of all products is
displayed. The employees can select the products from the catalog to modify/delete
the product details. Product details like name, description of the product,
product status, list price, catalog url can be modified.
Role
of Oracle9iAS Web Cache
Oracle9iAS Web Cache can be used in this system to store both static and
dynamic pages. When the dynamic pages are cached, the first request alone
will be sent to the Application Server and the content will be stored in
Oracle9iAS Web Cache. All subsequent requests will be served from the Oracle9iAS
Web Cache server until the pages are invalidated. Oracle9iAS Web Cache handles
the session information stored in these cached pages and substitutes session
information to the content stored in it. The suitable candidates for caching
dynamic pages in the system are
-
Product catalog displayed both to the employee
and customers.
-
List of top 5 products displayed to the customers
-
Product information displayed for each product
-
Customer information displayed for each customer
-
Greeting message displayed to each user of
the system
When the content is cached in Oracle9iAS Web Cache, the application must
make sure to invalidate the content as it changes. For example, the product
catalog will change when new products are added/removed in the system or
product details are modified.
The system has to invalidate cached pages
in Oracle9iAS Web Cache when the product catalog changes. The invalidation
of the cached pages is done by sending the XML invalidation messages to
the specified invalidation port of Oracle9iAS Web Cache Server. When these
pages are invalidated, fresh copy of the content will be requested from
the Application Server for the next request.
The
top 5 products are based on the orders received from the customer. When
the customer orders for a product, the pages needs to be invalidated.
The product information displayed for each product can also be cached in
Oracle9iAS Web Cache. The product information page embeds the product id
in its URL. Oracle9iAS Web Cache will use the embedded product id in the
URL to identify the content for each of the products. The customer information
pages can also be cached in Oracle9iAS Web Cache by embedding customer
id in its URL. The cached pages has to be invalidated when the information
changes.
The greeting message or Oracle9iAS Web Cache's "Personalized messages"
can also be cached. The only content in this greeting message which will
change is the <username>. The personalized content will be identified
by the special tag <!-- WEBCACHETAG --> in the source content. The personalized
content i.e., the user name in this case, can be passed as encoded
URLs or as cookies to these pages. Oracle9iAS Web Cache will substitute
the cookie value / encoded URL value into these pages. The greeting message
"Welcome <username>" will be displayed correctly only from the second
request to web cache as the first request will just display 'username'
alone.
This section shows the various screen shots in this application.
Figure 1.1 Login Page
Figure 1.1 Customer Catalog
This page is
displayed when the customer logs into the system.
Figure 1.3 Product Information Page
This page is
displayed when the user clicks on the More Info
link.
Figure 1.4 Add Product to Cart page
This page is
displayed when the user adds the product to the cart.
Figure 1.5 Product Added to cart
This page is
displayed when the selected product is added to the cart.
Figure 1.6 Order Products in the cart
This page is displayed
when the customer submits the cart. When the products are ordered,
the products in the top 5 product list will also change. The top 5 product
list, which is cached in Oracle9iAS Web Cache will be invalidated. The invalidation
messages in this page, displays status of this Invalidation Mechanism.
Figure 1.7 Customer Information Page
This page displays
the customer information. It is displayed when the user presses the 'Custom
Information' button.
Figure 1.8 View Cart
This page displays the products
in the cart. This page is displayed when the user presses' View cart' button
Figure 1.9 Employee Product Catalog
This page displays the product catalog
for the employees. This page is displayed when the user logs in as employee.
The user can add, modify and delete products from this page.
Figure 1.10 Add Product to the system
This page is displayed when
the user chooses to add new products into the system.
Figure 1.11 Product Added to the system
This page is displayed when a product is
added to the system. The invalidation messages list the various pages that
should be invalidated, when a product is added to the system. The catalog
displayed to both customer and employee will change as a result of this.
The names of the pages that need to be invalidated are shown below.
Figure 1.12 Modify Product in the system
This page is displayed when the
user chooses to modify a product.
Figure 1.13 Product Modified
This page is displayed when the product
is successfully modified in the system. After modification, the pages
like top 5 products page, product catalog for both customers and employees,
product information pages will be invalidated. The invalidation messages
carry the status of this invalidation.
Figure 1.14 Delete Product in the system
This page is displayed when the
user chooses to delete a product.
This system uses Oracle9i sample schemas. It uses Order Entry Schema available
at Understanding
the Common Schema
This
sample has been tested against the Oracle9iAS Containers for Java
1.0.2.2 and Oracle9iAS Web Cache Release 2.0.
Refer to Install.html
for step-by-step instructions on copying files, installing packages, and
configuring any other systems to successfully run the sample.
Contents of Archive file
| 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\orderentrysample\ |
ConnectionParams.java |
This java file stores the database connection
parameters. |
| InvalidationBean.java |
This Bean is used to invalidate the cached
pages in the
Oracle9iAS Web Cache. |
| OrderEntryBean.java |
This Bean contains the business logic
of the order entry system. |
| ShoppingCart.java |
This Bean holds the items in the shopping
cart. |
| code\ |
AddProduct.jsp |
This JSP adds the product details to the
system. |
| AddToCart.jsp |
This JSP adds the product details to the
cart. |
| CachedCustInfo.jsp |
This JSP displays the customer information. |
| CachedCustProductlist.jsp |
This JSP list the product catalog
for the customer. |
| DeleteProduct.jsp |
This JSP deletes the product details from
the system. |
| CachedDispAddProduct.jsp |
This JSP displays form to add product
details into the system. |
| CachedDispModifyProduct.jsp |
This JSP displays form to modify product
details. |
| CachedEmpProductList.jsp |
This JSP displays product catalog for
the employees. |
| ErrorHandler.jsp |
This JSP handles the error messages. |
| Heading.jsp |
This JSP displays the greeting message
for the user. |
| Login.jsp |
This JSP validates the user and
creates shopping cart for the customers |
| CachedMain.jsp |
This JSP displays form for the user to
login into the system. |
| ModifyProduct.jsp |
This JSP modifies product details in the
system. |
| OrderItems.jsp |
This JSP order items in the cart. |
| CachedProductInfo.jsp |
This JSP displays product information. |
| CachedShowAddToCart.jsp |
This JSP displays form to add items into
the cart. |
| ShowOrderItems.jsp |
This JSP displays form to order Items
in the cart. |
| SetDBConnections.jsp |
This JSP intializes the DBconnection in
each JSP Page. |
| CachedTop5.jsp |
This JSP displays top 5 products ordered
by the customers. |
| CachedViewCustCatalog.jsp |
This JSP displays catalog for customers. |
| CachedViewEmpCatalog.jsp |
This JSP displays catalog for employees. |
| / |
OrderEntry.jpr |
JDeveloper Project File |
| OrderEntry.jws |
JDeveloper WorkSpace File |
| OrderEntry.deploy |
Deployment File |
Revision history:
Nov 20, 2001
Please enter your comments about this sample
in the OTN Sample code discussion forum.
|