Pageflow and Form Guide
CHAPTER 7
This chapter provides instructions for using the Database Pageflow Wizard. It contains the following sections:
exteNd Director provides the Database Pageflow Wizard to help you create database pageflows. A database pageflow is a flow that gives the user a way to find, display, and modify records in a database.
The Database Pageflow Wizard lets you create flows that access a single database table, or flows that navigate to other tables that are related by many-to-one relationships (lookups) and/or one-to-many relationships (master/detail).
After you use the wizard, you can run the generated pageflow right away. You can also use the Pageflow Modeler to make changes to the pageflow, just as you would with any other pageflow.
The Database Pageflow Wizard generates a set of forms (XHTML pages that use XForms technology) as well as one or more pageflow processes that tie the forms together into a simple database application. This application provides a convenient and easy-to-use interface for accessing one or more database tables.
Flows that access a single table The following example shows a typical database pageflow used to access a single table:
Master/detail database flows When you build a database pageflow, you specify which table is the primary table. When the wizard knows which table is primary, it can examine the relationships among the various tables you've selected to determine how many levels there are within the query. A lookup (many-to-one relationship) is treated as a single level within the query, whereas a master/detail (one-to-many relationship) is treated as two levels.
When you build a database pageflow that combines data from tables that have a master/detail relationship, the wizard generates multiple pageflow processes, one for each level within the query.
The flow that accesses data in the primary table is the parent flow. The parent flow has a Pageflow activity (View Details) that references a child flow. The child flow accesses data in the detail table. When the user clicks the View link, the parent flow reaches its Pageflow activity, which passes control to the child flow. When the user clicks on the Back link, the child flow reaches its Finish activity, which passes control back to the parent flow.
Here is an example of a parent flow:
Here is an example of a child flow that is referenced by the View Details activity:
When you create a database pageflow, the following forms (XHTML files) are generated for you:
Every pageflow process generated by the Database Pageflow Wizard includes a Data Set object that provides all of the information required to access the database.
For more information on the Data Set, see Working with the Data Set.
Each pageflow process created by the Database Pageflow Wizard includes a Form activity for each form created. In addition, the flow contains the following database activities:
If you specify that you want to use a change log, the Apply Change Log activity is also included in the flow:
Activity |
Description |
---|---|
Apply Change Log activity |
Applies all changes from the record cache to the database.
|
The pageflow also contains the following additional activities:
To create a database pageflow process:
If you do not have a profile for the database you want to connect to, create one by clicking the New button.
Specify settings in the Create a New Database Profile dialog as follows:
Click Test to check the connection to the database specified by the JDBC URL.
This test makes a JDBC connection to the database. The test will fail when a connection is not available or a setting is not correctly specified.
On the test popup, enter your database user name and password and click OK to verify access.
Optionally enter your database user name and password on the Database Profile dialog and click OK:
Select the columns you want to use in your database pageflow in the Database Columns dialog and click OK:
Any tables directly related to the primary table are listed as choices in the Database Columns box, along with columns defined on the primary table.
To select columns for a related table, first open the table in the Database Columns box, then select the columns.
Specify how you want to format the controls on forms:
These settings control the appearance of controls on the Search, View Details, Edit Record, and New Record forms.
Specify the base names for the files that will be generated. You need to specify a separate base name for each database table you selected:
After you run the wizard, you use the Pageflow Modeler to make changes to the pageflow. You can also use the Form Designer to make changes to the generated forms.
Here are some things to keep in mind when editing a generated database pageflow:
When you make a change to a pageflow, this does not change any of the forms used by the flow.
If you want to add or remove a column in a database pageflow, you need to manually add or remove the corresponding field in one or more forms. To add or remove a database column, you need to make changes in the property sheet for the Data Set. Once you've done this, you typically need to add the column to the design-time instance data in each form, as well as add the input or output control to the form.
For complete details on making changes in the property sheet for the Data Set, see Working with the Data Set. For complete details on modifying the instance data or the controls associated with a form, see Form Designer.
If you prefer not to make manual changes to a database flow, you can run the Database Pageflow Wizard again. When you run the wizard, you can either overwrite your old flow and forms, or create new ones.
The Data Set provides all of the information that a pageflow requires to connect to a database and access rows and columns of data. The Data Set lets you make changes to various database settings. In many cases, it simply allows you to modify settings you specified when you first ran the Database Pageflow Wizard. In other cases, it lets you make changes to more advanced settings that are not available in the wizard.
Each Data Set has a unique name that is referenced by the following database activities:
Since the Data Set encapsulates all of the information needed to access the database, these activities do not need to specify this kind of information. Instead, they simply point to a Data Set object:
The properties of the Data Set are:
Property Inspector tab |
Property name |
Description |
---|---|---|
Activity |
Name |
Specifies a name for the activity. |
Description |
Describes what the activity does. |
|
Data Set |
Advanced Settings |
Allows you to specify concurrency and caching settings, as well as other details that control database access.
|
Enable Changelog |
Indicates whether the change log will be enabled for this flow. Changing this setting does not add or remove activities or links within the flow, nor does it alter the forms associated with the flow. Therefore, if you want to add or remove the Apply Change Logs activity or the Apply Changes links in the forms, you need to make these changes by hand. |
|
JNDI Data Source |
Identifies the data source. The valid data source types are:
|
|
Columns |
Lets you add or remove columns from the pageflow or change their properties. |
|
Row Limit |
Specifies the maximum number of rows that will be retrieved. |
|
Rows Per Page |
Specifies the number of rows that will be displayed on each page of the View Results form. |
|
Sort Order |
Allows you to specify the order in which rows will be sorted in the result set. For more information, see Sort order. |
The Advanced Settings dialog lets you specify several settings that are not available in the Database Pageflow Wizard.
On the Concurrency tab, you can select columns for concurrency checking:
The columns you select are used to verify that no changes were made to the database record since the time it was first retrieved. If any changes were made, an attempt to modify the record will fail.
On the Caching tab, you can specify a caching strategy for the flow, as shown below:
The caching strategy used for a database pageflow has a direct effect on how well the flow performs at runtime. The strategy you select will depend on your application requirements. If you're most concerned about memory usage, select Strategy 1. If you're most concerned about minimizing database access operations, select Strategy 3. For a more balanced approach, select Strategy 2.
The SQL Details tab provides some additional settings for those who want greater control over how the pageflow accesses the database at runtime. It lets you override the default SQL handler class and also specify whether identifiers will be wrapped in quotes in SQL statements.
The Sort Order dialog lets you specify the order in which rows will be sorted in the result set. A database pageflow can have up to four levels of sorting:
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...