Skip Headers
Oracle® Database Lite Developer's Guide
10g (10.0.0)
Part No. B13788-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

12 Building Mobile Web Applications: A Tutorial

This tutorial guides you through the relevant phases of implementing a web application for mobile devices. Topics include:

12.1 Overview

Using a simple "To Do List" application, this tutorial guides you through the different phases of implementing a web application for mobile devices, with a detailed description of the creation, deployment, and administration phases. The To Do List application allows the user to maintain a list of To Do items. It maintains a status for each item indicating its completion and stores all items in the Oracle database. The To Do List application can be accessed by multiple users and displays their corresponding To Do items.

This overview is followed by five sections, each of which contains several topics that represent a unique phase in the life cycle of the To Do List application. When you complete each section, you can either review its contents, view related documentation, or proceed to the next one.

This tutorial uses a limited set of the functionality that is available. For a complete list of functionality and limitations, see Chapter 4, "Developing Mobile Web Applications". For more information on Oracle Database Lite concepts, refer the Oracle Database Lite Concepts Guide.

12.1.1 Before You Start

This tutorial assumes that you have installed and configured the Mobile Development Kit for Web-to-Go and the Mobile Server on the same computer. Before you start the tutorial, ensure that the development computer and the client computer meet the requirements specified below.

12.1.1.1 Development Computer Requirements

As Table 12-1 describes, the development computer must contain the following components.

Table 12-1 Development Computer Requirements

Requirement Description
Windows User Login The Windows login user on the development computer must be assigned ADMINISTRATOR privileges.
Installed Java Components Java Development Kit 1.3.1 or higher.
Installed Oracle Components Oracle Database 8.1.7 or higher.

Mobile Server (Oracle Database Lite CD-ROM)

The Mobile Development Kit for Web-to-Go (Oracle Database Lite CD-ROM)


12.1.1.2 Client Computer Requirements

The client computer is used to test your mobile web applications in online or offline mode. Using a browser, the client computer must connect to the Mobile Server over a network.

12.2 Developing the Application

This section describes how to develop and test the To Do List application, using the Mobile Development Kit for Web-to-Go. As Table 12-2 describes, the To Do List application contains the following components.

Table 12-2 To Do List Application Components

Component Function
Java Servlet Accesses the database and inserts To Do items.
Java Server Page (JSP) Provides the To Do List application user interface in HTML.
JavaBean Provides database access to the JSP.

The source code for the ToDoList application is installed along with the Mobile Development Kit. It can be found at the following location.

ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial

The javaServer Page

The To Do List JSP generates an HTML page which displays the list of items that must be completed. You can access the To Do List JSP from the following location.

ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial\ToDoList.jsp

The JavaBean

The To Do List JSP uses a JavaBean to perform operations with the Oracle database. You can access the To Do List JavaBean from the following location.

ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial\ToDoBean.java

The Java Servlet

The To Do List Java Servlet inserts a new To Do Item in the Oracle database, and uses the To Do List JSP to regenerate the HTML page. You can access the To Do List Java Servlet from the following location.

ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial\InsertToDo.java

In this section, the following tasks are discussed.

The Mobile Development Kit for Web-to-Go always uses Oracle Database Lite as the development database.

The Mobile Development Kit for Web-to-Go also uses a web server that is referred to as the Mobile Client Web Server.

12.2.1 Step 1: Creating Database Objects in Oracle Database Lite

In this step, you will create the To Do List application's database objects in Oracle Database Lite.

During the development phase, the To Do List application's servlet stores the To Do items in Oracle Database Lite. Later, during the deployment phase, you will copy the database objects from Oracle Database Lite to the Oracle database.

12.2.1.1 The To Do List Application Database Objects

The To Do List application uses the following database objects.

  1. The TODO_ITEMS table.

    The application stores To Do Items in this database table. As Table 12-3 describes, the To Do Items table contains the following columns.

    Table 12-3 The TODO_ITEMS Table

    Column Function
    ID Primary key
    TODO_ITEM Text describing the To Do item
    USERNAME Owner of the To Do item
    DONE Indicates whether or not the To Do item has been completed

  2. The TODO_SEQ sequence.

    Each time a user inserts a new record in the TODO_ITEMS table, the TODO_SEQ sequence generates a primary key value for the new record.

