Saturday, March 19, 2011 at 1:05 AM.


on buildEverything (username) {
		<<3/18/11; 3:35:19 AM by DW
			<<When building the month pages in the archive we were hard-coding for "davewiner" -- this is why we were getting so many bug reports re: Can't process the request because there is no user named "davewiner." We were also just building months 2 through 6. This code was written in June 2010 and the archive must have started in February? Of course in June I was the only user. This was obviously provisional code that never got revisited. Classic. :-)
				<<bundle //build month pages
					<<local (month)
					<<for month = 2 to 6
						<<scripting2Suite.server.buildMonthPage ("davewiner", date.set (1, month, 2010, 0, 0, 0))
		<<6/14/10; 3:02:09 AM by DW
			<<Before the rebuild delete all the textCache elements in the story tables.
		<<6/9/10; 5:21:34 AM by DW
			<<I needed to run this script as I was booting up the new version of It may come in handy at other times.
	local (adrdata = scripting2suite.inituser (username), adrcal = @adrdata^.calendar);
	bundle { //6/14/10 by DW -- delete all textCache elements in story tables
		on visit (adrstory) {
			if defined (adrstory^.textCache) {
				delete (@adrstory^.textCache)};
			return (true)};
		mainresponder.calendar.visitreversechronologic (adrcal, @visit);
		filemenu.savemyroot (adrdata)};
	scripting2Suite.server.buildHomePage (username);
	scripting2Suite.server.buildTableOfContents (username);
	scripting2Suite.server.buildAllStories (username);
	scripting2Suite.server.buildRss (username);
	bundle { //build the day pages
		on visit (adrday) {
			local (theday = mainresponder.calendar.getaddressday (adrday));
			scripting2Suite.server.buildDayPage (username, theday);
			return (true)};
		mainresponder.calendar.visitreversechronologic (adrcal, @visit, true)};
	bundle { //build month pages, rewrite 3/18/11 by DW
		local (adryear, adrmonth);
		for adryear in adrcal {
			local (yearnum = number (nameof (adryear^)));
			for adrmonth in adryear {
				local (monthnum = number (nameof (adrmonth^)));
				scripting2Suite.server.buildMonthPage (username, date.set (1, monthnum, yearnum, 0, 0, 0) )}}};
	bundle { //stats
		adrdata^.stats.whenLastBuildEverything = ()}};
bundle { //test code
	buildEverything ("davewiner")}

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.