|
Oracle9i Lite Developer's Guide for Web-to-Go
Release 5.0.2 Part No. A97671-01 |
|
This chapter provides instructions for defining Web-to-Go applications and packaging them in preparation for them to be published by the administrator. Topics include:
Section 5.2, "Using Sequence Support for Disconnected Clients"
Section 5.4, "Support for the web.xml Format"
After you develop the Web-to-Go application, you define it using the Packaging Wizard. The Packaging Wizard packages application files and application meta data, and uploads them to the Mobile Server Repository. Before you can use the Packaging Wizard, you must first understand the different types of sequences that you can assign to a disconnected application. You must also configure Oracle database tables for advanced replication.
Many database applications use sequences to generate unique identifiers. Using sequence support, Web-to-Go applications can generate unique primary key values when inserting new records in a database table. In offline mode, sequence support enables each Mobile Client for Web-to-Go to generate primary key values that are unique across all clients.
Web-to-Go determines unique primary key values for Mobile Clients for Web-to-Go by creating sequences for them when these clients synchronize with the Mobile Server. Web-to-Go ensures that each sequence contains a set of unique numbers by using the Window sequence.
Web-to-Go maintains sequences based on sequence definitions. The developer creates the sequence definition and publishes it to the Mobile Server using the Packaging Wizard. Web-to-Go then creates the sequence locally by executing a SQL statement based on the sequence definition. However, you must create the sequence objects on the Oracle database yourself. You can create the sequence objects on the Oracle database by executing the SQL CREATE SEQUENCE statement. In addition, the Packaging Wizard can define sequence support for offline Web-to-Go applications.
The Window sequence assigns a unique range of values to each client. The range of values never overlaps with those of other clients. When a client uses all the values in the range of its sequence, Web-to-Go recreates the sequence with a new, unique range of values. Web-to-Go only recreates the sequence when the client synchronizes with the Mobile Server.
For each window sequence, Web-to-Go defines a threshold containing the minimum number of available sequence numbers it requires. When a client synchronizes with the Mobile Server, Web-to-Go checks if its sequence range is still larger than the threshold value. If it is not, Web-to-Go automatically recreates the sequence with a new, unique range of values.
The following example assigns the Window sequence to two clients.
| Client | Sequence Range |
|---|---|
| Client 1 | 1-10 |
| Client 2 | 11-20 |
When Client 1 runs out of values, Web-to-Go recreates the sequence with a new window containing unique values such as: 21, 22,..., 30.
Web-to-Go creates and maintains the Window sequence on the client based on the sequence definition in the Mobile Server Repository. For example, assume that the Mobile Server Repository contains the following Window sequence definition:
| Sequence Parameter | Definition |
|---|---|
| NAME | AUDIODB_SEQ |
| TYPE | WINDOW |
| START_VALUE | 1 |
| INCREMENT | 1 |
| WINDOW_SIZE | 200 |
| THRESHOLD | 25 |
When the first client disconnects and is in offline mode, Web-to-Go creates the sequence locally by executing the following SQL statement:
CREATE SEQUENCE audiodb_seq START WITH 1 MAXVALUE 200 INCREMENT BY 1;
When the second client disconnects and is in offline mode, Web-to-Go creates the sequence locally by executing the following SQL statement:
CREATE SEQUENCE audiodb_seq START WITH 201 MAXVALUE 400 INCREMENT BY 1;
Web-to-Go keeps track of the number of assigned windows to ensure that each client has a unique range. When the first client's sequence exceeds 175, its available range drops below the specified threshold of 25. Web-to-Go detects this situation and recreates the sequence the next time the client synchronizes with the Mobile Server. Web-to-Go accomplishes this by executing the following SQL statements:
DROP SEQUENCE audiodb_seq;
CREATE SEQUENCE audiodb_seq START WITH 401 MAXVALUE 600 INCREMENT BY 1;
In online mode, all users can share the same sequence. This sequence must have a range of values that supports a large number of users and does not overlap with the range of values assigned to users in offline mode. You can meet these requirements by using one of the following methods:
Reserve a large window for the Oracle sequence and allow disconnected clients to create sequences above this value.
Reserve the odd sequence numbers for online mode, and the even sequence numbers for offline mode. This method requires a sequence increment of two to ensure uniqueness of the sequence numbers.
To reserve a large window from 1 to 100000000 for the Oracle database sequence, execute the following SQL statement:
CREATE SEQUENCE audiodb_seq START WITH 1 MAXVALUE 100000000 INCREMENT BY 1;
Web-to-Go must assign disconnected clients sequence numbers that begin at least one increment higher than the window reserved for online users. If the window reserved for online users has a range from 1 to 100000000 then the first window assigned to a disconnected user must have a start value of 100000001 or higher. The following example defines window sequences to two clients whose start values account for the large window sequence already reserved for the Oracle database:
| Sequence Parameter | Definition |
|---|---|
| NAME | AUDIODB_SEQ |
| TYPE | WINDOW |
| START_VALUE | 100000001 |
| INCREMENT | 1 |
| WINDOW_SIZE | 200 |
| THRESHOLD | 25 |
| Client | Sequence Range |
|---|---|
| Client 1 | 100000001 - 100000200 |
| Client 2 | 100000201 - 100000400 |
You can provide unique sequence values for online and offline mode by assigning each mode with either odd or even sequence numbers and an identical increment value. The following procedure reserves a window with odd sequence numbers for online mode and a window with even sequence numbers for offline mode.
Execute the following SQL statement on the Oracle database server:
CREATE SEQUENCE audiodb_seq START WITH 1 INCREMENT BY 2;
Enter the following sequence definitions in the Packaging Wizard:
| Sequence Parameter | Definition |
|---|---|
| NAME | AUDIODB_SEQ |
| TYPE | WINDOW |
| START_VALUE | 2 |
| INCREMENT | 2 |
| WINDOW_SIZE | 200 |
| THRESHOLD | 25 |
When you use this method, the range of the online sequence is only limited by the maximum size of an Oracle sequence number, which is approximately 1026. For offline clients, the WINDOW_SIZE and THRESHOLD parameters do not take the increment steps into account. In step 2, the disconnected clients only have 100 (200/2) possible sequence values before they need to recreate a sequence.
The Packaging Wizard is a graphical tool that you can use to perform the following:
Create and publish a new Web-to-Go application.
Edit an existing Web-to-Go application.
Package a Web-to-Go application for easy deployment.
Publish a Web-to-Go application to the Mobile Server Repository.
When you create a new Web-to-Go application, you define its components and publish them to the Mobile Server Repository. In some cases you may want to edit the definition of an existing Web-to-Go application's components. For example, if you develop a new servlet for your application, you can use the Packaging Wizard to add the servlet to your application definition and then publish the modified application to the Mobile Server Repository. The Packaging Wizard also enables you to package application components in a .jar file for easy deployment.
Additionally, the Packaging Wizard supports the Web Application Archive (WAR) file format including the web.xml descriptor file. See Section 5.4, "Support for the web.xml Format" for information on the web.xml descriptor format. WAR files are created using a tool such as JDeveloper, according to the Java Servlet Specification 2.3.
To launch the Packaging Wizard, type the following from a DOS prompt:
wtgpack
The Packaging Wizard appears, as Figure 5-1 shows, and defaults to the Make a Selection dialog box. This dialog box enables you to create, edit, open, or delete a packaged application using the following features:
| Feature | Description |
|---|---|
| Create a new application | When selected, this option enables you to define a new application. |
| Edit an existing application | When selected, this option enables you to edit an existing application. Users can select an existing application from the adjacent drop-down list. |
| Delete the existing application | When selected, this option enables you to delete the existing application from the XML file, but not from Mobile Server Repository. |
| Create a new application using a WAR file | When selected, this option enables you to create an application using a Web Application Archive (WAR) file. You can enter the name of the WAR file in the adjacent field or select the file using the Browse button. |
| Open a packaged application | When selected, this option enables you to select an application that has been packaged as a JAR file. You can enter the name of the packaged application in the adjacent field or select the application using the Browse button. |
Figure 5-1 The Make a Selection Dialog Box
Use the Select a Platform dialog box to select the platform for which you want to package your application. As Figure 5-2 illustrates, this dialog box enables you to specify a platform, such as, Web-to-Go, Palm, Win32 Native, or Handheld PC (ARM), among others. If you are packaging a WAR file, Web-to-Go is automatically selected as the primary application platform.
Figure 5-2 The Select a Platform Dialog Box
The Packaging Wizard also supports development mode. In this mode, the Packaging Wizard only enables you to define the Web-to-Go application information, list the application files, compile JSPs, add servlets, and make registry changes. Since the application is packaged to your local machine, it requires neither connectivity nor database information.
To launch the Packaging Wizard in development mode, type the following from a DOS prompt:
wtgpack -d
The following sections explain the function of each Packaging Wizard panel.
Use the Application panel to name a new Web-to-Go application and to specify where you want to store it on the Mobile Server. As Figure 5-3 illustrates and the following table describes, Application panel includes the following fields:
| Field | Description | Required |
|---|---|---|
| Application Name |
The name of the new Web-to-Go application.
When packaging a WAR file the application name must be set to the value of the element <display name> found under the main element <web-app> in the web.xml file. See Section 5.4, "Support for the web.xml Format" for more information. |
Yes |
| Virtual Path |
A path that is mapped from the root directory of the server repository to the Web-to-Go application itself. The virtual path eliminates the need to refer to the application's entire directory structure. It indicates that all of the subdirectories and all of the files that are in the virtual path will be uploaded exactly as they are in the directory structure to the Mobile Server Repository when the application is published. It also provides the application with a unique identity.
As Figure 5-3 shows, the name When the administrator publishes the application, the Packaging Wizard uses automatically the name that you entered in the virtual path as the name of the application root directory in the Mobile Server Repository. However, the administrator can change the name of the application root directory in the Mobile Server Repository by entering a different name for it when the administrator publishes the application. |
Yes |
| Description |
A brief description of the Web-to-Go application.
When packaging a WAR file the description must be set to the value of the element <description> found under the main element <web-app> in the web.xml file. See Section 5.4, "Support for the web.xml Format" for more information. |
Yes |
| Application Classpath | The application classpath specifies where the classes (servlets, beans) for the application are located. The default application classpath is always the application root directory. Add other directories or jar and zip files to the application classpath to specify additional locations that Web-to-Go can search for application classes.Entries must be separated by semicolons (;)In addition, Web-to-Go automatically appends the following to the application classpath:1) application root directory2) classpath as specified in the Application Panel in the Packaging Wizard3) classes located under WEB-INF/classes4) all jar and zip files located in the directory WEB-INF/lib5) classes located under /shared/WEB-INF/classes6) all jar and zip files located in the directory /shared/WEB-INF/lib. All7) SYSTEM classpath | No |
| Default Page |
The server location of the Web page that functions as the Web-to-Go application's entry point. This is a relative path to the Repository Directory. For example, if the server directory is /apps and the default page is index.htm, then Default Page is /apps/index.htm. The default page can be a servlet. A generic page is issued if the user does not specify a default page.
When packaging a WAR file the default page must be set to the value of the element<welcome-file-list> in the web.xml file. See Section 5.4, "Support for the web.xml Format" for more information. |
Yes |
| Local Application Directory |
The directory on the local machine that contains all of the components for this application. You can type this location or select it by clicking the Browse button.
During development, the application root directory is set to the local application directory. Note: See Section 5.3.4.1, "Locating Platform Files in the Local Application Directory" after this table for more information about locating your platform application files when you have multiple versions of the same application for different platforms. |
Yes |
| Icon |
The GIF image the Web-to-Go application uses as its icon in the Web-to-Go workspace. Users may enter the icon name in the adjacent field or select an icon file using the Browse button.
When packaging a WAR file, the description field must be set to the value of the element <large-icon> as a primary choice or <small-icon> as a secondary choice found under the main element <web-app> in the web.xml file. See Section 5.4, "Support for the web.xml Format" for more information. |
No |
You can have multiple versions by platform of the same application published and managed in the Mobile Server Repository. Multiple implementations by platform (for example, Web-to-Go, Palm, WinCE, and Windows 32) of the same application (for example, Sales Force Automation) can exist, each of them accessing the same application tables in the Oracle database server.
For example, a C++ application developed for Compaq iPAQ can be recompiled to run on a Palm device without changing the application code. In this case, two application versions of the same application exist, each of them using the same database tables.
The Local Application Directory is the directory on the Windows development system where the different application versions are stored. Application files for each platform must be stored in a subdirectory that is dedicated to that platform, which must have a distinct name according to the platform, under the Local Application Directory. The Packaging Wizard recursively reads the application files under this application (root) directory.
For all platforms other than Web-to-Go for which you have applications, or application versions of the same application, the subdirectory for each platform must be named exactly as shown in Table 5-1, which lists the required subdirectory names and the corresponding platforms.
Table 5-1 List of Required Subdirectory Names According to the Platform
| Platform | Required Subdirectory Name for Application Files |
|---|---|
| Windows 32 | WIN32 |
| WinCE SH3 | wce\<platform>\<language>\SH3 |
| WinCE SH4 | wce\<platform>\<language>\SH4 |
| WinCE MIPS | wce\<platform>\<language>\MIPS |
| WinCE StrongArm | wce\<platform>\<language>\ARM |
| EPOC | EPOC |
| Palm | PALM |
Figure 5-3 Application Panel
On your local machine, a Local Application Directory called which can be any name you choose, for example, 'Applications'. This subdirectory stores the different application versions by platform, or in a directory name of your choice for Web-to-Go applications, which is illustrated as follows:
C:\Applications
The Java application files for the Web-to-Go platform may be stored in a subdirectory, which you may name as you choose, for example, MyAPP. This is stored under the Applications directory, which is illustrated as follows:
C:\Applications\MyAPP
If no platform type directory is specified, for example, PALM, the application will be treated as a Web-to-Go application. Web-to-Go applications can be packaged into any directory, for example:
C:\
or
C:\Applications
or
C:\Applications\MyAPP
The C++ application files for the Palm platform must be stored in the \PALM subdirectory under the Applications directory, which is illustrated as follows:
C:\Applications\PALM
The C++ application files for iPAQ must be stored in the \WCE\<platform>\<language>\ARM subdirectory, where <platform> determines the operating system, and <language> determines the language set you wish to use. See the Oracle9i Lite Developers Guide for Windows CE for more information. These are placed under the Applications directory, which is illustrated as follows:
C:\Applications\WCE\<platform>\<language>\SH4
The Local Application Directory is C:\Applications but it has three subdirectories, each of which contains the version of the application files for a particular platform:
C:\Applications // Local Application Directory
C:\Applications\MyAPP // Application subdirectory for the Web-to-Go version
C:\Applications\PALM // Application subdirectory for the Palm version
C:\Applications\WCE\Pocket_PC\us\SH4 // Application subdirectory for the Pocket
PC, US English, StrongArm version
Use the Files panel to list your application files and to specify where they are located on the local machine. The Packaging Wizard analyzes the contents of the Local Application Directory and displays each file's local path. The panel contains the following field:
| Field | Description | Required |
|---|---|---|
| Local Path | The absolute path of each Web-to-Go application file. Each entry on the list includes the complete path of the individual file or directory. | Yes |
If you select an application for a platform other than Web-to-Go, see the appropriate developer's guide for that platform for instructions regarding the placement of the applications files.
Figure 5-4 Files Panel
You can add, remove, load, or compile any of the files listed in the Files panel. If you are creating a new application, the Packaging Wizard automatically analyzes and loads all files listed under the local directory when you proceed to the Files panel. If you are editing an existing application, then you can use the Load button to load the individual application files.
If you are importing a WAR file into an existing application, select the "Import WAR file" button on the Files panel to see a dialog that prompts you for the location of the WAR file to be imported. Once you have located the appropriate file, and selected the "OK" button, the contents of the WAR file should be displayed in the Files panel.
If you click the Compile JSP button, the Packaging Wizard will compile all the JSP files that are listed in the Files panel.
The Compile JSP button allows you to compile your JSP files for deployment. If you click the Compile JSP button, the following Compile JSP dialog box appears with detailed compilation information. If there are any errors, you should correct the JSP files before proceeding.
Figure 5-5 The Compile JSP Dialog Box
You can sort the files by their extensions or by the directory in which they are located. To sort files, click the By Extension or By Directory radio buttons.
When you click the Load button, the Input dialog box appears. You can use the Input dialog box to create a comma-separated list of filters that either include or exclude application files from the upload process. To exclude a file, type a preceding minus sign (-) before the file name. For example, to load all files but exclude files with the .bak and .java suffixes, type the following:
*,-*.bak,-*.java
The Packaging Wizard can analyze servlets in the File tab and define them on the Mobile Server. You can view your application's servlets in the Servlets panel. The panel includes the following fields:
| Field | Description | Required |
|---|---|---|
| Servlet Name |
The servlet's name. For example: DeleteDetail. You will then refer the servlet as
|
Yes |
| Servlet Class | The fully qualified class of the servlets to be added. | Yes |
Figure 5-6 Servlets Panel
You can add, remove, or load any servlets listed in the Servlets panel. If you are creating a new application, the Packaging Wizard automatically lists all Servlets based on the files listed in the Files tab. If you are editing an existing application, then you can use the Load button to load individual servlets.
Use the Database panel to specify how the Web-to-Go application user connects to the replication master groups on the Oracle server. The panel includes the following fields and check boxes:
| Field | Description | Required |
|---|---|---|
| Database User Name | The login name for the Web-to-Go application's Oracle database account. All Web-to-Go application users access the same account. The application must have the CONNECT.RESOURCE privilege. The default database user name is "master". | Yes |
| Number of Connections | The number of concurrent connections the Web-to-Go application can have to the Oracle server. | Yes |
| Share Connections | When checked, multiple servlets can share the same database connection. Sharing connections among multiple servlets enables servlets to avoid exceeding Oracle's maximum number of available concurrent connections. However, when one servlet performs a commit, it automatically affects any others that share its connection. | No |
|
Client side
Database DSN Name |
The name of the database that you want to create on the client side. For example, a native Windows 32 application will access the client database with this name. This is not needed for Web-to-Go applications. | No |
Figure 5-7 Database Panel
Use the Roles panel to define the Web-to-Go application's roles. Developers create roles in the application's code and the Packaging Wizard redeclares them for the Oracle database. After you publish the application to the Mobile Server, you can assign roles to users and groups by using the Mobile Server Control Center. The panel includes the following field:
| Field | Description | Required |
|---|---|---|
| Roles | Assigns roles to the Web-to-Go application. |
Figure 5-8 Roles Panel
All Web-to-Go applications contain a default role. You can add or remove roles from the Roles panel by clicking the New or Delete button.
Use the Snapshots panel to create replication snapshots for your application. A snapshot must have the same name as the database object (table or view), and it must be unique across all applications. Be sure to use unique names when creating database objects. The Packaging Wizard allows you to create snapshots for a number of platforms. For Web-to-Go, use the Windows 32 platform.
|
Note: Once you have specified a database connection it is used for the remainder of your Packaging Wizard session. If you need to switch between an Oracle database and Oracle Lite database but have already established a connection you must quit the Packaging Wizard application completely and run wtgpack.exe again. |
The Snapshots panel includes the following fields:
| Field | Description | Required |
|---|---|---|
| Name | The name(s) of the snapshot(s) associated with the Web-to-Go application. It must be the same name as the underlining database object. | X |
| Template | Lists available snapshot templates. The template is a SQL statement that is used to create the snapshot. The template may contain variables. After you publish the template to the Mobile Server, you can specify user-specific template variables using the Mobile Server Control Center. However, you cannot modify snapshots in the Mobile Server Control Center. | X |
| Platform | The platform for the snapshot. Use Win32 for Web-to-Go. Users can create snapshots for different platforms. When users synchronize data from the client, they get only the snapshots appropriate to the platform running the client application. | |
| Weight | This is the order of tables to be replicated. For tables with a master-detail relationship, the master table needs to be replicated first and therefore should have a lower weight. | |
| Platforms |
A drop-down list of the platforms of the current snapshots. The drop-down list may include all of the following platforms:
Selecting a platform from the drop-down list displays only the snapshots for that platform in the Snapshots panel. For example, selecting Win32 from the All Platforms drop-down list displays only Win32-based snapshots. Selecting the All Platforms option from the drop-down displays all snapshots by the platforms currently in use. The drop-down list displays additional platforms as users add new snapshots. |
Figure 5-9 Snapshots Panel
You can add or remove snapshots from the Snapshots panel by clicking the New or Delete button. You can also import or edit snapshots by clicking the Import or Edit button.
|
Note: You can import multiple snapshots from the Snapshots panel or import one when you create a new table from the New Table Dialog box. |
To create new snapshots, click the New button. The New Snapshots dialog box appears. As Figure 5-10 illustrates, if you click the Server tab, the Server panel appears, which contains fields for snapshot name, weight, owner, and SQL, as well as a check box for generating SQL.
Figure 5-10 New Snapshots - Server Panel
Create a new snapshot by entering the appropriate information. The name that you enter in the Name field reflects the underlining database table name.
For a description of Weight, see Section 5.3.9, "Defining Snapshots For Replication".
If you enable Generate SQL, you should provide a CreateTable SQL statement to construct the database table. Enter the SQL statement in the SQL field. At the end of the defining phase, you will have the option to generate a SQL file.
Use the Win32 tab for the Mobile Client for Web-to-Go.
If you click the Win32 tab, the following panel appears:
Figure 5-11 New Snapshots - Client Panel
Create a new snapshot on the Mobile Client for Web-to-Go by modifying the following features in the New Snapshots dialog box:
| Feature | Description |
|---|---|
| Updateable | When selected, this check box creates an updateable snapshot of the named table. |
| Template | Displays the snapshot template for the named table. You can modify the snapshot template. Administrators can instantiate variables for different users to this template using the Mobile Server Control Center. See "Defining Snapshots For Replication" for more information about template variables. |
To create an index for a snapshot using the Packaging Wizard, use the following procedure:
From the Snapshots Panel (see Figure 5-9, "Snapshots Panel") select the Edit button to create an index from an existing snapshot, or the New button for creating a new snapshot and new index.
Figure 5-12 Index Creation
Select the platform tab on the panel which appears, for example Win 32. The SQL statement which defines your snapshot appears in the Template field. Below that is an Indices table; to create a new index, select the New button beneath this table.
There are three columns in the Indices table:
Name - This is the name of the index.
Type - Indexes can be Regular, Primary, or Unique. There is a drop down menu to select this.
Columns - Enter the column name which the index uses.
To import snapshots from an Oracle database or from an Oracle Lite database, click the Import button. The database connection window appears if you have not specified a connection.
Enter the user name, password, and database URL for the Oracle database, or Oracle Lite database from which you are importing your snapshot(s). The Tables window appears.
|
Note: Use the following format when entering the database URL for an Oracle database: jdbc:oracle:oci8:@webtogo.world. For Oracle Lite, use jdbc:polite:webtogo. |
Select the schema from which you want to import your table(s), and then select the table(s). Click Add and then click Close. The table appears in the Snapshots panel of the Packaging Wizard.
To edit a snapshot, select the snapshot from the Snapshots panel and click Edit. The Edit Snapshots dialog box appears.
Figure 5-13 Edit Snapshots Dialog Box (Client)
Edit the snapshot by modifying the following features of the Edit Table window:
| Feature | Description |
|---|---|
| Create on Client | When selected, the check box allows you to edit the snapshot on the Mobile Client for Web-to-Go. |
| Updateable | When selected, this check box creates an updateable snapshot of the named table. |
| Template | Displays the snapshot template for the named table. You can modify the snapshot template. Administrators can instantiate variables for different users to this template using the Mobile Server Control Center. |
Use the Sequences panel to define offline sequence support for the Web-to-Go application. Web-to-Go uses sequences to assign unique primary key values to an application before it disconnects and is in offline mode. These unique primary key values are used for replication when the client goes back online. Sequences are important because they eliminate replication conflicts by preventing duplicate primary key values across disconnected applications. All sequences must have a unique name. You can accomplish this by modifying your sequence names by preceding them with your application name. For more information on sequences, see "Using Sequence Support for Disconnected Clients" in this chapter.
The Sequences panel includes the following fields:
| Field | Description | Required |
|---|---|---|
| Name | The name of the sequence used by the Web-to-Go application in disconnected mode. | X |
| Type |
The type of sequence used by the Web-to-Go application in disconnected mode. There are two types of sequences, Window and Leapfrog.
Window. The window sequence assigns a unique range of values to each client. Window sequences are unique to each client and never overlap with those of other clients. When a client uses all the values in its sequence range, Web-to-Go recreates the sequence with a new, unique range of values the next time the client goes offline. Leapfrog. The leapfrog sequence assigns a unique series of incremental values to each client. Every sequence contains a different start value for each client and each sequence increment is set to a larger value than the maximum number of clients. |
X |
| Start Value | The sequence's start value on the Mobile Client for Web-to-Go. The sequence begins at this number and then increments according to the increment number you define. | X |
| Increment | The number by which the sequence increments on the Mobile Client for Web-to-Go, beginning at its start value. | X |
| Window Size | Defines the range of numbers in a window sequence. This information is not used by the Leapfrog sequence. | window only |
| Threshold | Defines the minimum range of required numbers in a window sequence. Web-to-Go creates a new sequence when the existing one reaches this range and when the client goes offline. This information is not used by the leapfrog sequence. | window only |
| Server Start | The sequence's start value on the Oracle database. The sequence begins at this number and then increments according to the increment number you define. This number must be different from the sequence's start value on the Mobile Client for Web-to-Go. | |
| Server Increment | The number by which the sequence increments on the Oracle database, beginning at its start value. | |
| Server Minimum | The minimum start value for an ascending sequence on the Oracle database. For example, an ascending sequence could start at 1 and continue on in ascending order. | |
| Server Maximum | The maximum start value for a descending sequence on the Oracle database. For example, a descending sequence could start at -1 and continue in descending order. |
Figure 5-14 The Sequences Panel
You can add or remove sequences from the Sequences panel by clicking the Add or Remove button.
To import sequences from an Oracle database, click the Import button. The Sequences window appears.
Select the sequence you want to import, click Add, and then click Close.
To edit a sequence, select the sequence from the Sequences panel and click Edit. The Edit Sequences window appears.
Edit the sequence by modifying the following features of the Edit Sequences window:
| Feature | Description |
|---|---|
| Name | The name of the sequence. |
| Create on Server | When selected, this check box enables the options for creating a sequence on the Oracle database. Information entered by the user is used to generate a SQL script to create the sequence on the Oracle server. |
| Start Value | The start value of the sequence on the Oracle database. |
| Increment | The increment of the sequence on the Oracle database, beginning with its start value. |
| Minimum | The minimum start value for an ascending sequence on the Oracle database. For example, an ascending sequence could start at 1 and continue in ascending order. |
| Maximum | The maximum start value for a descending sequence on the Oracle database. For example, a descending sequence could start at -1 and continue in descending order. |
| Create on Client | When selected, this check box enables the options for creating a sequence on the Mobile Client for Web-to-Go. |
| Type | Defines the type of sequence on the Mobile Client for Web-to-Go. Options include the window and leapfrog sequences. |
| Start Value | The sequence start value on the Mobile Client for Web-to-Go. |
| Increment | The increment of the sequence on the Mobile Client for Web-to-Go, beginning with its start value. |
| Window Size | The range of numbers that constitute a window sequence on the Mobile Client for Web-to-Go. This information is not used by the leapfrog sequence. |
| Threshold | The minimum range of required numbers in a window sequence. Web-to-Go creates a new sequence when the existing one reaches this range and when the client goes offline. This information is not used by the leapfrog sequence. |
Use the DDLs panel to define any DDL (Data Definition Language) statements that the Web-to-Go application can execute the first time it goes offline. All DDL statements must have a unique name. One way to accomplish this is to modify your DDL names by preceding them with your application name. After you publish the application to the Mobile Server, you can create additional DDL statements by using the Mobile Server Control Center. The panel includes the following fields:
| Field | Description | Required |
|---|---|---|
| Name | The DDL name. | |
| DDL Statement | Defines DDL statements with the Web-to-Go application. These DDL statements will be executed when the Web-to-Go application runs on the client. |
Figure 5-15 The DDLs Panel
You can add or remove DDLs from the DDLs panel by clicking the Add or Remove button. When you click the ADD button, the New DDL dialog box appears.
| Field | Description | Required |
|---|---|---|
| Name | The DDL name. | X |
| SQL | Defines the DDL statements. These SQL statements will be executed when the Web-to-Go application runs on the client. | X |
To import views and indexes definitions from an Oracle database, click the Import button. The import DDLs window appears.
To import an index definition, click the Indexes tab and then click the schema from which you want to import an index. Select the index you want to import, click Add, and then click Close.
To import a view definition, click the Views tab and then click the schema from which you want to import a view. Select the view you want to import, click Add, and then click Close.
Use the Registry panel to define name/value pairs for the Web-to-Go application. The registry contains unique Web-to-Go name/value pairs. All names must be unique. One way to accomplish this is to modify names by preceding them with your application name. The panel includes the following fields:
| Field | Description | Required |
|---|---|---|
| Name | The name. | X |
| Value | The name's corresponding value. | X |
Figure 5-16 The Registry Panel
You can add or remove name/value pairs from the Registry panel by clicking the New or Delete button.
When you complete all of the Packaging Wizard panels, the Application Definition Completed window appears with the following options:
Create Files
Publish the current application
Restart Wizard
The Packaging Wizard automatically outputs all of your application information to an XML file. The Packaging Wizard retains the XML file on the local machine and provides you with the option of publishing it to the Mobile Server, among others. You can only publish the XML file to the Mobile Server when the server is running. Packaging Wizard always retains the Web-to-Go application's XML file on the local machine.
The Create Files option allows you to either package your application components in a .jar file or generate SQL scripts that create database objects. To package your application components in a .jar file, click Create Files, and then click "Package applications in a JAR file". You can specify the location for the .jar file. To generate SQL scripts, click Create Files, and then click "Generate SQL scripts for database objects". The generated script will be placed in a SQL subdirectory under the application's local root directory. The SQL scripts, which make use of the information you supplied about the server-side table, sequences, and DDLs, can be executed on the database to create these database objects.
The Publish Current Application option enables you to publish the application that you created and defined in the Packaging Wizard. To publish the Web-to-Go application, click the Publish Current Application button and then click OK. The Publish Application window appears.
Figure 5-17 The Publish the Application Dialog Box
Enter the required information in the specified fields of the Publish the Application dialog box.
| Field | Value |
|---|---|
| Mobile Server URL | http://server |
| Mobile Server Username | Administrator |
| Mobile Server Password | admin |
| Repository Directory | /tutorial |
| Public | Do not select the Public check box. |
|
Note: You must have the publish privilege to publish applications to the Mobile Server. The Mobile Server administrator assigns privileges using the Mobile Server Control Center. |
You can edit applications by launching the Packaging Wizard and selecting "Edit an existing application." Although you can manually create or edit applications by writing or modifying an XML document that conforms to Web-to-Go's DTD file, for best results, you should use the Packaging Wizard to create or modify applications.
An important part of WAR file support is the requirement to read a web.xml descriptor file.
In order to be read when an application is run, the web.xml descriptor file must be located in a specific directory by the application developer. The web.xml file must be located in: <application_root_directory>/WEB-INF/web.xml. For example, when published the sample file sample3.war will deploy the web.xml file to sample3/WEB-INF/web.xml.
Packaging Wizard supports a subset of the web.xml tags defined by the Java Servlet Specification 2.3 which can be found at http://java.sun.com/dtd/web-app_2_3.dtd. Most of the supported tags are used by the servlet runtime engine. Some of the tags are only supported:
When you use the Packaging Wizard to package a new application based on a WAR file.
When you publish an application based on a WAR file using Control Center.
The supported tags are described in Table 52, "Supported web.xml Tags".
Table 5-2 Supported web.xml Tags
| Tag | Description |
|---|---|
| <web-app> | Yes, start tag, required |
| <icon> | Yes, only for new Packaging Wizard packaged application or when publishing a WAR file with Control Center. |
|
<small-icon>
</small-icon> |
Yes, secondary choice for icon. |
|
<large-icon>
</large-icon> |
Yes, primary choice for icon. |
| </icon> | Yes |
|
<display name>
</display name> |
Yes, only for new Packaging Wizard packaged application or when publishing a WAR file with Control Center. |
|
<description>
</description> |
Yes, only for new Packaging Wizard packaged application or when publishing a WAR file with Control Center. |
| <distributable></distributable> | No, tag is ignored, but should not be present. |
| <context-param> | Yes, used by runtime engine. |
| <param-name> | Yes, used by runtime engine. |
| <param-value> | Yes, used by runtime engine. |
| <description></description> | Yes, used by runtime engine. |
| </context-param> | Yes |
| <servlet> | Yes, however, not all tags are supported |
| <icon> | Not supported at the <servlet> level. |
| <small-icon></small-icon> | Not supported at the <servlet> level. |
| <large-icon></large-icon> | Not supported at the <servlet> level. |
| </icon> | Not supported at the <servlet> level. |
| <servelet-name></servelet-name> | Yes, used by runtime engine. |
| <display-name></display-name> | Not supported at the <servlet> level. |
| <description></description> | Not supported at the <servlet> level. |
| <servelet-class></servelet-class> | Yes, used by runtime engine. |
| <jsp-file></jsp-file> | Not supported at the <servlet> level. |
| <init-param> | Yes, used by runtime engine. |
| <param-name> | Yes, used by runtime engine. |
| <param-value> | Yes, used by runtime engine. |
| <description></description> | Yes, used by runtime engine. |
| </init-param> | Yes, used by runtime engine. |
| <load-on-statup> | Yes, used by runtime engine. |
| <security-role-ref> | Yes, used by runtime engine. |
| <description></description> | Yes, used by runtime engine. |
| <role-name></role-name> | Yes, used by runtime engine. |
| <role-link></role-link> | Yes, used by runtime engine. |
| </security-role-ref> | Yes |
| </servlet> | Yes |
| <servlet-mapping> | Yes, used by runtime engine. |
| <servlet-name></servlet-name> | Yes, used by runtime engine. |
| <url-pattern></url-pattern> | Yes, used by runtime engine. |
| </servlet-mapping> | Yes, used by runtime engine. |
| <mime-mapping> | Yes, used by runtime engine. |
| <extension></extension> | Yes, used by runtime engine. |
| <mime-type></mime-type> | Yes, used by runtime engine. |
| </mime-mapping> | Yes |
| <welcome-file-list> | Yes, only for new Packaging Wizard packaged application or when publishing a WAR file with Control Center. |
| <welcome-file></welcome-file> | Yes, only for new Packaging Wizard packaged application or when publishing a WAR file with Control Center. |
| </welcome-file-list> | Yes, only for new Packaging Wizard packaged application or when publishing a WAR file with Control Center. |
| <error-page> | Yes, used by runtime engine. |
| <error-code></error-code> | Yes, used by runtime engine. |
| <exception-type></exception-type> | Yes, used by runtime engine. |
| <location></location> | Yes, used by runtime engine. |
| </error-page> | Yes, used by runtime engine. |
| </web-app> | Yes, end tag, required. |
|
![]() Copyright © 2002 Oracle Corporation All rights reserved |
|