12.2.1.2 Required Action

Create the database objects in Oracle Database Lite using MSQL. MSQL is an interactive tool that allows you to execute SQL statements against Oracle Database Lite. It is similar to SQL*Plus. To create the database objects, you must run the SQL script named tutorial.sql. Using the Command Prompt, enter the following statements.

  1. cd ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial

  2. msql system/xyz@jdbc:polite:webtogo @tutorial.sql


Note:

MSQL requires a user name and password. Enter system as the User Name and substitute xyz with any alphanumeric string.

There is a mandatory space between webtogo and @tutorial.sql.


12.2.2 Step 2: Compiling the Application

In this step, you will compile the application by performing the following tasks.

  1. Set the CLASSPATH to include required libraries.

  2. Compile the Java Servlet and JavaBean.

  3. Install the JSP.

12.2.2.1 Required Action

  1. Set the CLASSPATH.

    You must set the CLASSPATH to include the required Java Servlet Development Kit and Mobile Server libraries. To include these libraries, this tutorial provides a script called setenv.bat. Using the Command Prompt, enter the following commands.

    cd ORACLE_HOME\mobile\sdk\wtgsdk\bin

    setenv.bat

  2. Compile the application.

    You can compile the application manually or by running the compile.bat script. To run the script, start the Command Prompt and enter the following commands.

    cd ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial

    compile.bat

    To compile the application manually, perform the following tasks.

    1. Compile the Java Servlet.

      Using the Command Prompt, enter the following commands.

      cd ORACLE_HOME\mobile\sdk\wtgsdk\src\tutorial

      javac -d ..\..\root\tutorial InsertToDo.java

      This creates the following servlet class file.

      ORACLE_HOME\mobile\sdk\wtgsdk\root\tutorial\InsertToDo.class

    2. Compile the Java Bean.

      Using the Command Prompt, enter the following command.

      javac -d ..\..\root\tutorial\WEB-INF\classes ToDoBean.java

    3. Install the JSP.

      Using the Command Prompt, enter the following command.

      copy ToDoList.jsp ORACLE_HOME\mobile\sdk\wtgsdk\root\tutorial\ToDoList.jsp

12.2.3 Step 3: Defining the Application and Registering the Servlet

In this step, you must perform the following tasks.

  • Use the Packaging Wizard to create the To Do List application.

  • Add application files.

  • Register the application's servlet with the Mobile Client Web Server.

In the development environment, every application and its associated servlets must be registered with the Mobile Client Web Server. You do not need to register the To Do List JSP or JavaBean.

12.2.3.1 The Packaging Wizard

As a mobile application developer, you can use the Packaging Wizard to create or modify Web-to-Go applications. During this tutorial, you will first run the Packaging Wizard in development mode and subsequently in regular mode. In development mode, you will use the Packaging Wizard to perform the following functions.

  • Define the Web-to-Go application

  • Add files

  • Compile JSP files

  • Register Servlets

Running the Packaging Wizard in development mode disables the panels that it uses exclusively during deployment. As you will publish the application to your local machine, you do not have to enter the application's connectivity or database information in the Packaging Wizard.

For more information on how to use the Packaging Wizard, refer the Oracle Database Lite Tools and Utilities Guide.

12.2.3.2 Required Action

