DIRECTORY WPDirectory; WPDirectoryImpl: CEDAR PROGRAM IMPORTS Rope, FinchSmarts, FinchTool, IO, MBQueue, NodeProps, TiogaButtons, TiogaOps, ViewerTools, VoiceUtils EXPORTS WPDirectory = { ROPE: TYPE ~ Rope.ROPE; Entry: TYPE ~ WPDirectory.Entry; Cursor: TYPE ~ WPDirectory.ComplexCursor; AttributePatterns: TYPE ~ WPDirectory.AttributePatterns; tName: LoganBerry.AttributeType = $name; tRname: LoganBerry.AttributeType = $rname; tOffice: LoganBerry.AttributeType = $officenumber; tHome: LoganBerry.AttributeType = $homenumber; tRemarks: LoganBerry.AttributeType = $remarks; GetName: PUBLIC PROC [entry: Entry] RETURNS [ROPE] ~ { RETURN[GetAttributeValue[entry, tName]]; }; GetRName: PUBLIC PROC [entry: Entry] RETURNS [ROPE] ~ { RETURN[GetAttributeValue[entry, tRname]]; }; GetHomePhone: PUBLIC PROC [entry: Entry] RETURNS [ROPE] ~ { RETURN[GetAttributeValue[entry, tHome]]; }; GetOfficePhone: PUBLIC PROC [entry: Entry] RETURNS [ROPE] ~ { RETURN[GetAttributeValue[entry, tOffice]]; }; GetRemarks: PUBLIC PROC [entry: Entry] RETURNS [ROPE] ~ { RETURN[GetAttributeValue[entry, tRemarks]]; }; GetAttributeValue: PROC [entry: LoganBerry.Entry, type: LoganBerry.AttributeType] RETURNS [LoganBerry.AttributeValue] ~ { FOR e: LoganBerry.Entry _ entry, e.rest WHILE e # NIL DO IF e.first.type = type THEN RETURN[e.first.value]; ENDLOOP; RETURN[NIL]; }; }. ŠWPDirectoryImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Doug Terry, July 13, 1987 5:51:12 pm PDT Whitepage database facilities. Ad-hoc query parsing Query syntax: (): ... { at { home | office } } { in } Defaults: a missing is taken to be: "officenumber" if starts with a digit and "at home" is not specified, "homenumber" if starts with a digit and "at home" is specified, "rname" if does not start with a digit but contains a ".", "name" if does not start with a digit and contains no ".". a missing is taken to be: "SimpleDWIM" (without subrange or date parsing). a missing is taken to be: all standard databases. Notes: if "officenumber" is selected as a default and produces no results, then "homenumber" should be tried. Whitepage query execution Operations on entries Κ>˜šœ™Icodešœ Οmœ1™