Monday, November 08, 2010 at 12:04 AM.
system.verbs.builtins.mainResponder.search.client.checkSearchTable
on checkSearchTable (adrObject, adrTable) {
<<Check for missing or empty items in the search prefs table. If something's missing or empty, log it, then return.
on check (name) { //check that a field exists and is not empty
if not defined (adrTable^.[name]) {
mainResponder.search.client.logNoIndex (adrObject, "the required preference \"" + name + "\" does not exist.");
return (false)};
if adrTable^.[name] == "" {
mainResponder.search.client.logNoIndex (adrObject, "the required preference \"" + name + "\" is empty.");
return (false)};
return (true)};
local (requiredFields = {"domain", "addToIndex", "indexOnCheckIn", "siteName", "siteUrl", "supportsIndexing", "port"});
local (i);
<<Check that required fields exist and are not empty.
for i = 1 to sizeOf (requiredFields) {
if not (check (requiredFields [i])) {
return (false)}};
return (true)}
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.