Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

FRToolBox_Overview.html

https://wiki.teamdf.com/wiki/pages/42Z1S2t5/FRToolBox_Overview.html

Overview

Looking for the FRToolBox Function Reference? https://splashdocs.atlassian.net/wiki/spaces/FusionReactor/pages/2202599558 FRToolBox関数のリファレンス

The real power of the Fusion Reactor plugin is that it allows a JavaScript solution running in a web viewer to actively communicate with your database. The possibilities opened by this are limitless, but begin with something as simple as updating FileMaker data based on what the user is doing in a web viewer with interactive content.

...

To understand how the system works, we'll start with a quick look at three different ways of communicating, starting from the lowest level and leading up to the highest. Then we'll work through these techniques in detail in the opposite order, so that you can pick the level at which you need to operate.

Levels of Communication

There are three different levels at which your solution can interact with the Fusion Reactor plugin.

...

At the lowest level, you can talk directly to the plugin using either its two basic ‘callback’ functions: SQL() and Script(), or using the newer XML format requests. https://splashdocs.atlassian.net/wiki/spaces/FusionReactor/pages/2202730599 XML形式のリクエスト(Reactor3) Doing this will require your JavaScript solution to handle the AJAX communications, which you may want to do if, for example, you are making use of a third-party JavaScript library which includes AJAX handling.

...

Lastly, the Fusion Reactor ToolBox gives you access to an even simpler Object Oriented notation for executing requests on your database. The Object provides useful automated debugging, and automates all aspects of creating and sending multiple requests to FileMaker, allowing you to concentrate on your JavaScript rather than XML, and SQL.

Some Terminology

Before going into more details on the levels of communication, it’s helpful to define a few terms we’ll be using:

SQL (Structured Query Language)

SQL is a widely-used language for communicating with databases. Although it is not a documented feature, FileMaker includes an internal facility for working with data in FileMaker tables using SQL statements. The Fusion Reactor plugin makes use of this feature to help communicate database requests between a JavaScript solution and your FileMaker database. Using SQL, you can frame requests to fetch data from FileMaker tables, update field values, create new records, and delete records.

XML (Extensible Markup Language)

XML (Extensible Markup Language) is a widely-used data format for transmitting and encapsulating data. This format is used in Reactor 3.1 to allow simpler and more accurate parsing of return data for Finds, and also to allow a simple and effective way for users to pass extra parameters and instructions to Reactor in one single request.

Fusion Reactor ToolBox

Included with the Fusion Reactor plugin is a suite of JavaScript functions called the Fusion Reactor Toolbox. These ‘helper’ functions are designed to handle some tasks like AJAX communications handling and SQL query construction, so that you don’t have to take the time to build those into your own JavaScript solution.

...

Code Block
<script type='text/JavaScript' src='./libs/FRToolBox.js'></script>

FRTB Object

FRTB in ToolBox version 2.1 is not compatible with Reactor versions under v3.1. Please make sure you are using FRToolBox 2.1.0 or greater - v2.0.x is significantly different to what is described here.

...

The FRTB object gives you access to several methods which make it really easy for you to interact with your FileMaker data, and even allow you do do things that weren't previously possible, like evaluating an arbitrary FileMaker Calculation.

Asynchronous Programming Model

The first "A" in AJAX stands for "Asynchronous," and this is one of the more challenging concepts to get to grips with. When your JavaScript solution communicates with FileMaker, it does so by sending off an AJAX-style XML HTTP 'request,' and cannot simply wait for an answer as (for example) a FileMaker script would do. Your solution needs to relinquish control at some point (usually immediately after issuing a request), and when the response to your query arrives it will trigger the execution of another part of your code.

...