User Tools

Site Tools


evergreen-admin:customization:cat

Managing MARC Templates

NOTE:

By default, MARC templates live under /openils/var/templates/marc and the only file installed by default is k_book.xml

To add additional templates, simply add them to this directory and make the necessary addition to opensrf.xml

Look for the section containing this:

<app_settings>
             <marctemplates>
                     <K_book>/openils/var/templates/marc/k_book.xml</K_book>

By looking at k_book.xml you'll see the file structure needed for the template. However, the tricky part is managing the spacing for your fixed field data.

One method is to locate an existing record in the database that already has the desired MARC structure, and use this for your template.

SELECT marc from biblio.record_entry where tcn_value='ABC123';
marc
----------------------------------------------------
 <marc:record xmlns="http://www.loc.gov/MARC21/slim" xmlns:marc="http://www.loc.gov MARC/slim">                                                                                         
   <leader>01571cam a2200409 a4500</leader>                                                                                                                                              
   <controlfield tag="001"/>                                                                                                                                                              
   <controlfield tag="005">20090228144931.0</controlfield>                                                                                                                                
   <controlfield tag="008">920728                       000 0</controlfield>                                                                                                              
   <datafield tag="010" ind1=" " ind2=" ">                                                                                                                                                
     <subfield code="a"/>                                                                                                                                                                 
   </datafield>                                                                                                                                                                           
   <datafield tag="020" ind1=" " ind2=" ">                                                                                                                                                
     <subfield code="a">9789042023703</subfield>                                                                                                                                          
   </datafield>                                                                                                                                                                           
   <datafield tag="100" ind1="" ind2=" ">                                                                                                                                                 
     <subfield code="a">Birken, Marcia</subfield>                                                                                                                                         
   </datafield>                                                                                                                                                                           
   <datafield tag="245" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a">Discovering patterns in mathematics and poetry</subfield>                                                                                                         
   </datafield>                                                                                                                                                                           
   <datafield tag="520" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a"/>                                                                                                                                                                 
   </datafield>                                                                                                                                                                           
   <datafield tag="599" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a">ILL</subfield>                                                                                                                                                    
   </datafield>                                                                                                                                                                           
   <datafield tag="599" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a">University of Oklahoma Libraries</subfield>                                                                                                                       
   </datafield>                                                                                                                                                                           
   <datafield tag="599" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a"/>                                                                                                                                                                 
   </datafield>                                                                                                                                                                           
   <datafield tag="599" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a"/>                                                                                                                                                                 
   </datafield>                                                                                                                                                                           
   <datafield tag="599" ind1="" ind2="">                                                                                                                                                  
     <subfield code="a"/>                                                                                                                                                                 
   </datafield>                                                                                                                                                                           
 </marc:record> 

Copy/Paste this XML into a new file, clear out the data specific to this record, and clean up any unwanted tag data. For instance, all that's needed is <record> and </record> to open and close the data, the xmlns data is not needed, nor is the "marc:" namespace that may or may not exist in the tags.

Most importantly, don't disturb the spacing of the <leader> which contains the fixed field information, as that was the primary purpose for using this method.

New templates require a restart of the Perl services to be utilized, and they are cached by the client on startup, so you'll need to close and reopen the client to use them.

Some consortia have shared their MARC templates:

evergreen-admin/customization/cat.txt · Last modified: 2018/11/12 09:18 by rjs7

© 2008-2017 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a member of Software Freedom Conservancy.