Define the To Do List application and register its servlet by performing the following steps.

  1. Start the Packaging Wizard in debug mode. Using the Command Prompt, enter the following commands.

    cd ORACLE_HOME\mobile\sdk\bin

    wtgpack -d

    The Packaging Wizard appears and provides you with the option to create a new application, edit an existing application, delete an existing application, or open a packaged application, as displayed in Figure 12-1.


    Note:

    Deleting an existing application merely deletes the application from the XML file and does not remove the application from the Mobile Server.

    Figure 12-1 Make a Selection Dialog

    Use this dialog to create a new application.
  2. Select the Create a new application option and click OK.

  3. The Select a Platform panel appears. As Figure 12-2 displays, this panel enables you to specify the platform for your application. Select Oracle Lite WEB;US from the Available Platform list. Click Next.

    Figure 12-2 Selecting a Platform

    Use this dialog to select your mobile platform.
  4. As Figure 12-3 displays, the Application panel appears. Use the Application panel to modify To Do List application settings. As Table 12-4 describes, enter the specified values in the corresponding fields.

    Figure 12-3 Application Panel

    Use this dialog to describe your mobile application.

    Table 12-4 The To Do List Application Values

    Field Value
    Application Name ToDoList
    Virtual Path /tutorial
    Description This is the To Do List Application
    Application Classpath (Leave this field blank)
    Default page ToDoList.jsp (this is case sensitive)
    Local Application Directory ORACLE_HOME\mobile\sdk\wtgsdk\root\tutorial
    Publication Name (Leave this field blank)
    Icon tutorial.gif

  5. Click Next. As Figure 12-4 displays, the Files panel appears. Using the Files panel, you can select files that are part of the application. The Packaging Wizard uploads the selected files from the local application directory to the application repository on the Mobile Server.

    The Files panel identifies files that the Packaging Wizard uploads from the local application directory to the application repository on the Mobile Server.

    Figure 12-4 Uploading Application Files

    Use this dialog to compile JSP.
    Description of the illustration pw_files.gif

  6. Click Compile JSP. The Packaging Wizard compiles all your JSP files to Java Servlet classes. As Figure 12-5 displays, the following confirmation page appears.

    Figure 12-5 JSP Compilation Completion Message

    This dialog displays the JSP compilation completion message.
  7. As Figure 12-6 displays, the generated files are automatically added to the list of application files.

    Figure 12-6 Including Generated Files to Application Files

    Displays files that are added to your application.
  8. To view To Do List application servlets, click Next. To register with the Mobile Client Web Server, the Packaging Wizard automatically detects and selects servlets in your Local Application Directory. These servlets are registered with the Mobile Client Web Server.

    As Figure 12-7 displays, you can view the To Do List application's servlet in the Servlets panel. Since the To Do List application contains only one servlet, the Servlets panel displays a single line.

    The Servlets panel enables you to map virtual paths (servlet name) to the corresponding Java classes (servlet class).

    Change the servlet name to insert by selecting the field, which turns white when selected. The servlet name is case sensitive, and must be in lower case.


    Note:

    Ensure that you change the servlet name.

    Figure 12-7 Registering Servlets

    The servlets panel
    Description of the illustration pw_serv.gif

  9. At this stage, this tutorial does not use the other tabs that are displayed in the Packaging Wizard. Click Next till you arrive at the last panel, and click Finish.

12.2.4 Step 4: Conducting a Trial Run

In this step, you will conduct a trial run of the To Do List application by starting the Mobile Client Web Server on the development computer. You will then access the To Do List application by launching your web browser and connecting to the application's URL.

12.2.4.1 The Mobile Development Kit for Web-to-Go Web Server

The Mobile Client Web Server loads the To Do List application information and the Java servlet that you specified in the Packaging Wizard. Once started, you can access the Mobile Client Web Server from any web browser, by specifying the URL of the computer it resides on. The default port for the Mobile Client Web Server is 7070. You can configure the port used by the Mobile Client Web Server by changing the port entry in the webtogo.ora file. This file is located in the following directory.

ORACLE_HOME\mobile\sdk\bin\webtogo.ora

For more information on how to edit the webtogo.ora file, see Section 11.3, "Editing the webtogo.ora file," in the Oracle Database Lite Administration and Deployment Guide.

For additional information regarding configuration parameters in the webtogo.ora file, see Appendix B, "Mobile Server Configuration Parameters," in the Oracle Database Lite Administration and Deployment Guide.

12.2.4.2 Required Action

Run the To Do List application by performing the following steps.

  1. Start the Mobile Client Web Server.

    Using the Command Prompt, enter the following.

    cd ORACLE_HOME\mobile\sdk\bin

    wtgdebug.exe

    The Mobile Client Web Server starts and reports which servlets are loaded. If your servlets contain any System.out.println() statements, the messages appear in this window.

  2. Start your web browser and connect to the following URL.

    http://<your_machine>:7070

    As Figure 12-8 displays, the browser displays the list of applications currently known to the Web-to-Go system.

    Figure 12-8 Available Applications Page

    The available applications page
    Description of the illustration moclwese.gif

    Table 12-5 describes the Available Applications page.

    Table 12-5 List of Available Applications Description

    Application Description
    Sample 4 The Hello Applet illustrates how applets and servlets can communicate with each other. The application is located in the following directory.

    ORACLE_HOME\mobile\sdk\wtgsdk\root\sample4

    Sample 6 The Image Gallery shows how to store binary data in the database without using the LONG datatype. The application is located in the following directory.

    ORACLE_HOME\mobile\sdk\wtgsdk\root\sample6

    To Do List The application that you have added to the Mobile Client Web Server in Step 4.
    Sample 1 The Hello World servlet is an example of a basic servlet. The application is located in the following directory.

    ORACLE_HOME\mobile\sdk\wtgsdk\root\sample1

    ServletRunner The default application containing all published servlets that are not assigned to an application.
    Sample 3 The Recording Tracker demonstrates how servlets can be used to maintain a database with recording information. The application is located in the following directory.

    ORACLE_HOME\mobile\sdk\wtgsdk\root\sample3

    Sample 7 The Employee Data Applet demonstrates the use of JDBC inside an applet. The application is located in the following directory.

    ORACLE_HOME\mobile\sdk\wtgsdk\root\sample7


  3. Click the To Do List application. A new browser window displays the following information.

    • The list of incomplete To Do items.

    • A simple HTML form that you can use to create new To Do items.

    All incomplete To Do items are preceded by the letter 'X'. When you click 'X', the To Do List application flags the item as complete and removes the item from the list.

12.3 Packaging the Application

This section describes how to package the application and prepare it for publishing to the Mobile Server. In this section, you will perform the following tasks.

12.3.1 Step 1: Defining the Application

In this step, you select and describe the To Do List application using the Packaging Wizard.

12.3.1.1 The Packaging Wizard

Using the Packaging Wizard, you can create or modify a Web-to-Go application and publish it to the Mobile Server. In this tutorial, you will use the Packaging Wizard to complete Steps 4 through 8 of the development phase.

12.3.1.2 Required Action

Select and describe the To Do List application by launching the Packaging Wizard in regular mode.

  1. Using the Command Prompt, enter the following.

    1. cd ORACLE_HOME\mobile\sdk\bin

    2. wtgpack

      The Packaging Wizard appears.

  2. Choose Edit an existing application and select the To Do List application from the list displayed.

  3. Click OK. The Platforms panel appears. As Figure 12-9 displays, the Platforms panel contains the same information that you entered in Section 12.2.3, "Step 3: Defining the Application and Registering the Servlet".

    Figure 12-9 Selecting a Platform

    Use this dialog to select a mobile platform.
  4. Click the Application tab. As Figure 12-10 displays, the Application tab contains the same information that you entered in Section 12.2.3, "Step 3: Defining the Application and Registering the Servlet".

    Figure 12-10 Application Description Panel

    Use this panel to describe your mobile application.
  5. Describe the To Do List application by performing the following steps.

    1. As Table 12-6 describes, verify that the specified values in the following fields are correct.

      Table 12-6 Application Panel Description

      Field Value
      Application Name ToDoList
      Virtual Path /tutorial
      Description This is the To Do List Application
      Application Classpath
      Default Page ToDoList.jsp
      Local Application Directory ORACLE_HOME\mobile\sdk\wtgsdk\root\tutorial
      Publication Name
      Icon tutorial.gif

    2. Click the Files tab. The Packaging Wizard automatically includes all files to the application.

    3. Click the Servlets tab. The Servlets tab appears.

    4. Click the Database tab. The Database tab appears.

12.3.2 Step 2: Specifying Database Details

In this step, you will specify the Client Side Database Name.

Figure 12-11 displays the Database tab.

The Database Name refers to the database file and the corresponding DSN that will be created for this application on the Mobile Client for Web-to-Go.

12.3.2.1 Required Action

Enter todo as the Client Side Database Name.

Click the Snapshots tab.


Note:

This tutorial skips Roles because the tutorial application does not use any special roles.

The Roles tab enables the developer to define roles for the Web-to-Go application. In general, the developer must build application roles into the Web-to-Go application, because they do not occur automatically. For more information on how to build application roles, see Chapter 4, "Developing Mobile Web Applications", Section 4.2.2, "Application Roles".


12.3.3 Step 3: Defining the Snapshot

In this step, you will deploy the To Do List application's database schema objects using the Packaging Wizard.

12.3.3.1 The Snapshots Tab

The Snapshots tab defines database tables for which you will create snapshots. Using the Packaging Wizard, you can import the table definitions from the development database. These definitions can then be used to define the snapshots for the mobile application.

Figure 12-12 displays the Snapshots tab.

Figure 12-12 Snapshots Tab

Use this tab to view your chosen snapshot.

12.3.3.2 Required Action

In the Snapshots tab, import the table definition from the development database by performing the following steps.

  1. Click Import. As Figure 12-13 displays, the Connect to Database dialog appears. As Table 12-7 describes, enter the following information in the corresponding fields.

    Figure 12-13 Connect to Database Dialog

    Use this dialog to specify your connection to the database.

    Table 12-7 Connect to Database Dialog Description

    Field Value
    User Name system
    Password Enter your database password
    URL jdbc:polite:webtogo


    Note:

    Importing a table definition within the Packaging Wizard caches the JDBC Connection information. You cannot re-import a table definition using a different Connect String as the same connection information is used and cannot be modified.

  2. Click OK. As Figure 12-14 displays, the Tables dialog appears and displays a list of available tables.

    Figure 12-14 Tables Dialog

    Use this dialog to select the to do items table.
  3. Select the TODO_ITEMS table, click Add, and click Close. The TODO_ITEMS snapshot appears in the Tables dialog. To view the SQL statement for the snapshots template, double-click TODO_ITEMS.

  4. Select the SQL statement and click Edit. As Figure 12-15 displays, the Edit Snapshots panel appears.

    Figure 12-15 Edit Snapshots Panel - Server Tab

    change the order in which snapshots are refreshed
    Description of the illustration pw_edsnap.gif

  5. Change the weight to 1. This parameter controls the order in which snapshots are refreshed on the client.

  6. Change the Owner to master. The Packaging Wizard seeks your confirmation to change the owner for all the templates. Click OK.

  7. Click the Oracle Lite WEB;US tab. Select the Create on client box. Re-enter the SQL statement in the Template field as given below, and click OK.

    SELECT * FROM MASTER.TODO_ITEMS WHERE USERNAME = :USERNAME
    
    

    Figure 12-16 displays the SQL statement in the Template field.

    Figure 12-16 Edit Snapshots Panel

    Use this dialog to specify your SQL statement.

12.3.4 Step 4: Defining Sequences

The Sequences panel defines sequences that Web-to-Go creates for your client's applications in offline mode. In this step, you create a new definition of the TODO_SEQ sequence which the To Do List application uses in offline mode. Later on, you will create the actual sequences in the Oracle database. During synchronization, Web-to-Go automatically creates a local copy of the TODO_SEQ sequence on your client.

  1. Click the Sequences tab. The Sequences panel appears as displayed in Figure 12-17. Using the Sequences tab, you can list database sequences for Web-to-Go applications. To specify how Web-to-Go creates sequences on the Mobile Client for Web-to-Go, you can include sequence definitions. These sequences must exist in the database prior to performing this step.

    Figure 12-17 Sequences Tab

    Use this dialog to include sequence definitions.
  2. Click Import. As Figure 12-18 displays, the Sequences dialog appears displaying a list of available sequences.

    Figure 12-18 Sequences Dialog

    Use this dialog to choose your application sequence.
  3. Select the TODO_SEQ sequence. Click Add and click Close.

  4. Click OK. The Application Definition Completed panel appears, as displayed in Figure 12-19.

    Figure 12-19 Application Definition Completed Dialog

    Specify application definition requirements.

Note:

This tutorial application does not use DDLs and therefore skips the DDLs tab.

12.3.5 Step 5: Creating SQL Files for the Application

Using the Application Definition Completed panel, you can create SQL files for the To Do List application.

12.3.5.1 Required Action

Select the Create files option and select the Generate SQL scripts for database objects box. Click OK.

This action generates SQL scripts for database objects.

The Packaging Wizard places the specified files in the following directory.

ORACLE_HOME\mobile\sdk\wtgsdk\root\tutorial\sql

Table 12-8 describes the SQL scripts.

Table 12-8 SQL Scripts for Database Objects

File Description
ToDoList.sql The master script that calls other SQL scripts.
tables.sql The script that creates all SQL tables.
sequences.sql The script that creates the Sequences.
ddls.sql This file is empty because no DLLs are defined.

