Re: Using Applescript to process WebCatalog functions

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 17703
interpreted = N
texte = >Bob Mosebar changed the universe: > >> I would like to be able to send a commit and close event to WebCatalog >> from an AppleScript process. We want our customer to be able to FTP an >> updated database, file exported from Filemaker Pro, whenever they get new >> information from their sources. > >Why with Applescript? >You can let your customer upload into a special folder and check this folder with WebCat for the existence of a file, whenever a user enters the shop. I am currently working on a procedure which lets my customer upload a new database at any time with any name and blocks the access for all users while the update is running. I used this kind of stuff already with 4D-databases, here is the workflow: > >If a user enters the shop and an uploaded file is present in the upload-folder: >#1 rename the original start-template to entry.tpl_disabled >#2 rename a predefined warning-page from entry.tpl_update to entry.tpl >#3 send this page, it says Database gets updated, try again in a minute. > (any user gets now THIS entry.tpl while it is active...) >#4 close the database >#5 move it to a backup-folder, set the name to date and time. >#6 move the new file to its correct position (and set the original name). >#7 rename the warning-page to entry.tpl_update >#8 rename the original page back from entry.tpl_disabled to entry.tpl > (from now on users get the right entry page again) Why do all this page renaming? A more efficient solution would be to put a pair of showif and hideif contexts into the entry.tpl page that will display the normal entry.tpl page content when there's nothing in the upload-folder, and perform the four steps below, when there *is* something in that folder:1- Display Databases updating, try again in a minute ... 2- Use [closedatabase] to close the database that's being updated 3- Use [copyfile] to copy the original db file to a backup folder, setting the name to date and time. 4- Use [movefile] to move the new file to its correct position and set the name to the original db name, thus replacing the original db file with the newly-uploaded replacement db file.Of course, there's a lot more to it than this, especially if there's more than one database that needs to be replaced in this manner. But for a single customer with a single database, it will work fine -- assuming that the customer actually uploads a properly formatted database file and not something else ... :)Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Associated Messages, from the most recent to the oldest:

    
>Bob Mosebar changed the universe: > >> I would like to be able to send a commit and close event to WebCatalog >> from an AppleScript process. We want our customer to be able to FTP an >> updated database, file exported from Filemaker Pro, whenever they get new >> information from their sources. > >Why with Applescript? >You can let your customer upload into a special folder and check this folder with WebCat for the existence of a file, whenever a user enters the shop. I am currently working on a procedure which lets my customer upload a new database at any time with any name and blocks the access for all users while the update is running. I used this kind of stuff already with 4D-databases, here is the workflow: > >If a user enters the shop and an uploaded file is present in the upload-folder: >#1 rename the original start-template to entry.tpl_disabled >#2 rename a predefined warning-page from entry.tpl_update to entry.tpl >#3 send this page, it says Database gets updated, try again in a minute. > (any user gets now THIS entry.tpl while it is active...) >#4 close the database >#5 move it to a backup-folder, set the name to date and time. >#6 move the new file to its correct position (and set the original name). >#7 rename the warning-page to entry.tpl_update >#8 rename the original page back from entry.tpl_disabled to entry.tpl > (from now on users get the right entry page again) Why do all this page renaming? A more efficient solution would be to put a pair of showif and hideif contexts into the entry.tpl page that will display the normal entry.tpl page content when there's nothing in the upload-folder, and perform the four steps below, when there *is* something in that folder:1- Display Databases updating, try again in a minute ... 2- Use [closedatabase] to close the database that's being updated 3- Use [copyfile] to copy the original db file to a backup folder, setting the name to date and time. 4- Use [movefile] to move the new file to its correct position and set the name to the original db name, thus replacing the original db file with the newly-uploaded replacement db file.Of course, there's a lot more to it than this, especially if there's more than one database that needs to be replaced in this manner. But for a single customer with a single database, it will work fine -- assuming that the customer actually uploads a properly formatted database file and not something else ... :)Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[WebDNA] Competitors! (2008) Summing fields (1997) Big Databases (1997) Possible Bug in 2.0b15.acgi (1997) [OT] Unix question (2002) Re:E-mailer application times out (1998) [ot] ascii values for lf and cr (2001) syntax question, not in online refernce (1997) Cookies (2003) [ot] Any One Want A WebDNA Billing Program? (2003) includes and cart numbers (1997) Encyption mail was Suggestions for Topics ... (1998) Referrer field to header field conversion (1997) [WebDNA] java and webnda (2017) Quitting WebMerchant ? (1997) [WebDNA] WebDNA frameworks and beginners (2012) Adding multiple items to Cart (1999) email [title] (1997) [searchString] (1997) [ot] Authorize.Net Resellers (2006)