Open SiteSearch 4.1.1
Final

ORG.oclc.obi.util
Class Databases

java.lang.Object
  |
  +--ORG.oclc.obi.util.Databases

public class Databases
extends Object

The Databases class is a utility set of methods used to build HTML selection for various lists of database. Such as a list of checkbox to add to a FORM or list of database anchors.

See Also:
ZUserData, Zdb, Db, UserStateObject

Constructor Summary
Databases()
           
 
Method Summary
static String buildAnchors(String[] dbnames, String anchorAction, String addnlAnchorInfo, String lastDbName, String anchorStart, String anchorEnd, String anchorLabel, String anchorTrailer, String lineSeparator, int numAnchorPerLine)
          Builds a list a databases as anchors from the user's database list
static String buildCheckBoxes(String[] dbNames, String boxStart, String boxEnd, String boxLabel, String boxTrailer, String lineSeparator, int numBoxPerLine)
          Builds a list of HTML checkboxes from an array of database names.
static String buildCheckBoxes(String[] dbNames, String boxStart, String boxEnd, String boxLabel, String boxTrailer, String lineSeparator, int numBoxPerLine, String font)
          Builds a database checkBox list from an array of database names using the input font.
static String buildCheckBoxes(String[] dbNames, String nameWidget, String boxStart, String boxEnd, String box1Label, String box2Label, String boxTrailer, String lineSeparator, int numBoxPerLine, String font)
          Builds a database checkbox list from an array of database names using the input font.
static String buildCheckBoxes(String dbNames, String boxStart, String boxEnd, String boxLabel, String boxTrailer, String lineSeparator, int numBoxPerLine)
          Builds a list of HTML checkboxes from an input string of database names.
static String buildCheckBoxes(String dbNames, String boxStart, String boxEnd, String boxLabel, String boxTrailer, String lineSeparator, int numBoxPerLine, String font)
          Builds a list of HTML checkboxes from an input string of database names using the specified font.
static String buildCheckBoxes(String dbNames, String boxStart, String boxEnd, String box1Label, String box2Label, String boxTrailer, String lineSeparator, int numBoxPerLine, String font)
          Builds a list of HTML checkboxes from an input string of database names using the specified font.
static String getAnchors(String[] dbnames, String anchorAction, String cellColor, String textFont)
          Retrieves the database anchor list built for the input list of dbnames
static String getAnchors(String[] dbnames, String anchorAction, String cellColor, String textFont, int numAnchorPerLine)
          Retrieves the database anchor list built for the input list of dbnames
static void setCheckBoxSelected(UserStateObject user, String selectedName)
          Toggles the "CHECKED" attribute of the list of checkboxes based on whether the database is currently selected.
static void setCheckBoxSelected(UserStateObject user, String selectedName, String nameWidget)
          Toggles the "CHECKED" attribute of the list of checkboxes based on whether the database is currently selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Databases

public Databases()
Method Detail

buildCheckBoxes

public static String buildCheckBoxes(String dbNames,
                                     String boxStart,
                                     String boxEnd,
                                     String boxLabel,
                                     String boxTrailer,
                                     String lineSeparator,
                                     int numBoxPerLine)
Builds a list of HTML checkboxes from an input string of database names. (NOTE: The "NAME" attribute of the INPUT tag defalts to "dbname".)
Parameters:
dbNames - the space separated list of database names
boxStart - the string to start the line (e.g., table row tag)
boxEnd - the string to put at the end of the line (e.g., table row close tag)
boxLabel - the string to precede the INPUT tag (e.g., table cell tag)
boxTrailer - the string to follow the INPUT tag (e.g., table cell close tag)
lineSeparator - the string for line terminator (e.g., table row close tag, table row tag)
numBoxPerLine - the number of boxes to put on a line. (NOTE: -1 indicates all on the same line)
Returns:
The list checkboxes or an empty string("") if an error is encountered

buildCheckBoxes

public static String buildCheckBoxes(String dbNames,
                                     String boxStart,
                                     String boxEnd,
                                     String boxLabel,
                                     String boxTrailer,
                                     String lineSeparator,
                                     int numBoxPerLine,
                                     String font)
