14.10.2013 Views

Download - FileMaker

Download - FileMaker

Download - FileMaker

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Creating JavaServer Pages with<br />

<strong>FileMaker</strong> Pro 5 Unlimited and<br />

Macromedia Dreamweaver<br />

UltraDev 4<br />

-August 2001-


Introduction<br />

2<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

A brief introduction to creating JavaServer Pages that access <strong>FileMaker</strong> ® Pro 5 Unlimited databases with Macromedia<br />

Dreamweaver UltraDev, running under Macromedia JRun Server on Microsoft Windows NT and Windows 2000 Servers.<br />

JavaServer Pages (JSP) is an ever increasingly popular technology for creating and deploying web based applications. <strong>FileMaker</strong> Pro users<br />

have long sought to broaden their reach when it comes to creating compelling web solutions.Two events have combined to make this goal a<br />

reality. Macromedia UltraDev 4 is easier to use than ever, and several of its new features and enhancements now allow it to interface smoothly<br />

with <strong>FileMaker</strong> Pro 5 Unlimited. Making this great combination possible in the first place is the new improved Java Database Connectivity driver<br />

(JDBC) from <strong>FileMaker</strong>, Inc.This new improved driver allows <strong>FileMaker</strong> Pro databases to be accessed from JavaServer Pages. JSP is a standard<br />

technology developed by Sun Microsystems, Inc. for creating dynamic web applications that access databases like <strong>FileMaker</strong> Pro. Because<br />

UltraDev supports the visual creation of JSP pages, it is now possible to harness the visual authoring power of UltraDev to create compelling<br />

web based interfaces for your <strong>FileMaker</strong> databases.<br />

The first thing you must know is how all these pieces come together to create a working web application. The main<br />

components are a database (<strong>FileMaker</strong> Pro 5 Unlimited), a database driver (<strong>FileMaker</strong> JDBC driver), an application server<br />

(Macromedia JRun Server),a web server (Microsoft IIS),and a tool for creating JSP files (Macromedia Dreamweaver UltraDev).<br />

If you have used Macromedia Dreamweaver UltraDev this document may seem very familiar to you. The fine folks at<br />

Macromedia have given <strong>FileMaker</strong>, Inc. permission to use their tutorial and demonstration files in order to quickly and easily<br />

explain how to create JSP with UltraDev and <strong>FileMaker</strong> Pro 5 Unlimited.<br />

EXPECTATIONS<br />

A friend of mine in the consulting business is fond of saying that "Satisfaction equals Perception minus Expectation." In order<br />

for this tutorial to be successful, let's set some expectations from the start.<br />

This guide is:<br />

• A brief overview of how to create JavaServer Pages with UltraDev that contain dynamic data from <strong>FileMaker</strong> Pro 5<br />

Unlimited.These JavaServer Pages will be executed by Macromedia JRun, running on Microsoft Windows NT or<br />

2000 Server.<br />

• An explanation of some of the special considerations necessary when using JDBC and UltraDev with <strong>FileMaker</strong> Pro<br />

5 Unlimited.<br />

It is NOT a:<br />

• Guide to writing JavaServer Pages.<br />

• Guide to troubleshooting Microsoft Window NT/2000 Server, JDBC connection parameters, or debugging<br />

JavaServer Pages.<br />

• Database design guide.<br />

• Collection of benchmarks on <strong>FileMaker</strong> Pro 5 Unlimited performance.


Overview<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

This tutorial shows you how to build a simple Web application using Dreamweaver UltraDev. You'll create a Web-based<br />

employee directory that accesses a <strong>FileMaker</strong> Pro database served up by <strong>FileMaker</strong> Pro 5 Unlimited for a fictitious adventure<br />

travel company called Compass.The directory will give Compass employees the ability to search and get more information<br />

about their coworkers.<br />

Along the way, you will learn how to build the following pages:<br />

• Two sets of search/results pages-a simple one requiring no knowledge of SQL (Structured Query Language, a common<br />

database language), and a more advanced set requiring very little knowledge of SQL<br />

• A detail page to display the information about particular employees, including their photographs<br />

• An insert page allowing the site administrator to insert new employee records in the database with a Web browser.<br />

This tutorial also covers the following one-time-only tasks:<br />

• Defining a local site so you can develop the Web application on your local system<br />

• Defining a remote site so you can deploy the application on a Web server<br />

• Configuring UltraDev to work with your JRun server<br />

• Creating a database connection so you can interact with the tutorial database<br />

To complete this tutorial, you will need the following:<br />

Software<br />

• <strong>FileMaker</strong> Pro 5 Unlimited and <strong>FileMaker</strong> Pro Compass database tutorial file.The Compass tutorial database file<br />

(named "employees") is available at:<br />

http://www.filemaker.com/downloads/index.html<br />

• Macromedia Dreamweaver UltraDev 4 and the installed JSP Tutorial files<br />

• Macromedia JRun 3.1 or higher<br />

• Microsoft Windows NT or 2000 Server with Microsoft Internet Information Services<br />

• Sun Java 2 SDK, Standard Edition, for Windows, version 1.18 or above<br />

• <strong>FileMaker</strong> Pro JDBC driver version 1.2 driver.The <strong>FileMaker</strong> Pro JDBC driver is available at:<br />

http://www.filemaker.com/support/updaters.html#fmpdjdbc<br />

See Appendix H for locations of trial software downloads of each product.<br />

Hardware<br />

• Appropriate hardware for Windows NT or 2000 Server as Web and JRun server<br />

• Appropriate hardware for running <strong>FileMaker</strong> Pro 5 Unlimited<br />

• Development machine for running Macromedia UltraDev<br />

See the associated Appendices for hardware requirements.<br />

For the purposes of this tutorial, the Web Server / JRun Server machine must be a Windows NT or Windows 2000 machine.<br />

As additional testing is completed <strong>FileMaker</strong>, Inc. may publish information detailing a similar Mac OS server configuration. (JRun<br />

Server is compatible with many different web servers. For a complete list of supported servers, see Appendix G.)<br />

3


4<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

Configuring your computers<br />

This diagram provides a simplified overview of the development and deployment system you will be using in this tutorial:<br />

To configure your Web Server / Java Application Server machine:<br />

1. Make sure Internet Information Services (IIS) is installed and running on your system. IIS is the full-featured version<br />

of PWS. It should already be installed on your system. If not, install it or ask your system administrator for help.<br />

Appendix C contains pointers to Microsoft documentation and support for IIS.<br />

2. Make sure FTP services are installed along with the standard IIS HTTP services.The FTP root folder should be the<br />

same as your HTTP root folder (by default it is c:\Inetpub/wwwroot)


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

3. Install the following components on your the system:<br />

• Java 2 SDK, Standard Edition, for Windows<br />

• Macromedia JRun. See Appendix G for JRun configuration information<br />

4. Create a subfolder in the c:\Inetpub\wwwroot folder and call it: MyTutorialSite<br />

5. Here's the correct folder structure: c:\Inetpub\wwwroot\MyTutorialSite<br />

Configuring <strong>FileMaker</strong> Pro 5 Unlimited<br />

1. For best performance, <strong>FileMaker</strong> Pro 5 Unlimited should run on a separate machine than Microsoft Internet<br />

Information Services and Macromedia JRun.<br />

2. Launch <strong>FileMaker</strong> Pro 5 Unlimited and choose Edit » Preferences » Application<br />

The Preferences dialog appears<br />

3. Select the Plug-Ins tab<br />

4. If it is not already checked, enable the Web Companion plug-in<br />

5. Choose Configure<br />

The Web Companion Configuration dialog appears<br />

6. Note the TCP/IP Port number.The tutorial will use a port number of 591.<br />

7. Choose File » Open and open the "employees" database.<br />

If <strong>FileMaker</strong> Pro 5 Unlimited is running on a Microsoft Windows NT or 2000 machine, you will need to select "All Files (*.*)"<br />

from the Files of Type pop-up menu.When using the <strong>FileMaker</strong> JDBC driver with UltraDev, <strong>FileMaker</strong> database files may not<br />

have extensions.<br />

Configuring UltraDev<br />

Define a local site<br />

A local site tells UltraDev where all the documents and files of a particular Web site are stored on your local disk.You must<br />

define a local site to develop a Web application using UltraDev.When you installed UltraDev, it automatically created a local<br />

site for you.<br />

To choose a local site, launch UltraDev, open the Site window Site» Site Files,and select the site from the pop-up menu on<br />

the toolbar: JSP tutorial site. If you need to restart the tutorial from scratch, clean copies of the tutorial files are available in<br />

the Tutorial folder in the Dreamweaver UltraDev application folder.The complete path to the Tutorial folder varies, depending<br />

on where you installed Dreamweaver UltraDev<br />

5


Define the remote site folder in UltraDev<br />

6<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

In UltraDev, you define the tutorial's remote site folder by specifying the published folder you set up on the Web server,<br />

then uploading all the tutorial files to it.<br />

1. Choose Site » Define Sites.<br />

A dialog box appears listing currently defined sites.<br />

2. Select your tutorial site from the list and click Edit.<br />

3. In the Category list on the left, click Remote Info.<br />

4. Choose the following Access options: FTP.<br />

5. Enter the host name of the FTP host (the server JRun is installed on), and enter the name of the host directory on<br />

the remote site (c:\inetpub\wwwroot\MyTutorialSite).The host directory is where documents visible to the public are<br />

stored. Next, enter the login name and password used to connect to the FTP server, and then select the<br />

appropriate firewall options.<br />

6. Click OK and click Done.<br />

7. In the Site window (Site » Site Files), verify that you've specified the correct folder on the remote site. If you're<br />

using FTP, click the Connect button to view the remote site.<br />

8. Select all the files under Local Folder, including the Images folder, and click the blue up-arrow on the toolbar to<br />

upload them to the remote site.<br />

Configure UltraDev to work with JRun Application Server<br />

You must specify the kind of application server you are using so UltraDev knows what server-side scripts to insert in your<br />

dynamic pages.You must also specify a URL prefix so UltraDev can borrow the services of the application server at design<br />

time.Among other things, UltraDev uses the application server at design time to power the Live Data window and to establish<br />

connections to databases.The Live Data window is a fully functional, visual design and editing environment that displays your<br />

page's dynamic content at design time.


Specify a URL prefix<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

You must specify a URL prefix so UltraDev can borrow the services of your application server at design time.<br />

1. Choose Site » Define Sites.<br />

A dialog box appears listing currently defined sites.<br />

2. Select your tutorial site and click Edit.<br />

3. In the Category list on the left, click Application Server.<br />

4. Verify the URL prefix in the URL Prefix box.<br />

5. UltraDev tries to determine your URL prefix based on the settings for your remote site. If the UltraDev guess is<br />

wrong, correct the URL prefix.The URL prefix is the URL users type into their browsers to open your Web<br />

application, minus the file name at the end. For example, if your tutorial's URL is:<br />

http://www.macromedia.com /MyTutorialSite/Search.htm<br />

Enter the following URL prefix:<br />

http://www.macromedia.com/MyTutorialSite/<br />

6. If UltraDev runs on the same system as your Web server, you can use the term "localhost" as a stand-in for your<br />

domain name. For example, if your application's local URL is http://buttercup_pc/MyTutorial/Search.htm, you can<br />

enter the following URL prefix:<br />

http://localhost/MyTutorial/<br />

7. Click OK, then click Done.<br />

Create a database connection<br />

A database connection is a set of parameters you define to establish a link to a database. Without it, your application won't<br />

know where to find the database or how to talk to it. In this part of the tutorial, you'll create a connection to the tutorial's<br />

<strong>FileMaker</strong> Pro database file, employees.<br />

7


8<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

1. In the UltraDev Document window, choose Modify » Connections.<br />

The Connections dialog box appears.<br />

2. Click New and choose your driver from the pop-up menu. If your driver does not appear, choose Custom JDBC<br />

Connection.<br />

A connection dialog box appears.<br />

3. In the Connection Name box, enter connCompass.<br />

A common practice is to add the prefix conn to connection names to distinguish them from other object names<br />

in your code.<br />

4. Enter the JDBC driver's connection parameters.<br />

For the parameters specific to the <strong>FileMaker</strong> JDBC driver, see Appendix D.<br />

5. URL: jdbc:fmpro:http://IP address of the JRun machine:Port number of JRun default server/<br />

For example:<br />

jdbc:fmpro:http://17.184.22.6:591/properties?fetchsize=10<br />

Here we are making use of the <strong>FileMaker</strong> JDBC driver property fetchsize. Since the results will be returned in small<br />

groups of records, specifying a smaller fetchsize will improve performance.<br />

6. User Name: Enter appropriate user name according to your configuration.<br />

7. Password: Enter appropriate password according to your configuration.<br />

8. Specify how UltraDev should connect to the database at design time: select the Using Driver on Application Server<br />

option.<br />

9. Click the Test button to verify that the connection can be created successfully. If not, retrace your steps above to<br />

ensure that the <strong>FileMaker</strong> JDBC driver is installed at the location listed above.<br />

10. Click OK to close the connection dialog box.<br />

Your new connection, connCompass, appears in the Connections dialog box.<br />

11. Click Done to close the Connections dialog box.


Create a simple search/results page set<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

You're now ready to build the employee directory for the Compass intranet site. In this part of the tutorial, you'll create a<br />

simple search/results page set that lets Compass employees look up their coworkers online using a single search parameter.<br />

Building this simple page set requires almost no knowledge of SQL (Structured Query Language).<br />

The search and results pages have been laid out for you. Your job is to make them work together. Later, you'll extend the<br />

