Oracle® HTML DB User's Guide Release 1.6 Part Number B14303-02 |
|
|
View PDF |
This section describes how to deploy an application.
This section contains the following topics:
When developing applications using Oracle HTML DB, you need to find a balance between two dramatically different development methodologies:
Iterative, rapid application development
Planned, linear style development
The first approach offers so much flexibility, you run the risk of never completing your project. In contrast, the second approach can yield applications that do not meet the needs of end users even if they meet the stated requirements on paper.
The System Development Life Cycle (SDLC) is the overall process of developing software using a series of defined steps. There are a number of SDLC models that work well for developing applications in Oracle HTML DB.
The SDLC waterfall is probably the best known model. In this methodology, the development process is broken down into the following stages:
Project Planning
Requirements Definition
Design
Development
Integration and Testing
Installation and Acceptance
Maintenance
This methodology is referred to as a waterfall since the output from one stage is the input for the next stage. One of the primary problems with this approach is that it is assumed that all requirements can be establish in advanced. Unfortunately, in the real world requirements often change and evolve during the development process.
The Oracle HTML DB development environment enables developers to take a more iterative approach to development. Unlike many other development environments, creating prototypes is easy. With Oracle HTML DB, developers can:
Use built-in wizards to quickly design an application user interface
Easily make protoypes available to users and gather feedback
Implement changes in real time, creating new prototypes instantly
Other methodologies what work well with Oracle HTML DB include:
Spiral - This approach is actually a series of short waterfall cycles. Each waterfall cycles yields new requirements and enables the development team to create a robust series of prototypes.
Rapid Application Development (RAD) Life Cycle - This approach has a heavy emphasis on creating a prototype that closely resembles the final product. Essentially the prototype is an essential part of the requirements phase. One disadvantage of this model is that the emphasis on prototyping can lead to scope creep. Developers can lose sight of their initial goals in the attempt to create the perfect application.
Deploying an application from one Oracle HTML DB instance to another is a two part process:
First, you move the supporting database objects.
Second, you export the application definition and all associated files.
When you develop an application in Oracle HTML DB, you create the application within a specific workspace. Each workspace has an unique ID and name. A common scenario is to create the application in a development instance and then deploy it to a production instance.
During the deployment process you would need to decide whether to use the existing application ID, the existing workspace, the existing database, or the existing Oracle HTTP Server, or create new ones. Deployment options to consider include:
Do nothing. Send the URL and login information to users. This approach works well for applications with a small and tolerant user population.
Same workspace and same schema. Export and then import the application and install it using a different application ID. The approach works well when there are few changes to the underlying objects, but frequent changes to the application functionality.
Different workspace and same schema. Export and then import the application into a different workspace. This is an effective way to prevent a production application from being modified by developers.
Different workspace and different schema. Export and then import the application into a different workspace and install it using a different schema.
Different database with all its variations. Export and then import the application into a different Oracle HTML DB instance and install it using a different schema and database.
Whether to copy an existing workspace really is a matter of preference. Keep in mind that the production version must have access to all the appropriate objects. For example, you might want to copy a workspace in the following situations:
When the application subscribes to other objects within the workspace.
When the application relies on Oracle HTML DB authentication. Copying the workspace would automatically migrate all the required user data.
When determining whether to copy the database, remember that the schema against which the application runs must have access to the same objects as the development instance. The actual name of the schema is unimportant. You can change it during the import process.
It is not necessary to have matching application IDs for a development version and production version of an application. In fact, as a best practice never hard code the application ID. Instead use the application alias (defined on the Edit Application Attributes page), or use a built-in substitution string (such as APP_ID
and APP_ALIAS
). Using a substitution string is the best approach since it enables you to change the application ID without impacting any application functionality.
See Also: "Application Definition" for information on defining an application alias and "Built-in Substitution Strings" for information on usingAPP_ID and APP_ALIAS |
Installing Oracle HTML DB loads a new Oracle HTTP Server in a separate Oracle home. Additionally, the installer properly configures Oracle HTTP Server with a mod_plsql
database access descriptor (DAD) and creates all virtual directory mappings.
Using a different Oracle HTTP Server configuration requires additional configuration. For example, you might want to:
Use a different Oracle HTTP Server from the one that installs with Oracle HTML DB
Use the Oracle HTTP Server that installs with Oracle Application Server Release 10g
Use the Oracle HTTP Server that installs with Oracle9i Application Server
All of these scenarios require you manually configure the mod_plsql
DAD and map the directory from which Oracle HTML DB retrieves images.
You can also have a single Oracle HTTP Server serve pages for multiple Oracle HTML DB instances. In this configuration, all Oracle HTML DB instances must be the same version, map to the same image directory, and have a unique mod_plsql
DAD.
See Also: Oracle HTML DB How To Documents section of Oracle Technology Network for more information on implementing these configurations |
To move an application and related files from one instance of Oracle HTML DB to another, you must export the application definition and all associated files. Exporting your application definition is the first step toward deploying it outside of your development environment.
Topics in this section include:
Whether you want to move an application to another workspace or just make a copy of it, the export process involves the following steps:
Export the application and all related files (See "Exporting an Application and Related Files")
Import the exported files into the target Oracle HTML DB instance. (See "Importing Export Files")
Note that if the target instance is a different schema, you also need to export and import any required database objects.
Install the exported files from Export Repository (See "Installing Files from the Export Repository")
You can import an application into your workspace regardless of the workspace in which it was developed.
Before you export an application and the appropriate related files, you need to determine if you also need to migrate the database objects referenced by the application.
If the target Oracle HTML DB instance is different from the development environment, you will need to migrate the database objects referenced by the application. In many cases this process can be as simple as using Oracle database export and import utilities to copy the application schema from the development environment to target Oracle HTML DB instance. The following are two common scenarios where this approach will not work:
When the object development schema refers to tablespaces to which the target instance schema does not have access
When the development instance schema has sample data that you do not to want migrate to the target instance schema
If a database administrator or an Oracle HTML DB administrator is the person responsible for exporting Oracle HTML DB applications, be sure to clearly communicate if he or she:
Should include all data when exporting your application
Should not include data from specific tables you identify
You export and import application definitions and all associated files using the Workspace, Application, CSS, Images, Script Files, Themes, and User Interface Defaults buttons located at the top the Export page.
Topics in this section include:
When you export a application, Oracle HTML DB generates a text file containing PL/SQL API calls.
To export an application:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
From the Application list, select an application
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
From Build Status Override, select one of the following:
Run Application Only - Developers can only run an application
Run and Build Application - Developers can both run and edit an application
Selecting Run Application Only is an effective way to protect an application from modifications from other developers. Note that if you select Run Application Only you cannot set the argument p_trace
to Yes
. Also, be aware that once you override the Build Status, you can only change it in Oracle HTML DB Administration Services.
Use the As of field to export your application as it was previously defined. Specify the number of minutes in the field provided.
This utility uses the DBMS_FLASHBACK
package. Because the timestamp to System Change Number (SCN) mapping is refreshed approximately every five minutes, you may have to wait that amount of time to locate the version you are looking for. The time undo information is retained and influenced by the startup parameter UNDO_RETENTION
(the default is three hours). However, this only influences the size of the undo tablespace. While two databases may have the same UNDO_RETENTION
parameter, you will be able to go back further in time on a database with fewer transactions since it is not filling the undo tablespace, forcing older data to be archived.
Click Export Application.
In addition to exporting the actual application file, you may also need to export other related files such cascading style sheets, images, and script files.
You can export a specific page within an application by clicking the Export button on the Page Definition. When exporting a page, remember that some pages may reference shared components. To export all pages within an application as well as application shared components, you need to export the entire application.
To export a page in an application:
Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)
From the Applications list, select an application.
Application Builder appears. The list of pages in the current application appears at the bottom of the page.
From the Pages list, select a page.
The Page Definition appears.
On the Page Definition, click Export at the top of the page.
From Page, select the page to be exported.
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Use the As of field to export a page as it was previously defined. Specify the number of minutes in the field provided.
This utility uses the DBMS_FLASHBACK
package. Because the timestamp to System Change Number (SCN) mapping is refreshed approximately every five minutes, you may have to wait that amount of time to locate the version you are looking for. The time undo information is retained and influenced by the startup parameter UNDO_RETENTION
(the default is three hours). However, this only influences the size of the undo tablespace. While two databases may have the same UNDO_RETENTION
parameter, you will be able to go back further in time on a database with fewer transactions since it is not filling the undo tablespace, forcing older data to be archived.
Click Export Page.
Use the Export Cascading Style Sheets utility to export cascading style sheets you imported.
To export related cascading style sheets:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
Click CSS at the top of the page.
On the Export Cascading Style Sheets page:
Select the cascading style sheets
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Click Export Style Sheets.
Use the Export Images utility to export images you have imported.
To export related images:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
Click Images at the top of the page.
On the Export Images page:
Select application from which to export images.
Be aware that selecting Workspace Images only exports those images in your repository that are not associated with a specific application. If all of your images are associated with specific applications then the workspace image export file will be empty.
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Click Export Images.
Use the Export Static Files utility to export static files you have imported.
To export related static files:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
Click Files at the top of the page.
On the Export Static Files page:
Select the files to be exported.
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Click Export File(s).
Use the Export Script Files utility to export script files from one Oracle HTML DB development instance to another.
To export script files:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
Click Script Files at the top of the page.
On the Export Script Files page:
Select the files to be exported.
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Click Export Script Files.
Use the Export Theme utility to export themes from one Oracle HTML DB development instance to a file.
To export an application theme from the Export page:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
Click Themes at the top of the page.
From Export Theme, select the theme to be exported.
Click Export Theme.
To export an application theme from the Themes page:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Shared Components.
Under User Interface, select Themes and Templates.
The Themes page appears.
From the Tasks list, select Export.
The Export page appears.
Click Themes at the top of the page.
From Export Theme, select the theme to be exported.
Click Export Theme.
Exporting User Interface Defaults is useful when you plan to develop on the target machine.
When you export User Interface Defaults, all User Interface Defaults for the selected schema are exported to a single SQL*Plus script. When prompted by your browser, save this file to your hard drive. The file contains an API call to create table hints by making calls to the application PL/SQL API. You can use this file to import User Interface Defaults to another database and Oracle HTML DB instance.
To export User Interface Defaults from SQL Workshop:
Click SQL Workshop on the Workspace home page.
Under SQL Workshop, select User Interface Defaults.
From the Tasks list, select Import/Export User Interface Defaults.
When prompted to select a task, select Export and click Next.
Click User Interface Defaults at the top of the page.
On the User Interface Defaults page:
From Schema, select the schema that owns the table associated with the User Interface Defaults.
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Click Export.
To export User Interface Defaults from the Export page:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Export and click Next.
Click User Interface Defaults at the top of the page.
On the User Interface Defaults page:
From Schema, select the schema that owns the table associated with the User Interface Defaults.
From File Format, select how rows in the export file will be formatted:
Choose UNIX to have the resulting file contain rows delimited by line feeds.
Choose DOS to have the resulting file contain rows delimited by carriage returns and line feeds.
Click Export.
Once you export an application and any related files, you need to import them into the target Oracle HTML DB instance before you can install them. Always import application first and then the related files.
To import an application and related files:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
When prompted to select a task, select Import and click Next.
In Import file, specify the file you are importing.
From File Type, select the type of file you are importing and click Next.
Once you have imported a file, you have the option to install it. You can also install it later from the Export Repository.
To install an imported file, click Install. On the Application Install page:
From Parse As Schema, select a schema.
This is the schema against which all of the application's SQL and PL/SQL will be parsed.
From Build Status Override, select one of the following:
Run Application Only - Developers can only run an application
Run and Build Application - Developers can both run and edit an application
Selecting Run Application Only is an effective way to protect an application from modifications from other developers. Be aware that once you override the Build Status, you can only change it in Oracle HTML DB Administration Services.
From Install As Application, select one of the following:
Reuse Application ID from Export File
Auto Assign New Application ID
Change Application ID
Use these options to avoid application ID conflicts. These options come in handy when you need to have two versions of the same application in the same workspace. For example, if you are migrating an application to a production instance but still need to maintain development version.
Click Install Application.
Once you have imported files into the target Oracle HTML DB instance, you must install them before they can become active in Application Builder.
To install files stored in the Export Repository:
Navigate to the Workspace home page.
From the Applications list, select an application.
On the Application Builder home page, click Export/Import.
From the Navigate menu on the right side of the page, select View Repository.
Select the file to be installed and click Install in the Action column adjacent to the appropriate file.
From Parse As Schema, select a schema.
This is the schema against which all of the application's SQL and PL/SQL will be parsed.
From Build Status, select one of the following:
Run Application Only
Run and Build Application
Select Run Application Only to run the application in the target instance, but make it inaccessible to developers.
From Install As Application, select one of the following:
Reuse Application ID from Export File
Auto Assign New Application ID
Change Application ID
Use these options to avoid application ID conflicts. These options come in handy when you need to have two versions of the same application in the same workspace. For example, if you are migrating an application to a production instance but still need to maintain development version.
Click Install Application.
In addition to installing files, you can also use this page to delete a file from the Export Repository.
To delete a file from the Export Repository:
Navigate to the Export Repository.
Select the file to be deleted Delete Checked.
Once you have deployed your application, loaded data, and created users, you can publish your production URL.
You can determine the URL to your application by positioning the mouse over the Run icon on the Application Builder home page. The URL displays in the status bar at the bottom of the page.
The Run icon gets its value from the Home link found under the Session Management section of the Application Attributes page. This link is only referenced by this icon and by applications that do not use the Oracle HTML DB Login API. Consider the following example:
http://htmldb.oracle.com/pls/otn/f?p=11563:1:3397731373043366363
Where:
htmldb.oracle.com
is the URL of the server
pls
is the indicator to use the mod_plsql
cartridge
otn
is the DAD name
f?p=
is a prefix used by Oracle HTML DB
11563
is application being called
1
is the page within the application to be displayed
3397731373043366363
is the session number
To run this example application, you would use the URL:
http://htmldb.oracle.com/pls/otn/f?p=11563:1
When each user logs in, he or she will receive an unique session number.
Build options enable you to conditionally display specific functionality within an application.
Build options have two possible values: INCLUDE and EXCLUDE. If you specify an attribute as being included, then the HTML DB engine considers it part of the application definition at runtime. Conversely, if you specify an attribute as being excluded then the HTML DB engine treats it as if it does not exist.
Topics in this section include:
To create a build option:
Navigate to the Workspace home page.
Select an application name from the Applications list.
On the Application Builder home page, click Shared Components.
Under Logic, select Build Options.
To create a new build option, click Create.
Follow the on-screen instructions.
Once you create a build option, click the Edit icon to change it.
You can choose to enable or disable a build option on the appropriate attributes page. Most attributes pages contain a Configuration Management section where you can select defined build options.
See Also: "Editing Application Attributes" and "Editing Page Attributes" for more information on specifying build options |
Oracle HTML DB includes a report detailing build option utilization in the current application.
To view a report of build option utilization:
Navigate to the Workspace home page.
Select an application name from the Applications list.
On the Application Builder home page, click Shared Components.
Under Logic, select Build Options.
On the Build Options page, click Utilization.
This report displays build option utilization in the current application.