Builds a list of HTML checkboxes from an input string of database names using the specified font. (NOTE: The "NAME" attribute of the INPUT tag defalts to "dbname".)
Parameters:
dbNames - the space separated list of database names
boxStart - the string to start the line (e.g., table row tag)
boxEnd - the string to put at the end of the line (e.g., table row close tag )
boxLabel - the string to precede the INPUT tag (e.g., table cell tag)
boxTrailer - the string to follow the INPUT tag (e.g., table cell close tag)
lineSeparator - the string for line separation (e.g., table row close tag, table row tag)
numBoxPerLine - the number of boxes to put on a line. (NOTE: -1 indicates all on the same line)
font - the open font tag to use
Returns:
The list checkboxes or an empty string("") if an error is encountered

buildCheckBoxes

public static String buildCheckBoxes(String dbNames,
                                     String boxStart,
                                     String boxEnd,
                                     String box1Label,
                                     String box2Label,
                                     String boxTrailer,
                                     String lineSeparator,
                                     int numBoxPerLine,
                                     String font)
Builds a list of HTML checkboxes from an input string of database names using the specified font. (NOTE: The "NAME" attribute of the INPUT tag defalts to "dbname".)
Parameters:
dbNames - the space separated list of database names
boxStart - the string to start the line (e.g., table row tag)
boxEnd - the string to put at the end of the line (e.g., table row close tag )
boxLabel - the string to precede the INPUT tag (e.g., table cell tag)
boxTrailer - the string to follow the INPUT tag (e.g., table cell close tag)
lineSeparator - the string for line separation (e.g., table row close tag, table row tag)
numBoxPerLine - the number of boxes to put on a line. (NOTE: -1 indicates all on the same line)
font - the open font tag to use
Returns:
The list checkboxes or an empty string("") if an error is encountered

buildCheckBoxes

public static String buildCheckBoxes(String[] dbNames,
                                     String boxStart,
                                     String boxEnd,
                                     String boxLabel,
                                     String boxTrailer,
                                     String lineSeparator,
                                     int numBoxPerLine)
Builds a list of HTML checkboxes from an array of database names. (NOTE: The "NAME" attribute of the INPUT tag defalts to "dbname".)
Parameters:
dbNames - the array of database names
boxStart - the string to start the line (e.g., table row tag)
boxEnd - the string to put at the end of the line (e.g., table row close tag )
boxLabel - the string to precede the INPUT tag (e.g., table cell tag)
boxTrailer - the string to follow the INPUT tag (e.g., table cell close tag)
lineSeparator - the string for line separation (e.g., table row close tag, table row tag)
numBoxPerLine - the number of boxes to put on a line. (NOTE: -1 indicates all on the same line)
Returns:
The list checkboxes or an empty string("") if an error is encountered

buildCheckBoxes

public static String buildCheckBoxes(String[] dbNames,
                                     String boxStart,
                                     String boxEnd,
                                     String boxLabel,
                                     String boxTrailer,
                                     String lineSeparator,
                                     int numBoxPerLine,
                                     String font)
Builds a database checkBox list from an array of database names using the input font. (NOTE: The "NAME" attribute of the INPUT tag defalts to "dbname".)
Parameters:
dbNames - the array of database names
boxStart - the string to start the line (e.g., table row tag)
boxEnd - the string to put at the end of the line (e.g., table row close tag )
boxLabel - the string to precede the INPUT tag (e.g., table cell tag)
boxTrailer - the string to follow the INPUT tag (e.g., table cell close tag)
lineSeparator - the string for line separation (e.g., table row close tag, table row tag)
numBoxPerLine - the number of boxes to put on a line. (NOTE: -1 indicates all on the same line)
font - the open font tag to use
Returns:
The list checkboxes or an empty string("") if an error is encountered

buildCheckBoxes

public static String buildCheckBoxes(String[] dbNames,
                                     String nameWidget,
                                     String boxStart,
                                     String boxEnd,
                                     String box1Label,
                                     String box2Label,
                                     String boxTrailer,
                                     String lineSeparator,
                                     int numBoxPerLine,
                                     String font)
