New in MBS FileMaker Plugin 13.0

In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 13.0.

MongoDB

In the last releases we have often talked about MongoDB. At the end of last year we added the possibility of transactions. This time we provide new functions for you with which you can document the changes. Here we can distinguish between three types of changes. With the function MongoDB.WatchClient we create a stream that documents the changes in the connection. With the function MongoDB.WatchDatabase we create a stream that documents the changes in a database and with the function MongoDB.WatchCollection we list all changes on the collection, which is similar in meaning to a table. A change stream is closed when the MongoDB reference is released, when a new stream has been set or when MongoDB.CloseChangeStream has been explicitly called. The MongoDB.NextChange function iterates over the underlying change stream and returns the next valid JSON document. You can check if there was an error during creation or iteration over a stream with the MongoDB.ChangeStreamErrorDocument. As return of this function you get a JSON with details.

JSON

Also in the JSON topic we got a new function. The JSON.Text function. This function returns us a text that is very readable for humans. The brackets are removed. We get the values with their keys as output. But see yourself. On the left is the JSON we put into the function and on the right is the plain text output.

DynaPDF

In the DynaPDF topic a few new functions have been added: With the function DynaPDF.TestGlyphs you can now check if all characters in the text can be displayed. If all characters of the text can be displayed, we get a -1 as return value. If one or more characters could not be read we get as return a positive number indicating the position of the first missing character. So we can not only check if the text can be displayed, but also where it fails.

The new function DynaPDF.GetPageField Returns the most important properties of a field on a page. Which property we want to get can be specified in the parameters. For example, we can query the field type, the bordercolor or the value itself. The new DynaPDF.GetPageFieldAnnotation function also queries in a similar way. The difference here is that we can use the function with annotation fields.

Also new is the function DynaPDF.CreateICCBasedColorSpace. This function creates an ICC-based color space. ICC-based color spaces (PDF 1.3) are based on a cross-platform color profile as defined by the International Color Consortium (ICC). Unlike the CalGray, CalRGB, and Lab color spaces, which are characterized by entries in the color space dictionary, an ICC-based color space is characterized by a sequence of bytes in a standard format. An ICC profile describes the color characteristics of a particular device and it provides necessary information to convert color data between native device color spaces and device independent color spaces. The ICC specification classifies color devices according to their use as input or output devices such as monitors, scanners, cameras or printers. Depending on the output PDF format different device classes are supported. If the function succeeds the return value is the color space handle. The DynaPDF.CreateICCBasedColorSpaceContainer function does the same but reads the data from a container.

In the functions DynaPDF.ImportPDFFile and DynaPDF.ImportPDFPage we have provided two new optional parameters with which you can adjust the X and Y scaling of the pages that should be imported.

CURL

In the CURL component we have some new functions that I want to present here. The function CURL.SetOptionCACacheTimeout tells libcurl the maximum time any cached certificate store it has in memory may be kept and reused for new connections. Once the timeout has expired, a subsequent fetch requiring a certificate store will have to build a new one. In the parameters the time is given in seconds.

Also new we have the function CURL.SetOptionQuickExit with which we can determine whether an exit quickly is allowed. That means if we set 1 in the parameters, that when recovering from a timeout, libcurl should skip lengthy cleanups that are intended to avoid all kinds of leaks (threads etc.), as the caller program is about to call exit() anyway. This allows for a swift termination after a DNS timeout for example, by canceling and/or forgetting about a resolver thread, at the expense of a possible (though short-lived) leak of associated resources.

We have also added WebSocket support in CURL to our plugin. Compared to HTTP, WebSockets have the advantage that we don't have to send a request to the client for every action between the server and the client, but can exchange information on a open connection. With the function CURL.WebSocketReceive we can receive data over the web socket as JSON. As an optional parameter we can set the buffer size. So we will receive either as much data as the legal buffer size allows or until the buffer is full. If there is more fragment data to deliver than what fits in the provided buffer, CURL returns a full buffer and the application needs to call this function again to continue draining the buffer. This is how such a JSON may look like:

