|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ORG.oclc.gadgets.FormatRecords
The FormatRecords class is a gadget that invokes a database record formatting class to be executed on the object in the user state named UnformattedRecordData containing a Vector of unformatted record data objects in order to create an HTML string representation of the data. It uses the parameters contained in a RequestManager object and the parameters for the gadget read from the configuration files to build the appropriate output. If an error occurs, an empty string("") is returned.
The parameters to the gadget are:
fmtclass or fmt - the name of the formatting
class to use such as 'brief', 'full', or 'bookmark'.
This is specified in the [Formats]
section of the individual database configuration file.
startrecno - the name of the user state entity that
is used to denote the starting record number in the display, such
as toprecno
or fullrecno
. This is used
to attach a record number to the display of the record data.
tempDb - flag to indicate that the gadget will format
records from a temporary database search (tdbname) where true
indicates temporary.
norecordsmessage - text to display when there are
no raw records where the default is an empty string("").
errormessage - the text to display when an error occurs
formatting the record where the default is
Error formatting records from databasename
. If the
text none
is supplied as the error message, no
message will appear.
UserStateObject
,
WebZFormatter
Field Summary | |
protected DataPairs |
dataWrappers
DataPairs object containing the HTML or Text to use in the formatting utilities when the RulesBasedDisplayGenerator is used. |
protected String |
dbname
String data type containing a database name. |
protected StyleTable |
displayGadget
StyleTable object containing the definitions for the user's FmtDisplay context. |
protected String |
errormsg
String data type defining the error message to display. |
protected String |
fmtName
String data type containing the name of the format type to use to format the data, such as 'full'. |
protected Hashtable |
gadgetInfo
Hashtable object containing the parameters to the gadget. |
protected boolean |
initted
boolean data type defining whether the formatting initialization has been executed. |
protected String |
numHoldings
String data type containing the number of holdings records to attach - read from the gadget description. |
protected int |
recno
integer data type defining the current record number for the data based on the entities currecno for brief displays and |
protected Vector |
recordData
Vector object containing the raw data to be formatted. |
protected String |
recordformat
String data type containing the ElementSetName of the current records being formatted. |
protected String |
resultset
String data type containing the current resultset name for the data being formatted. |
protected int |
returnedRecs
integer data type defining the count of raw records. |
protected String |
searchKeyFmt
String data type containing the holdings search key formatting class if there are holdings to search and attach to the full record - read from the gadget description. |
protected UserStateObject |
user
UserStateObject containing the user specific context. |
protected ZDb |
zDb
ZDb object defining a database configuration the user has access to. |
protected ZUserData |
zUserData
ZUserData object containing the user's Z3950 context. |
Constructor Summary | |
FormatRecords()
Constructs a FormatRecords object. |
Method Summary | |
String |
buildit(RequestManager rMngr,
String name)
Generates a String containing the HTML for the data record generated by the database formatting class using the parameters containined in the RequestManager object and the name of the gadget. |
protected void |
formatPresentData(Vector dataFromPresent,
String formatType,
StringBuffer formatStringData,
int recno,
DataPairs wrapperData)
|
DataPairs |
getDataWrappers(String name,
Hashtable gadgetInfo,
StyleTable displayGadget)
|
void |
init(UserStateObject user,
String name)
|
protected String |
runFormat(ZDb zDb,
String formatType,
Vector rawRecords)
Deprecated. use runFormat(zDb, formatType, rawRecords, recno, wrapperData) |
String |
runFormat(ZDb zDb,
String formatType,
Vector rawRecords,
int recno,
DataPairs wrapperData)
Invokes the formatting class object for the input ZDb database object, formatting type, the Vector of records, the record number, and the DataPairs data wrapper definition(html/text) to the class to return a String containing formatted data. |
String |
toString()
Generates a String representation of the object. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected UserStateObject user
protected ZUserData zUserData
protected StyleTable displayGadget
protected Hashtable gadgetInfo
protected ZDb zDb
protected DataPairs dataWrappers
protected String resultset
protected String dbname
protected String fmtName
protected String recordformat
protected String searchKeyFmt
protected String numHoldings
protected Vector recordData
protected int recno
currecno
for brief displays andprotected int returnedRecs
protected boolean initted
protected String errormsg
Constructor Detail |
public FormatRecords()
Method Detail |
public String buildit(RequestManager rMngr, String name)
rMngr
- object containing input parameters for the request.name
- the name of the gadget - the section name in the configuration
file defining the particular gadget.protected final void formatPresentData(Vector dataFromPresent, String formatType, StringBuffer formatStringData, int recno, DataPairs wrapperData)
protected final String runFormat(ZDb zDb, String formatType, Vector rawRecords) throws Exception
zDb
- the ZDb database objectformattingClassName
- the String containing the name of the
format class. i.e. 'full' or 'brief'rawRecords
- the Vector of raw data recordspublic final String runFormat(ZDb zDb, String formatType, Vector rawRecords, int recno, DataPairs wrapperData) throws Exception
zDb
- the ZDb database objectformatType
- the String containing the name of the
format class. i.e. 'full' or 'brief'rawRecords
- the Vector of raw data recordsrecno
- the record number of the first record in the setwrapperData
- the DataPairs object containing all the html or
text to wrap around the record datapublic final void init(UserStateObject user, String name)
public final DataPairs getDataWrappers(String name, Hashtable gadgetInfo, StyleTable displayGadget)
public String toString()
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |