Queue Plugin/Documentation

From 360Works Product Documentation Wiki
Jump to: navigation, search

Contents

Queue Plugin User Guide

Performs POST operations in the background, sending notification to FileMaker via a callback script when an operation is completed.


360Works Plugin Setup Guides

See Plugins_101 for Error reporting, installation, registration, and more.

Function Summary

  • QueueClearQueue ( ) — Clears any pending POST operations in the queue.
  • QueueGetFileContents ( path { ; charset } ) — Returns a file as text.
  • QueueLastError ( ) — Returns the last QueuePlugin error which happend, or "" if the last operation was successful.
  • QueuePost ( url ; data ; fileName ; callbackScriptName { ; key1=value1 ; key2=value2 ; ... } ) — Queue an HTTP POST operation which posts data to a url, calling the script with name callbackScriptName in the file with name fileName.
  • QueueSetErrorCapture ( errorCapture ) — Toggles error dialogs on or off.
  • QueueVersion ( ) — The version of the QueuePlugin.

Function Detail

QueueClearQueue ( )

Clears any pending POST operations in the queue.

Returns: 1 on success, ERROR if the queue could not be cleared.

QueueGetFileContents ( path { ; charset } )

Returns a file as text.

Parameters:

file
path, url, or container data
charset
the file character set, defaults to "UTF-8"

Returns: text contents of the file.

QueueLastError ( )

Returns the last QueuePlugin error which happend, or "" if the last operation was successful.

Returns: the last QueuePlugin error.

QueuePost ( url ; data ; fileName ; callbackScriptName { ; key1=value1 ; key2=value2 ; ... } )

Queue an HTTP POST operation which posts data to a url, calling the script with name callbackScriptName in the file with name fileName. Once queued, the plugin will attempt to post the data to the URL in a background thread, retrying every minute if the data cannot be posted due to a network error.

After the data is successfully POSTed, the plugin will trigger the callback script with name callbackScriptName passing the data returned from the POST operation as a script parameter.

NOTE: this method will return immediately, before the actual POST operation occurs.

Optional Parameters

includeHeaders
whether to include HTTP headers in the script parameter to the callback script (default = false)

Parameters:

url
the URL to post the data to
data
the data to post
fileName
name of the filemaker file which contains the callback script
callbackScriptName
name of the callback script
args
optional args

Returns: 1 if the event was successfully queued, ERROR if the event could not be queued.

QueueSetErrorCapture ( errorCapture )

Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call SMSetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user.

Parameters:

errorCapture
set to true to suppress the default popups.


QueueVersion ( )

The version of the QueuePlugin.

Returns: version number.
Personal tools
Namespaces

Variants
Actions
Plug-in Products
Other Products
Navigation
Toolbox