1 class RecordController < ApplicationController
7 @start = params[:start]
9 puts "back: " + @back if @back
10 conn = ZOOM::Connection.new
11 conn.connect("localhost", 9999)
12 conn.set_option('charset', 'UTF-8')
13 conn.preferred_record_syntax = 'MARC21'
14 conn.database_name = "zcc"
15 search_term = "@attr 1=1016 \"#{@data}\""
16 rset = conn.search(search_term)
18 record = ZCC.convert_char(rset[0])
19 #@title = record['245']['a']
23 marc_record = record.to_s
24 marc_record.gsub!("LEADER", "<br>LEADER")
25 @records_string = marc_record.gsub("\n", "<br>")
29 string = "<span id=\"title\">"
30 string += r['245']['a'].to_s + r['245']['b'].to_s + r['245']['c'].to_s + "</span>"
31 string += "<br /><br /> Published: " + r['260']['a'].to_s + r['260']['b'].to_s + r['260']['c'].to_s
32 string += "<br /><br /> Edition: " + r['250']['a'].to_s if r['250']
33 string += "<br /><br />Physical Description: " + r['300']['a'].to_s + r['300']['b'].to_s + r['300']['c'].to_s
34 string += "<br><br>ISBN: " + r['020']['a'].to_s if r['020']
35 fields = r.find_all{|f| f.tag == "650"}
36 string += "<br /><br />Subjects: <br/>" if fields.size > 0
39 f.each{|sf| subject << sf.value}
40 string += subject.join("--")
43 string += "<br /><br />" + r['505']['a'] if r['505']