application with a detail page to display more information about each employee (including the employee's photo) and a page<br />

to insert new employee records in the database.<br />

Prepare the search page<br />

You need a search page to obtain search parameters from the user. A simple search page uses an HTML form to get a single<br />

search parameter and submit it to the results page on the server.This results page, not the search page, conducts the actual<br />

search and displays the results. In the HTML form, specify the results page that will use the search parameter collected in the<br />

form.<br />

1. Make sure the Site window is open.<br />

Choose Window » Site Files to display the Site window.<br />

2. Make sure your tutorial site is selected, and then double-click the Search.htm file under Local Folder.<br />

The simple search page for the Compass employee directory opens.This search page lets users conduct a search<br />

by department.<br />

3. In the Document window, select the form by clicking the Department list/menu form object, then clicking the<br />

rightmost tag on the tag selector.<br />

The form is selected.<br />

4. Make sure the Property inspector is open.<br />

Choose Window » Properties to open the Property inspector.<br />

5. In the Action box, click the folder icon and choose the file called Results.<br />

6. In the Method pop-up menu on the Property inspector, choose GET.<br />

Choosing GET ensures that the search parameters are passed to the server in the URL string used to open the<br />

results page.You will learn more about using the URL to pass parameters later in this tutorial.<br />

9


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

7. Rename the list/menu form object by clicking it then entering mnuDept in the List/Menu box on the Property<br />

inspector (Window » Properties).<br />

8. Save your work (File » Save).<br />

That is all for the search page.You are ready to build the results page, which involves defining a recordset to hold the search<br />

results and displaying the search results on the page.<br />

Define a filtered recordset for the results page<br />

A recordset is a subset of data extracted from one or more tables in a database. It acts as a source of data for your dynamic<br />

pages.You will define a recordset that contains only the records returned by the search. For a simple search/results page set,<br />

you can create this kind of recordset by defining a filter.<br />

You will begin by defining the general outlines of the recordset.<br />

10<br />

1. In the Site window, (Window » Site Files) double-click the Results file under Local Folder.<br />

The simple results page for the Compass employee directory opens in UltraDev.<br />

2. In the Data Bindings panel (Window » Data Bindings), click the Plus (+) button and select Recordset (Query) from<br />

the pop-up menu.<br />

The simple Recordset dialog box appears.<br />

3. If the advanced Recordset dialog box appears instead, click Simple.<br />

4. In the Name box, enter Results.<br />

5. This is the name of your recordset. Do not confuse it with the file name of your page. In this case, they happen to<br />

be the same.<br />

6. Select the connCompass connection from the Connection pop-up menu.<br />

7. If it doesn't appear in the menu, click the Define button to create it. For instructions, see "Create a database<br />

connection" on page 50 of the Macromedia Dreamweaver UltraDev manual.<br />

8. In the Table pop-up menu, select EMPLOYEES.<br />

9. In the Columns area, click the Selected option to choose selected columns in the EMPLOYEES table.<br />

10. Control-click (Windows) or Command-click (Mac OS) the following columns in the list to include them in the<br />

recordset: EMPLOYEEID, FIRSTNAME, LASTNAME, DEPARTMENT, and EXTENSION.


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

11. The results page displays information from four of these columns.You include the EMPLOYEEID column because<br />

it contains information identifying individual records-information that will become useful later when you build a<br />

detail page.You could also use the special <strong>FileMaker</strong> Pro pseudo column RecordID , see Appendix E for more<br />

details.<br />

12. Click Test to test the recordset.<br />

A recordset appears containing data extracted from the database table. Click OK to close it.<br />

By default, the recordset contains all the records in the database table. Leave the Recordset dialog box open for now.You'll<br />

use it next to create a filter to remove all the records that don't meet the search criteria.<br />

To create the recordset filter:<br />

1. From the first pop-up menu in the Filter area, choose DEPARTMENT.<br />

You know the search parameter submitted by the search page is a department name.Therefore, you set up the<br />

filter so that it compares this name against each name in the DEPARTMENT column in the database table. If the<br />

filter finds a match, the record is included in the search results.<br />

2. From the pop-up menu beside the first menu, select the equal sign (it should be the default).<br />

This choice states that you want only those records with DEPARTMENT column values that match exactly the<br />

department name submitted by the search page.<br />

3. From the third pop-up menu, select URL Parameter (it should be the default).<br />

Earlier on your search page, you specified the GET method for the HTML form, ensuring that the search<br />

parameter is passed to the server in the URL string. he server reads the string and stores the search parameter in<br />

memory as a URL parameter.<br />

4. In the fourth box, enter mnuDept, the name of the form object used to collect the search parameter on the<br />

search page.<br />

Here's how your Filter section should look:<br />

5. Click OK.<br />

UltraDev adds the recordset to your list of available data sources in the Data Bindings panel.To view the fields you<br />

defined for the recordset, expand the recordset branch.<br />

11


12<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

6. Save your work (File » Save).<br />

The next step is to display the results on the page.<br />

Add dynamic content to the results page<br />

After defining a filtered recordset, you can use its columns as sources of dynamic content for your page. For the results page,<br />

you'll use the following fields as data sources: FIRSTNAME, LASTNAME, DEPARTMENT, and EXTENSION.<br />

1. Make sure the Data Bindings panel is open (Window » Data Bindings) and lists the Results recordset you just<br />

defined. Expand the recordset's branch to see the data sources you need-namely, FIRSTNAME,LASTNAME,<br />

DEPARTMENT, and EXTENSION.<br />

2. If these columns don't appear in the list, click the Plus (+) button to define a new recordset<br />

3. You will begin by adding the LASTNAME data source to the page.<br />

4. On the page, double-click the word "LAST" to select it.<br />

5. In the Data Bindings panel, select LASTNAME and click Insert, or drag LASTNAME onto the text you selected<br />

on the page.<br />

6. A data placeholder replaces the text selection on the page and the necessary server-side scripts are added to the<br />

page's HTML source code. When the server runs the page, the placeholder will be replaced with live data from<br />

the recordset.<br />

7. Repeat steps 2 and 3 to replace the word "First" with the FIRSTNAME data source, the word "dept" with the<br />

DEPARTMENT data source, and the word "Ext" with the EXTENSION data source.<br />

8. Save your work (File » Save).<br />

9. If you make a mistake, open the Server Behaviors panel (Window » Server Behaviors), select the dynamic content<br />

(one of the Dynamic Text items), and click the Minus (-) button to delete it.<br />

View your work in the Live Data window<br />

To display the page in the Live Data window, you must provide it with a URL parameter because the page is expecting one<br />

from a search page. For testing purposes, you can simulate a search query by choosing Live Data Settings from the View menu,<br />

clicking the URL Request Plus (+) button, and entering the following values:<br />

• Name: mnuDept<br />

• Value: Trip Staff<br />

Click OK to close the Live Data Settings dialog box, then choose View » Live Data.The Live Data window shows the first<br />

record in the recordset. By default, a dynamic page displays only a single record. Naturally, you would like to show all the<br />

records found, not just one.<br />

Add a repeated region to the results page<br />

A search often returns more than one record. In this part of the tutorial, you will give your page the ability to display more<br />

than one record by adding a repeated region to the page.You create a repeated region by applying the Repeat Region server<br />

behavior to a page element-in this case, a table row. When the results page runs on your server, the Repeat Region server<br />

behavior will repeat the table row to accommodate all the records in the Results recordset. Each row will display the content<br />

of one employee record.


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

1. Select the table row with the dynamic content by clicking anywhere in the row and clicking the rightmost <br />

tag in the tag selector.<br />

The table row is outlined.<br />

2. In the Server Behaviors panel (Window » Server Behaviors),click the Plus (+) button and select Repeat Region.<br />

3. In the Repeat Region dialog box, make sure the Results recordset is selected.<br />

4. In the Show area, enter 5.<br />

5. The page will only display five records at a time even if more than five records are found.The user will need to<br />

click the Next icon to see the other records.<br />

(You'll activate the Next icon later in the tutorial.)<br />

6. Click OK.<br />

7. View the page in the Live Data window.<br />

8. If you're already working in the Live Data window, click the Refresh button (the circular arrow) on the toolbar. If<br />

you're working in the Document window, choose View » Live Data.<br />

9. Where only one of the search results was displayed, now five records are displayed.<br />

10. Save your work (File » Save).<br />

11. If you make a mistake, open the Server Behaviors panel (Window » Server Behaviors) and double-click the repeat<br />

region in the list to edit it.<br />

Activate the recordset navigation links<br />

The results page should allow users to move forward and backward through the results if the search returns more than five<br />

results.The tutorial page includes "Previous" and "Next" images for this purpose.Your job is to activate these images so that<br />

when a user clicks one, the page displays more results (if any more exist).<br />

1. Select the "Previous" image on the page.<br />

2. In the Server Behaviors panel, click the Plus (+) button and select Move to Record » Move to Previous Record.<br />

The Move to Previous Record dialog box appears.<br />

3. In the Recordset pop-up menu, make sure the Results recordset is selected, and then click OK.<br />

4. Repeat the procedure for the "Next" image, only this time select Move to Record » Move to Next Record from<br />

the pop-up menu.<br />

5. Save your work (File » Save).<br />

If you make a mistake, select the server behavior in the Server Behaviors panel and click the Minus (-) button to delete it.<br />

Add a record counter to the results page<br />

If your searches are likely to produce many results, you can add a record counter to your page to help users keep track of<br />

where they are in the recordset.You can create a record counter in a single operation using an UltraDev live object.<br />

1. Place the insertion point in the row above the "Previous" and "Next" images.<br />

2. Choose Insert » Live Objects » Recordset Navigation Status.<br />

3. Make sure your Results recordset is selected.<br />

13


14<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

4. Click OK.<br />

5. Save your work (File » Save).<br />

UltraDev builds and adds the record counter to your page. Except for the dynamic content, the record counter is fully<br />

customizable.To view the completed results page in the Live Data window, click the Refresh button on the Live Data window's<br />

toolbar. If you're working in the Document window, choose View » Live Data.<br />

Note:The "Previous" and "Next" links do not work in the Live Data window.To test them, you must upload the page to your<br />

published directory on the server and open the page in a browser.<br />

Create an advanced search/results page set<br />

In this part of the tutorial, you will create an advanced search/results page set that lets Compass employees look up their<br />

coworkers by using more than one search parameter. Building an advanced search/results page set in UltraDev requires some<br />

knowledge of SQL (Structured Query Language). The tutorial provides the SQL statement required to make the pages work.<br />

Prepare the advanced search page<br />

The advanced search page uses an HTML form to get multiple search parameters and submit them to the results page on<br />

the server.This results page, not the search page, conducts the actual search and displays the results.<br />

In the HTML form, specify the results page that will use the search parameters collected in the form.<br />

1. Make sure the Site window is open.<br />

2. Choose Window » Site Files to display the Site window.<br />

3. Double-click the SearchAdv.htm file under Local Folder.<br />

The advanced search page for the Compass employee directory opens in UltraDev.This search page lets users<br />

conduct a search using the employee's last name, department, or both.<br />

4. In the Document window, select the form by clicking the Department list / menu form object, then clicking the<br />

rightmost tag in the tag selector.<br />

5. Make sure the Property inspector is open.<br />

6. Choose Window » Properties to open the Property inspector.


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

7. In the Action box, click the folder icon and choose the ResultsAdv file.<br />

8. In the Method pop-up menu, choose GET.<br />

Choosing GET ensures that the search parameters are sent to the server in the URL string used to open the<br />

results page.<br />

9. Rename the form objects as follows:<br />

10. Click the text field and enter txtLastName in the Text Field box on the Property inspector.<br />

11. Click the list/menu object and enter mnuDept in the List/Menu box on the Property inspector.<br />

12. Save your work (File » Save).<br />

That is all for the search page. Next you'll build a results page that can handle multiple search parameters.<br />

Define a recordset for the advanced results page<br />

You will add a recordset to the results page that contains only the records returned by the search. For an advanced<br />

search/results page set, you create this kind of recordset by writing a SQL statement that uses the search parameters passed<br />

by the search page.The search parameters are stuffed in variables in the SQL statement, which is then used to generate the<br />

recordset.<br />

1. In the Site window, double-click the ResultsAdv file under Local Folder.<br />

The advanced results page for the Compass employee directory opens in UltraDev.<br />

2. In the Data Bindings panel (Window » Data Bindings),click the Plus (+) button and select Recordset (Query) from<br />

the pop-up menu.<br />

3. The simple Recordset dialog box appears. Click the Advanced button to switch to the advanced Recordset dialog<br />

box.<br />

4. In the Name box, enter Results.<br />

5. In the Connection pop-up menu, select connCompass.<br />

6. If it does not appear in the list, click the Define button to create it. For instructions, see "Create a database<br />

connection" on page 50.<br />

7. In the Database Items area at the bottom of the dialog box, expand the Table branch, and then expand the<br />

EMPLOYEES branch.<br />

8. Next, you will build the Select clause.<br />

9. Select EMPLOYEEID in the Database Items area and click the Select button.<br />

10. Select FIRSTNAME and click the Select button.<br />

11. Select LASTNAME and click the Select button.<br />

12. Select DEPARTMENT and click the Select button.<br />

13. Select EXTENSION and click the Select button.<br />

14. In the SQL text area, enter the following line below FROM EMPLOYEES WHERE LASTNAME LIKE<br />

'varLastName' AND DEPARTMENT LIKE 'varDept'<br />

The full statement in the SQL text area should look as follows:<br />

SELECT EMPLOYEEID, LASTNAME, FIRSTNAME,DEPARTMENT, EXTENSION<br />

FROM EMPLOYEES<br />

WHERE LASTNAME LIKE 'varLastName' AND DEPARTMENT LIKE 'varDept'<br />

15


16<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

15. "Stuff " the two SQL variables, varLastName and varDept, with the values of the search parameters passed by the<br />

search page by clicking the Plus (+) button in the Variables area and entering the following information.<br />

The default value is the value the variable should take if no run-time value is returned.The run-time value is usually<br />

a server object holding a value sent by the search page.<br />

16. If you are satisfied with the recordset, click OK.<br />

UltraDev adds the recordset to your list of available data sources in the Data Bindings panel.<br />

When the SQL query runs on the server, each record in the database table is checked. If the specified field in a record meets<br />

the Where condition, the record is included in the recordset.The query in effect builds a recordset containing only the search<br />

results.<br />

Display the results on the page<br />

After defining the recordset, you can use its columns as sources of dynamic content for your page.The procedure for adding<br />

the data to the page is identical to the procedure for the simple result page.<br />

To view your work in the Live Data window, you must provide the page with some test parameters to simulate the URL<br />

parameters submitted by your search page. Provide those test parameters by choosing View » Live Data Settings and<br />

entering the following values:<br />

Click OK to close the dialog box, and then choose View » Live Data.<br />

Give your page the ability to display more than one record by creating a repeated region on the page and activating the<br />

"Next" and "Previous" recordset navigation images.The steps are the same as for the simple results page. Finally, add a record<br />

counter to help users keep track of where they are in the recordset.<br />

Create a detail page<br />

Name Default Run-time Value<br />

varLastName % request.getParameter("txtLastName")<br />

varDept % request.getParameter("mnuDept")<br />

By now, you should have created at least one results page that can list employees. In this part of the tutorial, you will create<br />

a detail page that displays more information about each employee listed on the results page.The detail page will even display<br />

a photograph of the employee.<br />

Here is how this "master/detail" set of pages should work: A user viewing the list of employees on the results (master) page<br />

should be able to see more details about any listed employee by clicking a link specific to that employee. The link opens a<br />

detail page showing more details about the selected employee. By making the detail page dynamic, you do not have to create<br />

a separate detail page for each employee.You create one detail page with content that changes at run time depending on the<br />

link the user clicks on the results page.<br />

The first step in setting up this master/detail page set is to add a link on the results page to open the detail page.<br />

Name Value<br />

txtLastName Nicholas<br />

mnuDept Trip Staff


Add a link on the results page<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

Clicking an employee link on your results page should open a detail page displaying more information about the employee.<br />

However, using a standard link to open the detail page won't work: to retrieve the correct record, the detail page needs to<br />

know what employee the user selected on the results page. In other words, the results page must pass information to the<br />

detail page.<br />

Use the following steps to add a link that passes information from the results page to the detail page. Perform this procedure<br />

for both versions of your results pages (the files called Results and ResultsAdv).<br />

1. Make sure your results page is open in UltraDev.<br />

2. On the results page, click the "View" image to select it.<br />

3. If you are working in the Live Data window and it displays multiple records, select the first "View" image in the<br />

column.<br />

4. In the Server Behaviors panel (Window » Server Behaviors),click the Plus (+) button and select Go to Detail Page<br />

from the pop-up menu.<br />

The Go to Detail Page dialog box appears.<br />

5. In the Detail Page box, click Browse and select the file called Detail (the pre-designed detail page), then click OK.<br />

6. In the Pass URL Parameter box, enter a parameter called id and make sure the parameter is set to the value of<br />

the EMPLOYEEID column in the Results recordset.<br />

7. You're telling the page to pass a parameter called id to the detail page.<br />

8. The parameter identifies the employee selected by the user.The server will set the parameter's value to the value<br />

specified in the Recordset and Column pop-up menus.<br />

9. Click OK and save your work (File » Save).<br />

When the user clicks the linked "View" image on the results page, not only will the detail page open, but information identifying<br />

the record the user chose will be passed to the detail page so it can display the correct employee details.You are finished<br />

with the results page. Now you need a detail page that can display detailed information about employees selected on the<br />

results page.<br />

Define a recordset for the detail page<br />

You will define a recordset for the detail page to hold the detailed employee information. Begin by opening the pre-designed<br />

detail page.<br />

1. In the Site window, double-click the Detail file under Local Folder.<br />

The Compass detail page opens in UltraDev.<br />

2. In the Data Bindings panel (Window » Data Bindings),click the Plus (+) button and select Recordset (Query) from<br />

the pop-up menu.<br />

3. The simple Recordset dialog box appears. If the advanced Recordset dialog box appears instead, click Simple.<br />

4. In the Name box, enter Details.<br />

5. In the Connection pop-up menu, choose connCompass.<br />

6. In the Table pop-up menu, select EMPLOYEES.<br />

7. In the Columns area, make sure the All option is selected.<br />

17


8. For this page, you want to retrieve data in all the columns in the table.<br />

9. Click Test to test the recordset.<br />

10. A recordset appears containing data extracted from the database table. Click OK to close it.<br />

11. Click OK and save your work (File » Save).<br />

Add dynamic content to the detail page<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

After defining the recordset, you can use its columns as sources of dynamic content for the detail page.<br />

1. Make sure the Data Bindings panel is open (Window » Data Bindings) and lists the Details recordset you just<br />

defined. Expand the recordset's branch to see the data sources you need.<br />

2. On the detail page, double-click the text string LastName (in the blue table row) to select it.<br />

3. In the Data Bindings panel, select the LASTNAME field and drag it onto the selected string on the page.<br />

4. Repeat steps 2 and 3 (select text on page, then drag the corresponding data source to it) for the other text strings on<br />

the page, as follows:<br />

• Drag FIRSTNAME to FirstName<br />

• Drag PHONE to number<br />

• Drag STARTDATE to date<br />

• Drag DEPARTMENT to dept<br />

• Drag EXTENSION to ext<br />

• Drag EMAIL to email<br />

• Drag NOTES to notes<br />

Next, you will bind the source attribute of the image on the page to display employees' photographs.The source attribute<br />

consists of a text string such as jones_lyn.jpg stored in the database.<br />

1. Open the Property inspector (Window » Properties).<br />

2. Click the image on the page, and then click the small folder icon beside the Src box on the Property inspector.<br />

3. The Select Image Source dialog box appears.<br />

4. Select the Data Sources option.<br />

5. A list of data sources appears.<br />

6. Select PHOTO from the list.<br />

7. In the URL box, type images/ at the start of the line of code.<br />

8. The employees database contains the file names of the images, not the folder where they are stored on your site.<br />

The code in the URL box will retrieve the correct file name from the database and insert it in the image's source<br />

attribute.<br />

9. Typing images/ in the URL box adds the correct path to the attribute.<br />

10. Click OK to close the dialog box.<br />

11. Save your work (File » Save).<br />

Choose View » Live Data to display the dynamic content.The Live Data window displays the details of the first employee in<br />

the recordset. If you make a mistake, open the Server Behaviors panel (Window » Server Behaviors),select the dynamic content,<br />

and click the Minus (-) button.<br />

18


Enable the page to find and display an employee<br />

When the detail page opens in a browser, it should display detail information about an employee selected by the user on the<br />

results page. (You worked on the results pages earlier in this tutorial).To make the page work this way, you use the Move to<br />

Specific Record server behavior, which finds and displays the employee the user selected on the results page.<br />

1. In the Server Behaviors panel (Window » Server Behaviors),click the Plus (+) button and select Move to Record »<br />

Move to Specific Record.<br />

The Move to Specific Record dialog box appears.<br />

2. In the Move to Record In pop-up menu, make sure the Details recordset is selected.<br />

3. In the Where Column pop-up menu, make sure the EMPLOYEEID column is selected.<br />

4. The previous page you worked on passed the ID number (id=EMPLOYEEID) of an employee record to the detail<br />

page. By specifying the EMPLOYEEID column, you tell the detail page to look in the EMPLOYEEID column of<br />

the current recordset to find an ID number matching the one sent by the results page. When the behavior's<br />

server-side script finds a match, it displays the corresponding employee record.<br />

5. Click OK.<br />

If you make a mistake, open the Server Behaviors panel (Window » ServerBehaviors), and double-click the server behavior to<br />

edit it.<br />

Create an insert page<br />

The final page you will create for the Compass employee directory is a page that lets the site administrator insert new<br />

employee records in the database with a Web browser.<br />

An insert page consists of two building blocks:<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

• An HTML form that lets users enter data<br />

• An Insert Record server behavior that takes the data entered in the form and updates the database<br />

The HTML form has already been created for you.You will add the server behavior to update the database table.<br />

The EMPLOYEEID field (column) in the compass <strong>FileMaker</strong> Pro database has been set as an auto-increment field so that each<br />

successive employee will receive a new unique ID.<br />

1. In the Site window, double-click the file called Insert under Local Folder.<br />

The insert page for the Compass employee directory opens in UltraDev.<br />

2. In the Server Behaviors panel (Window » Server Behaviors),click the Plus (+) button and choose Insert Record<br />

from the pop-up menu.<br />

The Insert Record dialog box appears.<br />

19


20<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

3. In the Connection pop-up menu, choose connCompass.<br />

4. In the Insert Into Table pop-up menu, choose EMPLOYEES.<br />

5. In the "After Inserting, Go To" box, click Browse and select the InsertOK file.<br />

6. This page will open after the record is successfully inserted into the table.<br />

7. In the Get Values From pop-up menu, make sure fmAdd is selected.<br />

fmAdd is the name of HTML form on the page.<br />

8. Specify what each object on your form will update in the database table by selecting the first form element in the<br />

Form Elements list (txtImageURL) and selecting the corresponding item in the Column pop-up menu (PHOTO).<br />

Repeat this step for the other form elements, as follows:<br />

• txtLastName updates the LASTNAME column<br />

• txtFirstName updates the FIRSTNAME column<br />

• txtPhone updates the PHONE column<br />

• txtDate updates the STARTDATE column<br />

• txtDept updates the DEPARTMENT column<br />

• txtExt updates the EXTENSION column<br />

• txtEmail updates the EMAIL column<br />

• txtNotes updates the NOTES column<br />

9. Click OK.<br />

With the insert page completed, the employee directory for the Compass intranet site is done. In the Site window, select all<br />

the pages, and then click the blue up-arrow on the toolbar to upload them to your published directory on the server. Launch<br />

your browser and open the Search.htm page.<br />

APPENDIX A<br />

Installing <strong>FileMaker</strong> Pro 5 Unlimited<br />

Before you begin the installation process, exit other open programs and save your work, and turn off virus protection utilities.<br />

To install <strong>FileMaker</strong> Pro 5 Unlimited in Windows NT, you must log on with Administrator privileges. Windows 2000<br />

Professional users must log on with Administrator or Power User privileges. If <strong>FileMaker</strong> Pro 5 Unlimited is already installed,<br />

you can install <strong>FileMaker</strong> Pro 5 Unlimited without uninstalling <strong>FileMaker</strong> Pro 5 Unlimited. You can use either version of<br />

<strong>FileMaker</strong> Pro 5 Unlimited on the same computer. However, if you later choose to uninstall <strong>FileMaker</strong> Pro 5 Unlimited, your<br />

<strong>FileMaker</strong> Pro 5 Unlimited preferences will be reset to the default values.You will need to restore your preference settings in<br />

<strong>FileMaker</strong> Pro 5. For instructions on installing <strong>FileMaker</strong> Unlimited using the DOS command line, see the Windows help or<br />

visit the Microsoft web site at www.microsoft.com.<br />

You must use the installation program to install <strong>FileMaker</strong> Pro 5 Unlimited -you cannot install <strong>FileMaker</strong> Pro 5 Unlimited by<br />

dragging files to your hard disk. For late-breaking information about <strong>FileMaker</strong> Pro 5 Unlimited, browse the contents of the<br />

CD and view the Readme file or visit www.filemaker.com.<br />

To install <strong>FileMaker</strong> Pro 5 Unlimited on your hard disk:<br />

1. Insert the CD into your CD or DVD drive.


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

2. Click Install <strong>FileMaker</strong> Pro 5 Unlimited.<br />

3. When you see the <strong>FileMaker</strong> Pro 5 Unlimited Welcome panel, click Next.<br />

4. In the License Agreement panel, read the Software License Agreement. If you accept the terms of the license<br />

agreement, click I accept..., then click Next.<br />

5. In the Customer Information panel, type your name and your organization's name. If you don't have an<br />

organization name, you can put other information (like your address) in the box or leave it blank. Choose whether<br />

to allow all users to access this application or only the named user.<br />

6. Click Next.<br />

7. In the Destination Folder panel, choose the folder where you want to install <strong>FileMaker</strong> Pro 5 Unlimited. By default,<br />

<strong>FileMaker</strong> Pro 5 Unlimited will be installed in the C:\Program Files\<strong>FileMaker</strong>\<strong>FileMaker</strong> Pro 5 Unlimited folder. If<br />

you want to install <strong>FileMaker</strong> Unlimited in another folder or on another drive, click the Change button and<br />

navigate to the folder where you want to install <strong>FileMaker</strong> Pro Unlimited. If the selected disk doesn't have enough<br />

space for the files you select, or is write-protected, you can leave the installer and delete existing files to make<br />

more room on the disk. If the disk is locked, or isn't a hard disk, you can choose another drive.<br />

8. Click Next.<br />

9. In the Setup Type panel, choose whether to install all program features (Complete),or to install only selected<br />

portions of the program (Custom). For example, you may choose not to install the tutorial, in order to save disk<br />

space. Click the Space button to see how much disk space you have available and how much disk space is<br />

required to install <strong>FileMaker</strong> Pro 5 Unlimited.<br />

10. Click Next.<br />

11. If you chose a Complete installation, go to Step 14.<br />

12. If you chose a Custom installation, you see the Custom Setup panel. By default, all of the <strong>FileMaker</strong> Pro 5<br />

Unlimited features are selected to be installed.To change the installation of any feature, click on its icon and<br />

choose an installation option.<br />

13. Note:The option "This feature will be installed when required" means that the necessary files are copied to your<br />

hard drive, but are not installed until needed.<br />

14. When you have selected the custom installation options for all the features you want to install, click Next.<br />

15. In the Network Protocol panel, choose the network protocol you want to use for sharing databases.The default<br />

protocol is TCP/IP.You can change the network protocol later without reinstalling the program. If you are not<br />

certain which protocol to use, see your network administrator.<br />

16. Click Next.<br />

17. In the Application Shortcuts panel, choose whether to place shortcuts on the Desktop and in the Quick Launch<br />

toolbar and/or Start Menu. Shortcuts provide a quick and convenient way to launch the application. Shortcuts can<br />

be added or removed after program installation.<br />

18. Click Next.<br />

19. In the Installation Code panel, type the 17-digit installation code that came with the product.<br />

20. Click Next to go to the Installation panel, or click Back to review or change any of your installation settings, such<br />

as the destination folder, user name, or setup type.<br />

21. Click Install to begin the installation.<br />

22. During the installation process, you will see a progress panel.<br />

23. When the installation is complete, click Finish.<br />

21


22<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

24. If you chose to add shortcuts, a shortcut icon is placed on your desktop, in the Start menu, and in the Quick Launch<br />

toolbar.<br />

APPENDIX B<br />

Installing Macromedia Dreamweaver UltraDev 4<br />

The following hardware and software is required to run Dreamweaver UltraDev.<br />

For Microsoft Windows:<br />

• An Intel Pentium processor or equivalent, 166 MHz or faster, running Windows 95, Windows 98, Windows Me,<br />

Windows NT 4.0 with Service Pack 5, or Windows 2000.<br />

• 64 MB of random-access memory (RAM) plus 170 MB of available disk space.<br />

• Macromedia Flash Player to view the Guided Tours and Lessons. A Flash Player installer file is located on the CD, or<br />

you can download it from the Macromedia Web site at:<br />

http://www.macromedia.com/software/flashplayer/downloads/<br />

For the Mac OS:<br />

• A Power Macintosh running Mac OS 8.6 or 9.x.<br />

• 64 MB of random-access memory (RAM) plus 130 MB of available disk space.<br />

• Macromedia Flash Player to view the Guided Tours and Lessons. A Flash Player installer file is located on the CD, or<br />

you can download it from the Macromedia Web site at:<br />

http://www.macromedia.com/software/flashplayer/downloads/<br />

Follow these steps to install Dreamweaver UltraDev on your computer.<br />

To install Dreamweaver UltraDev:<br />

1. Insert the Dreamweaver UltraDev CD into the computer's CD-ROM drive.<br />

2. Choose from the following options:<br />

3. In Windows, choose Start > Run.Click Browse and locate the UltraDev installer file on the CD. Click OK in the<br />

Run dialog box to begin the installation.<br />

4. In Mac OS, double-click the Dreamweaver UltraDev Installer icon.<br />

5. Follow the onscreen instructions.<br />

6. If prompted, restart your computer.<br />

APPENDIX C<br />

Installing Microsoft Internet Information Services<br />

Internet Information Services 5.0 is installed on Windows 2000 Server by default. You can remove IIS or select additional<br />

components by using the Add/Remove Programs application in Control Panel.<br />

Click Start, point to Settings, click Control Panel and start the Add/Remove Programs application.<br />

Select Configure Windows, click the Components button, and then follow the on-screen instructions to install, remove, or add<br />

components to IIS.


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

You can start Windows Internet Information Services by clicking Start,pointing to Settings, and clicking Control Panel. Doubleclick<br />

Administrative Tools and then double-click Computer Management. Expand the Server Applications and Services node in the<br />

console tree of the Microsoft Management Console (MMC) and select Internet Information Services.<br />

For more information on installing and administering Microsoft Internet Information Services, refer to your system<br />

documentation, your local administrator, or the following URLs:<br />

http://localhost/iisHelp/iis/misc/default.asp<br />

http://www.microsoft.com/windows2000/technologies/web/default.asp<br />

http://www.microsoft.com/windows2000/en/server/help/iint1.htm<br />

APPENDIX D<br />

Using the <strong>FileMaker</strong> JDBC Driver<br />

The information in Appendices D & E is drawn from the <strong>FileMaker</strong> Developer 5 documentation and is presented here to aid<br />

in your JSP development efforts.You can use the <strong>FileMaker</strong> JDBC Driver with any Java compiler or RAD tool to connect with<br />

your database while you build the code for your Java application or applet. After the Java application or applet has been<br />

created, the <strong>FileMaker</strong> JDBC Driver must be present with the files or included within the code in order for the application or<br />

applet to communicate with the database.<br />

To use the <strong>FileMaker</strong> JDBC Driver, your Java application or applet must register the driver with the JDBC driver manager and<br />

23


24<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

you must specify the correct JDBC URL from within the application or applet. You need the JDBC URL to make the<br />

connection to the database.<br />

About the <strong>FileMaker</strong> JDBC Drivers<br />

The <strong>FileMaker</strong> JDBC Driver is a JDBC 1.2 API compatible driver designed to work with the Java Development Kit (JDK) 1.1.8.<br />

It is a Type 4 driver - a native protocol, pure Java driver that converts JDBC calls directly into the network protocol used by<br />

the database management system. This type of driver offers all the advantages of Java including automatic installation (for<br />

example, downloading the JDBC driver with an applet that uses it). The driver will work with JDK 1.1.8 and Java 2 (e.g. JDK 1.2,<br />

1.3, etc.) as long as you only use JDBC 1.2 calls in a Java 2 environment.<br />

Note:Although the driver implements the entire JDBC 1.2 API, it cannot be classified as a true JDBC-compliant driver because<br />

it supports only a subset of SQL that matches the capabilities of <strong>FileMaker</strong> Pro 5 Unlimited, and is therefore not fully SQL-<br />

92 Entry Level compliant.<br />

The <strong>FileMaker</strong> JDBC Driver is packaged as a Java archive file (with the .jar filename extension) containing a collection of class<br />

files.The archive file is named Fmpjdbc12.jar.<br />

The driver class and main entry point for the driver is named:<br />

com.fmi.jdbc.JdbcDriver<br />

Using a JDBC URL to connect to your database<br />

In Java, most resources are accessed through URLs (Uniform Resource Locators).A JDBC URL is used to identify the database<br />

so the <strong>FileMaker</strong> JDBC Driver can recognize and establish a connection with the database.<br />

The JDBC URL consists of three main parts separated by colons:<br />

jdbc::<br />

The first part in the JDBC URL is always the JDBC protocol ("jdbc"). The subprotocol is the driver name or the name of the<br />

mechanism that supports multiple drivers. In this case, the subprotocol is fmpro, which is registered with Sun Microsystems,<br />

Inc.The subname is the IP address of the machine that is hosting <strong>FileMaker</strong> Pro.<br />

The <strong>FileMaker</strong> JDBC Driver connects to <strong>FileMaker</strong> Pro through an HTTP connection.The subname in the JDBC URL includes<br />

an HTTP protocol (such as HTTP or HTTPS), an IP address or domain name, and an optional port number preceded by a<br />

colon.<br />

jdbc:fmpro:http://1.184.21.234:80/<br />

Specifying driver properties in the URL subname<br />

You can specify the escape, fetchsize, user, and password driver properties in the subname of the JDBC URL. This is useful<br />

when you're using a RAD tool that doesn't support spaces, periods, or other non-letter characters.<br />

jdbc:fmpro:http://17.184.21.234/properties?escape=%20.&fetchsize=100&user=fred&pa<br />

ssword=test


Property Description<br />

escape<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

A string containing the characters to be escaped in table name, field name, and layout name SQL identifiers.The driver will<br />

escape all identifiers returned via any method in the DatabaseMetaData class.This will allow RAD tools that don't support<br />

spaces and periods in SQL identifiers to work with any <strong>FileMaker</strong> Pro databases. The driver will automatically escape all<br />

identifiers for you. See "Using a character escape" on page 8-7 for more information.<br />

fetchsize<br />

This property allows you to set the number of records that are retrieved by the driver at any one given time.This is important<br />

for result sets (such as a result set of 20000 records) that are too large to retrieve all at once without causing memory<br />

constraints and performance problems.<br />

user<br />

The user name for the connection<br />

password<br />

The password for the connection<br />

APPENDIX E<br />

SQL supported by the <strong>FileMaker</strong> JDBC Driver<br />

The <strong>FileMaker</strong> JDBC Driver provides support for certain SQL statements, a RecordID pseudo column, a ModID pseudo<br />

column, DbOpen and DbClose pseudo procedures, character escaping, and <strong>FileMaker</strong> data type mapping to JDBC SQL and<br />

Java data types.The following is a list of the SQL statements and definitions that are supported by the <strong>FileMaker</strong> JDBC Driver.<br />

SQL statement Definitions<br />

SELECT statement<br />

SELECT { { * | field_name .,.. } [ , RECORDID [ , MODID ] ] }<br />

FROM database_name<br />

[ LAYOUT layout_name ]<br />

[ WHERE { predicate [ { { AND | OR } predicate } ... ] } ]<br />

[ ORDER BY { field_name [ASC | DESC] } .,.. ]<br />

Where predicate equals<br />

{ field_name { = | | > | >= | < |


26<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

{ value | ? } } | {field_name IS NULL} |<br />

{RECORDID = {value | ?}}<br />

INSERT statement<br />

INSERT INTO database_name<br />

[ LAYOUT layout_name ] ( field_name .,.. )<br />

VALUES ( { value | NULL | ? } .,.. )<br />

UPDATE statement<br />

UPDATE database_name [ LAYOUT layout_name ]<br />

SET { field_name = { value | NULL | ? } } .,..<br />

[ WHERE { predicate [ { { AND | OR } predicate } ... ] } ]<br />

Where predicate equals<br />

{ field_name { = | | > | >= | < | | >= | < |


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

UPDATE "Employees.fp5"<br />

SET "Telephone.3"='(555) 555-5555'<br />

WHERE recordid=4<br />

To add a specific repeating field or field in a portal, add a period and the number zero (0) to the end of the field name and<br />

enclose the field name in double quotation marks. For example, to add the City field to a portal in the Address relationship:<br />

INSERT INTO "Employees.fp5"<br />

LAYOUT "Data Entry" ("Last Name", "Address::City.0")<br />

VALUES ('Jones', 'San Jose')<br />

Using the RecordID pseudo column<br />

The <strong>FileMaker</strong> JDBC Driver provides a RecordID pseudo column (in place of a primary key used by other types of databases)<br />

that can be specified in the column name list of a SELECT statement or in the WHERE clause of SELECT, UPDATE or<br />

DELETE statements.This lets you guarantee that the statement will operate on a specific record.<br />

All other columns are ignored when the RecordID pseudo column is used in a WHERE clause.<br />

UPDATE "Employees.fp5"<br />

SET department='engineering'<br />

WHERE recordid=4<br />

Using the ModID pseudo column<br />

Each record in a <strong>FileMaker</strong> Pro database has a corresponding modification ID (ModID) number that increases incrementally<br />

every time the record is modified. To detect modification collisions, the <strong>FileMaker</strong> JDBC Driver provides a ModID pseudo<br />

column that can be used in the WHERE clause of an UPDATE statement in conjunction with the RecordID. The Web<br />

Companion compares the ModID in the WHERE clause to the current ModID of the record and an error is returned if they<br />

do not match.<br />

SQL statement examples<br />

The following are some examples of SQL statements, some of which use RecordID and ModID pseudo columns, and<br />

DbOpen and DbClose pseudo procedures:<br />

SELECT recordid, modid, "last name", "first name", department<br />

FROM "Employees.fp5"<br />

WHERE "last name"='smith' AND "first name" = 'joe'<br />

SELECT * FROM "Employees.fp5" WHERE recordid=4<br />

SELECT recordid, modid, * FROM "employees.fp5"<br />

27


SELECT "last name", "first name", "telephone::phone number"<br />

FROM "employees.fp5" LAYOUT "personal info"<br />

UPDATE "Employees.fp5"<br />

SET department='engineering'<br />

WHERE recordid=4 AND modid=2<br />

UPDATE "Employees.fp5" LAYOUT "personal info"<br />

SET "telephone::phone number.2"='555-555-5555'<br />

WHERE recordid=4<br />

DELETE FROM "Employees.fp5"<br />

WHERE recordid=4<br />

{ CALL DbOpen("inventory.fp5", "some password") }<br />

{ CALL DbClose("inventory.fp5") }<br />

{ CALL FindManagers("employees.fp5") }<br />

{ CALL SortByLastName("employees.fp5", "list view") }<br />

Using a character escape<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

The <strong>FileMaker</strong> JDBC Driver supports escaping of lower ASCII characters in column and table name SQL identifiers. This is<br />

useful if your RAD tool does not support characters such as spaces in column names or periods in table names.The escape<br />

sequence starts with the dollar symbol ($) and is followed by the two-digit hex value for the character (such as 2E for a period<br />

and 20 for a space).<br />

employees.fp5 => employees$2Efp5<br />

last name => last$20name<br />

SELECT last$20name FROM employees$2Efp5<br />

<strong>FileMaker</strong> data type mapping to JDBC SQL and Java data types<br />

The <strong>FileMaker</strong> JDBC Driver uses the following mappings when converting <strong>FileMaker</strong> Pro data types to JDBC SQL types or<br />

to Java data types. (For information about these types, see the JDK 1.3.x documentation web pages at www.javasoft.com.)<br />

28<br />

This <strong>FileMaker</strong> Pro data type Converts to this JDBC SQL type<br />

TEXT java.sql.Types.LONGVARCHAR<br />

NUMBER java.sql.Types.DOUBLE<br />

DATE java.sql.Types.DATE<br />

TIME java.sql.Types.TIME<br />

CONTAINER java.sql.Types.LONGVARBINARY<br />

Repeating and related fields com.fmi.jdbc.Array


<strong>FileMaker</strong> Pro support for Unicode characters<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

<strong>FileMaker</strong> Pro only supports the Windows Latin 1 and Macintosh character sets, which are a subset of Unicode.Therefore,<br />

any character data submitted to <strong>FileMaker</strong> Pro that contains characters not present in these character sets (such as certain<br />

math symbols) will not be stored properly in your database. <strong>FileMaker</strong> Pro inserts a question mark (?) for any character that<br />

it does not recognize.<br />

APPENDIX F<br />

Special Considerations<br />

As you prepare a <strong>FileMaker</strong> database solution for deployment as a web application with Macromedia UltraDev and JRun, you<br />

should keep in mind a few "best practices". Following this list of guidelines will ease your development and implementation<br />

efforts dramatically:<br />

• Build your databases without the ".FP5" extension.<br />

If you do not remove the extension, UltraDev and <strong>FileMaker</strong> Pro 5 Unlimited will not properly communicate. An<br />

easy way to accommodate this under Microsoft Windows based <strong>FileMaker</strong> Unlimited installations is with a "launcher"<br />

<strong>FileMaker</strong> database that has the extension, which loads the actual database files upon opening.The <strong>FileMaker</strong> tutorial<br />

files include such a database, cleverly named "launcher.fp5".<br />

• Do not use spaces or special characters in field (column) names.<br />

Although the <strong>FileMaker</strong> JDBC driver supports such naming techniques, your SQL statements will be cleaner and<br />

integrating your solution with other data sources will be much easier.<br />

APPENDIX G<br />

Configuring Macromedia JRun<br />

JRun Server System Requirements<br />

• 32 MB RAM (128 recommended)<br />

• 20 MB hard disk space (50 recommended)<br />

• Java Runtime Environment (JRE) 1.1 (version 1.2.2 or later required for EJB, JTA, and JMS)<br />

• Netscape Communicator 4.0 or Microsoft Internet Explorer 4.0 (or higher) for administration<br />

Supported Operating Systems<br />

• Windows 95/98/NT/2000<br />

• Solaris 2.6, 7, 8<br />

• Red Hat Linux 6.0, 6.1<br />

29


• HP-UX 11.0<br />

• IBM AIX 4.2, 4.3<br />

• SGI IRIX 6.5<br />

• Compaq Tru64 UNIX 4.0<br />

Supported Web Servers<br />

30<br />

• Apache<br />

• Microsoft IIS<br />

• Microsoft Personal Web Server<br />

• Netscape Enterprise Server<br />

• Netscape FastTrack Server<br />

• Netscape iPlanet<br />

• O'Reilly WebSite Pro<br />

• Zeus Web Server<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

1. Install JRun according to the documentation.<br />

2. Copy the <strong>FileMaker</strong> JDBC driver to the lib directory of the JRun installation.<br />

The default location is:<br />

C:\Program Files\Allaire\JRun\servers\lib\<br />

3. Log into the JRun server and configure it for <strong>FileMaker</strong> Pro Unlmited JDBC access<br />

4. The default administration login for JRun is available at this URL:


FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

http://server IP address:8000/<br />

The image below show the administration login screen.<br />

5. After successfully logging in the main administration screen for JRun appears.<br />

6. Configure the <strong>FileMaker</strong> JDBC driver<br />

7. Click the [+] symbol next to the JRun Default Server to expose its administration options.<br />

8. Click on JDBC Data Sources to display the configured JDBC drivers.<br />

9. Click Add to configure the <strong>FileMaker</strong> JDBC driver.<br />

31


32<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

10. Enter a name for the data source (fmitest in this image).<br />

11. Enter com.fmi.jdbc.JdbcDriver in the Driver text box.<br />

12. Enter the URL to the <strong>FileMaker</strong> Pro 5 Unlimited machine<br />

In this example:<br />

jdbc:fmpro:http://17.184.22.6:591/properties?fetchsize=10<br />

Where 17.184.22.6 represents the IP address of your <strong>FileMaker</strong> Pro 5 Unlimited machine.<br />

Note that these entries are case sensitive.<br />

13. Click update to save your new data source.<br />

The JDBC data sources screen will appear again, containing the new data source.<br />

14. Click test.


Appendix H<br />

Resources<br />

FILEMAKER PRO 5 UNLIMITED AND MACROMEDIA ULTRADEV<br />

Site URL<br />

<strong>FileMaker</strong>, Inc. http://www.filemaker.com<br />

<strong>FileMaker</strong>, Inc. <strong>FileMaker</strong> Pro Unlimited http://www.filemaker.com/products/fmu_home.html<br />

<strong>FileMaker</strong>, Inc. Solution Alliance http://www.filemaker.com/developers/index.html<br />

Macromedia http://www.macromedia.com<br />

Macromedia Dreamweaver UltraDev http://www.macromedia.com/software/ultradev/<br />

Macromedia Dreamweaver UltraDev Exchange http://www.macromedia.com/exchange/ultradev/<br />

Macromedia JRun http://www.allaire.com/products/JRun/<br />

Microsoft Corporation http://www.microsoft.com<br />

Microsoft Internet Information Services http://www.microsoft.com/windows2000/en/server/help/iint1.htm<br />

Microsoft Windows 2000 http://www.microsoft.com/windows2000/technologies/web/<br />

Sun Microsystems, Inc. JavaServer Pages http://java.sun.com/products/jsp/<br />

Sun Microsystems, Inc. http://www.sun.com<br />

Sun Microsystems, Inc. Java JDK http://java.sun.com/j2se/<br />

Sun Microsystems, Inc., Java http://java.sun.com/<br />

© 2000-2001 Macromedia, Inc.All rights reserved. Dreamweaver, Macromedia, Macromedia Dreamweaver UltraDev, and Macromedia JRun are registered trademarks or trademarks of Macromedia,<br />

Inc., and may be registered in the U.S. and other countries. Some portions of the text are reprinted by permission from <strong>FileMaker</strong>, Inc. <strong>FileMaker</strong> is a trademark of Apple Computer, Inc., registered<br />

in the U.S. and other countries <strong>FileMaker</strong> is a trademark of <strong>FileMaker</strong>, Inc., registered in the U.S. and other countries and the file folder logo is a trademark of <strong>FileMaker</strong>, Inc. All other trademarks<br />

are the property of their respective owners.<br />

33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!