For Windows, Mac OS X Server, and Red Hat Linux ® FileMaker Pro 5.5 Unlimited Administrator’s Guide ©1999, 2001 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 www.filemaker.com FileMaker is a trademark of FileMaker, Inc., registered in the U.S. and other countries, and the file folder logo is a trademark of FileMaker, Inc. Red Hat is a registered trademark of Red Hat, Inc., in the U.S. and other countries.
This page intentionally left blank.
Contents Preface Introducing FileMaker Pro 5.5 Unlimited About this guide Contents of the FileMaker Pro 5.
iv FileMaker Pro 5.
Contents Example of XML data in the FMPXMLLAYOUT 5-7 grammar 5-8 About UTF-8 encoded data Generating FileMaker Pro CGI requests for an XML document 5-8 5-8 Request and parameter names 5-9 Requests for adding records to a portal 5-9 Requests for editing multiple records in a portal 5-10 Using style sheets with your XML document 5-11 Comparing CSS, XSLT, and JavaScript 5-13 Cascading style sheets (CSS) example Extensible Stylesheet Language–Transformations (XSLT) example 5-14 5-16 JavaScript scripting langua
vi FileMaker Pro 5.
Preface Introducing FileMaker Pro 5.5 Unlimited FileMaker® Pro 5.5 Unlimited is a companion product to FileMaker Pro 5.5 that allows unlimited web user access to your FileMaker databases via the Web Companion plug-in. 1 Chapter 1 describes how to install the Web Server Connector on the Microsoft Internet Information Server, Apache on Mac OS X Server, and Apache on Red Hat Linux web servers. In addition, the FileMaker Pro 5.
vi FileMaker Pro 5.5 Unlimited Administrator’s Guide Contents of the FileMaker Pro 5.5 Unlimited CDs FileMaker Pro 5.5 Unlimited consists of two CDs: one for the FileMaker Pro software and related files, and one for custom web publishing and the Web Server Connector. Contents of the CDML folder Description CDML Templates Folder containing nine CDML format files for different types of interaction with a database Web Tools Folder containing the CDML Reference.fp5 and CDML Tool.
Introducing FileMaker Pro 5.5 Unlimited Contents of the FileMaker JDBC Driver folder Contents of the XML folder Description fmpjdbc12.jar The FileMaker JDBC driver Read Me.doc JDBC read me file Simple Examples Unsupported folder Contents of the Unsupported folder Description FMWSC.jar The FileMaker Web Server Connector servlet FMWSCResources.jar Strings and supporting HTML pages for the Web Server Connector servlet Readme.txt Text file containing instructions for recompiling the .
viii FileMaker Pro 5.5 Unlimited Administrator’s Guide Where to go for more information For more information on See New features in FileMaker Pro 5.5 FileMaker Pro Help or chapter 4 in the FileMaker Pro 5.5 Getting Started Guide General information on Instant Web Publishing Chapter 14 in the FileMaker Pro 5.5 User’s Guide Web publishing enhancements Chapter 4 in the FileMaker Pro 5.
Chapter 1 Installing the FileMaker Web Server Connector The built-in Web Companion in FileMaker Pro 5.5 Unlimited acts as a CGI (Common Gateway Interface) application and as a web server by handling browser interactions with FileMaker Pro databases and serving by web pages and image files to the web browser. You can extend this functionality by using the FileMaker Web Server Connector included with FileMaker Pro 5.5 Unlimited.
1-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide Web Browser Web Browser Web Browser Web Browser Web Server Web Server Connector FileMaker Pro Unlimited FileMaker Pro Unlimited FileMaker Pro Unlimited In this configuration, each copy of FileMaker Pro Unlimited accesses the databases as a guest of FileMaker Server.
Installing the FileMaker Web Server Connector In this configuration, you use a dedicated copy of FileMaker Pro or FileMaker Pro Unlimited as the backend host for the databases and use peer-to-peer networking for each of the FileMaker Pro Unlimited guests. (If you use FileMaker Pro Unlimited as the backend host, then you can also use the same machine as a node in the RAIC for the Web Server Connector.
1-4 1 1 1 FileMaker Pro 5.5 Unlimited Administrator’s Guide a CD or DVD drive Mac OS X Server 10.0.3 Apache Web Server 1.3.19 Requirements on Linux machines To use the Web Server Connector on Linux you need: 1 1 1 1 Click this arrow a hard disk with at least 42 MB of free space a CD or DVD drive Red Hat Linux 7.1 i386 Apache Web Server 1.3.19 3. In the Welcome screen, click Next. Installing on Windows You can use the FileMaker Web Server Connector with Microsoft Internet Information Server 5.0.
Installing the FileMaker Web Server Connector The Web Server Connector automatically starts after you restart your computer. For information on configuring the Web Server Connector with FileMaker Pro Unlimited, see chapter 2, “Administering the Web Server Connector.” Setting up user names and passwords Before you can configure the Web Server Connector with FileMaker Pro Unlimited, you must enable the Basic (Clear Text) Password Authentication option in Microsoft Internet Information Server.
1-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide 5. Restart your server. Note The Uninstall command removes all files that have been installed, but does not remove any files generated by the Web Server Connector. Examples of files not removed include .PROPERTIES files, .LOG files, and ISAPI filter entries, which must all be removed manually. To remove the ISAPI filter entry: 1. Start the Internet Service Manager application. 2.
Installing the FileMaker Web Server Connector Contents of the bin folder Description FMWSC_Apache.sh Shell script FMWSC.log The Web Server Connector log file (does not appear until the Web Server Connector is first run) FMWSC.properties The Web Server Connector properties file (does not appear until the Web Server Connector is first run) 1-7 For information about accessing the shell prompt, see your operating system documentation. 3. Enter the root password.
1-8 FileMaker Pro 5.5 Unlimited Administrator’s Guide File Description /var/fmwsc/install/httpd.fmwsc Appends to the Apache configuration file /var/fmwsc/lib/FMWSC.jar The FileMaker Web Server Connector servlet /var/fmwsc/lib/FMWSC.properties The Web Server Connector properties file (does not appear until the Web Server Connector is first run) /var/fmwsc/lib/FMWSCResources.jar Strings and supporting HTML pages for Web Server Connector servlet /var/fmwsc/lib/FMWSC_Apache.
Chapter 2 Administering the Web Server Connector You administer the FileMaker Web Server Connector from your web browser. FileMaker Pro 5.5 Unlimited and your databases must be set up on your host machine(s) before you can use the Web Server Connector. The first time you use the Web Server Connector, you must configure the administration account. Then you can configure the Web Server Connector with your FileMaker Pro Unlimited host(s) either by host machine or by database.
2-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide http://localhost/FMPro?config For information on using localhost without a network connection, see “Testing your site without a network connection” on page 3-18. Note On Windows 2000, you can also start the Web Server Connector by choosing Start > Programs > FileMaker WSC - IIS > FileMaker WSC Admin. 3. On the Initial Security page, enter a user name and password in the text boxes.
Administering the Web Server Connector http://www.domainname.com/FMPro?config http://localhost/FMPro?config Configuring by host When you configure the Web Server Connector by host, you specify which databases on each host machine that you want the Web Server Connector to send database requests to. This configuration is useful if you have all of the databases on one or more machines.
2-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide To remove a database from the list: 2. On the Configure by Database web page, click Add Database. 1. Select the database in the list. The Database Detail page appears. 2. Deselect the Serve Database checkbox. 3. Click Submit. Configuring by database When you configure the Web Server Connector by database, you set up a list of IP addresses or domain names of the machines that are hosting the database(s).
Administering the Web Server Connector If the host machine is the same as the web server machine, this port number must be different than Port 80, which is reserved for web servers. 6. Click Submit. The Web Server Connector log files are located on the following web servers: Web server Log file location Internet Information Server c:/program files/filemaker/filemaker wsc 5.5/ FMWSC.log 7. Repeat steps 2 through 6 for each database and host machine you want to add to the configuration.
2-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide 1. Point your web browser to the IP address or domain name of the web server. http://web server IP address or domain name/ Use the format 123.456.789.123 or www.yourdomainname.com for web server IP address or domain name. You see the FileMaker Pro default page and a list of links to the currently shared databases. 2. From the list, click the database you want to access.
Chapter 3 Publishing your database on the Web The FileMaker Pro Web Companion plug-in makes it possible for you to publish your database on the Internet or an intranet in several different ways, giving you more choices and control over the design and functionality of your web pages.
3-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide For information, see chapter 6, “Using Java and JDBC to deliver your data.” For a list of JDBC resources, see the product support pages on the FileMaker, Inc. web site at www.filemaker.com. As a shortcut, double-click FileMaker on the Web (included on the Filemaker Pro CD). Custom web publishing with CDML The FileMaker Pro Web Companion lets you publish your database with custom web pages using a proprietary markup language called CDML.
Publishing your database on the Web 3-3 Requirements for web access 2. In the Application Preferences dialog box, click the Plug-Ins tab. The host computer must have a copy of FileMaker Pro Unlimited serving the databases on the Web (preferably with a full-time, constant connection to the Internet or your intranet). The Web Companion must be enabled in FileMaker Pro Unlimited.
3-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide 6. Select a Remote Administration option. If you want to remotely access the Web folder from a different computer, for example, to upload or download files using HTTP Put and Get commands or to change settings in the Web Security Database, select Requires Password and enter a password in the box. (If it doesn’t matter who has access to the Web folder and everything inside it, select Requires no password.
Publishing your database on the Web By default, web browsers use the TCP/IP port number 80 to communicate with the web server. If that port is in use, you can use any number between 1024 and 65535 or the port number 591, which is registered by FileMaker, Inc. with the Internet Assigned Numbers Authority (IANA) for use with the FileMaker Pro Web Companion. Mac OS X To use port numbers below 1024 on Mac OS X machines, you’ll need your Mac OS X administrator name and password.
3-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide When web users enter the IP address of the host computer in their web browsers, the Web Companion will serve either the built-in home page used for Instant Web Publishing, any web page named “default.htm,” “default.html,” “index.htm,” or “index.
Publishing your database on the Web 3-7 Note If you are using a Netscape web browser, you must specify JavaScript 1.4. This HTML statement places the JavaScript object called WebPortal inside a window object in your web page. The window.webPortal object contains the following subobjects: webPortal.databases = Array of webPortal.
3-8 FileMaker Pro 5.5 Unlimited Administrator’s Guide 2. Include a FileMaker CGI request for the FileMaker WebPortal object: 3. As desired, use scripting to write HTML and text to the document. 4. Save the file with the .htm or .html filename extension and place it in the root level of the Web folder (inside the FileMaker Pro 5.5 folder). 5.
Publishing your database on the Web Now when you enter your computer’s IP address or “localhost” in the web browser, the Web Companion will display the database layout for your custom home page in the browser window. Using script buttons in Instant Web Publishing You can provide special script buttons in your FileMaker Pro layout to work with Instant Web Publishing. When web users click on a button in the browser, the script’s URL is sent to the Web Companion as a FileMaker CGI request.
3-10 FileMaker Pro 5.5 Unlimited Administrator’s Guide FileMaker script step CGI request Description FileMaker script step CGI request Description Go to Related Record [] Go to specified record in a related database The related database must be open and shared via the Web Companion, and the specified record must be available when the script is performed.
Publishing your database on the Web FileMaker script step CGI request View As [Cycle] Cycle between Form and Table views Open Help Open HTML help Description This opens the built-in help for Instant Web Publishing, called “FileMaker Pro Web Companion Help” in a new browser window.
3-12 FileMaker Pro 5.5 Unlimited Administrator’s Guide 2. In the Script Definition dialog box, click Clear All, and select Toggle Status Area. Choose Hide from the Specify pop-up menu to add the parameter to the script step. Then click OK. 3. Click Done to close the Define Scripts dialog box. 4. Choose Edit > Preferences > Document. 5. In the Document Preferences dialog box, select the checkbox for Perform script when opening the database, and choose the script you named in step 1 from the pop-up menu. 6.
Publishing your database on the Web For example, the following redirect statement contains a FileMaker CGI request for layout ID number 3 in the “MyCustomUI.fp5” database to open in the Form View instant web page (formvwcss.htm). 3-13 Format filenames for instant web pages The following table lists the instant web pages and their format filenames as they apply to those web styles that use cascading style sheets. Instant web page Format filename Form View FormVwCSS.htm Table View TableVwCSS.
3-14 FileMaker Pro 5.5 Unlimited Administrator’s Guide For example, you might want to serve WML (Wireless Markup Language) documents from your web site. Browsers with the appropriate plug-in would be able to display the file in the browser window. For information about the Internet media type registry, go to ftp://ftp.iana.org/in-notes/iana/assignments/media-types/.
Publishing your database on the Web 1 3-15 translate information in your database to HTML or HTTP Where Means this “request” The request line exactly as it came from the client To use a Web Companion external function in a calculation field: status The HTTP status code returned to the client (for information, see the World Wide Web Consortium’s web site at www.w3c.org) 1. Be sure the Web Companion is enabled.
3-16 FileMaker Pro 5.5 Unlimited Administrator’s Guide A formula for an external function requires the name of the external function to call and the function’s parameter. 7. Replace the word “parameter” with the required parameter for the function (0, field name, or text value). See the next table for a description of the Web Companion external functions and their parameters.
Publishing your database on the Web 3-17 5. To export one record that subtotals multiple records, click Summarize by. Then, in the Summarize by dialog box, click to the left of the field you want to use as the break field. A check mark appears to the left of the field. (You must have set up one or more summary fields and sorted by the break field in the database.) Click OK.
3-18 FileMaker Pro 5.5 Unlimited Administrator’s Guide FileMaker Pro saves the data in table format in an HTML file. Each field you specified becomes a column heading in the table and each record becomes a row. Testing your site without a network connection You can set up your computer to test the Web Companion and your web site before uploading your site files and databases to the host web server or dialing up to an Internet service provider (ISP).
Publishing your database on the Web Opening and closing databases using XML Here is an example of making a –dbopen request using an XML document: FMPro?–db=secretfolder/employees.fp5&–format=–fmp_xml& –password= dbpassword&–dbopen Here is an example of making a –dbclose request using an XML document: FMPro?–db=secretfolder/employees.
This page intentionally left blank.
Chapter 4 Custom web publishing using CDML The FileMaker Pro Web Companion supports CDML, a proprietary markup language that enables your HTML pages to interact with a FileMaker Pro database. The FMWSC and Tools CD includes: 1 the CDML Tool database and template files to help you insert the CDML tags into your HTML pages (These HTML pages that contain CDML tags are referred to as format files.
4-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide For additional information and examples using CDML to publish FileMaker Pro databases on the Web, see the product support pages on the FileMaker, Inc. web site at www.filemaker.com. As a shortcut to the site, double-click FileMaker on the Web on the FileMaker Pro CD.
Custom web publishing using CDML < INPUT TYPE=“hidden” NAME=“-db” VALUE=“Filename.fp5”> < INPUT TYPE=“hidden” NAME=“-lay” VALUE=“Layout Name”> < INPUT TYPE=“hidden” NAME=“-format” VALUE=“Filename.htm”> 4-3 When a format file is displayed statically in the browser rather than as the result of a FileMaker Pro CGI request, CDML replacement tags will appear on the page. < INPUT TYPE=“hidden” NAME=“-error” VALUE=“Filename.
4-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide For example, to generate a –findall request to display all employees from a database, web users might click on an HREF link containing the following FileMaker Pro CGI command: FMPro?–db=Employees.fp5&–lay=FormView&–format=results.
Custom web publishing using CDML The following is an example of an –edit request for editing records in a portal, where “Address::” is the name of the relationship, “City.1” is the first row in the portal, and “City.2” is the second row in the portal: FMPro?–db=Employees.fp5&–lay=LayoutOne&recid=11& FirstName=Sam&LastName=Smith&Address::City.1=Seattle &Address::City.2=New York&–format=reply.
4-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide 4. Arrange the windows so you can easily go between the blank page and the CDML Tool. 5. In the CDML Tool, select either the Templates tab or the Tags tab and click the Refresh button. Then choose your database from the Database pop-up menu, and the layout that you want to use from the Layouts pop-up menu. The layout you choose determines which fields will be accessed. Otherwise, it does not affect the layout of the web page.
Custom web publishing using CDML 4-7 You can also click the Tag Description arrow to expand the window and view a description of the tag in another box below. 5. Click the Copy to clipboard button. 6. Paste the tag into your format file. Customizing a format file template The CDML Tool provides nine format file templates for the basic type of actions that web users can perform with your database. These templates are also included in the CDML Templates folder on the FMWSC and Tools CD.
4-8 FileMaker Pro 5.5 Unlimited Administrator’s Guide This template Contains these CDML tags New_reply.htm [FMP-LinkRecID: Layout=Layout Name, Format=pathto-file/Detail.htm] Results.htm [FMP-RangeStart], [FMP-RangeEnd], [FMP-CurrentFoundCount], [FMP-RangeSize], [FMP-LinkPrevious], [/FMP-LinkPrevious] [FMP-Record] [FMP-Field: Field Name1], [FMP-Field: Field Name2] [FMP-LinkRecID: Layout=layout_name, Format=pathto-file/detail.htm] [/FMP-Record] [FMP-LinkNext], [/FMP-LinkNext] Search.
Custom web publishing using CDML Use tags in this category For this type of interaction with FileMaker Pro Hidden Do not display this INPUT tag (–db, –lay, –db & –lay, –error, –format, or –token) Links Display a format file based on CDML replacement or action tags within HREF, MAILTO, and SRC (image) links Logical Conditionally display data within the [FMP-If] and [FMP-Else] replacement tags Looping Display multiple lines of data within one of these looping types of replacement tags (Current Find,
4-10 FileMaker Pro 5.5 Unlimited Administrator’s Guide New CDML variable tags –errnum (variable) Specify a range or single error number to be handled by the -error variable tag. You can specify discontinuous ranges, such as -errnum=500-510& -errnum=900-978. If no error numbers are specified, all errors are handled by the –error tag. See appendix B “FileMaker Pro values for error codes” for a list of error numbers.
Custom web publishing using CDML Modified CDML tag Description [FMP-If:.and.] Use these parameters (conditional operators) with the [FMP-If] tag to specify multiple replacement conditions. [FMP-If:.or.] [FMP-If:.xor.] (new parameters) [FMP-Field: FieldName, Format] and [FMPRepeatingItem: FieldName, Format] (new encoding parameter) If desired, use this modified [FMP-If] tag along with the new [FMP-ElseIf] replacement tag.
4-12 FileMaker Pro 5.5 Unlimited Administrator’s Guide To view the CDML Reference database: 1. In FileMaker Pro, open the CDML_Reference.fp5 file located inside the CDML folder. FMWSC and Tools > CDML > Web Tools > CDML Reference.fp5 4. Click the home button to return to the FileMaker Pro CDML Reference screen. From the home screen, you can open the CDML Tool by clicking the tool button. 5. Click the Custom Web Publishing tab to view general information about custom web publishing using CDML. 2.
Custom web publishing using CDML 6. Click an arrow or a subject title in the table of contents to view a list of underlined topic titles. Then click an underlined title to view the topic. 4-13 1 Use the –error variable tag in the request to specify an error page that contains [FMP-If] and [FMP-Else] replacement tags and FileMaker Pro error codes, which determine certain conditions for displaying an error message.
4-14 FileMaker Pro 5.5 Unlimited Administrator’s Guide For a complete list of error code numbers, see appendix B, “FileMaker Pro values for error codes.” For examples of error pages, see the gb_error.htm file in the Guest Book example, the errors.htm file in the Employee Database example, and the reqfielderror.htm file in the Shopping Cart example. (See “Looking at the three CDML examples” on page 4-15 for more information.
Custom web publishing using CDML 4-15 Three examples are included with FileMaker Pro 5.5 Unlimited to give you ideas on how to organize a site. You can also use them as templates and modify them for your own sites. Looking at the three CDML examples The FMWSC and Tools CD includes three CDML examples that demonstrate ways to publish your databases on the Web using CDML. These examples are located in the CDML folder: FMWSC and Tools > CDML > CDML Examples To examine the three CDML examples: 1.
4-16 1 1 1 FileMaker Pro 5.5 Unlimited Administrator’s Guide The second example link contains a FileMaker Pro CGI command for a CDML -view request. (The -view CDML action tag is usually used to display format files containing value lists or CDML replacement tags.) browse the database preselect how many records to view at a time add a record to the database
Custom web publishing using CDML 4-17 Once a guest signs in and sends the information, a summary page is returned notifying the guest that the information has been received. The summary page contains [FMP-Field] replacement tags for the first and last name of the guest that was entered in the new record. Web users add records to the empty Guest_Book.
4-18 FileMaker Pro 5.5 Unlimited Administrator’s Guide The default.htm page in the Shopping Cart Example folder Items that are placed in the Shopping Cart are added to the OrderedItems.fp5 database. Information that the web user enters on the customerid.htm page is added to a new record in the Customers.fp5 database. Items that are finally ordered (when the web user proceeds to Checkout and clicks Continue) are added to the Orders.fp5 database.
Chapter 5 Using FileMaker Pro XML to deliver your data With the enhanced Web Companion, FileMaker Pro 5.5 and FileMaker Pro 5.5 Unlimited can deliver data from your database to the Web in Extensible Markup Language (XML) format. In the same way that HTML has become the standard display language for communication on the World Wide Web, XML promises to become the standard language for structured data interchange.
5-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide General process for custom web publishing using XML Here’s a simple overview of the process for publishing your FileMaker Pro database on the Internet or an intranet using XML: 1. You send a FileMaker Pro CGI request (such as to find records in the database) to the Web Companion through an HTML form, an HREF link, or a script on your web page. The request can also be made by typing the URL in the web browser.
Using FileMaker Pro XML to deliver your data Use one of these grammars in your document or web page to display and work with FileMaker data in XML format. Note XML data generated by the Web Companion is encoded using UTF-8 format (Unicode Transformation Format 8). For information, see “About UTF-8 encoded data” on page 5-8. About XML namespaces To avoid name collisions, unique XML namespaces help distinguish XML tags by the application they were designed for.
5-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide
Using FileMaker Pro XML to deliver your data Using the FileMaker Pro Extended XML grammars The FileMaker Pro Extended XML grammars contain additional information about field types, value lists and layouts that is not found in the FMPDSORESULT grammar. Use the FMPXMLRESULT and FMPXMLLAYOUT grammars if you require layout information or want the METADATA information provided by these grammars. Note These grammars are not well suited for cascading style sheets with positioning.
5-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide The RESULTSET element contains all of the ROW elements returned as the result of a query and an attribute for the total number of records found. Each ROW element contains the field/column data for one row in the result set—including the record ID for the row, the modification ID for the row, and the COL element containing the data for one field/column in the row (where multiple DATA elements represent one of the values in a repeating or portal field).
Using FileMaker Pro XML to deliver your data The order of the COL elements corresponds with the order of the FIELD elements in the METADATA element—for example, where the “First Name”, “Last Name”, and then “Department” elements are listed in the METADATA, “Joe”, “Smith”, and then “Engineering” are listed in the same order in the RESULTSET ROW.
5-8 FileMaker Pro 5.5 Unlimited Administrator’s Guide About UTF-8 encoded data All XML data generated by the Web Companion is encoded in UTF-8 (Unicode Transformation 8 Bit) format. This format compresses data from the standard Unicode format of 16 bits to 8 bits for ASCII characters. XML parsers are required to support Unicode and UTF-8 encoding.
Using FileMaker Pro XML to deliver your data Use this request name To generate this request –scriptnames Retrieve names of all available scripts for a specified open, web-shared database –dbopen Open a database that’s in the Web folder with Remote Administration enabled –dbclose Close a database that’s in the Web folder with Remote Administration enabled Use these parameter names To go with these requests –db (database name) Required for all requests except –dbnames –lay (layout name) Required
5-10 FileMaker Pro 5.5 Unlimited Administrator’s Guide The following is an example of an –edit request for editing records in a portal, where “Address::” is the name of the relationship, “City.1” is the first row in the portal, and “City.2” is the second row in the portal: FMPro?–db=employees.fp5&–lay=LayoutOne&recid=11& FirstName=Sam&LastName=Smith&Address::City.1=Seattle &Address::City.
Using FileMaker Pro XML to deliver your data 5-11
5-12 FileMaker Pro 5.5 Unlimited Administrator’s Guide These three examples were designed to be viewed in the Internet Explorer 5.0 for Windows web browser. For information on new browsers that can be used to view the examples, double-click FileMaker on Web (included on the FMWSC and Tools CD) to go to the FileMaker product support pages in your browser. To view the examples: 1. Place a copy of the Simple Examples folder and its files in the Web folder inside the FileMaker Pro 5.
Using FileMaker Pro XML to deliver your data 5-13 This example demonstrates the use of a CSS document with an XML document. The following CGI command was used to generate the FMPDSORESULT grammar for the People.fp5 database and to apply the People_form.css stylesheet to the generated XML data: fmpro?–db=people.fp5&–lay=xml form&–format=dso_xml& –styletype=text/css&–stylehref=people_form.
5-14 FileMaker Pro 5.5 Unlimited Administrator’s Guide ERRORCODE, DATABASE, LAYOUT, Picture { visibility: hidden; } /* * Since it is not possible to add additional text to the output * of the XML document via CSS, we must rely on the XML document to * provide the labels when displaying the field data. In this case, * the labels are from global fields defined in the database.
Using FileMaker Pro XML to deliver your data XSL lets you display images in container fields, format the data, and add field labels and a logo to the XML document The three global fields for field labels in the People.fp5 database are not necessary when you’re using an XSL document. You can use XSLT to add labels after the XML document has been generated by FileMaker Pro. Note You can also include scripting (such as JavaScript) in your XSL document. See “JavaScript scripting language example” next.
5-16 FileMaker Pro 5.5 Unlimited Administrator’s Guide JavaScript scripting language example Using HTML and a scripting language with your XML document can allow your web users to interact with the database after it has been downloaded. For example, a simple onClick scripting event handler can allow web users to click a button and see different records in the database. This example demonstrates the use of the JavaScript scripting language with an XML document to publish the People.
Using FileMaker Pro XML to deliver your data function nextRecord( ) { if (foundSet.nextRecord( )) populateFields( ); 5-17 This example was designed to be viewed in the Internet Explorer 5.0 for Windows web browser. For information on new browsers that can be used to view the example, double-click FileMaker on the Web (included on the Filemaker Pro CD) to go to the FileMaker product support pages in your browser. } function previousRecord( ) { if (foundSet.
5-18 FileMaker Pro 5.5 Unlimited Administrator’s Guide To view the XML Inventory example: 1. If necessary, copy the Inventory example files from the FMWSC and Tools CD onto your hard disk. FMWSC and Tools > XML > Inventory Example 2. Place a copy of the Inventory Example folder and its files in the Web folder inside the FileMaker Pro 5.5 application folder on your hard disk. FileMaker Pro 5.
Using FileMaker Pro XML to deliver your data It is possible to have both the Detail View and Add Record windows open at the same time. The Detail View and Add Record windows will automatically close when a visitor clicks the Back or Forward button in the browser. 5-19 A detail view of an empty record opens in a separate window with a blinking insertion point in the Item field.
5-20 FileMaker Pro 5.5 Unlimited Administrator’s Guide The found set of records is displayed in the List View window 12. In List View, click Show All to display all the records in the database, including any records you added. If you want, you can examine the XML Inventory example’s JavaScript library as you view the source for the example pages. FMP.js text file containing the JavaScript library for this example 2.
Using FileMaker Pro XML to deliver your data The scripts and functions are well commented in the source and in the FMP.js library, providing information about each step. It’s useful to arrange the windows so you can switch between the example pages in the browser, the source, and the script library. Tip Use code snippets from the FMP.js JavaScript library for scripting your own web sites.
This page intentionally left blank.
Chapter 6 Using Java and JDBC to deliver your data If you’re a Java programmer, you can use the FileMaker JDBC Driver with any Rapid Application Development (RAD) tool to visually create your FileMaker Pro database-aware Java application or applet. The FMWSC and Tools CD also includes the proprietary FileMaker Java classes and examples of Java applets that use them. For information, see “Using the FileMaker Java classes” on page 6-17.
6-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide DBMS proprietary protocol Java application JDBC driver Client machine FileMaker Pro Note Although the driver implements the entire JDBC 1.2 API, it cannot be classified as a true JDBC-compliant driver because it supports only a subset of SQL that matches the capabilities of FileMaker Pro, and is therefore not fully SQL-92 Entry Level compliant.
Using Java and JDBC to deliver your data 6-3 System.out.println(resultSet.getString("last name") + ", " + resultSet.getString("first name")); The Web Server Connector allows you to encrypt and decrypt your data via HTTPS. } jdbc:fmpro:https://www.filemaker.
6-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide Property Description SQL statement Definition escape A string containing the characters to be escaped in table name, field name, and layout name SQL identifiers. The driver will escape all identifiers returned via any method in the DatabaseMetaData class. This will allow RAD tools that don't support spaces and periods in SQL identifiers to work with any FileMaker Pro database. The driver will automatically escape all identifiers for you.
Using Java and JDBC to deliver your data Class.forName("com.fmi.jdbc.JdbcDriver"); 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 enclose the field name in double quotation marks. For example, to add the City field to a portal in the Address relationship: // establish a connection to FileMaker Pro for remote // administration purposes. The user name for remote // administration is always "Admin.
6-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide ... { System.out.println("Could not load driver"); } catch(SQLException sqlException) Connection connection = DriverManager.getConnection("jdbc:fmpro: http://localhost", "some_user", "some_password"); Statement statement = connection.createStatement(); // retrieve all of the records where department equals "engineering" { System.out.println("JDBC Error: " + sqlException.
Using Java and JDBC to deliver your data SELECT "last name", "first name", "telephone::phone number" FROM "employees.fp5" LAYOUT "personal info" This FileMaker Pro data type Converts to this JDBC SQL type TIME java.sql.Types.TIME CONTAINER java.sql.Types.LONGVARBINARY This FileMaker Pro data type Converts to this Java data type TEXT java.lang.String NUMBER java.lang.Double DATE java.sql.Date TIME java.sql.Time CONTAINER java.awt.
6-8 1 1 1 1 FileMaker Pro 5.5 Unlimited Administrator’s Guide Example 1: Looking at the FileMaker Pro Explorer application PreparedStatement ResultSet ResultSetMetaData Statement The following FileMaker Pro-specific extensions have been added: This JDBC interface Includes this FileMaker Pro extension java.sql.DatabaseMetaData com.fmi.jdbc.DatabaseMetaDataExt java.sql.ResultSetMetaData com.fmi.jdbc.
Using Java and JDBC to deliver your data Install the example and the FileMaker JDBC Driver If necessary, install the FileMaker Explorer example and the FileMaker JDBC Driver. FMWSC and Tools > FileMaker JDBC Driver > JDBC Examples > FileMaker Explorer FMWSC and Tools > FileMaker JDBC Driver > Fmpjdbc12.jar 6-9 1 Mac OS X: Double-click the application icon to start FileMaker Pro Explorer.
6-10 FileMaker Pro 5.5 Unlimited Administrator’s Guide 5. Select Layouts to display the names of the layouts for the Inventory.fp5 database on the right side of the window. 6. Expand the Layouts node to display a leaf node for each layout. 7. Select the Form View node to display the fields for that layout on the right side of the window. View the source code of the example 1. Start your text editor (such as Notepad or SimpleText) or Java development tool. 2. Open the main class file, FileMakerExplorer.
Using Java and JDBC to deliver your data 6-11 Example 2: Creating the JBuilder Inventory application Open and share the Inventory.fp5 database This example demonstrates how to build a Java front end to a FileMaker database using the development tool, JBuilder 3.0 Professional for Windows and the FileMaker JDBC Driver. This example uses a modified version of the Asset Management.fp5 database that ships with FileMaker Pro.
6-12 FileMaker Pro 5.5 Unlimited Administrator’s Guide 6. In the Available Java Libraries dialog box, select the Fmpjdbc12.jar file. (If the FileMaker JDBC Driver does not appear in this dialog box, click New to locate the file and add it to the list.) Then click OK. 7. Click OK to close the Properties dialog box. Design the data module Create the data module 1. In the Data Modeler, choose Database menu > Add Connection URL. 1. In JBuilder, choose File menu > New. 2.
Using Java and JDBC to deliver your data 6-13 Test the data module 1. In the Data Modeler, click the Test tab and click Execute Query. The data and all of the images from the Inventory.fp5 database are downloaded into the data module. 2. Choose File menu > Save. JBuilder saves the data module and automatically adds it to your project. 3. Choose File menu > Exit. 4. Click Yes to invoke the Application Generator. Generate the application 1.
6-14 FileMaker Pro 5.5 Unlimited Administrator’s Guide 5. Click Generate. The Application Generator generates the source code and adds the generated files to your project. Field type Field name Field attribute Text Location Value List/Location List (Pop-up menu) Fred’s Office Dirk’s Office Pedro’s Office Anne’s Office Julie’s Office Ruth’s Office Joanna’s Office Business Center 6. Click Close All. 7. Choose Run menu > Run Application to execute the example application.
Using Java and JDBC to deliver your data 6-15 Install the example and the FileMaker JDBC Driver If necessary, install the Visual Cafe example and the FileMaker JDBC Driver. FMWSC and Tools > FileMaker JDBC Driver > JDBC Examples > Visual Cafe 4.0 Expert Edition FMWSC and Tools > FileMaker JDBC Driver > Fmpjdbc12.jar The Visual Cafe folder contains the modified database file used in this example and all of the completed files generated by the DataBound Project Wizard for the application. 3.
6-16 FileMaker Pro 5.5 Unlimited Administrator’s Guide 17. Choose Project menu > Execute to run the application. 9. In the DataBound Project Wizard, select com.fmi.jdbc.JdbcDriver in the list of data sources and click Next. 10. In the User Authentication dialog box, click OK. The inventory_db database is not password protected. 11. In the DataBound Project Wizard, select inventory_db in the list of database tables and views, and click Next. 12.
Using Java and JDBC to deliver your data Field type Field name Field attribute Text Location Value List/Location List (Pop-up menu) Fred’s Office Dirk’s Office Pedro’s Office Anne’s Office Julie’s Office Ruth’s Office Joanna’s Office Business Center Number Cost User defined entry field Date Date Purchased User defined entry field Container Picture Graphic import Text Serial Number User defined entry field Text Information User defined entry field 6-17 The FileMaker Java Class Library
6-18 FileMaker Pro 5.5 Unlimited Administrator’s Guide 1 the names of layouts, fields in a layout, and scripts defined for a database FileMaker Pro 5.5 > Web > FMBanner.html FileMaker Pro 5.5 > Web > FMBanner.jar 1 3. In FileMaker Pro, open the FMBanner.fp5 file. the images from FileMaker Pro container fields The FMProResponse class allows you to access the query results. The information you have access to includes: 4.
Using Java and JDBC to deliver your data 4. Choose File menu > Sharing, verify that Web Companion is selected, and click OK to share the database on the Web. For information about setting up the Web Companion so that it appears selected in this dialog box, see “Enabling the Web Companion” on page 3-3. 5. In your web browser, type localhost or your computer’s IP address followed by /FMMemoPad.html and press Enter. http://localhost/FMMemoPad.
This page intentionally left blank.
Appendix A Valid names used in CGI requests for FileMaker XML data This appendix describes the valid names of requests and their parameters you can use in a CGI (Common Gateway Interface) command when requesting FileMaker Pro data in XML format. Included are HREF link and HTML form examples of each request. For scripting examples of each request, see the JavaScript library, FMP.js, in the XML Examples folder (on the FMWSC and Tools CD).
A-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide Generating a –new request Name/Value Type: New Record Request What it does: Creates a new record and populates that record with the contents of any field name/value pairs.
Valid names used in CGI requests for FileMaker XML data Generating an –edit request Name/Value Type: Edit Record Request What it does: Updates the record specified by –recid, populating the fields with the contents of any field name/value pairs. The –recid parameter indicates which record should be edited. In order to edit a record, the web user must have editing privileges for the database.
A-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide Optional parameters: –styletype, –stylehref Examples of –dbnames requests To retrieve the database names using a hypertext link: PAGE 109
Valid names used in CGI requests for FileMaker XML data A-5 Generating a –dbopen request Generating a –dbclose request Name/Value Type: Open Database Request Name/Value Type: Close Database Request What it does: Opens a specified database that’s located in the Web folder with Remote Administration enabled in the Web Companion (web users must enter “Admin” as the user name) What it does: Closes an open database that’s located in the Web folder with Remote Administration enabled in the Web Companion (w
A-6 FileMaker Pro 5.5 Unlimited Administrator’s Guide Specifying parameters for the request The following are the parameters for requesting FileMaker Pro data in XML format. Some parameters are required to be present in the CGI command along with certain requests; others are optional. –db (Database) –format (Format) Name/Value Type: Parameter What it does: Specifies the XML grammar used for returning the results of a request. Value is: –dso_xml, –dso_xml_dtd, –fmp_xml, or –fmp_xml_dtd.
Valid names used in CGI requests for FileMaker XML data Optional with: –find requests Example: FMPro?–db=employees.fp5&–format= –fmp_xml& –recid=22&–delete –modid (Modification ID) Name/Value Type: Parameter What it does: Refers to the latest version (incremental counter number) of the record.
A-8 FileMaker Pro 5.5 Unlimited Administrator’s Guide –max (Maximum records) –sortfield (Sort field) Name/Value Type: Parameter Name/Value Type: Parameter What it does: Specifies the maximum number of records that should be returned. What it does: Specifies the field that will be used for sorting. The –sortfield parameter can been used multiple times to perform multiple field sorts. The position in which –sortfield appears in the CGI command will determine the sort order of the fields.
Valid names used in CGI requests for FileMaker XML data A-9 –script (Script) –styletype (Style type) Name/Value Type: Parameter Name/Value Type: Parameter What it does: Specifies the FileMaker Pro script that will be performed after finding and sorting records (if specified) during processing of the –find request.
A-10 FileMaker Pro 5.5 Unlimited Administrator’s Guide –password (Database password) Name/Value Type: Parameter What it does: Specifies the database password (set in the Access Privileges > Define Passwords dialog box) to open a database with. Optional with: The –dbopen request Example: FMPro?–db=employees.fp5&–dbopen&–password= dbpassword&–format= –fmp_xml& –styletype=text/css& –stylehref=mystylesheet.
Appendix B FileMaker Pro values for error codes The FileMaker Pro Web Companion generates an error code for databases published in XML, JDBC, or CDML format every time data is requested. The following table describes the value of each error code, which is based on the type of query to the database. Use these values to do error handling on your web pages.
B-2 FileMaker Pro 5.
FileMaker Pro values for error codes B-3 Error code value Description Error code value Description 806 File cannot be opened with this version of FileMaker Pro 975 The field has restricted access 807 File is not a FileMaker Pro file or is severely damaged 976 Security is disabled 808 Cannot open file because access privileges are damaged 977 Invalid client IP address 809 Disk/volume is full 978 810 Disk/volume is locked The number of allowed guests has been exceeded (for the 10 guest
This page intentionally left blank.
Appendix C Enabling the FileMaker Pro Web Companion in Mac OS X FileMaker Pro Unlimited uses the FileMaker Pro Web Companion plug-in to serve databases over the Web. To enable the Web Companion in Mac OS X: 1. Choose the FileMaker Pro application menu > Preferences > Application. 2. In the Application Preferences dialog, click the Plug-Ins tab. 3. Select the Web Companion checkbox.
C-2 FileMaker Pro 5.5 Unlimited Administrator’s Guide If you do not have an administrator password, or do not want to enable the Web Companion at this time, click Cancel. The Web Companion will not be enabled, and your system settings will remain unchanged. If you do not have an administrator password, or want to configure the Web Companion to use port 1024 or higher, click Advanced. Your system settings will remain unchanged.
Enabling the FileMaker Pro Web Companion in Mac OS X C-3 Note The IP Guest Limit should indicate Unlimited. If the IP Guest Limit does not indicate unlimited guests, you will need to reinstall FileMaker Pro 5.5 Unlimited using the installation code included with your copy of FileMaker Pro Unlimited. 7. Click OK to save your changes. You are finished. The Web Companion is now configured to use the port you have specified. 5. Click Change Port. You see the Web Companion Configuration dialog.
This page intentionally left blank.
Index A Access Log File option 3-4, 3-14 administering the Web Server Connector 2-1 Apache Web Server 1-1, 1-4 API (application programming interface) for FileMaker Pro 4.0 Java Class Library 6-17 for the FileMaker JDBC Driver 6-8 Java, for executing SQL statements 6-1 AppleScript error codes B-1 applets, Java FileMaker Pro 6-18 Microsoft XML Data Source Object 5-3 ASCII characters escaping in SQL identifiers 6-7 in XML documents 5-8 Asset Management.
I-2 FileMaker Pro 5.
Index FileMaker Pro Unlimited location of files and folders vi product, described v registering vii FileMaker Server v in RAIC 1-2 FileMakerExplorer.java file 6-10 filenames for instant web pages 3-13 -find requests 5-13, 5-14, A-1 FMBanner applet 6-18 FMBanner.fp5 database 6-18 FMMemoPad applet 6-18 FMMemoPad.fp5 database 6-18 FMP.js JavaScript library 5-16, 5-17, 5-21 FMPDSORESULT grammars 5-3 FMP-If tag 4-10 FMP-Include tag 4-17 Fmpjdbc12.
I-4 FileMaker Pro 5.5 Unlimited Administrator’s Guide JDBC See also FileMaker JDBC Driver described 6-1 JDBC 1.
Index R Rapid Application Development (RAD) tools 3-1, 6-1, 6-2 Raw encoding parameter 4-14 -recid request parameter A-6 RecordId pseudo column 6-4 Red Hat Linux. See Linux registering FileMaker JDBC Driver 6-2 FileMaker Pro Unlimited vii Remote Administration option 3-4 requesting data. See FileMaker Pro CGI requests requirements for installing WSC 1-3 Restrict access to IP addresses option 3-4 S schemas. See XML grammars -script request parameter A-9 -script.prefind request parameter A-9 -script.
I-6 FileMaker Pro 5.