Developer’s Guide

Table Of Contents
8-18
Developer’s Guide
The FileMaker Java Class Library is installed in the
FileMaker Developer 5 folder.
FileMaker Developer 5 > External FileMaker APIs > Java Class Library
About the FileMaker Java Class Library
The FileMaker Java Class Library is a set of Java classes that sends
requests to the FileMaker Pro Web Companion and gives you access
to the results.
FileMaker Java classes communicate with the Web Companion
using standard HTTP (Hypertext Transfer Protocol). The classes
formulate a request string based on the parameters you specify. Then
the classes send the request to the Web Companion. The response is
generated and sent back in the CDML proprietary format and
processed by the FMProResponse class. The Java application or
applet then determines how to display the data.
There are three main Java classes in the library:
1 FMProRequest
1 FMProProxy
1 FMProResponse
Use the FMProRequest class to create objects that submit queries to
the database. You specify the name of the database, layout, and fields
in a FMProRequest object.
Use the FMProProxy class to create objects that execute the queries.
The FMProProxy object is used to send a query from an
FMProRequest object to the computer where FileMaker Pro is
hosting the database, and to receive the result of the query from the
Web Companion. The FMProProxy object then converts the
resulting data into an FMProResponse object.
You can use a FMProProxy object to retrieve the following:
1 the names of all open databases shared via the Web Companion
1 the names of layouts, fields in a layout, and scripts defined for a
database
1 the images from FileMaker container fields
The FMProResponse class allows you to access the query results.
The information you have access to includes:
1 a result code indicating if the query was successfully processed
1 the number of records returned
1 the total number of records in the database
1 the names, field types, and value lists (if applicable) for each of the
fields on the specified layout, and field data
1 record IDs for the returned records
This information can be retrieved using the various methods
belonging to the FMProResponse object.
Looking at the Java applet examples
There are two examples of Java applets that use the FileMaker Java
classes to communicate with a FileMaker Pro database. The
FMBanner applet is a simple Java applet that displays a textual or
picture-based advertisement based on data from a FileMaker Pro
database. The FMMemoPad applet allows you to browse, edit, find,
sort, and create records in a FileMaker Pro database.
Note To view these examples, you need a web browser that is
compatible with Java 1.1, such as Internet Explorer 4.0 or Netscape
Communicator 4.0 with the JDK 1.1 support patch.
To view the FMBanner applet:
1. Locate the FMBanner folder in the FileMaker Developer 5 folder.
FileMaker Developer 5 > External FileMaker APIs > Java Class Library >
Java Examples > FMBanner
2. Place a copy of the FMBanner.html and FMBanner.jar files into
the Web folder in the FileMaker Pro 5 application folder.