Customer Module - Installation and Configuration
Instructions
Table of Contents
1. Oracle9iAS WebCache
9.0.2.0.0 (can be downloaded from
here
)
2. Oracle9i JDeveloper version 9.0.2
(can be downloaded from
here )
or
JDK1.3.x (can be downloaded
from here ) or
higher and Oracle9iAS Containers for J2EE version 9.0.2 (can be
downloaded
from here)
3. Oracle8i Database or higher running
SQL*Net TCP/IP listener (can be downloaded from
here ).
4. Any Java Script and cookie enabled
browser.
The sample archive is provided as a .jar file. Download
and extract the CustomerModule.jar file
to a convenient directory using
jar -xvf CustomerModule.jar
Extraction of the jar file results
in the creation of 'CustomerModule' in your installation root directory.
| Directory |
Filename |
Description |
| CustomerModule\doc\ |
Readme.html |
This file contains information
about the sample scenario and usecase. |
| Install.html |
This file. |
| blaf.css |
This file is a cascading style sheet applied to the Readme.html
and Install.html files. |
| CustomerModule\doc\images |
This folder contains images for screen shots and other images
used in the Readme.html and Install.html file. |
| CustomerModule\
src\oracle\otnsamples\webcache\customermodule |
CartBean.java |
This class contains functionality for operations
on the shopping cart. |
| CartItem.java |
This class represents an individual item of the shopping
cart |
| CustomerModule\src\web-root |
BestBuyDesc.jsp |
This jsp displays the detailed description of the best buy. |
| BestBuys.jsp |
This jsp lists the top 3 best buys. |
| Cart.jsp |
This jsp displays the shopping cart to the user. |
| Catalog.jsp |
This jsp is used to display the various product categories
available in the e-store. |
| Category.jsp |
This jsp displays the products of a particular category
chosen from the catalog. |
| Checkout.jsp |
This jsp is used to check out the cart. |
| ErrorHandler.jsp |
This jsp reports exceptions and errors. |
| Header.html |
This html file is used to display the header for each page
in the sample. |
| Header.jsp |
This jsp displays the links
for login, view cart etc.on the top. |
| Login.jsp |
This jsp is used when the user wants to login to the sample
application. |
| Logout.jsp |
This jsp is used when the user logs out. |
| Main.jsp |
This jsp is the first jsp called in this application. It
acts as a controller. |
| OrderStatus.jsp |
This jsp is used to check the order status. |
| Products.jsp |
This jsp displays the product description. |
| TopSelling.jsp |
This jsp selects the top 3
selling products of the e-store. |
| Ultimate.gif |
This image file is the logo for this sample
application. |
| CustomerModule\src\web-root\
Web-Inf\TagLib |
jesitaglib.tld |
The tag library for JESI tags. |
| sqltaglib.tld |
The tag library for SQL operations. |
| CustomerModule\src\web-root\
Web-Inf\ |
web.xml |
The deployment configuration file |
| CustomerModule\Config |
DatabaseSetup.sql |
This sql file is used to create database objects with some
initial data required by this sample. |
| CustomerModule\ |
CustomerModule.jpr |
JDeveloper project file. |
| CustomerModule.jws |
JDeveloper workspace file. |
| CustomerModule. deploy |
Deployment profile. |
In this sample application, Main.jsp acts as a controller. This jsp in turn
calls other JSPs. On the top pane, Header.html and
Header2.jsp are displayed. The left side pane contains BestBuys.jsp, TopSelling.jsp,
OrderStatus.jsp which are displayed in different
fragments. The center pane displays different JSPs dynamically based on
the flow given in the diagram below.
Figure 1. JSP Flow Diagram
NOTE: This Database Object
Creation Script file is common for both Administration Module and Customer
Module.
Need not run this script if you
have already used it for Admin Module.
Connect to your database
as any user and run the script CustomerModule\Config\DatabaseSetup.sql at
the SQL prompt
SQL> @
<your-installation-root>
\CustomerModule\Config\DatabaseSetup.sql
This creates a user "woc"
with password "woc". All the database objects required by the application
are created and
populated with initial data.
This is the list of database
objects that get created by running DatabaseSetup.sql file.
| Object Name |
Description |
| Categories |
A table which
stores list of Product Categories like Printers, Monitors, Stationary etc. |
| Customers |
A table which
stores information about the customers. |
| Order_Status |
A table that contains
description for Order status like Planning,Get Material in Quarantine, Get
Payment, Packing, QA1, QA2, Ready To Ship, Warehouse,
Ready To Deliver, Goods
Receive Note,Close Order. |
| Products |
A table that contains
product information. |
| Orders |
A table that stores
information about Orders status, Order date etc |
| Order_Details |
A table containing
detailed information about the products, quantity ordered in an order. |
| Best_Buys |
A table containing
information about best buys. |
| Products_Included |
A table containing
details like quantity, price_offered about the products included for a best
buy. |
| Orders_Seq |
A
Sequence used for auto generating the Order IDs |
| Best_Buy_Seq |
A Sequence used for auto generating
Best Buy IDs |
<JDEV_HOME> is the directory where Oracle9i JDeveloper is installed.
<OC4J_HOME> is the directory where OC4J is installed,
for eg: d:\oc4j\j2ee\home
<your-installation-root> is the directory where you have extracted
you sample application.
This application can be deployed either to Oracle9i
JDeveloper's embedded OC4J or to Stand Alone
OC4J using JDK .
Step 1. Make sure that the Database
Setup has been completed.
Step 2. Change data-sources.xml
located in <JDEV-HOME>j2ee\home\config folder to point to the same
database
used in Database Setup
. Change the value of the attribute 'URL' (highlighted in
red) to the corresponding host, port and SID
<data-source
class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
name="woc"
location="jdbc/woc"
xa-location="jdbc/xa/woc"
ejb-location="jdbc/Pooledwoc"
url="jdbc:oracle:thin:@insn104a.idc.oracle.com:1522:otn9idb
"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="woc"
password="woc"
inactivity-timeout="30"
/>
Step 3. Open the CustomerModule.jws in Oracle9i
JDeveloper. The workspace will contain
CustomerModule.jpr (project file), JSP files, Java Beans and other files.
Step 4. Right click CustomerModule.jpr.
Select “Project Settings…” from pop up menu.
Step 5. In the node Common->Input
Paths, ensure that the following are correct
- "Java Source Path" is the path where the
java source files are located.(CustomerModule\src\web-root\web- inf\classes\oracle\otnsamples\webcache\CustomerModule
)
- "HTML Source Path" is the path where
all JSP source files are located (CustomerModule\src\web-root)
Step 6. Expand Configuration->Development->Libraries
node on the left hand side, ensure JSP Runtime, Oracle JDBC are added
to the current project.
Step 7.
Start the built-in OC4J server available with Oracle9i JDeveloper
using
$ java -jar OC4J.jar
where
OC4J.jar is located under <JDev-Home>\j2ee\home directory.
Step 8. Create an Application Server
Connection by clicking on the Connections Node. Right click on
Application Servers and select "New Connection".
Step 9. Provide the appropriate connection
information like Connection name, URL with your hostname and port
where OC4J has been installed. And test the connection before deployment.
Step 10. Right Click on the CustomerModule.deploy
node and select "Deploy to <connection name>",
where the connection name is the name of the connection created in the previous
step. This results in
creation of war (CustomerModule.war) & ear (CustomerModule.ear)
files in <your directory configuration>\CustomerModule
directory and deployment to OC4J
After successful deployment of the application,
Oracle9iAS Web Cache needs to be configured. Click on this
link to proceed.
Step 1. Make sure that the Database
Setup has been completed.
Step 2. Change data-sources.xml
located in <OC4J-HOME>\config folder to point to the same database
used in Database Setup
. Change the value of the attribute 'URL' (highlighted in
red) to the corresponding host, port and SID
<data-source
class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
name="woc"
location="jdbc/woc"
xa-location="jdbc/xa/woc"
ejb-location="jdbc/Pooledwoc"
url="jdbc:oracle:thin:@insn104a.idc.oracle.com:1522:otn9idb
"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="woc"
password="woc"
inactivity-timeout="30"
/>
Step 3. Ensure that classes12.zip/jar
and jndi.jar are added to the classpath.
Step 4. Create folder 'classes' under
<your_installation_root>\CustomerModule\src\web-root\web-inf\
Step 5. Open command prompt, go to
<your-installation-root>CustomerModule\src\oracle\otnsamples\webcache\CustomerModule
directory.
Step 6. Compile all the java files under this directory, using
the following command
$ javac *.java -d
<your_installation_root>\CustomerModule\src\web-root\web-inf\classes
This command will compile the java files and put the class files
in <your_installation_root>\CustomerModule\src\web-root\web-inf\classes\oracle\otnsamples\webcache\CustomerModule
Step 7. Go to CustomerModule\src\web-root\ folder and create
war(web archive) file using
jar -cvfM CustomerModule.war *
and copy CustomerModule.war
to <OC4J_HOME>\applications directory
Step 8. Open the file application.xml present in <OC4J_HOME>\config
directory and add the following entry
<web-module
id="CustomerModule" path="../applications/CustomerModule.war" />
Step 9. Open the http-web-site.xml file present in <OC4J_HOME>\config
directory and add the following entry
<web-app
application="default" name="CustomerModule" root="/technology/CustomerModule" />
The above mentioned steps ensures the deployment of the sample in OC4J.
After successful deployment of the application,
Oracle9iAS Web Cache needs to be configured. Click on this link
to proceed.
This section describes the steps to configure
OC4J with Oracle9iAS WebCache. Refer
Oracle9iAS WebCache Administration and Deployment
Guide for more information.
Note: If OC4J has been already
configured for Oracle9iAS WebCache, then ignore this section.
Step 1. Start Oracle9
iAS WebCache Admin Tool using the browser. By default the administration
port is 4000.
Access the Admin tool on the browser using the URL
http://<hostname>:4000/webcacheadmin/
where <hostname> is the
machine on which Oracle9iAS is installed.
For example, http://incq221b.idc.oracle.com:4000/
Login as "administrator ". The default
password is 'administrator'.
Step 2. Configure the Application Server
- Click on 'Application Web Servers' option
under ' General Configuration'.
- Click the 'Add..' Button and enter the
Application Server Specific details and press 'Submit' Button.
Step 3: Setup the Listen Port, same as set in
Step 2.
- Go to 'Listening Ports' option under 'Cache-Specific
Configuration'.
- Click the 'Add..' Button
- Enter Listening IP Address
- IP Address can takes value 'ANY' or the IP Address of the Machine which
runs Oracle9iAS WebCache
- Enter Listening Port.
- The Listening Port on which Oracle9iAS WebCache will receive web
requests.
- Wallet is only required
for HTTPS Protocol.
- Click 'Submit' Button.
Step 4:
Set Site Definition
- Go to 'Site Definitions' option under
'General Configuration'.
- Click the 'Add Site..' Button
- Enter Host Name- Enter
the site's host name and domain name (hostname.domain), such as www.company.com.
- Enter Port Number. -
Enter the HTTP or HTTPS port number from which the Web site is listening
for incoming requests.
- Click 'Submit' Button.
Step 5. Set Site-to-Server Mapping.
- Go to 'Site to Server Mapping' option
under 'General Configuration'.
- Click the Insert Above..' Button after
selecting any of the sites listed.
- Select the radio button
'Select from Site Definitions'
- Select the Site Definition
just defined from the list.
- Select Application Web
Servers from the list provided.
- Click 'Submit' Button.
Step 6.Apply the changes
by clicking the 'Apply Changes' button. Choose "Web Cache
Operations" link
under "Administering Oracle Web Cache".Restart the Oracle9iAS
WebCache.
Step1. Make sure that the OC4J
server is up and running.
Step 2. Access the page on
the browser, using the url
http://<host_name>:<port>/CustomerModule/Main.jsp
where, <host_name> is
the machine on which OC4J is installed and <port> is the port on which
WebCache
listener is running.
For Example, http://incq221b.idc.oracle.com:1100/
CustomerModule/Main.jsp
The valid user ids for the
customers are 101 to 200.
This sample has
been tested against Oracle9iAS Containers for J2EE(OC4J) 9.0.2.0.0
Please enter your comments
about this sample in the OTN Sample
Code Discussion Forum .
|