Director Tutorials


Creating a Database Pageflow

 
Top of page

Objective

To create a database pageflow using the Database Pageflow Wizard.

The pageflow you create in this exercise accesses two tables that are related by a one-to-many (master/detail) relationship. 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.

Before creating the pageflow, you first need to create a database that has two tables that have a master/detail relationship. In addition, you need to create a connection pool and a database profile.

NOTE:   The Director50Tutorial.zip file includes a SQL file called DBPageFlowTutorial.sql that you can use to create the database for this exercise. Details for loading and executing this file are provided below.

Before you begin   See About exteNd Director Tutorials.

 
Top of page

Concepts

 
Top of page

Exercises

Procedure To create the database required for this exercise:

  1. Start MySQL-Front.

    TIP:   Click the Start menu and navigate to Novell exteNd5.0>MySQL>MySQL- Front.

  2. Connect to MySQL-Host by specifying a password and clicking Connect!:

    tutdpfMySQLConnect

    TIP:   Make sure the port number matches the one provided at installation time.

  3. Select Create Database from the Tools menu.

  4. Type tutorialdb in the Database Name field and click OK.

    tutdpfCreateDB

  5. Select the SQL Query tab.

  6. Click Load SQL from Textfile.

    tutdpfLoadSQL

  7. Specify DBPageFlowTutorial.sql as the file to load.

    NOTE:   The DBPageFlowTutorial.sql file is included in the Director50Tutorial.zip file.

  8. Click Execute SQL.

    tutdpfExecuteSQL

Procedure To create a connection pool for the database:

  1. Start the application server.

    TIP:   Click the Start menu and navigate to Novell exteNd5.0>AppServer>Application Server.

  2. Start the SMC.

    TIP:   Click the Start menu and navigate to Novell exteNd5.0>AppServer>Server Management Console.

  3. Select the Configuration icon from the toolbar, if it's not selected already.

  4. Click Pools.

  5. Choose JDBC and click Add.

  6. Select the Pre-configured exteNd Settings radio button, if it's not selected.

  7. Select MySQL as the database platform and use the default settings for this platform.

    tutdpfJDBCAdd

  8. Click Next.

  9. Specify TutorialDB as the pool name and enter the root user ID and password for MySQL.

    tutdpfPoolName

  10. Click Next.

  11. Enter this string as the JDBC URL:

      jdbc:mysql://localhost:63306/tutorialdb?profileSql=false&maxRows=0
    

    tutdpfJDBCURL

  12. Click Next.

  13. Click Next on each subsequent panel to accept the default settings.

  14. On the final panel of the connection pool wizard, click Finish.

Procedure To create a database profile:

  1. Start exteNd Director.

    TIP:   Click the Start menu and navigate to Novell exteNd5.0>Director>Director Designer.

  2. Open the Express Portal project if it's not open already.

  3. Select Profiles from the Tools menu.

  4. Choose the Databases tab and click New.

  5. Specify TutorialDB as the profile name.

  6. Select com.mysql.jdbc.Driver as the JDBC driver.

  7. Enter this string as the JDBC URL:

      jdbc:mysql://localhost:63306/tutorialdb?profileSql=false&maxRows=0
    
  8. Enter this string as the datasource name:

      JDBC/TutorialDB
    

    tutdpfDBProfile

  9. Click Test to be sure your settings are correct.

  10. If the test is successful, click OK to save the settings.

  11. Click OK to close the Profiles dialog.

Procedure To create the database pageflow:

  1. With the Express Portal project open in exteNd Director, select File>New.

  2. Click the Portlet tab.

  3. Select Database Pageflow and click OK:

    tutdpfDBPFlowWizard1

  4. Select TutorialDB as the database profile enter the root user ID and password for MySQL.

    tutdpfDBPFlowWizard2

  5. Select departments as the primary table for your pageflow.

    tutdpfPFlowWizard3

  6. Click Next.

    The Database Columns dialog displays, showing any tables directly related to the primary table, along with columns defined on these tables.

  7. Select departments in the Database Columns box and add all columns for this table:

    tutdpfDBPFlowWizard4

  8. Select employees in the Database Columns box. Add all columns for this table just you did for the departments table.

    The Selected Columns list should show all of the columns for both tables in the database:

    tutdpfDBPFlowWizard5

  9. Click Next.

  10. Click Next to accept the default settings on the UI Options panel.

  11. Click Next to accept the default selection on the Resource Set panel.

  12. Click Next to accept the default settings on the Specify Formatting panel.

    These settings control the appearance of controls on the Search, View Details, Edit Record, and New Record forms.

  13. Click Next to accept the default settings on the Column Details panel.

  14. Click Next to accept the default settings on the Update Strategy panel.

  15. Type the prefix Tutorial in front of the words departments and employees on the Generated Files panel.

    These strings will be used as the base names for the files that will be generated by the wizard. You need to specify a separate base name for each database table you select.

    tutdpfDBPFlowWizard6

  16. Click Finish.

Procedure To create a personal page that displays the portlet for the pageflow:

  1. Start a browser.

  2. Open the Express Portal application by typing this URL:

    http://host/ExpressPortal

    The default page for a guest user opens in your browser.

  3. Click Login.

    tutdpfLogin1

    The Login dialog opens in your browser:

    tutdpfLogin2

  4. Log in as a portal administrator or as a user, then click login or the Enter key.

    The default page for the user you specified opens in your browser.

    tutdpfPortalWelcomePage

  5. Click Personalize.

  6. Click New.

  7. Type Tutorial as the page name and click Update.

    tutdpfCreateTutorialPage

  8. Click Choose Content.

  9. In the Available Content box, select the TutorialdepartmentsPageflow and click Add.

    tutdpfAddPortlet

  10. Click Close.

  11. Click Portal.

  12. Under Personal Pages, select Tutorial.

    The portlet is initiated and the Search Form is displayed.

    tutdpfSearchForm

Procedure To test the pageflow:

  1. Click the Search button to see a list of all departments in the database.

    tutdpfListDepts

    TIP:   You can also narrow the search by entering one or more characters in either of the fields on the Search Form. For example, you might enter Doc to search for the Documentation department.

  2. Click the View link for the Documentation department:

    tutdpfViewDoc

  3. Click the View link for employee John Coltrane.

  4. Click the Edit link at the bottom of the form:

    tutdpfEditEmpl

  5. Change the salary for John Coltrane to 50000.00 and click Update.

    tutdpfUpdateEmpl

  6. Click New Record at the bottom of the screen.

  7. Specify values for a new employee. When you're done, click Save.

    TIP:   To insert a new employee row, you need to specify a department ID that already exists in the database. Valid department IDs are 1 through 9.

 
Top of page

What to do next



Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...