Developer Forum: A Look at Blueworld's Lasso and FileMaker Pro 5 Unlimited
by Kirk Bowman <kirk@mightydata.com>
RATING: General
PLATFORM: Macintosh & Windows
VERSION: FileMaker 4/5
TECHNIQUE FILE: None
Although other tools have come and gone, FileMaker Pro's Web Companion and Blueworld's Lasso continue to be the software of choice for creating web applications with FileMaker. The FileMaker Pro 5 suite of products, also includes FileMaker Pro 5 Unlimited. FMP Unlimited has two important features for developers. First, it has the ability to host an unlimited number of web users. Second, it ships with the Web Server Connector that allows third-party web servers to work with FileMaker.
Lasso has also seen numerous technology advancements over the last four years. With the latest version Lasso 3.6.5, it continues its heritage of offering developers a powerful tool set for building solutions. Like FileMaker Pro 5 Unlimited, Lasso offers the ability host unlimited web users and to work with third-party web servers.
To someone new to web-enabling databases, Unlimited and Lasso may appear to be the same and in many ways they are. However, Lasso offers several powerful features that are not available in FileMaker Pro 5 Unlimited. In this article, we'll look briefly at some basic similarities between Unlimited and Lasso and then delve into the unique features of Lasso which give the developer additional possibilities.
For the purpose of this article, I use the term Unlimited to refer specifically to FileMaker Pro 5 Unlimited with the Web Server Connector. I make this distinction because you can use FileMaker Pro 5 Unlimited without the Web Server Connector. Unlimited with the Web Server Connector is a more appropriate direct comparison to Lasso.
Web Servers and Java
The similarities between Unlimited and Lasso are primarily in the category of deployment. By this I mean the software necessary to install and run these products. We'll look at the similarities in web servers, Java, multi-threading, and communication with FileMaker Pro.
Unlimited and Lasso support the same third-party web servers. On Windows 98/NT, they support Internet Information Server (IIS), Personal Web Server (PWS) and Netscape Enterprise Server. For Mac OS, they support WebStar, AppleShare IP and Apache for Mac OS X. In addition Lasso also supports WebTen for Mac OS. (Note: Lasso support for Personal Web Server is limited to a single-user development version called Lasso Studio.)
Both Unlimited and Lasso need Java to be installed for full functionality. Unlimited requires Java on Windows 98/NT and Mac OS to use the Web Server Connector. The Web Server Connector is a server-side Java applet that connects Web Companion to third-party web servers. Lasso requires Java on Windows and Mac OS for email functionality and certain tags such as extended math and file tags.
Author's Note: For Mac OS, Java is only required for email if you need to send attachments.
Installing Java on Mac OS is a breeze. Simply download the installer from Apple's web site and run it. Installing on Windows 98/NT can be a little tricky. Fortunately, Blueworld provides some detailed instructions on their web site. Just go to <http://support.blueworld.com> and search the Support Central database for "Java".
Multi-Threading and Communication with FileMaker
One common problem when hosting a FileMaker database using only Web Companion (without Web Server Connector) is the lack of multi-threading. In other words, Web Companion can only process one request at a time. Both Unlimited and Lasso work with this limitation in several ways.
First, Unlimited and Lasso are multi-threaded which means they can act as a traffic cop, queing multiple database requests to be sent to FileMaker one-at-a-time. Second, both products utilize a dedicated (third-party) web server to serve static pages, images, and other non-database content, contacting FileMaker only when database action is necessary. Third, both products can communicate with FileMaker Pro on another server to improve web server and database server performance.
Related to using a separate database server, Unlimited and Lasso can both create a RAIC (Redundant Array of Inexpensive Computers) to balance the load between multiple copies of FileMaker. Although the details of this scenario are beyond the scope of this article, information for setting up a RAIC configuration is available on from FMI <http://www.filemaker.com> and Blueworld <http://support.blueworld.com>.
Finally, Unlimited and Lasso rely upon Web Companion for communication with FileMaker. Web Companion is the API that the Web Server Connector and Lasso use to send requests to FileMaker. Furthermore, the FileMaker licensing agreement requires FileMaker Pro 5 Unlimited to connect to a third-party web server. Therefore, even though you use Lasso, you must purchase FileMaker Pro 5 Unlimited. (Author's Note: On Mac OS, Lasso can also communicate with FileMaker on the same server by using AppleEvents.)
Database Support and Visual Development
Despite the apparent similarities between Unlimited and Lasso, they are more different than alike. One difference is the database support in Lasso. Lasso can connect to FileMaker 4.x and 5.x on Windows and FileMaker 3.x, 4.x, and 5.x on Mac OS. This is contrasted by Unlimited's FileMaker Pro 5 support on Windows and Mac OS. Furthermore, Lasso supports connections to databases other than FileMaker, primarily ODBC data sources. This is not critical if you are only serving FileMaker databases. But if your organization uses several different databases, Lasso is one tool that can web-enable a variety of databases such as Access, SQL Server, and Oracle in additional to FileMaker.
When creating web sites, Lasso offers direct support for the two most popular visual HTML editors, Dreamweaver and GoLive. While you can create data-driven sites for Unlimited and Lasso in any text editor, using a WYSIWYG editor allows the developer to visualize the site while programming the code for database actions.
Lasso Studio is Blueworld's name for a combination of extensions for Dreamweaver or GoLive and a single-user version of Lasso. Lasso Studio allows the developer to drag and drop icons to represent database tags and edit the underlying code in property editors. For Unlimited you can use FMI's Home Page to edit most but not all CDML 5 tags. Also, Vertebrate, a third-party vendor, has created a set of extensions to extend the CDML vocabulary of Dreamweaver; available from <http://www.vertebrate.co.uk/cdml.html>. (Author's Note: At the time of publication, Lasso's support for GoLive was announced but not yet commercially available.)
Data Manipulation
The biggest difference between Unlimited and Lasso is the depth of the tag vocabulary of each product. According to the CDML Reference database available with FileMaker Developer 5, 111 tags are available for Unlimited. In contrast, the LDML 3.6 Reference Database has 330 tags available for Lasso. To be precise, 300 of the 330 tags are for use with FileMaker.
One of the most powerful sets of tags that Lasso has available is data manipulation. These tags are actually 3 different groups of tags: Date, Math, and String. The Date tags allow you to manipulate dates similar to FileMaker's date functions. For example, you can get the month of a particular date using the Date_GetMonth tag, similar to FileMaker's Month function. This allows the developer to avoid creating new fields in FileMaker just parse a date for the web. You also can change the display format for a date similar to the Date Format command in FileMaker. The advantage of the Date tags is that you can manipulate dates independent of the date format in FileMaker.
The Math tags provide the expected addition, subtraction, multiplication, and division operations. Furthermore, Math tags can be used to perform rounding, get the absolute value, determine maximum and minimum values, and calculate trigonometric functions, such as Sin and Cos. The advantages of the Math tags are the same as the Date tags. Numbers can be manipulated independent of FileMaker and without creating extra FileMaker fields just to parse data for the web.
The String tags are similar to the FileMaker Text functions such as Position and PatternCount. Just as the FileMaker Text functions can be used to push and pull data in FileMaker calculations and scripts, the String tags can be used to push and pull data in web pages. The benefit of the strings tags is not only for formatting the display of data in HTML pages but also in Boolean tests for IF statements. Again, this is done independent of FileMaker and without creating extra fields.
Decision Making Tags
Three groups of tags that expand Lasso's decision-making abilities are the Variable, Logic, and File tags. The Variable and Logic tags are used to control the flow in a web site just like an IF statement is used in a FileMaker script. The File tags give you the ability to create and manipulate text files on the hard drive of the web server.
The Variable tags allow you to declare a variable and assign it a value for the duration of an HTML page. This is useful if you need to assess a value in multiple places in a page, access a value inside and outside an inline tag, or create a temporary storage area to use in decision logic which is not related to data in the database. Similar to the Variable tag is the List tag, which can contain multiple values delimited by a common character such as a comma or pipe. A list is a one-dimensional array for variable storage.
In the same category as the Variable tag is the Form Parameter tag. The Form_Param tag is a special kind of token that allows you to access any value placed into a form on one HTML page in the following page. Using the Form_Tag, you can create a variety of advanced processing structures. For example, you can create a new record form that does not contain the specific database name or fields. When the new record form is submitted to Lasso, a record is added to the database using an Inline tag and Form_Param tags in the following HTML page. This design allows you to prevent a user from viewing the source code of your new record form to obtain the file name and field names of your database.
The Loop and While tags give the developer the ability to execute an action or set of code repeatedly. The Loop tags repeats for a specified number of iterations or repeats. The While tag repeats as long as a specified condition is true. These tags serve the same purpose as the Loop/End Loop and Exit Loop If script commands in FileMaker. The Record and Portal tags common to Unlimited and Lasso are a special kind loop but they can only loop through records related to a search action. The Loop and While commands can be used to loop through LDML code which has no direct database functionality.
The File tags are a powerful, yet dangerous, group of tags. They provide Lasso with a set of commands similar to external functions available to FileMaker using the Troi File Plug-in. When you use a tool that can create, change, and delete files on the server hard drive, security is essential. Fortunately, Lasso provides robust security to control the directories in which the File tags can be used. Furthermore, the File tags are not a standard installation with Lasso. The File tags module must be moved to correct folder and then the web server must be restarted before they are available.
The File tags can be used for simple or complex routines. For example, one use of the File tags is to create a page counter that is updated each time a specific web page is accessed. A text file on the hard drive would contain the page count and the content would be updated each time a web page is accessed. A more complex use of the File tags is to create a browser-based text editor that would allow specific users to edit the contents of web pages in their web browser. A demo of this technique is available on Blueworld's web site at <http://www.blueworld.com/blueworld/products/lassosolutions.html>.
Additional Features in Lasso
Two other features that warrant mention in this article are action filters and macros. Action filters allow you to validate the input for a field on a search, add, or update form, similar to the Validation by Calculation option available on FileMaker fields. The advantages of action filters are they can be used on a form that does not require database interaction and they can be used to proof data before it is inserted into the database. Furthermore, the same action filter can be used on multiple fields and pages through the use of an include file. A perfect example of an action filters is to limit input to 4 or more characters and to prevent the use of high-ASCII characters on a search form, just as Blueworld has implemented on their searchable mailing list archives.
Macros are similar to handlers in AppleScript. In a macro, a portion of LDML code is executed each time the macro is called. Parameters can be passed to and from the macro. Say, for instance, a ten-line section of code is used at numerous places throughout a web site. The section of code processes two variables and returns a result. Using a macro, this routine can be called using a short tag such as [test_macro:'value one', 'value_two']. The benefits of macros are reuse and optimization of code.
Converting/Upgrading to Lasso
OK, so you have read all the groovy things Lasso can do and you want to use Lasso for one of your existing FileMaker web solutions. Is there an easy way to migrate to Lasso from straight CDML? The answer is yes!
Lasso comes with a CDML Tags module that will allow Lasso to support most CDML code as it exists. Simply install the CDML Tags module in the appropriate folder and restart your web server. Some hand-tweaking may be required for the CDML tags that Lasso does not directly support, but it sure beats having to re-code an entire site. Furthermore, it provides an easy way to help you determine whether you want to migrate to LDML on a permanent basis.
If you are using a site based on Lasso 2.5, you can move your site immediately to Lasso 3.6 using a specialized macro file which comes with Lasso. The macro substitutes Lasso 2.5 tags with the updated Lasso 3.6 tags. The macro file is in the following folder on your hard drive:
Lasso Folder:Lasso Tools:Upgrading
Again, this is a great way to test a site before making a permanent migration.
If you decide to migrate permanently, two tools are included with Mac OS version of Lasso to ease updating your code to Lasso 3.6 syntax. In the following folder:
Lasso Folder:Lasso Tools:Upgrading
you will find the Lasso Tag Converter and the Lasso Tag Updater. Together the Updater and Converter can take a site from CDML to Lasso 3.6.
The Lasso Tag Converter is a BBEdit extension <http://www.barebones.com> that will update Lasso 1.x, Lasso 2.x, or CDML code to Lasso 2.5. The Lasso Tag Updater is BBEdit extension that will update Lasso 2.5 code to Lasso 3.6. Together these tools go a long way toward migrating to Lasso 3.6; however, some hand tweaking of the code should be expected as these tools cannot handle every iteration of the older tags.
Where Do We Go from Here
Over the next several issues of ISO FileMaker Magazine, we will explore several of the unique features of Lasso in more detail, giving you specific examples of LDML code and how it works. If you have a topic about Lasso you would like to see covered the magazine, please drop me an email.
Happy FileMaking!
Kirk Bowman is the founder of MightyData, L.L.C. <http://www.mightydata.com> and a distinguished FileMaker and Lasso developer and trainer. Email him at <kirk@mightydata.com>.