12.3.6 Step 6: Package the Application

Using the Application Definition Completed panel, you can package the To Do List application into a jar file.

12.3.6.1 Required Action

The Application Definition Completed Dialog remains open for you to initiate application packaging.

  1. Select the Create files option and select the Package Application into a JAR file box. Ensure that you select the Generate SQL scripts for database objects box.

  2. At this stage, the Save the Application dialog prompts you for the name of the jar file, as Figure 12-20 displays. The default location is given below.

    ORACLE_HOME\Mobile\Sdk\wtgsdk\root\ToDoList.jar

    Figure 12-20 Save the Application Dialog

    Use this dialog to locate your jar file.

    After choosing the JAR file, the jar file is created and contains the application files and definition.

    You have now completed all development tasks that are required for packaging your application. Your application is packaged.

12.4 Publishing the Application

After packaging your application, you are ready to publish it. The following sections describe the steps for publishing the application.

12.4.1 Step1: Create the Table Owner Account

In this step, you will create the database user who will own the To Do List application objects in the Oracle database. If you have installed the samples during your Mobile Server installation, you can skip this step and continue with the next step. If you have not installed the samples, enter the following commands using the Command Prompt.

sqlplus system/manager@webtogo.world

create user master identified by master;

grant connect, resource to master;

12.4.2 Step 2: Create the Database Objects in the Oracle Database

In this step, you create database objects of the To Do List application in the Oracle database.

12.4.2.1 Required Action

Run the SQL master script and enter the following using the Command Prompt.

cd ORACLE_HOME\mobile\sdk\wtgsdk\root\tutorial\sql

sqlplus master/master@webtogo.world @ToDoList.sql

This script performs the following actions on the Oracle database.

  • Creates the TODO_ITEMS table.

  • Creates the TODO_SEQUENCE sequence.

12.4.3 Step 3: Start the Mobile Server

In this step, you start the Mobile Server.

12.4.3.1 Required Action

To start the Mobile Server, perform the following steps.

  1. Using the Command Prompt, go to the following directory.

    ORACLE_HOME\mobile_oc4j\j2ee\home


    Note:

    Mobile Servers installed on iAS can access the ORACLE_HOME\j2ee\home directory.

  2. To start the Mobile Server for the first time and subsequent occasions, enter the following command.

    java -jar oc4j.jar

12.4.4 Step 4: Log on to the Mobile Server and Start the Mobile Manager

In this step, you will log on to the Mobile Server and start the Mobile Manager.

12.4.4.1 Required Action

To start the Mobile Manager, perform the following steps.

  1. Start your web browser and connect to the Mobile Server by enter the following URL.

    http://<mobile_server>/webtogo


    Note:

    Replace the <mobile_server> variable with the host name of your Mobile Server.

  2. Log on as the Mobile Server Administrator using administrator as the User Name and admin as the Password. As Figure 12-21 displays, the Mobile Manager link appears in the workspace.

    Figure 12-21 Launching the Mobile Manager

    This image displays the Mobile Manager.
  3. To launch the Mobile Manager, click the Mobile Manager link in the workspace. As Figure 12-22 displays, the Mobile Server Farms page appears.

    Figure 12-22 Mobile Server Farms Page

    The Mobile Server farms page
    Description of the illustration ms_farm.gif

  4. Click your Mobile Server link. As Figure 12-23 displays, the corresponding Mobile Server home page appears.

    Figure 12-23 Mobile Server Home Page

    This image displays the Mobile Server home page.

12.4.5 Step 5: Upload the Application

In this step, you upload the jar file containing the To Do List application.

12.4.5.1 Required Action

To upload an application to the Mobile Server, perform the following steps.

  1. Click the Applications link. As Figure 12-24 displays, the Applications page appears.

    Figure 12-24 Applications Page

    The applications page
    Description of the illustration ms_apps.gif

  2. Click Publish Application. As Figure 12-25 displays, the Publish Application page appears.

    Figure 12-25 Publish Application Page

    Publish your application
    Description of the illustration ms_pub.gif

  3. Enter /tutorial as the value for the repository directory.

  4. Select the Packaging Wizard JAR File option.

  5. Using the Browse button, locate the jar file which you created in Section 12.3.6, "Step 6: Package the Application". The default location of the jar file is given below.

    ORACLE_HOME\Mobile\sdk\wtgsdk\root\ToDoList.jar

  6. To upload the application, click Upload.

    At this stage, your application is published.


    Note:

    You will set the application properties in the following Section 12.5.3, "Step 3: Setting Application Properties".