Builds a database checkbox list from an array of database names using the input font.
Parameters:
dbNames - the array of database names
nameWidget - the "NAME" attribute value to use in the INPUT tag
boxStart - the string to start the line (e.g., table row tag)
boxEnd - the string to put at the end of the line (e.g., table row close tag )
box1Label - the string to precede the INPUT tag (e.g., table cell tag)
box2Label - the string to precede the Displayed Data (e.g., table cell tag)
boxTrailer - the string to follow the INPUT tag (e.g., table cell close tag)
lineSeparator - the string for line separation (e.g., table row close tag, table row tag)
numBoxPerLine - the number of boxes to put on a line. (NOTE: -1 indicates all on the same line)
font - the open font tag to use
Returns:
The list checkboxes or an empty string("") if an error is encountered

setCheckBoxSelected

public static void setCheckBoxSelected(UserStateObject user,
                                       String selectedName)
Toggles the "CHECKED" attribute of the list of checkboxes based on whether the database is currently selected. The updated list of checkboxes is cached as the UserStateObject entity sepcified as the selectedName. (NOTE: The "NAME" attribute of the INPUT tag defalts to "dbname".)
Parameters:
user - the user object
selectedName - the space seperated list of database names

setCheckBoxSelected

public static void setCheckBoxSelected(UserStateObject user,
                                       String selectedName,
                                       String nameWidget)
Toggles the "CHECKED" attribute of the list of checkboxes based on whether the database is currently selected. The updated list of checkboxes is cached as the UserStateObject entity sepcified as the selectedName.
Parameters:
user - the user object
selectedName - the space seperated list of database names
nameWidget - the "NAME" attribute value for the INPUT tag

getAnchors

public static String getAnchors(String[] dbnames,
                                String anchorAction,
                                String cellColor,
                                String textFont)
Retrieves the database anchor list built for the input list of dbnames
Parameters:
dbnames - an array of database names
anchorAction - URL for the anchor. (e.g., "/WebZ/html/search.html:active=3:dbchoice=1:")
cellColor - the color of the anchor cell
textFont - the open font tag for the anchor text
Returns:
The list of anchors or an empty string("") if an error is encountered

getAnchors

public static String getAnchors(String[] dbnames,
                                String anchorAction,
                                String cellColor,
                                String textFont,
                                int numAnchorPerLine)
Retrieves the database anchor list built for the input list of dbnames
Parameters:
dbnames - an array of database names
anchorAction - URL for the anchor. (e.g., "/WebZ/html/search.html:active=3:dbchoice=1:")
cellColor - the color of the anchor cell
textFont - the open font tag for the anchor text
Returns:
The list of anchors or an empty string("") if an error is encountered

buildAnchors

public static String buildAnchors(String[] dbnames,
                                  String anchorAction,
                                  String addnlAnchorInfo,
                                  String lastDbName,
                                  String anchorStart,
                                  String anchorEnd,
                                  String anchorLabel,
                                  String anchorTrailer,
                                  String lineSeparator,
                                  int numAnchorPerLine)
Builds a list a databases as anchors from the user's database list
Parameters:
dbnames - an array of database names
anchorAction - URL for the anchor. (e.g., /WebZ/search.html:&context;?dbchoice=1)
addnlAnchorInfo - additional string to append to the URL (e.g., target=frame1)
lastDbName - the last database name selected (will be made bold) null will indicate no database has been chosen.
anchorStart - the string to start the line (e.g., table row tag)
anchorEnd - the string to put at the end of the line (e.g., table row close tag)
anchorLabel - the string to precede the anchor (e.g., table cell tag)
anchorTrailer - the string to follow the anchor (e.g., table cell close tag)
lineSeparator - the string for line separation
numAnchorPerLine - the number of anchors to put on a line. (NOTE: -1 indicates all on the same line)
Returns:
The list of anchors or an empty string("") if an error is encountered

Open SiteSearch 4.1.1
Final