SiteSearch Formatting Classes: A Forum

OCLC SiteSearch User's Group Meeting
March 23, 1999
Larry Baerveldt (larry@incolsa.palni.edu)
Private Academic Network of Indiana

addGenericFieldHotLink base method

  /**
   *  

* Method for adding a hotlinked field whose MARC tag, subfield * or label may not fit within the predefined parameters set in * MarcArticleFmt.addSubject. This method works for both simple subject * and author headings, tag/one subfield (e.g. 650/1 or 100/1). *

*/ protected final void addGenericFieldHotLink(DataDir dir, boolean useLabel, boolean createHotLink, String fieldLabel, String fieldTag, String subfieldTag, String indexTag) { // concatenate the fieldTag and subfieldTag so they can be used as a unit String subjectField = fieldTag.concat("/"); subjectField = subjectField.concat(subfieldTag); if (fmtUtil.fieldsExist(dir, subjectField)) { if (useLabel) { fmtUtil.addText(labelMaker(fieldLabel)); } // end nested if String data; int currentFldid; Enumeration a, ab; DataDir abdir, adir; for (a = fmtUtil.fieldVector(dir, fieldTag).elements(); a.hasMoreElements();) { adir = (DataDir) a.nextElement(); if (adir == null) continue; currentFldid = adir.fldid(); // Now that we found a field, specify the subfields ab = fmtUtil.fieldVector(adir.subElement(), subfieldTag).elements(); for ( ; ab.hasMoreElements(); ) { abdir = (DataDir) ab.nextElement(); // we got data - make a hotlink and a displayable version of the data data = fmtUtil.asciiToLatin1(abdir); linkData = Diacritic.doHtmlDiacritics(data); if (createHotLink) { fmtUtil.addText(fmtUtil.MakeQueryHotLink("/WebZ/QUERY", indexTag, data, true, null, null, queryNext, queryBad, context, otherWidgets, queryTarget, linkData, subfieldTerminator)); } else { // oops no hotlink needed - just display it fmtUtil.addText(data); fmtUtil.addText(subfieldTerminator); } // end if-else } // end for loop fmtUtil.addText("
"); } // end for loop fmtUtil.addText(trailer); } // end if }

Previous    Top    Next


©1999 Larry R. Baerveldt/PALNI
Revised April 5, 1999