Monday, November 08, 2010 at 12:03 AM.
system.verbs.builtins.html.directory.compileIfDirty
on compileIfDirty (adroutline, identifier, adrdirectoryinfo, ownername=user.prefs.name, owneremail=user.prefs.mailAddress) {
<<Changes
<<5/10/02; 1:56:16 PM by JES
<<Created. Cribbed from manilaSuite.directory.initMessageTable.
on clearcache () {
new (tabletype, @adrdirectoryinfo^.cache);
html.directory.initDirectoryTable (identifier, parentOf (parentOf (adrdirectoryinfo^)^))};
bundle { //rebuild the xml structure if it needs it
local (flrebuild = false);
if defined (adrdirectoryinfo^.xmlstruct) {
if timemodified (adroutline) > timemodified (@adrdirectoryinfo^.xmlstruct) {
flrebuild = true}}
else {
flrebuild = true};
if flrebuild {
xml.compile (op.outlinetoxml (adroutline, ownername, owneremail), @adrdirectoryinfo^.xmlstruct);
clearcache ()}};
bundle { //clear the cache if one of the templates has changed
try {
local (pta = html.getpagetableaddress ());
if timeCreated (@adrdirectoryinfo^.cache) < pta^.newsSite^.directory.templateModified {
clearcache ()}}}}
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.