12.5 Administering the Application

This section describes how to administer the application that you created and deployed. In this section, you will perform the following tasks.

For more information about Mobile Manager tasks described in this tutorial, see the Oracle Database Lite Administration and Deployment Guide.

12.5.1 Step 1: Starting the Mobile Manager

In this step, you will start the Mobile Manager. This web based application enables you to easily administer Mobile Server applications.

12.5.1.1 Required Action

To start the Mobile Manager, perform the following steps.

  1. Start your web browser and connect to the Mobile Server by entering the following URL.

    http://<mobile_server>/webtogo


    Note:

    Replace the <mobile_server> variable with the host name of your Mobile Server.

  2. Log in as the Mobile Server administrator using administrator as the User Name and admin as the Password.

  3. To launch the Mobile Manager, click the Mobile Manager link in the workspace. The Mobile Server farms page appears. Click your Mobile Server link. Your Mobile Server home page appears.

12.5.2 Step 2: Using the Mobile Manager to Create a New User

In this step, you will create a new user.

12.5.2.1 Required Action

To create a new Mobile Server user, perform the following steps.

  1. On the Mobile Manager home page, click the Users link. As Figure 12-26 displays, the Users page appears.

  2. Click Add User. As Figure 12-27 displays, the Add User page appears.

  3. As described in Table 12-9, enter the following information in the Add User page and click Save.

    Table 12-9 Add User Page Description

    Field Value
    Display Name tutorial
    User Name tutorial
    Password tutorial
    Password Confirm tutorial
    Privilege User

12.5.3 Step 3: Setting Application Properties

In this step, you will set the To Do List application's properties.

12.5.3.1 Required Action

To set the To Do List application's properties, perform the following steps.

  1. On Mobile Manager home page, click the Applications link. The Applications page appears.

  2. To search for the application that you just published, enter To Do List in the Application Name field and click Search. The To Do List application appears in the workspace.


    Note:

    To display all the available applications, leave the search field blank and click Search. This action generates a list of all the available Mobile Server applications in the workspace.

  3. Click the To Do List application link. As Figure 12-28 displays, the Application Properties page lists application properties and database connectivity details.

    Figure 12-28 Application Properties Page

    The application properties page
    Description of the illustration app_prop.gif

  4. In the Database Password field type master. This is the default password for the Web-to-Go demo schema. Click Apply. The Mobile Manager displays a confirmation message.

12.5.4 Step 4: Granting User Access to the Application

In this step, you grant the user TUTORIAL access to the To Do List application.

12.5.4.1 Required Action

To grant the user TUTORIAL access to the To Do List application, perform the following steps.

  1. Navigate to the Application Properties page and click the Access link. As Figure 12-29 displays, the Access page lists groups and users that are associated with the application. The check boxes on this page indicate whether or not the user or group has access to the application.

  2. Under the Users table, locate the user TUTORIAL and select the check box displayed against the user, TUTORIAL.

  3. Click Save. The Mobile Manager displays a confirmation message. The user TUTORIAL has now been granted access to the To Do List application.

12.5.5 Step 5: Defining Snapshot Template Values for the User

In this step, you will define the snapshot template variable for the user, TUTORIAL. Each Mobile Client for Web-to-Go downloads the same application data when it synchronizes. In some cases, you may want to specify the data your application downloads for each user. You can accomplish this by modifying the user's snapshot template variable.

12.5.5.1 Required Action

To modify a user's Data Subsetting parameters, perform the following steps.

  1. Navigate to the Applications page and click the ToDoList application link. The Application Properties page appears. Click the Data Subsetting link. As Figure 12-30 displays, the Data Subsetting page appears.

    Figure 12-30 Data Subsetting Page

    The data subsetting page
    Description of the illustration td_datsub.gif

  2. Under the User Name column, click the user name link TUTORIAL. As Figure 12-31 displays, the Data Subsetting Parameters page appears.

    Figure 12-31 Data Subsetting Parameters Page

    The Data Subsetting parameters page
    Description of the illustration td_dsub.gif

  3. Select the Parameter Name and enter the value TUTORIAL. Click Save.

