3 Understanding the Sample Application

This section describes how to install and run the sample applications provided with Oracle Application Express. It also explains how to modify the sample application called Sample Application that installs with Application Builder. Running and analyzing how an application works is an effective way to better understand how you can use Application Builder to build your own applications.

Topics:

See Also:

"Disabling the Creation of Sample Applications in a New Workspace" in Oracle Application Express Administration Guide, and "Downloading Public Packaged Applications and Sample Code in Oracle Database 2 Day + Oracle Application Express Developer's Guide

Installing a Sample Application

Application Builder includes sample applications you can install. Use these applications to learn more about the different types of functionality you can include in your applications.

To install the sample applications:

  1. Log in to Oracle Application Express.

    The Workspace home page appears.

  2. Click the Application Builder icon.

    The Application Builder home page appears.

  3. From the Application Builder home page, click Create.

  4. Select Sample Applications and click Next.

    The Sample Applications page appears, displaying the following options:

    • Sample Application offers a working application that highlights basic design concepts.

    • Collection Showcase demonstrates shopping cart concepts.

    • Sample Websheet Application highlights the features and capabilities of Websheets.

  5. To install a sample application, locate the application you want to install, and click Install.

  6. Follow the on-screen instructions.

    The Application home page appears.

  7. To run an installed sample application, click the Run Application icon.

  8. Enter the appropriate login credentials and click Login.

    • For the Sample Application:

      • For User Name, enter either demo or admin.

      • For Password, enter the current workspace name in lowercase letters.

    • For other sample applications, enter your workspace user name and password.

Running an Application

Once you have installed a sample application, you can run it from the Application Builder home page.

To run a sample application from the Application Builder home page:

  1. Log in to the Workspace home page.

  2. Click the Application Builder icon.

  3. Click the application to be run.

    If the application is a database application, the Application home page appears. If the application is a Websheet application, the Run or Edit Application page appears.

  4. Click the Run Application icon.

  5. Enter the appropriate login credentials and click Login.

    • For Sample Application:

      • For User Name, enter either demo or admin.

      • For Password, enter the current workspace name in lowercase letters.

    • For other sample applications, enter your workspace user name and password.

Understanding Sample Application

This section describes the sample application called Sample Application.

Sample Application features an easy-to-use interface for viewing, updating, and searching order and customer information for clothing products. Users can navigate among the pages using the Home, Customers, Products, Orders, and Reports tabs.

When you log into the application using demo for User Name and the name of the workspace in lower case, the following home page appears.

Description of sampl_app_plain.gif follows
Description of the illustration sampl_app_plain.gif

Sample Application demonstrates the following functionality:

  • Examples of ways to display summary information, including a dial chart and summary reports

  • Reports for viewing, updating, and adding customers, products, and orders

  • Flash charts and maps available in Oracle Application Express

  • A Calendar report

  • Printer friendly mode

The following sections describe specific functionality available on each page.

About the Home Page

The Home page contains four main regions:

  • Sales Quota

  • Top Customers

  • Top Products

  • Top Orders by date

Sales Quota demonstrates the use of a Flash Dial chart. This chart displays a value based on an underlying SQL statement. Although not demonstrated in this example, you can enable an asynchronous refresh by editing the attributes of a Flash chart.

Tip:

The Flash Dial Chart only displays if you log in using the user name demo.

Top Customers is a report based on a SQL query and displays a subset of the information that appears on the Customers page. Users can link to additional details by clicking the customer name or by clicking the View Customer icon (a right arrow) in the upper right corner of the region.

Top Products is also a report based on an SQL query. This report displays a subset of the information that displays on the Products page. Users can link to product details by clicking the product name or by clicking the View Products icon in the upper right corner of the region.

Orders by Date displays orders by date and order amount. Users can view the Orders page by clicking the right arrow in the upper right corner.

Sample Application is a simple HTML region that displays static text. You can create this type of region to display explanatory information to users.

Tasks contains a list with links to other pages within the application. Links available on the Home page Tasks list include:

  • Enter a New Order links to a wizard for creating a new order.

  • Add a New Customer links to a form for entering new customer information.

  • Add a New Product links to a form for adding new products.

About the Customers Page

The Customers page enables users to view and edit customer information.

Description of customer.gif follows
Description of the illustration customer.gif

Customers is an interactive report for tracking customer information. To search for a customer, enter a customer name in the Search field and click Go. To sort by customer name, click the column heading and then select the Up or Down arrow to sort in ascending or descending mode. See "Selecting Columns and Sort Order".

You can change the appearance of the report using the Actions menu. See "Using the Actions Menu". To update existing customer information, click the Edit icon. To add a new customer, click the Create Customer button.

About the Products Page

The Products page enables users to view and edit product information. The Products page consists of two main regions:

  • Products

  • Top 5 Products

Products displays product information. This region is based on a SQL query that uses a custom function for displaying images stored in the database.

Description of products.gif follows
Description of the illustration products.gif

By default, this page display in Icon view. To edit product information in Icon view, click an image.

To view the information in a report format, click the View Report icon to the right of the Go button. In Report view, you can sort by product category by clicking the column heading and then selecting the Up or Down arrow to sort in ascending or descending mode. See "Selecting Columns and Sort Order". Users can change the appearance of the report using the Actions menu. See "Using the Actions Menu". To edit a product description, click the Edit icon. To add a new product, click the Create Product button at the top of the page.

Top 5 Products is also a SQL report. This report outlines the top five products based on quantities sold.

Description of products_top.gif follows
Description of the illustration products_top.gif

About the Orders Page

