-
For Windows and Mac FileMaker Developer 5 ® Developer’s Guide © 1998, 2000 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 www.filemaker.com FileMaker and ScriptMaker are trademarks of FileMaker, Inc., registered in the U.S. and other countries, and the file folder logo is a trademark of FileMaker, Inc. All other trademarks are the property of their respective owners.
-
-
Contents Chapter 1 Introducing FileMaker Developer 5 Chapter 2 Customizing your database solution Ways to use FileMaker Developer 5 1-1 Customize FileMaker database solutions 1-1 Create custom web sites 1-1 Take advantage of FileMaker support for open standards 1-1 Expand your FileMaker Pro calculations and scripts 1-1 Provide layout themes for your solutions 1-1 Use design tools and templates for UI design 1-1 Deploying your database solutions 1-2 About this guide 1-2 Installing the FileMaker Developer s
-
iv Developer’s Guide Chapter 3 Preparing files for a custom solution About the Relational Example General steps for preparing your solution files Issues to consider before creating a runtime database solution Opening files in Kiosk mode Design tips for navigating in Kiosk mode Emulating menu commands and window controls Centering a database window in the Kiosk screen Creating startup scripts Using button image samples Documenting your database solution Creating an About layout Creating a custom Help layou
-
Contents Specifying default values for themes Finding values for patterns and colors Adding comments to your document Checking your theme document for errors 5-9 5-9 5-10 5-10 Chapter 6 Publishing your database on the Web Moving forward using open web standards Custom web publishing with XML Custom web publishing with JDBC Custom web publishing with CDML Instant Web Publishing Static web publishing with HTML Using the FileMaker Pro Web Companion Requirements for web access Enabling the Web Companion Sett
-
vi Developer’s Guide Requests for adding records to a portal 7-9 Requests for editing multiple records in a portal 7-9 Using style sheets with your XML document 7-10 Comparing CSS, XSLT, and JavaScript 7-11 Cascading style sheets (CSS) example 7-13 Extensible Stylesheet Language–Transformations (XSLT) 7-14 example JavaScript scripting language example 7-16 Looking at the XML Inventory example 7-17 Chapter 8 Using Java and JDBC to deliver your data About the JDBC examples 8-1 About JDBC 8-1 Using the File
-
Contents Modified CDML tags Using an intratag parameter About the CDML Reference database Creating error messages Using an encoding parameter with a CDML replacement tag Planning your web site Looking at the three CDML examples Employee Database example Guest Book example Shopping Cart example 9-10 9-11 9-12 9-13 9-14 9-14 9-15 9-16 9-16 9-17 Chapter 10 Writing external function plug-ins About the plug-in examples and templates Contents of the Template folder Contents of the Full Example folder Installin
-
viii Developer’s Guide Generating a –dbopen request Examples of –dbopen requests Generating a –dbclose request Examples of –dbclose requests Specifying parameters for the request –db (Database) –lay (Layout) –format (Format) –recid (Record ID) –modid (Modification ID) –lop (Logical operator) –op (Comparison operator) –max (Maximum records) –skip (Skip records) –sortfield (Sort field) –sortorder (Sort order) –script (Script) –script.prefind (Script before Find) –script.
-
Chapter 1 Introducing FileMaker Developer 5 Welcome to FileMaker Developer 5! The FileMaker® Developer 5 product provides the software, APIs, and tools to create custom FileMaker Pro database solutions for work groups, web sites, or stand-alone runtime applications. Take advantage of FileMaker support for open standards 1 Use FileMaker Extended XML documents to exchange FileMaker Pro data with other XML-compatible applications.
-
1-2 Developer’s Guide Deploying your database solutions 1 For deploying your custom database solutions over a network, the Internet, or an intranet, the FileMaker, Inc. product line includes FileMaker Server 5 and FileMaker Pro 5 Unlimited. 1 FileMaker Server 5 provides multi-protocol support for TCP/IP, IPX/SPX (Windows) and AppleTalk (Mac OS) networks for serving up to 125 hosted files simultaneously to FileMaker Pro 5 guests on Windows and Mac OS machines.
-
Introducing FileMaker Developer 5 1-3 Requirements for the FileMaker Developer Tool To use the FileMaker Developer Tool application on Windows 95 (or later) or Windows NT systems, you need the following: 1 1 1 1 1 an Intel-compatible computer with a 486/33 processor a hard disk 16 MB of RAM (16 MB RAM recommended with Windows NT) a CD-ROM drive database files created in or upgraded to FileMaker Pro 5 To use the FileMaker Developer Tool application on Mac OS systems, you need the following: 5.
-
1-4 Developer’s Guide 9. For Custom installations, click in the column to the left of each custom component that you want to select. Then click Next. Enter your installation code here 3. Click Accept to accept the terms of the license agreement. 10. On the Installation Code screen, type your name, company, and See “Abiding by the license agreement” on page 1-9 for information. installation code. Then click Next. 4. Click Print or Save As to download last-minute additional 11.
-
Introducing FileMaker Developer 5 1-5 Installing the FileMaker ODBC driver On the FileMaker Developer CD, see the Installation Guide.pdf file in the ODBC Installer folder for instructions on installing the FileMaker Open Database Connectivity (ODBC) driver on remote machines. Your clients can use the FileMaker ODBC driver for accessing FileMaker Pro database files from other ODBC-compliant applications. Enter your installation code here 9.
-
1-6 Developer’s Guide FileMaker Trial Software folder The FileMaker Developer 5 folder contains these files and folders: For the latest versions of FileMaker trial software, visit the FileMaker, Inc. web site at www.filemaker.com or double-click FileMaker on the Web.
-
Introducing FileMaker Developer 5 Contents of the FileMaker Developer Tool folder (Mac OS) Description Contents of the Interface Elements folder FileMaker Developer Tool Application file (Mac OS) Interface Elements Runtime Files Contains the FileMaker Extensions and Solution Extras folders (described below) for distribution with the runtime application FileMaker Extensions Data import filters: ClarisWorks, DBF, Excel Contains the Claris and Extensions folders Claris Claris XTND System Claris Tra
-
1-8 Developer’s Guide External FileMaker APIs folder Contents of the FileMaker JDBC Driver folder Description XML folder JDBC ReadMe Text file FileMaker JDBC Driver folder fmpjdbc12.
-
Introducing FileMaker Developer 5 Contents of the External Function Plug-in folder Full Example 1 Description Folder containing example source code files, a compiled plug-in, and a Read Me-Full Example text file in either the Visual C++ folder (Windows) or CodeWarrior Pro folder (Mac OS and Windows) For information about the example, see chapter 10, “Writing external function plug-ins.
-
1-10 Developer’s Guide If you do not have access to the Web, please refer to the Technical Support and Customer Service sheet included in the software box. North American customers can also call 1-800-965-9090 to learn about the service options available. About the TechInfo database The TechInfo database is a great resource for technical information about FileMaker, Inc. products.
-
Chapter 2 Customizing your database solution FileMaker Developer 5 provides a utility application called the FileMaker Developer Tool that lets you: 1 bind your database files into a stand-alone runtime database solution that does not require FileMaker Pro in order to be used on a computer 1 rename all of your database files and automatically update the internal links to related files and scripts 1 1 1 Kiosk Solution Example—a runtime database solution for the World Class Burger Company that displays
-
2-2 Developer’s Guide Using the FileMaker Developer Tool Use the Developer Tool to create a new set of files, customize them, and enclose them inside a new solution folder. Note Database files from earlier versions of FileMaker Pro must be opened and saved in FileMaker Pro 5 before you can use them with the Developer Tool. To use the FileMaker Developer Tool: 1. Close all of your database files that you are going to customize. 2. If necessary, install the FileMaker Developer Tool. 5.
-
Customizing your database solution Select this option To create a copy of your database files and do this Permanently prevent modification of database structure Create a database solution with the following menu commands permanently unavailable in FileMaker Pro: Define Fields, Define Relationships, Access Privileges, Layout Mode, and ScriptMaker. Important Once removed, these menu commands cannot be made available again for the custom solution.
-
2-4 Developer’s Guide The next screen that appears depends on which options you selected on the Customize Your Solution screen (step 5). If you did not select Create a stand-alone runtime solution, then skip to step 21. 15. Type a name for your runtime application in the Runtime Name box. 10. Choose the primary file from the pop-up menu. The primary file stores the custom settings and is the database that users should open first.
-
Customizing your database solution 2-5 Select Filename Extension screen on Windows machines 21. On the Specify Location for Solution Folder screen, click Browse (Windows) or Select (Mac OS) to specify the location for the runtime database solution. The name of the new solution folder is determined by either the name of the primary file or the name of the runtime solution. 22. Select the location and click OK (Windows) or click Choose (Mac OS). 23. Click Finish.
-
2-6 Developer’s Guide Binding your databases into a runtime database solution Use the FileMaker Developer Tool to bind your database files into a stand-alone runtime database solution that users can access without running FileMaker Pro on their machines. The Developer Tool creates a copy of your files, and binds the primary database file and all auxiliary files to a runtime application with a name that you specify. Users double-click the runtime application to open the bound primary file.
-
Customizing your database solution 4. Specify the database files that you want to bind, rename them if desired, and click Next to go to the next screen in the runtime binding process. 5. Select a primary file. All of the settings for binding are stored in the primary file. The primary file opens automatically when a user double-clicks the runtime application. 6.
-
2-8 Developer’s Guide Assigning a three-character filename extension The three-character filename extension associates all of the solution files with the FileMaker Pro runtime application. If a user has more than one runtime database solution on a machine, the filename extension together with the binding key will ensure that the correct runtime application is started when a solution file is double-clicked.
-
Customizing your database solution Note No matter what the filename extensions are, runtime database files can still be opened in the FileMaker Pro application. To prevent users from modifying your runtime database solutions, create passwords for specific access privileges or select the Permanently prevent modification of database structure option in the Developer Tool before you bind the files into a runtime database solution.
-
2-10 Developer’s Guide Note The master password for the Kiosk Solution Example files is kiosk. Using this password will cause the example databases to open in FileMaker Pro with full menu bar access. The Developer Tool creates a duplicate copy of the database files with a new Kiosk-mode interface and places them in a new folder. Closing files in Kiosk mode The primary file is the main database that users see first in your Kiosk solution.
-
Customizing your database solution Renaming your databases Use the FileMaker Developer Tool to rename all the files in your database solution and automatically update all internal reference links (filespecs) to related files and scripts. The Developer Tool creates a duplicate copy of the database files before it renames them and updates the links.
-
2-12 Developer’s Guide Important Selecting this option permanently removes access to these menu commands for all database files in the solution, whether they’re opened in a runtime application or in FileMaker Pro. This will help protect your files from password hackers. Structural elements of the files cannot be modified by anyone, including FileMaker, Inc. employees.
-
Customizing your database solution 2-13 In runtime applications, the custom About menu command replaces the About FileMaker Pro menu command. If you don’t specify an About script when you bind your files into a runtime database solution, an About FileMaker Pro Runtime menu command is added to the Help menu (Windows) or Apple (4) menu (Mac OS) of the runtime application. When users choose this menu command, the FileMaker Pro 5 Runtime dialog box appears.
-
2-14 Developer’s Guide Renaming the Scripts menu Custom Help command in a runtime application (Windows) Use the Developer Tool to rename the Scripts menu for your database solution. The setting is stored in the primary file of your solution and the new menu name appears in the menu bar in FileMaker Pro and in a runtime application.
-
Customizing your database solution 2-15 Adding the FileMaker Pro extension to database filenames To use the Solution Options file: Use the FileMaker Developer Tool to quickly add the FileMaker Pro filename extension to your database files. For example, if you created your database files on a Mac OS machine but you now want the database solution to be used on Windows machines, you can add the .fp5 filename extension to your database filenames for Windows compatibility.
-
2-16 Developer’s Guide The FileMaker Dev Tool Options file keeps a record of the solution name and the binding key that you used for that solution 2. Scroll down to the Auto option at the bottom of the list of options. 3. Change the value from 0 to 1. Now, when you drag the text file onto the Developer Tool, the customizing process is performed immediately based on the database files and other settings specified in the text file.
-
Chapter 3 Preparing files for a custom solution Before you use the FileMaker Developer Tool to create a custom database solution, you need to decide how users will interact with it.
-
3-2 Developer’s Guide General steps for preparing your solution files Here are some general steps for preparing your database files before you customize them with the Developer Tool and distribute them to your users: 1. If desired, create a custom theme for all the layouts in your database solution. (See chapter 5, “Creating custom layout themes” for information.) 2. In FileMaker Pro, design, create and test the databases that make up your solution. 3.
-
Preparing files for a custom solution 1 Do you want users to be able to modify the database? Although many menu commands are unavailable in a runtime application, users can still access the menu commands by opening your runtime database solution files in FileMaker Pro. (For a complete list of available menu commands, see appendix A, “Feature comparison of the runtime application and FileMaker Pro.
-
3-4 Developer’s Guide Design tips for navigating in Kiosk mode To decide how users will navigate your Kiosk database solution, start by planning your navigation design on paper. Decide what will happen when each button is clicked, and give users a way to get back to the beginning of your system from each layout. To further control what users see, create startup scripts that display a specific layout when a file is opened.
-
Preparing files for a custom solution 1 If the window is smaller than the available screen area, it is centered in the middle of the screen. Important Before using the Toggle Window script step, perform any script steps that affect the window display area (such as Go to Layout or Toggle Status Area). Once the window area is determined, add the Toggle Window script step. The Toggle Window script step may cover up a window that has a Quit Application button.
-
3-6 Developer’s Guide To use a button image sample in your database: 1. Copy the object from the Artwork Sampler or Interface Elements database and paste it into a layout in your database. 2. In Layout mode, select the object and choose Format menu > Button. 3. In the Specify Button dialog box, select a script from the list on the left side, choose options for the script on the right side, and click OK.
-
Preparing files for a custom solution 3-7 Note The FileMaker Pro Help system is not available in FileMaker Pro runtime applications. However, Status Bar Help (Windows) and Balloon Help (Mac OS) are available. In addition, you can provide What’s This? Help for runtime database solutions that run on Windows machines. See “Providing What’s This? Help (Windows)” on page 3-9 for information.
-
3-8 Developer’s Guide 5. Choose Scripts menu > ScriptMaker and create a script that goes to the About layout. Include the word “About” in the script’s name. About 6. Use the Developer Tool to create a menu command that displays the About layout. The Developer Tool uses the script’s name for the name of the menu command. See “Adding a custom script to an About menu command” on page 2-12.
-
Preparing files for a custom solution 3-9 Providing What’s This? Help (Windows) When you create FileMaker Pro runtime database solutions for Windows users, the Developer Tool generates a What’s This? Help file that you can distribute with your databases. When users select an item in an open dialog box and click the ? button or press Shift+F1, a separate What’s This? Help window opens describing the option in the dialog box.
-
3-10 Developer’s Guide 1 What to do in case of a damaged file (see “Recovering damaged files” on page 4-7) 1 How to reach you for technical support You might also want to include the following recommendations: 1 Tell your users not to rename any solution files (except the runtime application), or they may be unable to run your solution. 1 Recommend that users back up their data regularly. You might want to automate some of the process by including scripts that save copies of the solution files.
-
Preparing files for a custom solution 3-11 The following are examples of characters that won’t display properly across platforms. Simulated text styles as displayed on the Mac OS Simulated text styles as displayed on the Windows OS Actual text styles as displayed on the Mac OS Actual text styles as displayed on the Windows OS To simulate a shadow effect for text: 1. Add text to your layout. 2. Set its text color to a shade of gray.
-
3-12 Developer’s Guide 1 Check the alignment of the field labels and their associated fields—they should both be aligned in the same direction. If you put a left-aligned label over a column of right-aligned numbers, for example, the report might look fine on your computer. But font substitution could cause field labels to shift when the file is opened on another computer. If a wider font is substituted on the second computer, your column heading will shift to the right.
-
Preparing files for a custom solution 3-13 To save a QuickTime movie in a cross-platform format: Using separate scripts for printing 1. On your Mac OS machine, start your QuickTime editing program. Scripts that include Page Setup/Print Setup and Print commands are not 100% compatible across platforms. The print steps in the ScriptMaker® feature rely upon the current printer driver in order to determine the paper sizes that are available, page orientation, and so on.
-
3-14 Developer’s Guide The Status (CurrentPlatform) function returns a 1 when run on a computer using the Mac OS, a 2 when run on a computer using Windows 95 or Windows 98, and a -2 when run on Windows NT systems. Use this function with the If script step to perform different actions depending on the current platform.
-
Preparing files for a custom solution 3-15 If you distribute FileMaker Pro runtime files with passwords, or you have removed master level design access and you do not want FileMaker, Inc. to decode passwords, repair access privileges, and/ or return data to a customer who requests such services, you must do the following: 1. Notify your customers in writing and keep a record of such notice that your database solution contains passwords and/or data that can only be provided by you.
-
3-16 Developer’s Guide The password protection in a FileMaker file should not be viewed as an absolute barrier that will prevent a customer from accessing files. FileMaker, Inc. cannot guarantee that a customer will not be able to identify or bypass the password without any assistance from FileMaker, Inc. Therefore, FileMaker Inc. recommends that you take appropriate steps to protect your consulting and development efforts without relying solely upon the password.
-
Preparing files for a custom solution The original files will be renamed “ Old” and the converted files will keep the original name. If the solution files use relationships or external scripts, the converted files will continue to work together. 2. If you want, update your databases to take advantage of new FileMaker Pro 5 features, such as the new enhanced value lists. 3.
-
-
Chapter 4 Distributing FileMaker Pro runtime database solutions The final steps in developing your FileMaker Pro runtime database solution are to bundle all of the necessary files together, choose how you will distribute your solution—for example, on a CD-ROM disc, over a network, or on floppy disks—and provide your users with documentation for installing your solution. In addition, your documentation should include instructions for starting the runtime application and what to do if a file is damaged.
-
4-2 Developer’s Guide Other solution components that you need to provide include: 1 A license agreement — see “Including a license agreement” on page 4-4. 1 Installation instructions — see “Documenting the installation procedures” on page 4-6. Generated DLL files for Windows runtime database solutions The following table describes the Dynamic Link Libraries (DLLs) that are provided for your runtime database solutions running on Windows machines.
-
Distributing FileMaker Pro runtime database solutions System folder and files Description Cworks.imp Used to import ClarisWorks databases Dbf.imp Used to import dBASE files Excel.imp Used to import Excel files Claddon.clr Spelling dictionary that contains computer terminology Ukenglsh.mpr Primary British English dictionary of over 100,000 words that the runtime application uses to check the spelling Usenglsh.mpr User.
-
4-4 Developer’s Guide Copy the FileMaker Extensions folder and its contents from the Runtime Files folder into the root level of your runtime database solution folder. When the runtime application is started, the files should work immediately.
-
Distributing FileMaker Pro runtime database solutions 4-5 Using a custom installation program Requirements for your runtime solution (Windows) If your runtime database solution is large, or if you plan to distribute the files on floppy disks, consider using a custom installation program. Configuring a custom installation application to automatically install runtime database solution files may require more engineering than using a compression utility, but usually offers more professional results.
-
4-6 Developer’s Guide For optimal performance, they can host the solution files using FileMaker Server 5 for Windows NT or FileMaker Server 5 for Mac OS. Primary file icon For information about the FileMaker Server 5 and FileMaker Pro products, and information about volume license sales, see the FileMaker, Inc. web site at www.filemaker.com. Documenting the installation procedures You’ll need to provide instructions to your users for how to install your runtime database solution.
-
Distributing FileMaker Pro runtime database solutions Recovering damaged files Power failures, hardware problems, or other factors can damage a FileMaker Pro file. If your database solution becomes damaged, your users need to recover the damaged file. When the runtime application discovers a damaged file, a dialog box appears, telling the user to contact the developer.
-
4-8 Developer’s Guide If you forget the original binding key for your runtime database solution and want to update or add a file, you’ll need to rebind all of the database files with a new binding key and redistribute the entire solution. To distribute an updated primary file: 1. Open the original primary file (before it was bound) in FileMaker Pro. 2. Make the changes to the primary file. If necessary, create an Import script so users can import their existing data into the new primary file.
-
Chapter 5 Creating custom layout themes FileMaker Pro 5 uses a variety of layout themes to describe the colors, patterns, fonts, and borders of text, fields, and parts in a new layout. Note A FileMaker Pro theme is not a stylesheet and does not contain positioning information for objects on a layout.
-
5-2 Developer’s Guide In order for the New Layout/Report assistant in FileMaker Pro to display a theme option, the theme file must reside in the Themes folder and it must have the .fth filename extension. See the table in “Valid values for theme attributes” on page 5-7 and “Finding values for patterns and colors” on page 5-9 for guidelines. 3. Open the theme file in your text editor. remove the entire single-line or multi-line element including its start and end tags. 6.
-
Creating custom layout themes Basic requirements for a theme file FileMaker Pro layout themes are described in an XML document saved in text file format. Each text file must have the .fth filename extension and reside in the Themes folder inside the FileMaker Pro application folder so FileMaker Pro can display the themes in the New Layout/Report assistant. XML resembles HTML in many ways—however, unlike HTML the XML for layout themes must be well-formed and comply with the required syntax.
-
5-4 Developer’s Guide Removing elements from a theme file The FileMaker Pro layout theme files contain multi-line elements for fields, field labels, text, and every part in a layout. Each of these elements contains other multi-line elements and single-line elements. You can remove any of these elements, but you must remove the entire element—that is, everything inside the element’s start and end tags and the start and end tags as well.
-
Creating custom layout themes This multi-lined element is used To describe this layout part Trailing grand summary — appears at the end of a report and displays a summary field for all the records in a found set. (A layout can have only one trailing grand summary part.) Footer — appears at the bottom of every screen or page (except the first one if there’s a title footer).
-
5-6 Developer’s Guide These multi-line elements May contain these elements These single-line elements Must contain these attributes FIELD BASELINE CHARSTYLE COLOR (text/data in a field) BORDER FONT CHARSTYLE SIZE EFFECT STYLE FILL Syntax example: TEXT CHARSTYLE (text in a part—except field labels or field data) EFFECT FILL PEN TEXTLABEL CHARSTYLE (text in a field label) EFFECT EFFECT <
-
Creating custom layout themes These single-line elements Must contain these attributes This attribute THEMEDEFAULT VALUE COLOR Syntax example: For more information, see “Specifying default values for themes” on page 5-9. VERSION VALUE Syntax example: And may contain these values RGB color hex values for COLOR = “#FFFFFF” background fills, text, and COLOR = “#33FF00” borders in layout parts, fields, COLOR = “#CC9966” text blocks, and field labels.
-
5-8 Developer’s Guide This attribute HINT ONOFF PARTNUMBER Is used to describe these characteristics And may contain these values The name of the platform that HINT = “WIN” the theme name is edited on. HINT = “MAC” This attribute ensures that any upper-ASCII characters present in the THEMENAME value (for example, an accent over a letter in the theme’s name) will appear in FileMaker Pro on both Windows and Mac OS. Whether a field’s border should be displayed (turned on or off).
-
Creating custom layout themes This attribute STYLE Is used to describe these characteristics And may contain these values Character styles for text in fields, text blocks, and field labels. More than one style can be specified, separated by commas or spaces. STYLE = “PLAIN” No error checking is done for contradicting styles, such as UPPERCASE and LOWERCASE. STYLE = “STRIKETHRU” The PLAIN style value overrides all other style values.
-
5-10 Developer’s Guide Themes use 6-digit color hexadecimal (hex) values to describe colors (such as #CC9966), which can be found in most graphics programs that use a color palette. Themes should use web-safe colors for databases that will be accessed by multiple platforms, displayed on monitors with varying resolutions, or displayed on a network.
-
Creating custom layout themes Here is a list of things to check for if your new layout themes don’t appear in the New Layout/Report assistant as expected: 1 1 1 The theme filename has the .fth extension. The theme file is in text format. The theme file is located in the Themes folder inside the FileMaker Pro application folder. 1 All required elements are there, including their start and end tags:
-
-
Chapter 6 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.
-
6-2 Developer’s Guide For information, see chapter 8, “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 (installed in the FileMaker Developer 5 folder). 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 6-3 In addition, your site folders and web pages must be located inside the Web folder (inside the FileMaker Pro 5 application folder) in order for the Web Companion to serve them on the Web. However, your databases do not have to be inside the Web folder. They only need to be open in FileMaker Pro or FileMaker Pro Unlimited and shared via the Web Companion. For security, it’s a good idea not to have your databases or other sensitive documents in the Web folder.
-
6-4 Developer’s Guide 2. In the Web Companion Configuration dialog box, choose an The [Built-in] option displays the “FileMaker Pro Instant Web Portal” home page by default. All other HTML files that are located in the root level of the Web folder appear in this list.
-
Publishing your database on the Web Web users must append the 591 port number to the end of the IP address with a colon when they enter the URL to your published database, for example, http://17.17.17.17:591. 10. Click OK to close the Web Companion Configuration dialog box. 11. Click OK again to close the Application Preferences dialog box. Sharing the database via the Web Each database that you’re publishing on the Web must be open and shared via the Web Companion. To share a database on the Web: 1.
-
6-6 Developer’s Guide Specifying a custom home page as the default To use a custom home page with Instant Web Publishing: To specify the custom home page as the default in the Web Companion Configuration dialog box: 1. Create an HTML file for your home page using a text editor or 1. Make sure the custom home page is located in the root level of the 2. Save the file with the .htm or .html filename extension and place Web folder (inside the FileMaker Pro folder).
-
Publishing your database on the Web 6-7 2. Open and share the database via the Web Companion, then choose 4. Examine the HTML source for the HREF links on this page and a web style and specify browser view layouts for the open database. (In FileMaker Pro, choose File menu > Sharing, select Web Companion, and click Set Up Views. For more information, see “Setting up browser views” in chapter 14 in the FileMaker Pro 5 User’s Guide or see FileMaker Pro Help.
-
6-8 Developer’s Guide Filenames for instant web pages The following table lists the instant web pages and their format filenames as they apply to the English language setting and all web styles that use cascading style sheets. The language setting made in the Web Companion Configuration dialog box (Spanish in this example) does not affect the language of your data or the graphics This letter Indicates this language Filename of the Form View instant web page N Dutch NFormVwCss.
-
Publishing your database on the Web In addition, the Web Companion provides several external functions for monitoring activity with your databases, which can be used in your calculation fields and scripts. Using the access.log file The access.log file keeps a record of every time someone accesses the Web Companion from a web browser and lists the hits in NCSA/ CERN-compatible Common Log Format. 6-9 The Common Log Format used for the access.
-
6-10 Developer’s Guide For example, these CDML replacement tags in the web page: [FMP-Log: Bob wanted this feature.] [FMP-Log: Let’s be nice and implement it for him.] Will generate these lines in the info.log file: [06/May/2000:20:33:08 –0800] Bob wanted this feature. [06/May/2000:20:33:08 -0800] Let’s be nice and implement it for him. 6.
-
Publishing your database on the Web 9. Click Done to close the Define Fields dialog box. Exporting data to a static HTML page External function’s name and parameter 6-11 Web-Version, 0 Returns the version of FileMaker Pro Web Companion that loads when you open FileMaker Pro To quickly display the existing data in your FileMaker Pro database on the Web, you can export it into an HTML table and publish your database as a static web page.
-
6-12 Developer’s Guide 3. In the Specify Field Order for Export dialog box, indicate how you want FileMaker Pro to export the data by selecting fields in the left box and moving them to the Field Order box on the right — in the order that you want them to appear. 4. To export a related field, choose the relationship from the pop-up menu.
-
Publishing your database on the Web 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).
-
6-14 Developer’s Guide For example, you can open a database, and configure the Web Companion to publish it. To test your database, open your web browser, then type http://10.10.10.10/ to see your database home page. 11. After testing, return your computer to the original network settings. Setting up on a Mac OS machine To set up your computer as a single-machine network, you can tunnel TCP/IP through AppleTalk and set AppleTalk to use a “null” connection that won’t connect to the outside world.
-
Publishing your database on the Web 6-15 Now, to test your web published databases, you can type localhost or 127.0.0.1 in your web browser and the Web Companion will serve the home page as specified in the Web Companion Configuration dialog box (see “Displaying a custom home page” on page 6-5 and “Setting Web Companion configuration options” on page 6-3). The Web Companion uses HTTP basic authentication to enforce web security.
-
6-16 Developer’s Guide If desired, use the [FMP-CurrentError] and [FMP-CurrentDatabase] tags in the format file to display the results of the request (the “current database” was successfully opened or the “current database” could not be opened because of “error #”). 1 1 1 Here is an example of making a –dbopen request: 1 FMPro?–db=secretfolder/employees.fp5&–format=dbopen.htm& –password=dbpassword&–dbopen Here is an example of making a –dbclose request: FMPro?–db=secretfolder/employees.
-
Publishing your database on the Web 6-17 Once a user name and password are established, they are sent by the web browser with every request to the web server. The FileMaker Pro Web Companion checks these values against the settings configured in the Web Security Database, and then determines if any user permissions or field restrictions exist for a specific action.
-
6-18 Developer’s Guide 2. In the Database Name field of each new record, type the name of the database you want to protect. Or, type All Databases in the Database Name field of one record if you want to make the same user permissions and field restrictions for all of your published databases. 7. If you want to access the Web Security Database settings later from the Web, select Requires password and enter a password in the box.
-
Publishing your database on the Web 6-19 5. Type a password in the User Password field (optional). When creating a password, use only the characters A through Z, numerals, or a combination of the two. Do not include spaces in your password. This minimizes the possibility that you will choose characters that may be interpreted incorrectly over the Web. 6. Select one or more of the following permissions for the user.
-
6-20 Developer’s Guide When this field restriction is selected ExactUpdate Web users can do the following Edit only those records containing a value that exactly matches the value specified by the user for this field in a search. A record cannot be updated unless an exact match is made with the field’s value in the database. Web users cannot edit this field. Note This option does not work with FileMaker Pro Instant Web Publishing and should not be selected in that case.
-
Publishing your database on the Web 6-21 Note All fields that you have set with the ExactSearch, ExactUpdate, or ExactDelete field restrictions must be present in the HTML form or script that specifies the search action. For example, if two fields are specified in the Web Security Database with these field restrictions, but only one of the fields is on the search page, then an error page is displayed when a web user attempts a search.
-
6-22 Developer’s Guide On the resulting web page, you see a summary of the user permissions and field restrictions for the specified database. You can remove the web security record of this database from the Web Security Database by clicking the Delete Database button on this page. If the password for the database was changed in FileMaker Pro, you can type the new password in the Database Password box and click Update Password to update the web security record. 7.
-
Publishing your database on the Web 6-23 10. On the Add User page, enter the desired user name, password, and permissions, and then click Add User. 11. Click the View Database link to return to the summary page. 12. Click a field’s underlined link on the specified database’s summary page to change the restrictions for the field in the specified database. 16. On the Add Field page, enter the desired field name and field restrictions, and then click Add Field.
-
6-24 Developer’s Guide 19. In the New Database Name box, enter the name of the database you want to create a web security record for. 20. If the database has a password set up for FileMaker Pro access privileges, enter it in the New Database Password box. (This should be the master password for the database.) 21. Enter the first user name and the desired password and permissions. Then click Add Database. The summary page for the new database record appears.
-
Chapter 7 Using FileMaker Pro XML to deliver your data With the enhanced Web Companion, FileMaker Pro can now 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.
-
7-2 Developer’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 7-8. About XML namespaces To avoid name collisions, unique XML namespaces help distinguish XML tags by the application they were designed for.
-
7-4 Developer’s Guide Description of elements in the FMPDSORESULT grammar Each ROW element in the generated FMPDSORESULT grammar contains a number of FIELD elements that correspond to the field names in the specified layout.
-
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.
-
7-6 Developer’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.
-
7-8 Developer’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 Use these parameter names –scriptnames Retrieve names of all available scripts for a specified open, web-shared database –script.
-
7-10 Developer’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.2=New York&–format= –fmp_xml&–edit The –styletype parameter is used for setting the value of the type attribute (type=text/css or type=text/xsl).
-
Using FileMaker Pro XML to deliver your data 7-11
-
7-12 Developer’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 (installed in the FileMaker Developer 5 folder) to go to the FileMaker Developer product support pages in your browser. To view the examples: 1.
-
Using FileMaker Pro XML to deliver your data 7-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.
-
7-14 Developer’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.
-
7-16 Developer’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.fp5 database on a web page.
-
Using FileMaker Pro XML to deliver your data function nextRecord( ) { if (foundSet.nextRecord( )) populateFields( ); 7-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 (installed in the FileMaker Developer 5 folder) to go to the FileMaker Developer product support pages in your browser. } function previousRecord( ) { if (foundSet.
-
7-18 Developer’s Guide To view the XML Inventory example: 1. If necessary, install the Inventory example files from the FileMaker Developer 5 CD. FileMaker Developer 5 > External FileMaker APIs > XML > Inventory Example The currently selected record displays in a separate Detail View window. It is also possible to open the Detail View window by double-clicking a record item in the list. To close the Detail View window, click the Cancel button.
-
Using FileMaker Pro XML to deliver your data 7. Enter data for the new record and click Add to add it to the bottom of the list. 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. 7-19 A detail view of an empty record opens in a separate window with a blinking insertion point in the Item field.
-
7-20 Developer’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.
-
-
Chapter 8 Using Java and JDBC to deliver your data If you’re a Java programmer, you’ll find the new FileMaker JDBC Driver a welcome addition to FileMaker Developer 5. You can use this driver with any Rapid Application Development (RAD) tool to visually create your FileMaker Pro database-aware Java application or applet. The previous version of the Developer Edition provided the proprietary FileMaker Pro 4.
-
8-2 Developer’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 8-3 ResultSet resultSet = fmpStatement.execute("select \"last name\", \"first name\" from \"employees.fp5\" where department='engineering' order by \"last name\""); jdbc:fmpro:http://1.184.21.234:80 If you need a secure connection, you might want to use the FileMaker Pro Unlimited software, which includes the Web Server Connector that allows you to encrypt and decrypt your data via HTTPS. System.out.println("Engineering Department"); while (resultSet.
-
8-4 Developer’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.
-
8-6 Developer’s Guide Using the ModID pseudo column { System.out.println("Could not load driver"); } catch(SQLException sqlException) { System.out.println("JDBC Error: " + sqlException.getMessage()); } Each record in a FileMaker Pro database has a corresponding modification ID (ModID) number that increases incrementally every time the record is modified.
-
Using Java and JDBC to deliver your data SQL statement examples The following are some examples of SQL statements, some of which use RecordID and ModID pseudo columns, and DbOpen and DbClose pseudo procedures: 8-7 FileMaker data type mapping to JDBC SQL and Java data types SELECT recordid, modid, "last name", "first name", department FROM "Employees.
-
8-8 Developer’s Guide About the FileMaker JDBC Driver interfaces and extensions The FileMaker JDBC Driver implements all of the following JDBC interfaces: 1 1 1 1 1 1 1 1 The API documentation for these standard interfaces and the FileMaker extensions is included in HTML format in the FileMaker Developer 5 folder: FileMaker Developer 5 > External FileMaker APIs > FileMaker JDBC Driver > Documentation CallableStatement Connection Example 1: Looking at the FileMaker Pro Explorer application DatabaseMet
-
Using Java and JDBC to deliver your data To view the example on Windows machines, you need: 1 Java.exe (included with JDK 1.1.8 for Windows) or equivalent Java virtual machine installed in the system path on your computer 8-9 FileMaker Developer 5 > External FileMaker APIs > FileMaker JDBC Driver > Examples > FileMaker Explorer > FileMakerExplorer.
-
8-10 Developer’s Guide 4. Expand the Inventory.fp5 node (folder) to expose the Layouts and Scripts nodes. 9. Select the Scripts node to display the names of scripts for the Inventory.fp5 database on the right side of the window. 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.
-
Using Java and JDBC to deliver your data 8-11 FileMaker Developer 5 > External FileMaker APIs > FileMaker JDBC Driver > Examples > JBuilder 3.0 Professional FileMaker Developer 5 > External FileMaker APIs > FileMaker JDBC Driver > Fmpjdbc12.jar The JBuilder 3.0 Professional example folder contains the database file used in this example and all of the completed files generated by the JBuilder wizard for the application. Set up JBuilder to use the FileMaker JDBC Driver 1.
-
8-12 Developer’s Guide 2. In JBuilder, choose File menu > New Project. Create the data module 3. In the dialog box, specify the name and location for the project file 1. In JBuilder, choose File menu > New. (JBuilder Inventory). 2. In the New dialog box, select the Data Module icon and click OK. 4. Choose Project menu > Properties. 3. In the New Data Module dialog box, make sure that inventory is in the Package text box and that the checkbox for Invoke Data Modeler is selected. 4.
-
Using Java and JDBC to deliver your data 8-13 JBuilder connects to FileMaker Pro. 7. In the Data Modeler, click the + symbol to expand Tables. 8. Click the + symbol to expand the Inventory$2efp5 table (now encoded with the period escaped). 9. Click the + symbol to expand Columns. 10. Select each of the following columns and copy it to the right side 2. In the Driver text box, type com.fmi.jdbc.JdbcDriver. 3. In the URL text box, type jdbc:fmpro:http://localhost/ properties?escape=.%20.
-
8-14 Developer’s Guide 2. Click the Java Client Layout tab. Because JBuilder requires a unique row identifier for updating and deleting rows, it automatically adds the RecordID pseudo column to the list of output columns, which you probably don’t want displayed in your application. 3. Deselect the Layout check mark for the RecordID identifier. 4. Choose File menu > Generate. The field attributes used for the example from the Inventory.
-
Using Java and JDBC to deliver your data 8-15 Field type Field name Field attribute Set up Visual Cafe to use the FileMaker JDBC Driver Date Date Purchased User defined entry field 1. Start Visual Cafe 4.0 Expert Edition for Windows. Container Picture Graphic import 2.
-
8-16 Developer’s Guide 3. In the DataBound Project Wizard, select Application for the project 11. In the DataBound Project Wizard, select inventory_db in the list type and click Next. of database tables and views, and click Next. 4. Select Define another data source and click Next. 12. Click Clear to move all the used columns to the Available 5. In the DataBound Project Wizard, click New. Columns list. 6. In the Insert Datasource dialog box, click Add Driver. 13.
-
Using Java and JDBC to deliver your data Field type Field name Text Location 8-17 Field attribute 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 The field attributes used for the example from the inventory_db database are described in the following table: Field type Field name Field attribute Text Item User defined entry field Text Category Value List/Category List (Pop-up menu) Offic
-
8-18 Developer’s Guide The FileMaker Java Class Library is installed in the FileMaker Developer 5 folder. 1 the names of layouts, fields in a layout, and scripts defined for a database FileMaker Developer 5 > External FileMaker APIs > Java Class Library 1 About the FileMaker Java Class Library The FMProResponse class allows you to access the query results.
-
Using Java and JDBC to deliver your data 8-19 FileMaker Pro 5 > Web > FMBanner.html FileMaker Pro 5 > Web > FMBanner.jar 4. Choose File menu > Sharing, verify that Web Companion is selected, and click OK to share the database on the Web. 3. In FileMaker Pro, open the FMBanner.fp5 file. For information about setting up the Web Companion so that it appears selected in this dialog box, see “Enabling the Web Companion” on page 6-3. 4.
-
-
Chapter 9 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 FileMaker Developer 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.
-
9-2 Developer’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 (installed in the FileMaker Developer 5 folder). See “Enabling the Web Companion” on page 6-3 and “Sharing the database via the Web” on page 6-5.
-
Custom web publishing using CDML
-
9-4 Developer’s Guide Or, web users might click on a submit button in an HTML form containing the FMPro form action and the following hidden INPUT elements:
-
Custom web publishing using CDML The following is an example of another–edit request for editing records in a portal, in an HTML form:
-
Custom web publishing using CDML 9-7 2. Use the CDML Tool to add any CDML tags for the fields and Choose this template So web users can do this with your database other types of data you’re requesting from the database. Edit.htm Make changes to one record See “Categories of CDML tags” next. Edit_reply.htm Receive feedback after editing a record 3. Add text, images and links as desired. New.htm Add a record 4. Name and save the file in your web site. New_reply.
-
9-8 Developer’s Guide Categories of CDML tags There are three types of FileMaker CDML tags: 1 Action tags — these tags are used to make a specific request to the Use tags in this category For this type of interaction with FileMaker Pro Fields (Add) Static Display static field name and value list information from the database in HTML form elements (text field, text area, check box, radio button, repeating fields, scrolling list).
-
Custom web publishing using CDML Use tags in this category For this type of interaction with FileMaker Pro New CDML action tags Replacement Display specific data from the database in one of 44 types of replacement tags on the web page. For example, display the web user’s IP address in the [FMP-ClientIP] replacement tag.
-
9-10 Developer’s Guide New CDML variable tags –errorfmtfield (variable) New CDML replacement tags Description [FMP-IncludeField: fieldname] Replace with specific field data. (replacement) For –view requests, the specified field must be a global field.
-
Custom web publishing using CDML Modified CDML tag Description [FMP-If: CurrentRepeatNumber] Use this parameter with the [FMP-If] tag to specify a number for the current field repetition within the [FMP-Repeating] looping tag. (new parameter) [FMP-If:.and.] [FMP-If:.or.] [FMP-If:.xor.
-
9-12 Developer’s Guide About the CDML Reference database Each topic explains how the CDML tag is used and its syntax. The CDML Reference database is divided into two parts: 1 CDML Tag Index — an index for all of the CDML tags with topics that describe what each tag does and how it appears in syntax 1 Custom Web Publishing — general guidelines for custom web publishing using CDML To view the CDML Reference database: 1. In FileMaker Pro, open the CDML_Reference.
-
Custom web publishing using CDML 9-13 Creating error messages Click to view a topic The FileMaker Pro Web Companion automatically generates an error page for various errors that occur when web users access a database. You can specify your own error pages to override the builtin pages in the following ways: 1 Use the –error variable tag in a FileMaker Pro CGI request to specify a single error page, which will be displayed for every type of error that occurs.
-
9-14 Developer’s Guide UnexpectedError.htm NotEnoughMemory.htm This encoding parameter Tells the browser to do this DatabaseNotOpen.htm Raw Don’t perform any encoding LayoutNotFound.htm HTML Use standard HTML encoding DataEntryError.htm Format DatabaseViolation.htm (new parameter) Use standard HTML encoding and replace text, numbers, dates, times, and container size formatting with FileMaker Pro formats (for example, to add and elements) FieldViolation.htm SecurityDisabled.
-
Custom web publishing using CDML 1 which format file will be displayed as a result of each request You’ll also need to create pages to display error messages and other types of feedback. 9-15 The Web Companion displays the default.htm file located inside the CDML Examples folder. For information on setting up your computer as a localhost, see “Testing your site without a network connection” on page 6-13.
-
9-16 Developer’s Guide Employee Database example The Employee Database example is designed to demonstrate the most widely used CDML tags. It shows how to 1 1 1 1 1 search for records in the database The first example link is a simple HREF link to the example.htm page. example And the CDML replacement tags appear statically on the page.
-
Custom web publishing using CDML 9-17 Arrow icons on the New Record page indicate three fields that are required fields in the database. If any of these fields is left blank when the information is submitted to the database, then the error message page (gb_err.htm) is displayed. The error page is specified on the New Record page in a hidden INPUT element. For information, see “Creating error messages” on page 9-13.
-
9-18 Developer’s Guide The site keeps track of each web user by passing CDML tokens from one web page to the next. Some of the CDML format files use the [FMP-Include] replacement tag to reference text files and include their content on the web pages. In addition, the site uses scripting for easy navigation, which is described in the nav.js JavaScript library. 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.
-
Chapter 10 Writing external function plug-ins If you are a C or C++ programmer and familiar with advanced calculations in FileMaker Pro, you can create external function plugins that extend the feature set of FileMaker Pro — including calculation formulas that take advantage of recursion and looping, or that hook into other programming interfaces. Users can enable your plug-ins in FileMaker Pro and use your external functions in their calculation fields and scripts.
-
10-2 Developer’s Guide Contents of the Template folder The following tables describe the template files in the Template folders for the Microsoft Visual C++ and Code Warrior Pro projects. Microsoft Visual C++ template files FMExtern.c Code Warrior Pro template files FMExtern.c FMExtern.h This file is required for FileMaker Pro plug-in projects. FMExtern.h Header file that defines API function and type definitions.
-
Writing external function plug-ins Contents of the Full Example folder The following tables describe the example files in the Full Example folders for the Microsoft Visual C++ and Code Warrior Pro projects. Microsoft Visual C++ example files Description Code Warrior Pro example files 10-3 Description Example Plug-In (Mac) Full Example plug-in — Compiled version of the Code Warrior Pro example files for Mac OS machines Example.
-
10-4 Developer’s Guide Code Warrior Pro example files FMExtern.h To enable an external function plug-in: Description Header file that defines API function and type definitions. This file is required for FileMaker Pro plug-in projects. FMFlags.h Contains compiler flags so that a project can be used in both Microsoft Visual C++ and Code Warrior Pro to produce Windows and Mac OS versions of your plug-in. 1. In FileMaker Pro, choose Edit menu > Preferences > Application. 2.
-
Writing external function plug-ins Using external functions in a calculation Once your external function plug-in is installed, enabled, and configured (optional), users can access the functionality that your plug-in provides. They do this by selecting the external functions in the Specify Calculation dialog box when they are defining a calculation field. 10-5 4. Click Done to close the Application Preferences dialog box. 5. In FileMaker Pro, choose File menu > Define Fields.
-
10-6 Developer’s Guide Function’s name and parameter Description of external function Xpl-ThisVersion, “ ” or “P...” This function returns the version of the plug-in. If the parameter is “ ”, then the function will return the version “1.0v1.” If the parameter begins with the character “P,” the function will return the version and platform information. Note A PluginVersion function is required for every FileMaker Pro plug-in.
-
Writing external function plug-ins Note The source code for the Xpl-NumWords function is based on the calculation formula described in the TechInfo article “Converting Numbers to Words or Numbers to Text.” By writing the formula into the code, this Full Example plug-in demonstrates how an external function can save users hours of database development time. For a description of the formula, go to the support pages at www.filemaker.
-
10-8 Developer’s Guide FMExternCallStruct defines the structure of the parameter block. FMExternCallPtr is a pointer to that structure and gFMExternCallPtr is a global variable that is defined as an FMExternCallPtr pointer. Within the FMExternCallStruct definition are three variables of type long: param2, param3 and result. The param2 variable contains the ID (0, 1, 2, etc.) for the external function referenced from the Specify Calculation dialog box in FileMaker Pro.
-
Writing external function plug-ins The fifth character of the feature string is always “1,” the eighth is always “Y,” and the tenth is always “n.” Other values for these flags are reserved for FileMaker, Inc. use only. Characters in the feature string 11 Here’s a description of each character in the feature string: Characters in the feature string Description of characters 1-4 Characters 1-4 are the plug-in ID. (Register the ID on the Apple Developer Support web site at www.apple.com.
-
10-10 Developer’s Guide There should be no need for any custom DLLMain routine because the instance Handle of the DLL will be passed each time the DLL is called. Main entry point for Mac OS environments The Mac OS platform plug-in can contain any combination of PowerPC and 680x0 based code. If the plug-in requires a PowerPC processor to run, you must still write a small 680x0 code resource.
-
Writing external function plug-ins 1 kDoNotEnable should be returned if the plug-in should not be enabled. This could be the result of a specific piece of hardware missing or that a certain system software component was not of the proper version number. If the plug-in is going to return this value, it should first display some type of alert telling the user why it could not be enabled. 1 kCurrentExtnVersion is the only other result value that should be returned. This causes the plug-in to be enabled.
-
10-12 Developer’s Guide The names of the external functions start at string ID 144 for Windows and are defined as a STR# resource with ID 144 for the Mac OS. The first exported function name is mapped to ID 0 and increased incrementally by 1 for each following name. These ID numbers are then used to switch to the correct processing routine. The input and result parameters of the External Function message are Mac OS style Handles that contain text using Macintosh character set encoding.
-
Writing external function plug-ins 1 When a message for Xpl-Version is received, the routine returns a debug string instead of the version or platform string. 1 DebugPlugin will return different debug strings depending on the value of the parameter that is passed in. Avoiding potential Mac OS resource conflicts Problems can occur on Mac OS machines if your plug-in has the same ID for a resource that FileMaker Pro or another plug-in has for the same type of resource.
-
10-14 Developer’s Guide 4. Enter the following information about your plug-in: 7. Repeat these steps to register additional plug-ins. Plug-in Name You must submit a separate registration form for each external function plug-in. Your plug-in’s name as it will appear in the FileMaker Pro Application Preferences dialog box. The plug-in name “Web Companion” is already registered and any names that begin with the letters “FM” are reserved.
-
Writing external function plug-ins To revise your plug-in registration, provide the following information: 1 The registration ID number that was assigned to you when you first registered your plug-in. 1 1 1 1 Your name. Your full company name. Your daytime phone number. The name of the product with registered information you want to revise. 1 1 Include any changes you want to make. If applicable, send the revised plug-in file. A confirmation of the revision will be sent to you.
-
-
Appendix A Feature comparison of the runtime application and FileMaker Pro When you double-click the FileMaker Pro application icon to start the application, the New Database dialog box opens automatically, from which you can open a database file. When you start a FileMaker Pro runtime application, the primary bound database file opens automatically.
-
A-2 Developer’s Guide Application and document preferences In the runtime application, the following options aren’t available on the General tab of the Application Preferences dialog box: 1 1 1 Show templates in New File dialog check box Show recently opened files check box Network protocol options Color application preferences in the runtime application The Document Preferences dialog box does not have the General tab in the runtime application, only the Spelling tab.
-
Feature comparison of the runtime application and FileMaker Pro A-3 Note In the runtime application, the Format menu is unavailable in Preview mode.
-
A-4 Menu Developer’s Guide Menu command FileMaker Pro Runtime application Menu Menu command FileMaker Pro Runtime application Select All • • • • • • Format menu Font Spelling Size • • Object (Windows) • • Style • • Preferences • • (Some preferences aren’t available) Align Text • • Line Spacing • • • • Text Color • • Find Mode • • Text • • Layout Mode • • • • Use System Formats • Preview Mode View as Form • • New Record • • View as List • • Dupli
-
Feature comparison of the runtime application and FileMaker Pro Menu Menu command FileMaker Pro Runtime application Menu Scripts menu ScriptMaker...
-
A-6 Developer’s Guide 1 Open ScriptMaker 1 Open Help (executes custom Help script specified during binding) 1 Set Multi-User 1 New Database 1 Perform External Script (if the specified file has not been bound to the runtime application) 1 Open File (if the specified file has not been bound to the runtime application) Stored registry settings On Windows machines, FileMaker Pro 5 stores its registry settings at hkey_current_user\software\filemaker\filemaker pro\5.
-
Appendix B 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 (see “Installing the FileMaker Developer software package” on page 1-2 for information).
-
B-2 Developer’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. Generating a –view request A web user must have access privileges for creating records in order to execute this request.
-
Valid names used in CGI requests for FileMaker XML data B-3 Generating an –edit request Generating a –delete request Name/Value Type: Edit Record Request Name/Value Type: Delete Record Request What it does: Updates the record specified by –recid, populating the fields with the contents of any field name/value pairs. What it does: Deletes the record as specified by –recid parameter. In order to delete a record, the web user must have record deleting privileges for the database.
-
B-4 Developer’s Guide Examples of –dbnames requests To retrieve the database names using a hypertext link: PAGE 183
Valid names used in CGI requests for FileMaker XML data B-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
-
B-6 Developer’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.
-
B-8 Developer’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 B-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.
-
B-10 Developer’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 C 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.
-
C-2 Developer’s Guide Error code value Description Error code value Description 406 Replace/Reserialize criteria is invalid 700 File is of the wrong file type for import 407 One or both match fields are missing (invalid relationship) 701 Data Access Manager can't find database extension file 408 Specified field has inappropriate data type for this operation 702 The Data Access Manager was unable to open the session 703 409 Import order is invalid The Data Access Manager was unable to open
-
FileMaker Pro values for error codes Error code value Description 811 Temporary file cannot be opened as FileMaker Pro file 812 Cannot open the file because it exceeds host capacity 813 Record Synchronization error on network 814 File(s) cannot be opened because maximum number is open 815 Couldn't open lookup file 816 Unable to convert file 900 General spelling engine error 901 Main spelling dictionary not installed 902 Could not launch the Help system 903 Command cannot be used in a sha
-
-
Index Numerics 3-character filename extensions for runtime databases (Mac OS) 2-8 for runtime databases (Windows) 2-8 registered by the runtime application 4-6 A About layout adding a custom script 2-3, 2-4, 2-12 creating 3-7 displaying 3-8 example 3-7 license requirements 3-7 password warning 3-15 prevented modification warning 3-15 using 3-6, 3-7 About FileMaker Pro Runtime, default menu command 2-13 Access Log File option 6-4, 6-9 access privileges overriding Web Security Database privil
-
I-2 Developer’s Guide Claris XTND System file for graphic importing 4-3 ClarisWorks import filter 4-3, 4-4 closing files in Kiosk mode 2-10 code files required for external function plug-ins 10-7 Code Warrior Pro 10-1 COLOR attribute 5-7 color palette FileMaker Pro 5-10 for cross-platform databases 3-12 color values for layout themes 5-10 com.fmi.jdbc.
-
Index double colons in portal fields in CGI requests 7-9, 9-4 in XML documents 7-4 driver properties, for FileMaker JDBC URL 8-3 DRW graphic import filter 4-2 –dso_xml format parameter 7-3 Dynamic Link Libraries (DLLs) 4-1, 4-2 E –edit requests CDML examples 9-4 XML examples 7-10, B-3 editing multiple records in portals 7-9, 9-4 EFFECT attribute 5-7 elements in FMPDSORESULT grammars 7-4 in FMPXMLLAYOUT grammars 7-7 in FMPXMLRESULT grammars 7-5 in layout themes 5-3 Employee Database CDML example 9-15, 9-16
-
I-4 Developer’s Guide options, described 2-2 preparing files for 3-1 requirements (Mac OS) 1-3 requirements (Windows) 1-3 saving option settings 2-15 specifying files 2-3 using 2-2 FileMaker Java Class Library described 6-1 using 8-18 FileMaker JDBC Driver data type mapping 8-7 described 8-1 driver class and main entry point 8-2 escaping lower ASCII characters 8-7 examples 8-8, 8-11, 8-15 FileMaker extensions 8-8 implementing JDBC 1.
-
Index G Go to Layout script step 3-5 grammars.
-
I-6 Developer’s Guide displaying runtime databases 3-2 preparing databases 3-4 Kiosk Solution Example 2-1, 2-9, 3-4, 3-8 L Language option 6-4, 6-7 -lay request parameter B-6 Layout Mode command unavailable in FileMaker Pro 2-3, 2-11 unavailable in runtime applications 2-2, A-1 layout parts, XML elements for 5-4 layout themes attribute values 5-7 attributes for single-line elements 5-6 basic requirements 5-3 checking for errors 5-11 color values 5-10 comment tags 5-10 creating 5-1 default values 5-9 elem
-
Index Open Define Fields script step A-5 Open Define Relationships script step A-5 Open Define Value List script step A-5 Open File script step 3-17, A-6 Open Help script step A-6 Open ScriptMaker script step A-6 Open Sharing script step A-5 Open tool A-3 opening files in runtime applications 3-2, 4-6 runtime databases in FileMaker Pro 2-9, 3-3, 3-14 outline and shadow text styles 3-10 P Page Setup/Print Setup script steps 3-13 parameter block, defined 10-7 PARTNUMBER attribute 5-8 password driver propert
-
I-8 Developer’s Guide FileMaker Pro external function plug-ins 10-1, 10-13 registry conflicts with filename extensions 2-8 settings stored for runtime applications A-6 Relational Example 3-1, 3-8 Remote Access/PPP software 6-14 Remote Administration option 6-4 Remote Data Access Companion plug-in A-1 remotely administering the Web Security Database 6-21 renaming database files 2-11 Scripts menu 2-14, A-1 Solution Options file 2-15 requesting data.
-
Index runtime files over a network 4-5 Shopping Cart CDML example 9-15, 9-17 Shutdown message 10-11 SIDES attribute 5-8 SimpleText 8-10 single-line elements for layout themes 5-4, 5-5 SIZE attribute 5-8 -skip request parameter B-8 Solution Extras folder for runtime databases (Mac OS) 4-3 Solution Options file modifying for autocustomizing 2-15 renaming the file 2-15 using 2-15 Solutions Development Kit (SDK) for FileMaker Pro 3.0 3-16 solutions.
-
I-10 Developer’s Guide V VBScript 7-3 -view requests B-2 Visual C++ (Windows) 10-1 Visual Cafe 4.