Main -> Support Zone -> Technical Support Base -> add856 Method Example

add856 Method Example

add856 Method Example

// Method to format MARC 856 field 
    protected final void add856(DataDir dir, 
                                boolean addMailToLink) {
 
    Vector url_vector;
    DataDir urlDir;
    String str;
    int i;

    // Creating a vector to hold subfield information
    url_vector=fmtUtil.fieldVector(dir, "856/*");

    // If the 856 field exists, label it
    if(url_vector.size()!=0){
      fmtUtil.addText(labelMaker("Electronic Access"));

      // The for loop and case statement are used to
      // label and display each subfield
      for (i=0;i<url_vector.size();i++){
          str=null;
          urlDir=(DataDir)url_vector.elementAt(i);
          switch (urlDir.fldid()){
          case 1:
            str="<i> Host Name: </i>";
            break;
          case 2:
            str="<i> Access Number: </i>";
            break;
          case 3:
            str="<i> Compression Information: </i>";
            break;
          case 4:
            str="<i> Path: </i>";
            break;
          case 6:
            str="<i> Electronic Name: </i>";
            break;
          case 7:
            str="<i> Uniform Resource Name: </i>";
            break;
          case 8:
            str="<i> Processor of Request: </i>";
            break;
          case 9:
            str="<i> Instruction: </i>";
            break;
          case 10:
            str="<i> Bits per second: </i>";
            break;
          case 11:
            str="<i> Password: </i>";
            break;
          case 12:
            str="<i> Logon: </i>";
            break;
          case 13:
            if(addMailToLink){
            // The following will create an email hotlink for NetFirst
            // records if 'addMailToLink' is set to 'true'.
                str="<i> Contact for Access Assistance: </i><a href=mailto:" + urlDir.stringData() + ">";
                break;}
            else {
                str="<i> Contact for Access Assistance: </i>";
                break;}
          case 14:
            str="<i> Name of Location of Host Name: </i>";
            break;
          case 15:
            str="<i> Operating System: </i>";
            break;
          case 16:
            str="<i> Port: </i>";
            break;
          case 17:
            str="<i> Electronic Format Type:: </i>";
            break;
          case 18:
            str="<i> Settings: </i>";
            break;
          case 19:
            str="<i> File Size: </i>";
            break;
          case 20:
            str="<i> Terminal Emulation: </i>";
            break;
          case 21:
            // The following string will display the selected URL
            // in the target defined in the current style.
            // e.g., In SS 4.0.1 'defaultStyle.ini',
            //         "recordDisplay = target="workframe"

            str="<a href=" + urlDir.stringData() + "&StyleTable.targets.recordDisply;>";

            // The following string will create a new Web
            // browser window to display the selected URL.
            // str="<a href=" + urlDir.stringData() + " TARGET=NEW>";

            break;
          case 22:
            str="<i> Hours Access Method Available: </i>";
            break;
          case 23:
            str="<i> Record Control Number: </i>";
            break;
          case 24:
            str="<i> Nonpublic Note: </i>";
            break;
          case 26:
            str="<i> Public Note: </i>";
            break;
          case 29:
            str="<i> Access Method: </i>";
            break;
          case 30:
            str="<i> Materials Specified: </i>";
            break;
          default:
            str=null;
             }
          if (str != null){

            // Label the subfield
            fmtUtil.addText(str);

            // Display the subfield data
            fmtUtil.addText(urlDir.stringData());

            // Add the ending anchor if a hotlink
         if (urlDir.fldid()== 21 || addMailToLink){
             fmtUtil.addText("</a><br>");
             }
         else {

             // Place each subfield on a separate line
             fmtUtil.addText("<br>");
             }
         }
       }
     }
   }


References

Adding MARC 856 to a Formatted Record Display
Technical Support Base
Product Support FAQ


[Main][Documentation][Support][Technical Reference][Glossary][Search]