|
|
|
|
|
|
ContentServer: Text File ReadersWhen ContentServer imports a would-be web page from disk, it calls a number of text file readers scripts. The script that reads email is thus a different script from one that reads plain text files. You can create additional text file readers to handle special cases. Perhaps some of your writers compose in a WYSIWYG environment, and you need to strip out the <html> tags in their uploaded stories. You could write a custom text file reader to handle this. Your readers are called first When it's time to read a text file, the scripts in user.contentServer.textFileReaders are called first. After that the scripts at html.data.textFileReaders are called. Next ContentServer's email file reader is called. If none of the above text file readers have handled the file, then ContentServer's default text file reader is used. So your scripts have first shot at reading a file. How it works A text file reader script takes two parameters. The first is the path to the file on disk, the second is the address of a table containing two elements: title and pageText. The pageText should already be filled in with the raw text of the file, but your text file reader should check that this is true: if not, it should read in the file and put it in the pageText element. The title will probably be empty. If your text file reader handles the file, it should manipulate the raw text and put the manipulated version in the pageText element. Your text file reader is also responsible for determing the title of the piece. Your script should return true if it manipulated the contents, false otherwise. If it returns true then no more text file readers are called. If it returns false then the next text file reader is called.
|
|
|
||
|
|
|
© Copyright 1996-99 UserLand Software. This page was last built on 1/22/99; 11:02:17 PM.
It was originally posted on 3/24/98; 10:25:54 AM.
Webmaster: brent@userland.com.
|