Monday, November 08, 2010 at 12:04 AM.
system.verbs.builtins.opmlEditor.loadPartsFromFolder
on loadPartsFromFolder () { <<Changes <<9/21/10; 9:26:54 AM by DW <<Use opmlEditor.loadPartFromFile to load the files. <<9/18/10; 11:15:09 AM by DW <<Init the parts folder here, only if user.opmlEditor.prefs.flLoadPartsFromFolder is true. You don't get the folder (could be confusing) until you turn the feature on. <<9/18/10; 8:11:33 AM by DW <<Created. if user.opmlEditor.prefs.flLoadPartsFromFolder { local (f); if not defined (user.opmlEditor.prefs.partsFolder) { user.opmlEditor.prefs.partsFolder = frontier.getsubfolder ("/ops/drop new parts here/")}; fileloop (f in user.opmlEditor.prefs.partsFolder) { opmlEditor.loadPartFromFile (f); file.delete (f)}}}; <<bits = string.replaceAll (bits, cr + lf, cr) <<bits = string.replaceAll (bits, lf, cr) <<if fatPages.getPageAtts (@bits, @atts) <<if defined (atts.pageData) <<local (x = atts.objectType, objectType) <<local (prefix = "application/x-frontier-") <<if x beginsWith prefix <<objectType = string.delete (x, 1, sizeof (prefix)) <<local (data = binary (base64.decode (atts.pageData))) <<setBinaryType (@data, objectType) <<table.surePath (string (atts.adrPageData)) <<unpack (@data, atts.adrPageData) <<bundle //log it <<local (htmltext = "Loaded part \"" + atts.adrPageData + ".\" Size = " + sizeof (data) + " bytes.") <<log2.add ("OPML Editor", "Load", htmltext, startticks) bundle { //test code loadPartsFromFolder ()}
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.