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

system.verbs.builtins.io.server.archiveOutline

on archiveOutline (username, opmltext) {
	<<Changes
		<<8/28/10; 1:41:28 PM by DW
			<<Created. 
	local (adrdata = io.init (), adruser = io.server.initUser (username), now = clock.now (), startticks = clock.ticks ());
	scratchpad.ausername = username; scratchpad.aopmltext = opmltext;
	local (htmltext = "Archived an outline for user \"" + username + ".\"");
	local (adrday = mainresponder.calendar.getdayaddress (@adruser^.calendar, now));
	local (nametable = string.padwithzeros (++adruser^.stats.archiveSerialnum, 3));
	local (adrtable = @adrday^.[nametable]);
	new (tabletype, adrtable);
	adrtable^.opmltext = opmltext;
	adrtable^.ctAccesses = 0;
	adrtable^.whenLastAccess = date (0);
	adrtable^.whenCreated = now;
	local (url = "http://" + adrdata^.server.prefs.archiveDomain + "/" + username + "/" + file.getdatepath ("/", now) + nametable + ".opml");
	bundle { //logging
		log2.add (realtime.server.data.log.source, "Archive", htmltext, startticks);
		realtime.server.writeLog ()};
	return (url)};
bundle { //test code
	archiveOutline (scratchpad.ausername, scratchpad.aopmltext)}



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.