Sample Demonstrating Location and Customization Features in Wireless Application

Table of Contents

Overview of the Sample Application

Back To Top

Oracle9iAS Wireless presents a framework to develop mobile applications to be accessed "from anywhere, from any device, using any protocol". Additionally, Wireless includes many advanced services of which location-based services and customization (preset) features are demonstrated in this sample application. For more information on Oracle9iAS Wireless Server, click here.

The Location Service provides pre-built location applications and a location framework for developing and managing location aware applications. Support for leading position servers and map data suppliers is available. Customization is needed to make applications manageable by understanding visitor's needs based on their roles and preferences.

This sample illustrates how to use the location and customization features of Oracle9iAS Wireless Server. These features are demonstrated using the scenario of Theater System. After a user logs into the application, different options will be displayed. These options include Display theaters in Selected Cities and Display preselected theaters. On selecting the Display theaters in Selected Cities option, the application asks for the name of a city. On entering a City, all the theaters present in that city will be displayed. The user can also view the address of the theater and map of the locality surrounding the theater.
If the user is interested in a paricular theater, he/she can select and save that theater to his presets. User can even remove an existing theater from his/her presets.

Required Software

Back To Top

1) Oracle9iAS Enterprise Edition Release 2 v9.0.2 (Can be downloaded from here).

2) Device simulators like Nokia Mobile Internet Toolkit. Information on other device simulators supported by Oracle9iAS is present here.

3) Oracle9i Database Release 9.2.0.1.0 - Production (and above) downloadable from here

Notations used

Back To Top

This section describes the terms used in the document.

Notation Description
<IAS_HOME> This value will be the directory where iAS middle-tier has been installed. For example, D:/iAS.
<SAMPLE_HOME> Directory where this sample resides. For example, if <X> is the directory where the sample was extracted, then <X>/LocationSample would be the value of this Notation.

 

Installation

Back To Top

Step 1. Unjar the provided LocationSample.jar using the following command

> jar xvf LocationSample.jar

Step 2. Setup the database. Connect to your database as user SYS. Now, create a user YP using the following command

SQL > GRANT CONNECT,RESOURCE TO YP IDENTIFIED BY YP;

Step 3. Now, import the provided dump file (YP.dmp) in the YP schema. On command prompt, please type the command.

> imp userid=yp/yp@<TNS_NAME> file=<SAMPLE_HOME>/providers/YP.dmp grants=n full=y

where <TNS_NAME> - TNS name of the database where the YP user was created

This will install the required tables for YP Provider.

Step 4. Now, we will copy the classes required for configuring the Location Provider. These classes are provided by Oracle for demoing purposes only and should not be used in production environment. Copy all class files from <SAMPLE_HOME>/providers/geocoder to <IAS_HOME>/wireless/server/classes/oracle/panama/spatial/core/geocoder. If the mentioned folder does not exist within <IAS_HOME>, please create and then copy the class files.
These files are required to configure the Geocoder provider. The configuration parameters needed during installation are

Name = eLocation
Provider Impl = oracle.panama.spatial.core.geocoder.GeocoderImplXMLProviderFor20
URL = http://elocation.oracle.com/elocation/lbs
Locale = ;US;unknown

Please go through the viewlet to learn how to configure the Wireless Server to use this proxy.

Step 5. Copy all class files from <SAMPLE_HOME>/providers/mapper to <IAS_HOME>/wireless/server/classes/oracle/panama/spatial/core/mapper. Again, if the mentioned folder does not exist within <IAS_HOME>, please create and then copy the class files.
These classes are required for configuring the Mapping Provider. The configuration parameters needed during installation are


Name = eLocation
Provider Impl = oracle.panama.spatial.core.mapper.MapperImplXMLProviderFor20
URL = http://elocation.oracle.com/elocation/lbs
Parameter = us_base
Locale = ;US;DE;unknown

Please go through the viewlet to learn how to configure the Wireless Server to use this proxy.

Step 6. The Configuration parameters for YP Proxy are

Name = DBCA
Provider Impl = oracle.panama.spatial.core.yp.YPFinderImplDBFast
URL = jdbc:oracle:thin:@incq109b.idc.oracle.com:1521:otn
Username = yp
Password = yp
Parameters = US;CA;;;-124.302777;117.357300;34.112865;42.004170;DEMOPROVIDER;COMPANY_NAME;ADDRESS;CITY;
             STATE_ABBREVIATION;ZIP_CODE;ZIP_PLUS_4;LONGITUDE;LATITUDE;PHONE;COUNTRY

Here URL format should be jdbc:oracle:thin:@<DB_MACHINE>:<DB_PORT>:<DB_SID>
where <DB_MACHINE> - Name of the machine where the database is installed
           <DB_PORT> - Port on which the database listens
           <DB_SID> - SID of the database
Provide the above parameters for the database where the YP user was created in Step 2.

Please go through the viewlet to learn how to configure the Wireless Server to use this proxy.

Step 7. Copy LocationTags.tld from <IAS_HOME>/wireless/sample/sampleadapter/spatial/jsp to <SAMPLE_HOME>/code/jsp/tlds.

Step 8. On Command Prompt, navigate to the directory <SAMPLE_HOME>/code. Add <IAS_HOME>/wireless/lib/wireless.jar to the classpath.

Step 9. On Command Prompt, run the following commands in the given order

> javac -d jsp/WEB-INF/classes src/*.java
> jar cvfM LocationSample.war -C jsp .
> jar cvfM Location.ear LocationSample.war META-INF

This will create a file Location.ear in the <SAMPLE_HOME>/code directory.

Step 10. Now, we will configure and deploy the application to Oracle9iAS Wireless server. To do this, go through the viewlet located here.

Running the Application

Back To Top

Check the viewlet present here to know how to run the sample application.

Description of Sample Files

Back To Top

The directory structure of the deliverable LocationSample.jar is as shown below. Only the important files are mentioned here.

Directory Files Description
<SAMPLE_HOME>/docs Readme.html This file
<SAMPLE_HOME>/code/src PresetInfo.java This file contains the methods to create, delete and retrieve presets.
XMLEncoder.java This file helps to escape the characters which cannot be displayed as is in an XML file.
<SAMPLE_HOME>/code/jsp Options.jsp This is the Home page of the application. It displays all the available options to the user.
PreselectedTheaters.jsp This file displays all the theaters which are already selected by the user.
AllTheaters.jsp This file retrieves and displays the details of all the theaters present in the entered location. The user can also add or delete a theater to his/her presets through this JSP.
Address.jsp This file displays the address of the selected theater.
Map.jsp This file displays the map around the selected theater.
<SAMPLE_HOME>/providers This directory has the required classes to configure the Location Proxies.

 


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