This is an old revision of the document!
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
<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.
Now that you've gone through all that, it's worth noting that the Conifer project has a good number of templates available in their contributed SVN repository: http://svn.open-ils.org/trac/ILS-Contrib/browser/conifer/trunk/templates/marc