Frontier Scripting

ODB name:suites.xfile
Version:1.0b4
Version Date:2000/02/26
Compatibility: F5.0.2b20 - F5.1+ - F6.0 - F6.1
Download: Binhex file for Mac (90.1 kb)
ZIP file for Mac or Windows (82.7 kb)
Release notes

The XFile Suite

Created by Samuel Reynolds.
Copyright © 1998, 1999 by Samuel Reynolds. All rights reserved.


See The Need

Frontier provides a basic capability for dealing with .JPG and .GIF image files, and several third-party packages exist (including my own full-featured HtmlImage Suite) extend Frontier's capabilities in this area. However, with the exception of htmlImage, none of these packages supports keeping the images outside the ODB. In addition, there is no comparable package for dealing with other file types in a straightforward, standardized manner.

XFile is my attempt to provide this missing piece to the Frontier environment.


Fill The Need

XFile provides tools to help you manage files external to the ODB for use in your websites. You can make external files of a variety of types, including types you specify, part of your website table without having to physically import the files. You can specify, for each file type, whether to automatically import the file binary data into the ODB or to leave it external.

Once you have added the files to your website table, you can render them out as part of your website. Tools are provided to link to arbitrary files, including sound, video, and image files. You can specify, for each file type, where to place the files in your rendered site.

As installed, XFile supports a number of external file types (see user.xfile.fileExtension for the full list). You can also define new file types to be processed by selecting XFile->Setup->Add New File Type....


Dependencies

XFile requires the regex extension, which is available from http://www.scriptmeridian.org/projects/regex/.

Because of this dependency, it will only work with versions of Frontier 5 that have a working DLL interface, so that they can run the regex extension. These versions include Frontier 5.0.2b9 and later, including all versions of Frontier 5.1.