The Orders page enables users to view and edit customer orders.

Description of orders.gif follows
Description of the illustration orders.gif

My Orders is an interactive report for tracking order information. To sort by column, click the column heading and then select the Up or Down arrow to sort in ascending or descending mode. See "Selecting Columns and Sort Order".

You can change the appearance of the report using the Actions menu. See "Using the Actions Menu". To update existing customer information, click the Edit icon. To add a new order, click the Enter New Order button.

About the Reports Page

Description of reports_pg.gif follows
Description of the illustration reports_pg.gif

The Charts page enables you to view information in various formats, including bar chart, cluster bar, pie chart, calendar, map, and tree. To change the view, make a selection under Reports on the right side of the page.

About the Administration Page

The Administration page displays only if you log in to Sample Application using the user name admin. Sample Application makes use of a custom authentication scheme that stores user names and obfuscated passwords in a table. The Manage Users page enables you to manage additional users. To add a new user, click Add User at the bottom of the page. To delete a user, select the user and click Remove Selected Users.

Note that this custom authentication scheme does not use any user names or passwords associated with Oracle Application Express application developers.

Viewing Pages in Printer Friendly Mode

Clicking Print in the upper left corner of the page displays the current page in Printer Friendly mode. When in Printer Friendly mode, the Application Express engine displays all text within the HTML form fields as text.

To enable your application to display in Printer Friendly mode, you must create and then specify a Print Mode Page Template on the Edit Application page.

Modifying a Sample Application

Once you understand the type of functionality available in a sample application, the next step is to learn more about the construction of each page. An efficient way to speed up the learning process is to analyze and deconstruct the pages in the demonstration applications. If you happen to break something, you can quickly delete the demonstration application and install it again. See "Deleting a Database Application" and "Installing a Sample Application".

You edit existing pages in an application, add pages to an application, or create entirely new applications using Application Builder.

Topics:

About the Developer Toolbar

The Developer toolbar is a quick way to edit the current application, the current running page, create a new page, control, or component, view session state, or turn edit links on or off.

Description of d_toolbar_149.gif follows
Description of the illustration d_toolbar_149.gif

The Developer toolbar consists of the following links:

  • Home links you to the Workspace home page. See "About the Workspace Home Page".

  • Application links you to the Application home page. See "About the Application Home Page".

  • Edit Page accesses the Page Definition for the current running page. See "About the Page Definition".

  • Create links to a wizard for creating a page, region, page control (item, button, branch, computation, process, or validation), or a shared control (navigation bar icon, tab, list of values, list, or breadcrumb). See "Creating Applications".

  • Session links you to session state information for the current page. See "Viewing Session State".

  • Caching links to the Caching page. See "Managing Cached Regions".

  • View Debug displays the Debug window. See "Accessing Debugging Mode".

  • Debug toggles the page between Debug and No Debug mode. See "Accessing Debugging Mode".

  • Show Edit Links toggles between Show Edit Links and Hide Edit Links. Clicking Show Edit Links displays a small orange icon next to each editable object on the page. Each icon is orange and contains a triangle with two rules beneath it. Clicking the link displays another window in which to edit the object.

Editing a Sample Application

To edit a running application, click Application on the Developer toolbar. The Application home page appears. The application ID and application name display at the top of the page.

Description of bldr_hm_top.gif follows
Description of the illustration bldr_hm_top.gif

You can run the current application, edit supporting objects, create shared components, or export and import information by clicking one of the following:

The pages that make up the application appear on the Application home page. To access a specific page, simply click it. To search for a specific page, enter a case insensitive query for the page title or page number in the Page field and click Go.

Viewing Underlying Database Objects

The Application Express engine renders applications in real time based on data stored in database tables. You can view the database objects for any demonstration application in Object Browser, or by viewing the Application Database Object Dependencies report.

Topics:

Viewing the Database Object Dependencies Report

The Database Object Dependencies report identifies database objects referenced by the current application. Review this report to determine what objects to move when deploying an application.

To view the Database Object Dependencies report for an application:

  1. Navigate to the Workspace home page.

  2. Click the Application Builder icon.

  3. Select an application.

    The Application home page appears.

  4. Click Utilities.

  5. Under General Utilities, click Database Object Dependencies.

    The Database Object Dependencies page appears.

  6. Click Compute Dependencies.

Viewing Database Objects in Object Browser

To view the database objects in Object Browser:

  1. On the Workspace home page, click SQL Workshop and then Object Browser.

    Object Browser appears.

  2. Select an object type from the Object list in the upper left corner of the page. For example, to view tables, select Tables.

  3. To search for an object name, enter keywords in the search field beneath the Object list.

    A list of matching objects appears.

    Description of demo_obrws_srch.gif follows
    Description of the illustration demo_obrws_srch.gif

  4. To perform a specific task related to the selected object, select the appropriate task button.

    For example, to modify a column in the DEMO_CUSTOMERS table:

    1. From the Objects list, select Tables.

    2. From the list of tables, select DEMO_CUSTOMERS.

    3. When the DEMO_CUSTOMERS table appears, click the Modify Column tab.

  5. To view additional object details, select a tab beneath the object name. For example, to view the data in the DEMO_CUSTOMERS table:

    1. From the Tables list, select DEMO_CUSTOMERS.

    2. Select the Data tab.

      A report appears that displays the data in the DEMO_CUSTOMERS table appears.

    Description of demo_data.gif follows
    Description of the illustration demo_data.gif

See Also:

"Managing Database Objects with Object Browser" in Oracle Application Express SQL Workshop Guide