New archiving system!  3/15/05

Inspired by Mark Bernstein's site, J. Nathan Mathias' Notebook of Sand, and others, I considered my archive system and realized that it wasn't going to scale.

Scalability Problems

  • The "archive" note in Tinderbox was going to keep growing, leading to an archive.html that was both broken in its template usage and expanding with each entry
  • I would have no easy way to make a calendar with month-by-month summary pages like those on the two blogs mentioned
  • As the archive grew in my Tinderbox file, any time I opened it in outline view I would get the whole thing. To work with notes after the archive, I'd have to scroll past a list that is already longer than a screen.


So I set up a system like J. Nathan's, with year and month notes, and entries are children of the months. I'll just keep the latest month open, and since the years are children of the archive note (thus keeping descendedFrom(archive)=true), my agents still work. The challenges were twofold.

Legacy Links

Problem: Others have linked to existing entries. While Tinderbox easily accomodates this dramatic architectural shift, the static links of the web don't. I have to leave pointers from the old system.

Fixed: I made aliases of all the existing notes (not that many, really) and left them in the archive note. I exported the whole kit and kaboodle one more time. That created proper pages like I used to have. Then I tossed all the aliases in an unexported note. That keeps them around, their exported html is still hanging out in the export folder for the site, and if I ever forget and delete the legacy files I can pull the aliases back out again and re-export.

Cascading Actions

Problem: The old archive note had an action: publicationDate=today;hot=false; where publicationDate kept the note organized by blog publication date and hot marked entries which needed attention. But now I had a system which would expand with new year and month notes, and the months needed to have that action. Obviously I can't be bothered to remember to type that every month.

Fixed: I set up a few new prototypes. The prototype *year* has the action Prototype=*month*, and the prototype *month* has the action publicationDate=today;hot=false;. Now whenever I make a new month and drag it into a year, it becomes a *month* and gets the action. In point of fact I also gave the old archive note the action Prototype=*year* in case I forget to assign that, too. It took me a while at Tinderbox Weekend Boston to get my head around how to use cascading actions to enforce a data structurein that manner.

The Main Page

Problem: The main page is an agent that draws the first 7 children from the archive. After the change the children of the archive note are the years and months.

Fixed: This took a bit of kludge. I set up an agent called "pseudo-archive" with the following agent query:

  1. descendedFrom(archive)&!(Prototype=*year*|Prototype=*month*|Prototype=*note*)

... got that? It's in the archive but it's not a year, month, or subtopic. None of those should be listed by themselves.

Then I changed the main page agent query from #first(archive,7) to #first(pseudo-archive,7). Naturally I left pseudo-archive not exporting its children and using textOnly.html as its template so that its presence on the site is masked.