| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |
|
|
|
Monday, June 28, 1999htmlFTPThis suite remembers what files you need to upload and uploads them for you. |
|
|
This suite is for people who don't have a full-time net connection and upload their sites only after they render their sites locally.
Currently, it's difficult to keep track of what files have been updated and need to be uploaded to the server. A lot of people use Mirror, but for just a few files here and there while updating a site (particularly a news site that changes daily) it's a pain. htmlFTP helps you keep track of files that need to be uploaded, and uploads them for you.
htmlFTP keeps an outline of rendered files for you, and at request, will send them to the server from Frontier (via tcpcmd). It's very similar in function to the 'Changed Pages' mechanism. It keeps track of both html files and image files. Advanced scripters will be glad to know that it is also very easy to plug into the outline. so if you have a script that links to any file (video, sound, pdf, etc.) as part of the website building process and you want that file automatically uploaded to the website, htmlFTP can handle that for you. Download and Version Info This is suites.htmlFTP by Philip Suh. Read the change notes Get htmlFTP from the Downloads page. Requirements
Frontier 4.2.3
Make sure "tcpcmd" v1.0b7.1 or greater is installed. Download, unstuff, and doubleclick the suites.htmlftp file. Once htmlFTP is installed into Frontier, one further step of installation is required. Select 'Install' from the menu as shown below.
The install program will insist that you read the install Read Me. This is a good idea. The installer will ask you if you want to add some handy menu commands to your 'Web' menu. This is optional. Then it will patch html.ftpText and the imageRef macro to make them work with htmlFTP. Backups are made as well. As a final step, press the compile buttons on the two modified scripts. Finally, installation is done. A bit of a hassle, but from here on out, things are automatic.
The core of htmlFTP is a list (actually, an outline) of the pages to be uploaded. Let's take a look at this list. Select Open List from the menu. The item at @user.html.lists.filesToUpload opens up. At this point, it's empty, because we haven't rendered any new pages since we installed htmlFTP. To see the htmlFTP suite in action, open up any web page that you have in Frontier, and render it (only works with "Release Rendered Page" and "Release Table").
![]() Let's take a brief look at the structure of the outline. The summit contains the address of the website table. htmlFTP uses this to access the info in the #ftpSite table, to get login and directory info for the upload. Indented beneath the website address are the URLs of the files to be uploaded. And finally, indented again, is the location of the file on the local disk. If you wish, you can edit this list before uploading, or Clear List to start over again. If you comment out a URL or a website address (one of the outline summits), htmlFTP will skip that file or website during the upload process. Uploading is easy, just select Upload... from the menu. But first be sure that your #ftpSite in your website table is Setup properly. ![]() Choose Setup from the menu, and Frontier will open a setup card for the website you're working on. (If it can't figure out what site you are working on, it will prompt you for a website address, like user.websites.frontier). Use this card to enter and edit data into the #ftpSite subtable of the website. htmlFTP needs this info to do the uploads--login info, directories, servers, etc. Note that you'll have to do a Setup for every site that you have. Also note that the Setup card is nothing special, it just provides an easy interface to edit your #ftpSite table. The one thing it does do is create all the necessary fields for uploading from Frontier (whether you use htmlFTP or the html suite's uploading--controlled through #ftpSite.isLocal). Okay, now that everything is ready, select Upload from the menu. As the files are uploaded, the relevant parts of the list are deleted. Errors are posted below the file in the list that didn't get uploaded successfully.
Further down the htmlFTP menu is the Preferences submenu. Take a look:
![]() All the preferences toggle on and off. If there is a checkmark, it means its on. If Add images to ftp list is on,the patch in imageRef will add images to the upload list. If you only want to send text files when you upload the list, turn Send Images On Upload off. Constantly updating large image files is a waste of bandwidth and time, so you can save some of both by turning off Overwrite images on the server. When this is off, the image files (or any non-text file) only get uploaded if they don't already exist on the server. Below the line there is a preference for tcpcmd, to use the UCMD. tcpcmd can use it's own UCMD or the NetEvents app. NetEvents is purportedly more stable, but I found it far too slow to be useable. I've used the UCMD with no problems or slowdowns. Pick the one that's right for you. YMMV.
If you like, tcpcmd can log it's work. Control this with the tcpcmd.logging preference (not pictured above). This preference, like tcpcmd.useUCMD, is a feature of tcpcmd. It uses suites.log to take care of the logging. But because of an oversight in suites.log.add, the log outline gets confused with the htmlFTP outline. This of course, is easily fixable. htmlFTP will automatically update this for you the first time you set tcpcmd.logging to true.
There's one more preference, although there is no menu item for it. You can turn htmlFTP off if you want. This will prevent any rendered items from being added to the upload list. Just insert #useHtmlFTP into the user.html.prefs table and set it to true or false. Or you can enter it as a directive in your pages or website tables: #useHtmlFTP "false".
Change Notes
Miscellaneous InfoWhy I wrote this suite I got sick of rendering my News Center site every day and having to keep track of what to upload. I had a much more difficult project that I avoided doing by working on this. :-) It seemed like a good idea at the time. Credits Thanks to Alan German and Leonard Rosenthal for "tcpcmd". Especially to Alan for the great scripts he wrote. Feedback This software is free, but I do ask that you send me a note in email and let me know how you are using the program and how you like it. Feel free to send me urls of the sites you are building, too. Mostly I'm just curious to see how people actually use this suite. Comments and bug-reports are always welcome! Send your missive to: phil@filsa.net About this suite This software is provided without charge, and without warranty as well. Feel free to modify this suite to your own tastes, but please don't distribute modified copies. This suite is copyright 1997 by Philip Suh, who benevolently allows you to use it. It's unsupported, which means I may never get around to tweaking things, adding features, or fixing bugs. I will try to keep this suite bug free, but beyond that, no promises. It's time to stop writing docs, because I'm getting tired and things are starting to ramble. Oh yes, almost forgot. I'm really sorry about the un-pronouncable name: But I got started with it and didn't feel like changing it mid-way through. A good lesson in how not to name software.
htmlFTP does two things. One, it builds an outline of rendered files to upload. Two, it uploads the files from that outline. Building the outline: htmlFTP needs help from the html suite in order to make the outline. By selecting Install from the htmlFTP menu, the html suite is modified to send htmlFTP the information it needs to build the outline. Once it is installed, the outline building process is invisible. Whenever a page is built, the newly rendered file (and any graphics on the page) are added to the list of items to upload. The script addToOutline does most of the work. addFromFtpText and addFromImageRef are 'glue scripts' that convert the data available from those scripts into data useable by addToOutline. It's certainly possible to add a few lines to your own image processing scripts to plug into this delayed upload functionality. Uploading the files: ftpFromOutline is the key script that walks the special outline created by addToOutline. ftpFromOutline grabs the important data--website address, URL to upload to, and location of the file--and passes it to ftpOneFile,which actually does the interacting with tcpcmd. ftpFromOutline contains most of the error checking code. Note that the website address (kept on the summits of the outline) can be ANY table that has a subtable #ftpSite, with the appropriate data. If someone designs a image processing system for suites.html that uses a separate image glossary, it would be possible to implement a "poor-man's FireSite", keeping the html on a server and the graphics on a higher-bandwidth connection. htmlFTP could help in implementing such a system.
|
|
|
|
|
|
This is Phil's Frontier Scripting Site. San Francisco, CA Copyright © 1996-98, Phil Suh. All Rights Reserved. http://www.filsa.net/frontier/software/htmlftp.html This page last built on 6/28/99; 11:12:25 PM |
|
| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |