Oracle 9iASW Location Sample
Table Of Contents
Introduction
This sample aims at bringing out the most important
features of the location API:
- Mobile Positioning
- Geocoding
- Routing
- Yellow Pages
The application encompasses all of the above by
automatically detecting the location of the mobile user and allowing him to find emergency services close to his
location.
Sample
Scenario
This sample illustrates how to use the location
APIs available in Oracle 9iASW.
This application automatically detects the location of the mobile user and allows him to find emergency services
close to his location. If the application is unable to determine the user's location, it prompts him to type in
the address. The user is prompted to choose between 'Hospitals' and 'Veterinary' services. He then enters a radius
in miles - the maximum distance he is willing to travel to reach the emergency service. The user is presented with
a list of businesses and the precise distance to each of them. He chooses a destination. The full address and the
telephone number of the destination is displayed along with a choice of getting driving directions to it. On proceeding,
the driving directions as a text narrative is displayed.
Software
Requirements
This software requirements for this sample are
as follows:
- iASW 1.1
- UP Simulator 3.2 or higher (downloadable from
www.openwave.com)
- Oracle HTTP Server
- Oracle 8.1.7 or higher
- JDK 1.2 or higher
User Interface
Diagram
The UI design is in the form of cards connected
in a workflow. Refer to the UI_diagram.html for the figure.
Installing
The Location Sample
Step 1. Unzip LocationSample_11.zip (in a directory say, D:\). This will create a folder iASWE-LocationSample
(D:\ iASWE-LocationSample). The directory structure for this sample will be as follows:

Once the zip file has been unzipped, further installation
steps consist of three parts:
Configuring
the Webserver
Step 2. Copy the folder iASWE-LocationSample at your apache's htdocs directory. (This should be the
server that is used by your iASW). Compile the java files in the directory 'samplelocation'
using 'javac *.java'
Step 3. Open jserv.properties file
If you have Oracle's HTTP server installed it will be present at <OracleApacheServerHome> \Apache\Jserv\Conf\. Edit the file by adding the following classpath.
wrapper.classpath=<OracleApacheServerHome>\Apache\Apache\htdocs\iASWE-LocationSample
Step 4. Open system.properties file
If you have iASW installed it will be present at <iASW
Home>\panama\server\classes\oracle\panama\core\admin.
Go to the section on hooks.
Comment the line - locator.listener.registration.hook.class=oracle.panama.rt.common.ListenerRegistration
Add the line -
locator.listener.registration.hook.class=samplelocation.ListenerRegistrationHookLocationSample
Go to the section on Event and Listeners.
Ensure that the value of this parameter is set to true:
event.service.begin=true
Step 5. Copy the following files to your <iASWHome>/panama/server/classes/oracle/panama/spatial/router/ directory
- Routers.xml
- MapInfoRouterImpl.class
- RoutingOption.class
- WebraskaRouterImpl$GeoNodeList.class
- WebraskaRouterImpl.class
Step 6. Copy the following files to your <iASWHome>/panama/server/ classes/oracle/panama/spatial/yp directory
- YPCategories.xml
- YPProviders.xml
Step 7. Stop apache and start it again.
Configuring
the iASW
Step 8. Run service designer, connect to your iASW as Administrator/manager.
(For more information on service designer refer to the 'Oracle
9i Application Server Wireless Edition - Implementation Guide').
Step 9. Navigate to your user node(the node that has been created for your services) under 'Service Trees'.
Step 10. Create a master service called - "LocationSample"
based on the URLAdapter(Note that the service should be named Location Sample).
Step 11. Edit the input parameters of the service. Enter the value for the 'URL' parameter as
http:// <iASWhostname:port>/iASWE-LocationSample/LocationSample.jsp?event=welcome_screen
Configuring
the personalization portal
Step 12. In the personalization portal(http://
<iASWhostname:port>/portal/Login.jsp),
login using your username and password. Set your default locationmark to
Company Name: Oracle Corporation
Address Line1: 500 Oracle Parkway
City: Redwood City
State: CA
Postal Code: 94065
Country: USA
Running
the Sample using the UP SIMULATOR
Step 13. Set the timeout to 300 seconds
Step 14. Run the Simulator
Step 15. Enter the URL http://<your
iASW host name>:<port>/ptg/rm
Step 16. Login using your username and password
Step 17. Click on the LocationSample service and run it.
IMPORTANT NOTE: Ensure that the proxy has
been set in the ProxyFirewall.properties
file located in the <iASWHome>\ptg\panama\server\classes\oracle\panama\core\admin directory.
About the
Location API
The Wireless Edition provides a set of location
application component APIs that enable developers to include geocoding, location marks, routing, and business directory
(yellow pages) components into the Wireless Edition applications. A brief introduction to these API's can be found
in the document on Introduction
to Location API's.
Description
Of Sample Files
|
Directory
|
Filename
|
Description
|
| doc |
Readme-LocationSample.html |
This file |
| UI_Diagram.html |
This is the user interface card diagram for the sample |
| providers/router |
Routers.xml |
This xml file gives information about the routing
service providers |
| MapInfoRouterImpl.class |
These are the third party provided classes that provides
the communication between iASW API's and the third party web site. |
| RoutingOption.class |
| WebraskaRouterImpl$GeoNodeList.class |
| WebraskaRouterImpl.class |
| providers/yp |
YPCategories.xml |
This xml file gives details of the various Yellow
Pages categories on which search can be specified. |
| YPProviders.xml |
This xml file gives details of the Yellow Pages providers |
| samplelocation |
ListenerRegistrationHookLocationSample.java |
This class registers/unregisters a sample implementation
of RequestListener |
| LocationUtilities.java |
This class contains utility methods for location based
services. |
| RequestListenerLocationSample.java |
This class implements a RequestListener. Its purpose
is to obtain the request object and write it to a shared area so that it can be accessed from other programs |
| |
Location Sample.jsp |
The User Interface is generated in this JSP |
Please enter your comments about this sample
in the OTN Sample Code Discussion Forum.
|