XFile uses the fileWriters abstraction mechanism, if it is available (it is not required!). (This simply means it calls html.writeFile, which selects the filewriter script(s) to call based on the method specified in your #ftpSite table.) If you're using Windows and want to render directly to a remote (FTP) site, you may need Alan German's fileWriter.ftp, which is available from http://www.erols.com/asg/user/html/fileWriters/ftp.html. Alan's fileWriter.ftp uses Frontier's built-in TCP capability on both the Mac and Windows, so you won't need an external FTP program on the Mac to allow render-to-remote.


Documentation

Documentation is available via the XFile->Documentation submenu.


Release Notes

  • v. 1.0b4 -- 26 February 2000
    • Now licensed under the Frontier Artistic License, version 1.0 (http://www.spinwardstars.com/frontier/fal.html).
    • In xfile.utils.FindEntry, fixed two minor bugs in parameter validation.
    • In xfile.Link, fixed a bug in file size calculation:
      • For files of 1 Mb or larger size, it was appending " Mb" to the filesize, which caused an error "[Macro error: Division is not supported between values of this type.]" in when the following block attempted to round to 1 decimal place. Now it simply sets suffix=" Mb" (suffix is appended after rounding).
      • The filesize variable was being initialized to an integer value, which resulted in integer division (and effectively rounding down) for values >= 1024. It now is initialized to a floating-point value, so the calculated (display) value will properly round to the nearest 0.1 kb or 0.1 Mb.

  • v. 1.0b3 -- 1 January 2000
    • Changed mechanism for working within mainResponder sites. Now uses ObjectNotFoundHandler. See xfile.doc.MainResponder for details and instructions. (Users may need to reload cached pages in their browsers, but that's the only impact they should see.)
    • Added support for filename filtering to XFile->Add Folder of Files, using simple strings or regular expressions.
    • Hold down shift key when selecting XFile->Add File or XFile->Add Folder of Files to replace entries; otherwise, entries that already exist are not re-loaded (which matches previous behavior).
    • Several minor bug fixes.

  • v. 1.0b2 -- 24 September 1999
    • Now works within mainResponder sites.
      • At each location where you have an #xfile table, create an address entry named xfile with the value set to the address of the #xfile table.
    • Can be installed in GDB instead of root.suites.

  • v. 1.0b1 -- 1 March 1999
    • First BETA version.
    • Now uses html.fileWriters (if available) instead of writeWholeFile.
      • Will still write the old way if html.fileWriters isn't available.
    • This means your image files will be FTP-uploaded if that's what your #ftpSite specifies!
    • On Windows, download Alan German's filewriter.ftp from http://www.erols.com/asg/user/html/fileWriters/ftp.html
    • Dropped Object() macro from target features for 1.0 (may reappear in later version.)

  • v. 1.0a8 -- 6 Sep 1998
    • Added xf_showSize directive (boolean).
    • Added showSize parameter to Link() macro.
      • Defaults to xf_showSize.
      • If TRUE, Link() adds the size of the linked object, in bytes, kb, or Mb.
    • Code to use filewriters if it's available (DISABLED)
      • html.writeFile expects the data to be in an ODB location.
        • Have to load the external file into system.temp for html.writeFile.
      • Code to use filewriters is DISABLED because I couldn't get it to work.
      • If you want to try it...
        • Open xfile.utils.PrepareDestFile
        • Comment out useFileWriters = FALSE
        • Uncomment useFileWriters = defined( html.filewriters )
        • Let me know if it works for you.

  • v. 1.0a7 -- 2 Sep 1998
    • Added macro expansion in link text.
      • All macros of the form "[[macro text]]" will be evaluated and replaced.

  • v. 1.0a6 -- 29 July 1998
    • Erroneous references to xfile.utilities were fixed (became xfiles.compat).
    • Now checks dependencies on install (see xfile.utils.CheckDependencies).
    • Added xfile.utils.CallMe() script.
      • Pass callback script address as well as object specifier.
      • Calls your callback script to generate any text you want when entry is found.
      • Docs at xfile.doc.Macros.CallMe.
      • Example at xfile.examples.CallMe.
    • Improved docs
      • Filled out xfile.doc.HowItWorks.ObjectPlacement.
      • Added dependencies to xfile.doc.readMe.

  • v. 1.0a5 -- 27 July 1998
    • Now logs updates when entire table (or subtable) is updated.
    • Individual item update status still written to window message box.

  • v. 1.0a4 -- 27 July 1998
    • Removed leftover references to htmlImage.
      • XFile should now work without htmlImage being installed (as it should!).
      • Affects fileInfo.GetFileInfo(), utils.DestFolder(),
        • fileInfo.GetImageDimensions(), and fileInfo.GetImageInfo().
        • (The last two are not currently used; the first two are primary routines.)
    • Deinit() now removes xfile macros from user.html.macros.

  • v. 1.0a3 -- 27 July 1998
    • Added install of forwarding scripts in user.html.macros.
      • Currently only forwarding script is Link.

  • v. 1.0a2 -- 26 July 1998
    • NAME CHANGE: xf_genSiteGlossary is now xf_siteGlossary.
    • Manual loading and unloading of binaries now works.
    • Automatic loading of binaries now works.
      • New prefs control manual/automatic binary load for all and specific file types.
      • xf_manualUpdateOnly preference (=TRUE by default).
      • xf_manualUpdateOnly[type] preference (=xf_manualUpdateOnly by default)
    • Regression tests added.
      • Uncovered a couple of bugs (now fixed) in path generation.
      • Regression tests run on MacOS8/F5.1 update 21 and WinNT 4/F5.0.2b20ru114.

  • v. 1.0a1 -- 22 July 1998
    • First public release.
    • Working Parts:
      • #xfile table/subtable management (from menu)
      • All documented directives (see XFile->Documentation->Directives).
      • Link() macro (for linking to external file for browse or download).
    • Non-Working Parts:
      • Loading binary data.
      • Unloading binary data.
      • xf_loadBinaryData preference (=FALSE by default).
      • xf_loadBinaryData[type] preference (=xf_loadBinaryData by default)
      • Object() macro (for embedding objects).

    Spinward Stars
    Copyright © 1998, 1999 by Samuel Reynolds. All rights reserved. Last modified 2000/02/26.
    Built with Frontier v.6.1 on Macintosh OS 9.0 on 2000/02/26.