Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.outliner.menuCommands.refreshCode
<<Changes
<<3/27/02; 11:06:29 PM by JES
<<When doing the batchImport, pass in flLogErrors as true. This keeps batchExporer.batchImport from failing if a file fails to import.
<<3/27/02; 6:37:54 PM by JES
<<Write out all of the files needed in the www/system folder.
<<3/25/02; 7:25:37 PM by JES
<<Created. Download all of the Outliner parts to the temp folder, and import them. Then reset the menu bar.
if not (parentOf (this^) == @system.temp.radio) { //make a copy of myself and call the copy in its own thread
system.temp.radio.refreshOutlinerCode = this^;
thread.callScript (@system.temp.radio.refreshOutlinerCode, {});
return};
local (pc = file.getPathChar ());
local (directoryOpmlUrl = "http://radio.weblogs.com/0001000/userland/outlinerParts/directory.opml");
local (localFolder = file.getSpecialFolderPath (file.getSystemDisk (), "temp", true) + "UserLand" + pc + "Outliner" + pc);
file.sureFilePath (localFolder + "xxx");
radio.utilities.synchronizeFolder (localFolder, directoryOpmlUrl, true); //true == delete files that aren't in the opml
batchExporter.init ();
batchExporter.batchImport (localFolder, flLogErrors:true);
menu.noSuite ();
<<bundle //write system folder text files
<<msg ("Writing system folder files...")
<<local (adr)
<<for adr in @radio.outliner.data.systemFolderFiles
<<local (f = radio.file.getAbsolutePath (nameOf (adr^)))
<<if (f endswith ".txt") or (f endswith ".opml")
<<file.writeTextFile (f, string (adr^))
<<else
<<file.writeWholeFile (f, string (adr^))
<<bundle //install thread script
<<local (s = "radio.outliner.threadScript ()")
<<script.newScriptObject (s, @radio.thread.agents.pollOutlines)
bundle { //delete obsolete system folder text files
local (pc = file.getPathChar ());
local (systemFolder = user.radio.prefs.wwwFolder + radio.data.folderNames.wwwSystemSubfolderName + pc + "pages" + pc);
try {file.delete (systemFolder + "opmlSubscribe.txt")};
try {file.delete (systemFolder + "outlinerSubscribe.txt")};
try {file.delete (systemFolder + "outlinerSubscribers.txt")};
try {file.delete (systemFolder + "outlinerPrefs.txt")};
wp.newTextObject ("<%radio.outliner.macros.subscribe ()%>", @radio.data.systemFolderTextFiles.["pages/outlinerSubscribe.txt"]);
wp.newTextObject ("#flUseHeadTitle true\r\n<%radio.outliner.prefs.main ()%>", @radio.data.systemFolderTextFiles.["pages/outlinerPrefs.txt"])};
radio.data.flInstall = true; //trigger installation of system text files from radio.data.systemFolderTextFiles
msg ("")
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.