Showing posts with label utility. Show all posts
Showing posts with label utility. Show all posts

Thursday, August 16, 2007

iWeb and umlaut characters

My partner created a web-site with iWeb 2.0 for our son.
Because we don't need the .Mac features we decided to publish the website to a shared-hosting provider.
Unfortunately the provider has a FTP-Filename restriction: there are only alpha-numeric filenames (and '-','_') allowed. iWeb however creates file and folder names with german umlaut, exclamation marks and other unwanted characters.
I have decided to write a little command line utility wich translates the whole iWeb-Site to match the provider
constraints.
After a few hours of code-writing the tool has the following features:
  1. Rename files and directory to match the alpha-numeric rules.

  2. Replace the old filenames in the content of files with type *.html, *.js, *.xml with the new filenames (e.g links, javascript)

  3. Gather MD5 checksum and modified-date for every file. This information is stored in a file named iWebTranslator.config in
    the parent directory.

  4. Backup modifed-date for every file with the same MD5-checksum as before ( this is useful for a FTP-transfer
    to only transfer modified dates).


Example:

iWeb Site Name: TestSite
iWeb Publish Folder: /PATH/TO/Sites

Steps to Publish Site:
  1. Delete the folder /PATH/TO/Sites/TestSite if it already exists.
  2. Publish Site to Folder /PATH/TO/Sites within iWeb.
  3. Run iWebTranslator via Terminal: java -jar iWebTranslator.jar /PATH/TO/Sites/TestSite
  4. Upload Folder via FTP (e.g. via Transmit Synchronization/Mirror method).

The Application can be downloaded at: Download HERE