In addition to the commands covered so far, XSLT-CWP has a lengthy list of other commands and parameters that you can pass as part of the query string. This section lists and explains them briefly. For a more detailed reference, see this books companion volume, FileMaker 8 Functions and Scripts Desk Reference.
As you know, each Custom Web Publishing URL contains a query string, and that query string can supply at most one database command. Commands covered so far include -find, -findall, -delete, -new, and -edit. Commands are supplied as a single name with no associated value. Table 23.3 contains the full list.
Returns an XML document containing the names of all databases available on the given FileMaker Server that are enabled for Custom Web Publishing.
Deletes a specific record. Requires that a -recid parameter be sent to identify the record to delete.
Duplicates a specific record. Requires that a -recid parameter be sent to identify the record to duplicate.
Updates a record, according to whatever name-value pairs are passed with the request (generally taken from an HTML form). Requires a -recid parameter indicating which record to edit.
Performs a search, either based on field values sent as name-value pairs, and/or on a specified -recid. Can be modified by optional parameters for sort order, field operators, and logical operators.
Finds all records in the database.
Finds a random record.
Requires a -db parameter to specify a database to query. Returns an XML document with a list of names of all the layouts in the specified database.
Creates a new record based on whatever name-value pairs accompany the request.
Can be used only with XSLT stylesheets, and causes the stylesheet to be processed without any interaction with FileMaker Server.
Like -layoutnames, but provides a list of all script names in a database.
Requires that -db and -lay be specified. If the requested grammar is FMPXMLLAYOUT, this command retrieves detailed layout information for the specified layout (this includes things such as the contents of value lists). If the FMPXMLRESULT or fmresultset grammar is specified, this retrieves just the metadata section of the XML document.
In addition to a single database command, Custom Web Publishing URLs can contain other parameters. Some are mandatory, such as -db, and (generally) -lay and -grammar. Others, such as -lop and -sortfield, are particular to specific commands. Table 23.4 shows a list of the most important ones. For an exhaustive list, see this books companion volume, FileMaker Functions and Scripts Desk Reference.
Name of the database on which to act. Mandatory for all commands except for -dbnames and -process. Do not include a filename extension (such as .fp7) when using this parameter.
Use this to specify the encoding for an XSLT stylesheet.
Use the -field parameter with the name of a container field to request the contents of the container field.
Use plain unadorned field names as query parameters when sending data for use with the -new, -find, and -edit commands. See "Performing Specific Searches with CWP URLs," earlier in this chapter.
Sets the comparison operator for fieldname when performing a search. (See the table of operators earlier in this chapter.)
For XSLT stylesheets, specifies the grammar of the underlying XML.
Specifies which layout (and hence which table context) to use for the request. Mandatory with all commands except -process, -dbnames, -layoutnames, and -scriptnames.
Enables you to use one layout for processing the command contained in a URL, and a different layout for generating the XML that comprises the response. For example, you might want to process your request (an Add, say) via a layout with certain hidden fields on it, but process the response via a layout that omitted those fields. Data could thus be added to the hidden fields, but that hidden data would then be omitted from the response.
Used with the -find command, specifies whether to treat the search as an and search or an or search.
Used with the -find command, specifies the maximum number of records to return. Sending a parameter of -max=all permits all records to be returned. (This is the default.)
FileMakers modification ID is an internal number that increments every time a record is changed. Use the -modid parameter to ensure that the record you e editing has not been edited since the time you last checked the modification ID. This is useful for prohibiting different users changes from overwriting each other.
Specifies which record should be affected by a given action. This parameter is mandatory with -edit, -delete, and -dup, and can also be used with -find.
Use this parameter to run a FileMaker script during the processing of the request. By default the script runs after the query command and any sorting have occurred. For example, you run a script in your FileMaker solution after each new record is created, you can create a URL with the -new command that also includes the -script parameter for that post-creation script.
If your command URL involves any kind of find request, use this parameter to request a script to be run before the specified search takes place.
If your command URL involves any kind of find request and a sort, use this parameter to request that a script be run after the specified search takes place, but before sorting.
Used with the various search commands, specifies that records should be returned starting elsewhere than at the first record. If you specify -skip=10, the records are returned starting with the eleventh record.
Specify any of up to nine different fields to sort by.
For a given sort field, specify whether it should sort ascending or descending.
Used in conjunction with -stylehref. Use these two parameters to specify a client-side stylesheet for additional processing. The most common choices would likely be CSS and XSLT. For these choices, you would specify -styletype=text/css or -styletype=text/xsl.
Use this in conjunction with -styletype to specify the location of a stylesheet for client-side processing. Note that this option and the previous one are effective only when the users client (generally a browser) supports some form of client-side stylesheet processing.
Use to pass additional data from one stylesheet to another. See "Using Tokens to Share Data Between Stylesheets," earlier in this chapter, for more detailed information.
Part I: Getting Started with FileMaker 8
Using FileMaker Pro
Defining and Working with Fields
Working with Layouts
Part II: Developing Solutions with FileMaker
Relational Database Design
Working with Multiple Tables
Working with Relationships
Getting Started with Calculations
Getting Started with Scripting
Getting Started with Reporting
Part III: Developer Techniques
Developing for Multiuser Deployment
Advanced Interface Techniques
Advanced Calculation Techniques
Advanced Scripting Techniques
Advanced Portal Techniques
Debugging and Troubleshooting
Converting Systems from Previous Versions of FileMaker Pro
Part IV: Data Integration and Publishing
Importing Data into FileMaker Pro
Exporting Data from FileMaker
Instant Web Publishing
FileMaker and Web Services
Custom Web Publishing
Part V: Deploying a FileMaker Solution
Deploying and Extending FileMaker
FileMaker Server and Server Advanced
Documenting Your FileMaker Solutions