For more information about Snapshots, refer the Oracle Database Lite Administration and Deployment Guide.

At this stage, you have successfully administered the To Do List Application.

12.6 Running the Application on the Mobile Client for Web-to-Go

This section describes how to use the application that you created and tested in the Development section, deployed in the Deployment section, and then administered in the Administration section. In this section, you will perform the following tasks.

12.6.1 Step 1: Installing the Mobile Client for Web-to-Go

This section describes how to use the application that you created and deployed.


Note:

You must install the Mobile Client on a machine which does not host the Mobile Server installation.

12.6.1.1 Required Action

To install the Mobile Client for Web-to-Go, perform the following actions.

  1. Start your web browser and connect to the Mobile Server by entering the following URL.

    http://<mobile_server>/webtogo/setup

  2. As Figure 12-32 displays, the Mobile Client Setup page lists a set of mobile clients by platform. To download the Mobile Client for Web-to-Go setup program, click the corresponding Mobile Client link.

    Figure 12-32 Mobile Client Setup Page

    The Mobile Client setup page
    Description of the illustration mc_setup.gif


    Note:

    While installing the Mobile Client, you will be prompted for the User name and Password. Enter administrator as the user name and admin as the password.

  3. If you are using Netscape, choose a location to save the setup program and click OK. In Windows Explorer, double-click setup.exe to run the setup program.

    If you are using Internet Explorer, run the setup program from your browser window.

  4. While installing the Mobile Client, you will be prompted for the user name and password. Enter administrator as the User Name and admin as the password.

  5. The setup program prompts you to choose an installation directory such as D:\mobileclient and downloads all the required components and starts the Mobile Client for Web-to-Go on your machine. After completing the installation, the Mobile Manager login page appears as Figure 12-33 displays.

    Figure 12-33 Mobile Manager Login Page

    enter your user name and password.
    Description of the illustration wtglogin.gif

12.6.2 Step 2: Logging into the Mobile Client for Web-to-Go

In this step, you will complete the Mobile Client for Web-to-Go setup process.

12.6.2.1 Required Action

Your browser displays the Web-to-Go logon page. If your browser does not display the Web-to-Go login page, enter the following URL.

http://localhost/webtogo

  1. Log on to Web-to-Go using tutorial as the User Name and tutorial as the password.

  2. As you are logging into the Mobile Client for Web-to-Go for the first time, you must complete the initial setup process. The client initialization page appears and displays a confirmation message. "The Web-to-Go Client was installed successfully! Web-to-Go client will now synchronize your computer with the Mobile Server."

  3. To start downloading your applications and data, click Next. The data synchronization page appears. This page displays the data synchronization status.

  4. Once the synchronization process is finished, the Mobile Client for Web-to-Go is restarted automatically. The Mobile Server displays the following message: "New or updated application files have been downloaded. Please wait while Mobile Client for Web-to-Go is being restarted."

  5. After restarting the Mobile Client for Web-to-Go, the workspace portal appears with a single icon for the To Do List application and a link labeled ToDoList, as Figure 12-34 displays.

    Figure 12-34 Completion of the Synchronization Process

    The completion of the synchronization process.
  6. Click the To Do List application icon. As Figure 12-35 displays, Web-to-Go launches the To Do List application in your browser.

    Figure 12-35 The To Do List Application

    The To Do Items page that you created using this tutorial.
  7. Enter a new To Do item and save it in the database. Click Add.

  8. Exit the application by closing the browser window. This action returns you to the workspace.

12.6.3 Step 3: Synchronizing the Mobile Client for Web-to-Go

In this step, you synchronize the Mobile Client for Web-to-Go.

12.6.3.1 Required Action

To synchronize the Mobile Client for Web-to-Go with the Mobile Server, perform the following steps.

  1. As Figure 12-36 displays, click the Sync tab in the upper right corner of the workspace.

Figure 12-36 Sync Tab Location

This image displays the Sync tab’s location.

The Mobile Client for Web-to-Go synchronizes the application and all of your data to the Oracle 10g Database. The workspace appears when the synchronization process has completed.