{ "Offset":11, "BytesLeft":0, "BytesReceived":11, "Flags":2, "FlagText":false, "FlagBinary":true, "FlagContinue":false, "FlagClose":false, "FlagPing":false, "FlagPong":false, "FlagOffset":false, "Data":"48656C6C6F20576F726C64", "Text":"Hello World" }

With the CURL.WebSocketSend function we can Send the specific message fragment over an established WebSocket connection.

With the CURL.SetOptionWebSocketOptions function you can set behavior options for a WebSocket.

Shell

In the Shell section we added two functions Shell.GetTag and Shell.SetTag, with which you can set and query the values of tags. You can use the tag value to associate whatever value you like with the shell object.

Serial Port

Tags also play a big role in the new features in our SerialPort section. Again, we can set any tag with SerialPort.SetTag and query it later with SerialPort.GetTag. Also we have the new function SerialPort.Path with which we can query the path used to open the serial port. Here we only need to specify the appropriate reference in the function to get the path.

1 Like

List

We have added some functions in this release that return a list of reference numbers for objects in the corresponding area. This allows you to get an overview of the allocated objects and you can for example work in a loop with the objects. The following functions have been added in this context:

WebRequest

There are also interesting news from the WebRequest section. You can now query the mode in which a request is. To do this, you just need to specify the corresponding reference number in the WebRequest.GetMode function. The function then returns the mode of the webhook applied to the request. You can get the following possible answers.

0 Answer was sent and connection is closed
1 The connection is kept open after receiving a HTTP request and you can send an answer yourself
2 This is a RAW request and the answer was sent
3 The connection is kept open after receiving a RAW request and you can send an answer yourself

Life in the matrix

For years you have had the possibility to use matrices in your applications. For some a mathematical must, for others a practical two-dimensional list. Matrices allow you to do many things and are very helpful. That's why we are even more pleased to introduce a new function that combines LibXL and matrix. You can now convert table values in Excel with the function XL.Sheet.ReadCellsAsMatrix into a matrix and work with this matrix. You can not only read the whole table as a matrix, but you can also specify in the parameters the exact area in Excel that should be in the matrix. You can also use this function as a preparation for the Matrix.CSV function which exports the values of a matrix into a CSV. With this function, which is already part of the plugin since version 9.2, you can now also set a flag, so that all text values are written in quotes. This flag has also been added to the FM.SQL.CSV function.

New functions for Mac and iOS

The MBS FileMaker Plugin in version 13.0 offer some more new functions for Mac and iOS users.

Goodies

As a Mac user, you surely already know our free developer features. The individual goodies can be switched on and off in the menu. We have reorganized the menu so that you can further enhance your user experience.

So we have also added a checkbox with which you can turn the tooltips on and off in the export dialog. Until now, these tooltips were displayed by default.

Events

When we work with events, there are two different types of eventIDs we can get back. One is a long event ID, which belongs to a one-time event and the other is a short ID, which refers to an automatically repeating event.

If we need the long event number to a repeating event, we now query this long version with the new function Events.Event.EventIdentifier. Passing in a long event identifier just verifies it and returns it back.

Rich text

There are also news in the rich text area. You can now copy rich text to the clipboard on your Mac or in an iOS SDK app using the RichText.CopyToClipboard function and read it from the clipboard again using the RichText.ReadFromClipboard function.

iOSApp

The iOSApp section, which allows us to make settings in iOS, has got some new functions to query script names run by script triggers. We can now query the script names of the following script triggers:

  • did become active script
  • did enter background
  • did receive memory warning
  • significant time change
  • will enter foreground
  • will resign active

Of course, you will also find the functions, with which you can set these scripts for the script triggers in our plugin, too.

We hope you will also find some interesting new features. We wish you a lot of fun with MBS FileMaker Plugin Version 13.0. If you need a license or have any questions, please contact us.

2 Likes