Monday, November 08, 2010 at 12:00 AM.

scripting2Suite.server.saveSpecialOutline

on saveSpecialOutline (username, adroutline, fname=nil, flText=false) {
	<<Changes
		<<6/13/10; 2:18:10 PM by DW
			<<Save it to the misc folder of the user's website. Return the URL. We automatically save it as OPML with a .opml extension. If flText is true, we also save it as text with a .txt extension. Templates should be saved that way so people who don't have the OPML Editor can view it easily. The URL we return is the address of the OPML file.
	local (adrdata = scripting2suite.inituser (username), url);
	if fname == nil {
		fname = nameof (adroutline^)};
	local (path = "misc/" + fname);
	url = scripting2Suite.writeStaticFile (username, path + ".opml", op.outlinetoxml (adroutline));
	if flText {
		scripting2Suite.writeStaticFile (username, path + ".txt", string (adroutline^))};
	return (url)};
bundle { //test code
	saveSpecialOutline ("davewiner", @system.temp.scripting2.editor.homeTemplate.outline, "homeTemplate", true)}



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.