multivalent.std.adaptor
Class ManualPageVolume
public
class
ManualPageVolume
extends Behavior
Collect all man pages in Preferences' MANPATH (Java doesn't read environment variables, which is just as well, but would like to initially import setting).
Big list of all pages read, alphabetized, by volume.
Use standard system help mechanism, multiple media types (for possible Texinfo)
Intercepts manpage protocol (e.g., "manpage:ls(1)" or "manpage:ascii.5" or "manpage:sort") to look up in its database
Principle: Separate UI from media adaptor.
Discarded ideas:
- Could check for misfiled man pages (e.g., some-page.1 in .../man rather than .../man/man1) and offer to move
Later, perhaps
- if volume number in text title list, put it there, else fold into parent (single-letter) volume
Version: $Revision: 1.7 $ $Date: 2003/06/02 05:42:14 $
See Also: ManualPage
Field Summary |
static String | MSG_DATABASE
Request database to be rebuilt, to pick up changes made.
|
static String | MSG_EXISTS
Determine whether manual page exists in database, in any section.
|
static String | MSG_KILLCATS
Formatting on today's machines is so fast that there is no need for cached formatted "cat" pages; request to delete them.
|
static String | MSG_SECTION_VALID
Determine whether manual page section / volume letter is valid.
|
static String | PREF_DIR Boolean indicating whether or not to show file system directories of man page roots. |
static String | PREF_MANPATH List of directories that are man page roots, same as MANPATH environment variable. |
static String | PREF_RECENT Boolean indicating whether or not to scan for and show recently added (or changed) man pages. |
static String | PREF_VOLNAMES List of volume names separated by colons, parallel to PREF_RECENT. |
static String | PREF_VOLUMES List of letters separated by colons corresponding to volume extensions. |
static String | PROTOCOL |
Method Summary |
void | buildDatabase()
Scan directories of MANPATH and collect page names. |
void | configure()
Set up MANPATH, volume letters and names.
|
static void | main(String[] argv) Test database reading. |
void | restore(ESISNode n, Map<String,Object> attr, Layer layer) |
boolean | semanticEventAfter(SemanticEvent se, String msg)
Intercept openDocument with manpage protocol.
|
boolean | semanticEventBefore(SemanticEvent se, String msg) |
String | showPage(String page)
Parse page spec, look up in database, report if no found or multiple matches, or openDocument on single match. |
String | showVolume(String volnum)
Writes HTML page that list all pages in specified volume number, or all pages in database for "*". |
public static final String MSG_DATABASE
Request database to be rebuilt, to pick up changes made.
"rebuildManPageDatabaseNewCommand2".
public static final String MSG_EXISTS
Determine whether manual page exists in database, in any section.
"manualpageExists": arg= java.lang.String name-of-page
public static final String MSG_KILLCATS
Formatting on today's machines is so fast that there is no need for cached formatted "cat" pages; request to delete them.
Cat pages can be regenerated if needed, except in the cast of "stray cats" in which there is no source version.
"manpageDeleteCats".
public static final String MSG_SECTION_VALID
Determine whether manual page section / volume letter is valid.
"manualpageValidSection": arg= java.lang.String string-to-check / java.lang.Boolean returned-answer
public static final String PREF_DIR
Boolean indicating whether or not to show file system directories of man page roots.
public static final String PREF_MANPATH
List of directories that are man page roots, same as MANPATH environment variable.
public static final String PREF_RECENT
Boolean indicating whether or not to scan for and show recently added (or changed) man pages.
public static final String PREF_VOLNAMES
List of volume names separated by colons, parallel to
PREF_RECENT.
public static final String PREF_VOLUMES
List of letters separated by colons corresponding to volume extensions.
public static final String PROTOCOL
public void buildDatabase()
Scan directories of
MANPATH
and collect page names.
public void configure()
Set up MANPATH, volume letters and names.
Separated from buildDatabase() so can show UI without necessarily building database.
public static void main(String[] argv)
Test database reading.
public void restore(
ESISNode n, Map<String,Object> attr,
Layer layer)
Intercept openDocument with manpage protocol.
eventAfter to let newcomers filter or intercept.
public String showPage(String page)
Parse page spec, look up in database, report if no found or multiple matches, or openDocument on single match.
public String showVolume(String volnum)
Writes HTML page that list all pages in specified volume number, or all pages in database for "*".