zcc 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +13 -0
- data/Manifest.txt +36 -1
- data/Rakefile +6 -1
- data/bin/zcc +98 -132
- data/{bin → examples}/linter.pl +0 -0
- data/examples/zcc.yaml +22 -10
- data/examples/zebra/README +2 -0
- data/examples/zebra/key/empty +1 -0
- data/examples/zebra/lock/empty +1 -0
- data/examples/zebra/records/examples/0.xml +1 -0
- data/examples/zebra/records/examples/1.xml +1 -0
- data/examples/zebra/records/examples/2.xml +1 -0
- data/examples/zebra/records/examples/3.xml +1 -0
- data/examples/zebra/records/examples/4.xml +1 -0
- data/examples/zebra/records/examples/5.xml +1 -0
- data/examples/zebra/records/examples/6.xml +1 -0
- data/examples/zebra/records/examples/7.xml +1 -0
- data/examples/zebra/records/examples/8.xml +1 -0
- data/examples/zebra/records/examples/9.xml +1 -0
- data/examples/zebra/register/empty +1 -0
- data/examples/zebra/shadow/empty +1 -0
- data/examples/zebra/tab/bib1.abs +151 -0
- data/examples/zebra/tab/bib1.att +151 -0
- data/examples/zebra/tab/default.idx +57 -0
- data/examples/zebra/tab/explain.abs +224 -0
- data/examples/zebra/tab/explain.att +27 -0
- data/examples/zebra/tab/explain.tag +175 -0
- data/examples/zebra/tab/gils.att +79 -0
- data/examples/zebra/tab/kohalis +1 -0
- data/examples/zebra/tab/numeric.chr +13 -0
- data/examples/zebra/tab/record.abs +66 -0
- data/examples/zebra/tab/sort-string-utf.chr +48 -0
- data/examples/zebra/tab/tagsetm.tag +35 -0
- data/examples/zebra/tab/usmarc.mar +3 -0
- data/examples/zebra/tab/word-phrase-utf.chr +41 -0
- data/examples/zebra/tmp/empty +1 -0
- data/examples/zebra/zebra.cfg +39 -0
- data/lib/zcc/marcadditions.rb +32 -10
- data/lib/zcc/pickers.rb +105 -29
- data/lib/zcc/subfieldeditor.rb +70 -0
- data/lib/zcc/version.rb +1 -1
- data/lib/zcc/zoomer.rb +72 -0
- data/website/index.html +1 -1
- data/website/koha.html +2 -2
- data/website/koha.txt +7 -5
- data/website/zcc.html +59 -31
- data/website/zcc.txt +52 -23
- data/website/zebra.html +80 -0
- data/website/zebra.txt +36 -0
- metadata +76 -6
data/lib/zcc/zoomer.rb
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
module ZCC
|
2
|
+
#main search method
|
3
|
+
def ZCC.zoomer(search_term, server, port, database )
|
4
|
+
puts "\n-------------------------------------\n#{server} #{port} #{database} \n"
|
5
|
+
|
6
|
+
conn = ZOOM::Connection.new
|
7
|
+
conn.connect(server, port) #do |conn|
|
8
|
+
conn.set_option('charset', 'UTF-8')
|
9
|
+
conn.preferred_record_syntax = 'MARC21'
|
10
|
+
conn.database_name = database
|
11
|
+
|
12
|
+
# Determines kind of search and creates query
|
13
|
+
full_search = ''
|
14
|
+
if search_term =~ /\d+-\d+/
|
15
|
+
search_term = ZCC.lccn_conversion(search_term)
|
16
|
+
puts "converted lccn to #{search_term}"
|
17
|
+
full_search = "@attr 1=9 #{search_term}"
|
18
|
+
elsif search_term =~ /\d+[X||\d]/ and !(search_term.match( /[a-wyz]/i ))
|
19
|
+
puts "Searching for ISBN: #{search_term}"
|
20
|
+
full_search = "@attr 1=7 #{search_term}"
|
21
|
+
elsif ( search_term[/[a-z]/i] ) #-- This check for a string could be better!
|
22
|
+
puts "searching for title:#{search_term}"
|
23
|
+
search_term = "\'#{search_term}\'"
|
24
|
+
full_search = "@attr 1=4 \"#{search_term}\""
|
25
|
+
else
|
26
|
+
puts "What is this search? Does not compute."
|
27
|
+
exit
|
28
|
+
end
|
29
|
+
|
30
|
+
#conducts search
|
31
|
+
rset = conn.search(full_search)
|
32
|
+
if ( rset.length == 0)
|
33
|
+
return nil
|
34
|
+
end
|
35
|
+
puts "Number of results: #{rset.length}"
|
36
|
+
#Grabs only as many records as are set to be shown
|
37
|
+
rset_recs = rset[0,TO_SHOW]
|
38
|
+
|
39
|
+
|
40
|
+
# Turns result set into MARC::Record objects which are returned
|
41
|
+
xmlrecs = ''
|
42
|
+
rset_recs.each do |rsetrec|
|
43
|
+
#puts rsetrec
|
44
|
+
xmlrec = ZCC.convert_char(rsetrec)
|
45
|
+
xmlrecs += xmlrec
|
46
|
+
end
|
47
|
+
return records = MARC::XMLReader.new(StringIO.new(string=xmlrecs))
|
48
|
+
|
49
|
+
rescue Exception => except
|
50
|
+
puts "Error! #{except}"
|
51
|
+
return nil
|
52
|
+
end
|
53
|
+
|
54
|
+
# Tests leader of MARC21 records for character encoding
|
55
|
+
# If leader position 9 is ' ' then convert to UTF-8.
|
56
|
+
# If leader position 9 is 'a' then the record is already UTF-8.
|
57
|
+
# Finally converts to xml
|
58
|
+
def ZCC.convert_char rsetrec
|
59
|
+
rec = MARC::Record.new_from_marc(rsetrec.raw)
|
60
|
+
ldr9 = rec.leader[9, 1]
|
61
|
+
return_rec = ''
|
62
|
+
if ldr9 == ' '
|
63
|
+
return_rec = rsetrec.xml('MARC-8', 'UTF-8')
|
64
|
+
elsif ldr9 == 'a'
|
65
|
+
return_rec = rsetrec.xml
|
66
|
+
else
|
67
|
+
raise "Invalid value in leader 9 for MARC21"
|
68
|
+
end
|
69
|
+
return_rec
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>zcc projects</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/zcc"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.3</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘zcc’</h1>
|
39
39
|
|
data/website/koha.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>Using Koha with zcc</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/zcc"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.3</a>
|
37
37
|
</div>
|
38
38
|
<p><a href="http://www.koha.org">Koha</a> + <a href="http://zcc.rubyforge.org/zcc.html">zcc</a></p>
|
39
39
|
|
@@ -53,7 +53,7 @@
|
|
53
53
|
</ol>
|
54
54
|
|
55
55
|
<ol>
|
56
|
-
<li>Make sure the Koha modules are a part of your path. I accomplish this by adding “export <span class="caps">
|
56
|
+
<li>Make sure the Koha modules are a part of your path. I accomplish this by adding “export <span class="caps">PERL5LIB</span>=/usr/local/koha/intranet/modules” without the quotes to your .bashrc (or add the path to /etc/profile for the root user).</li>
|
57
57
|
</ol>
|
58
58
|
|
59
59
|
<ol>
|
data/website/koha.txt
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
h1. Using Koha with zcc
|
2
2
|
|
3
|
-
"Koha":http://www.koha.org + "zcc":
|
3
|
+
"Koha":http://www.koha.org + "zcc":wzcc
|
4
4
|
|
5
5
|
h2. Hints
|
6
6
|
|
7
|
-
# Follow all the directions on the "main zcc page":
|
7
|
+
# Follow all the directions on the "main zcc page":wzcc carefully. Please let me know if you run into problems with configuration.
|
8
8
|
|
9
|
-
# "zcc":
|
9
|
+
# "zcc":wzcc is *not* a part of Koha and is not developed by the same folks.
|
10
10
|
|
11
|
-
# "zcc":
|
11
|
+
# "zcc":wzcc only creates utf-8 encoded records. If you want marc-8 encoded records you're on your own. MARC-8 encoding has already caused enough problems in this world, so I encourage folks to move to UTF-8 ASAP. If you use a different encoding that you want supported, please let me know. To set up Koha properly for dealing with utf-8 encoded records see "this wiki page":http://wiki.koha.org/doku.php?id=encodingscratchpad&s=utf8
|
12
12
|
|
13
|
-
# Make sure the Koha modules are a part of your path. I accomplish this by adding "export
|
13
|
+
# Make sure the Koha modules are a part of your path. I accomplish this by adding "export PERL5LIB=/usr/local/koha/intranet/modules" without the quotes to your .bashrc (or add the path to /etc/profile for the root user).
|
14
14
|
|
15
15
|
# You can then have a choice on how to get the records into koha:
|
16
16
|
|
@@ -26,3 +26,5 @@ h2. Hints
|
|
26
26
|
h1. Contact
|
27
27
|
|
28
28
|
I use zcc and Koha for my own work. So I'm very interested in making zcc work better with Koha. Please send your comments, suggestions and patches to "Jason Ronallo":mailto:jronallo+zcc@gmail.com
|
29
|
+
|
30
|
+
[wzcc]http://zcc.rubyforge.org/zcc.html
|
data/website/zcc.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>zcc</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/zcc"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.3</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘zcc’</h1>
|
39
39
|
|
@@ -44,17 +44,59 @@
|
|
44
44
|
|
45
45
|
<h1><strong>THIS IS <em>alpha</em> SOFTWARE. <span class="caps">IT MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG</span>.</strong></h1>
|
46
46
|
|
47
|
-
<h2>
|
47
|
+
<h2>Requirements</h2>
|
48
|
+
|
49
|
+
<p><a href="http://ruby-lang.org/">Ruby</a> 1.8</p>
|
50
|
+
|
51
|
+
|
52
|
+
<p><a href="http://www.indexdata.dk/yaz/">YAZ</a> I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. <del>From a footnote to ruby-zoom: If you build from source, make sure you pass the—enable-shared option to the configure script before building <span class="caps">YAZ</span>, by default it does not build shared libraries required by Ruby/ZOOM.</del></p>
|
53
|
+
|
54
|
+
|
55
|
+
<h3>Gems</h3>
|
56
|
+
|
57
|
+
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline</pre>
|
58
|
+
<p><a href="http://www.textualize.com/ruby_marc">ruby-marc</a></p>
|
59
|
+
|
60
|
+
|
61
|
+
<p><strong>nix? Zcc has only been tested on Linux (Debian Etch). It may work under other operating systems. Feedback is appreciated on how it functions under other operating systems. I’m willing to try to make it work if there is enough interest.</p>
|
62
|
+
|
63
|
+
|
64
|
+
<p>The gems bin folder must be added to your <span class="caps">PATH</span>. For me it is /var/lib/gems/1.8.bin</p>
|
65
|
+
|
48
66
|
|
49
|
-
<pre syntax="ruby">sudo gem install zcc</pre>
|
50
67
|
<h2>Repository</h2>
|
51
68
|
|
52
|
-
<p>
|
69
|
+
<p>A new gem is super easy to release to rubyforge, so expect that the gem on rubyforge is up-to-date for working features, though not necessarily for small changes. If you want to build the gem yourself, it will also be super easy once you set things up.</p>
|
70
|
+
|
71
|
+
|
72
|
+
<p>To make sure you have all the dependencies needed to build the gem:</p>
|
73
|
+
|
74
|
+
|
75
|
+
<pre syntax="ruby">$ sudo gem install newgem --include-dependencies</pre>
|
76
|
+
<p>Grab the latest from the svn repository:</p>
|
77
|
+
|
78
|
+
|
79
|
+
<pre syntax="ruby">$ svn co svn://208.78.97.122/zcc</pre>
|
80
|
+
<p>To build and install the gem as a user most easily, the user must be added to the sudoers list. On my system I do this by running visudo as root. For more information on sudoers and possible settings that may be more secure consult: <a href="http://www.gratisoft.us/sudo/man/sudoers.html">Sudoers Manual</a></p>
|
81
|
+
|
82
|
+
|
83
|
+
<p>You can add the following lines using visudo:</p>
|
53
84
|
|
54
85
|
|
86
|
+
<pre syntax="ruby">Cmnd_Alias GEM=/usr/bin/gem
|
87
|
+
user ALL=GEM</pre>
|
88
|
+
<p>Now as a user you can build and install the gem on your own system:</p>
|
89
|
+
|
90
|
+
|
91
|
+
<pre syntax="ruby">$ cd zcc
|
92
|
+
$ rake local_deploy</pre>
|
93
|
+
<p>For more tasks take a look at the output of:</p>
|
94
|
+
|
95
|
+
|
96
|
+
<pre syntax="ruby">$ rake -T </pre>
|
55
97
|
<h2>Features</h2>
|
56
98
|
|
57
|
-
<p><
|
99
|
+
<p></strong><span class="caps">Z39</span>.50 search for records.* Configure Zcc for as many targets as you like in order of preference. A relatively current list of targets is provided based on the targettest list. If you find the perfect record with the first target other targets do not have to be searched.</p>
|
58
100
|
|
59
101
|
|
60
102
|
<p><strong>Search by Title or <span class="caps">ISBN</span></strong> Currently two searches are supported. From the same prompt you may search either by Title or <span class="caps">ISBN</span>. For a search of the Library of Congress you may also search by Library of Congress Card Number.</p>
|
@@ -81,6 +123,9 @@
|
|
81
123
|
<p><strong>Output to <span class="caps">CSV</span> file.</strong> Want to print labels or keep statistics? Zcc allows you to choose which subfields you would like to export into a <span class="caps">CSV</span> file. Programs like glabels can accept <span class="caps">CSV</span> files for custom labelmaking. <span class="caps">CSV</span> files can also be imported into spreadsheet programs like OpenOffice Calc or Excel. If a value is not found for a particular field Zcc will prompt the user for input, which can be blank.</p>
|
82
124
|
|
83
125
|
|
126
|
+
<p><strong>Light editing of subfields</strong> Since version 0.0.3 there is a facility for editing subfields. Have you found a good record but one or two subfields are different than the item you have in hand? You can still accept the record and make small edits of existing subfields. It allows you to pick the subfield you want to edit when there are repeatable fields and subfields. Not a replacement for a <span class="caps">MARC</span> editor, but for copy cataloging probably good enough in many cases. Still lacking some features like timestamp change.</p>
|
127
|
+
|
128
|
+
|
84
129
|
<h2>Configuration</h2>
|
85
130
|
|
86
131
|
<p>Because of all the scripting and csv features zcc requires a lot of configuration. Currently the configuration files are my own. I use them and they work for my purposes, but they will not work for yours. Once you have configured zcc, though, you should be copy cataloging much faster.</p>
|
@@ -92,7 +137,7 @@
|
|
92
137
|
<pre syntax="ruby">cp /var/lib/gems/1.8/gems/zcc-0.0.1/examples/zcc.yaml
|
93
138
|
~/.zcc/zcc.yaml</pre>
|
94
139
|
One line; that’s what I do.
|
95
|
-
<p>To get the program running right away also create a file called zoomer-iterator.txt and place
|
140
|
+
<p>To get the program running right away also create a file called zoomer-iterator.txt, put any number in it, and place the file in .zcc as well. I use this to create item numbers and barcodes.</p>
|
96
141
|
|
97
142
|
|
98
143
|
<h2>Use</h2>
|
@@ -109,18 +154,21 @@ One line; that’s what I do.
|
|
109
154
|
<li>Zcc command line<ul>
|
110
155
|
<li>Key in a number and hit Enter to select a record into your own set.</li>
|
111
156
|
<li>Key ’s’ followed by a number to see the result. For instance ‘s3’ would show you the full <span class="caps">MARC</span> for the 3rd record.</li>
|
112
|
-
<li>To compare two records enter ‘c
|
157
|
+
<li>To compare two records enter ‘c#–#’. For instance ‘c5–3’ would compare record 5 to record 3. Matches are shown with ‘m’ at the beginning of a line. The first record is denoted with a ’+’ and the second with a minus sign.</li>
|
113
158
|
<li>Enter ‘n’ to go to the next ztarget.</li>
|
114
|
-
<li>Enter ‘d’ if you are done selecting records. This will skip
|
159
|
+
<li>Enter ‘d’ if you are done selecting records. This will skip the rest of the ztargets.</li>
|
160
|
+
<li>If you have the linter turned on (and Perl modules instaled) ‘l#’ will give any <span class="caps">USMARC</span> errors such as incorrect indicators for a particular field.</li>
|
161
|
+
<li>Once you select a final records it goes through scripting and csv creation if those are turned on.</li>
|
162
|
+
<li>You are then prompted to conduct a new search.</li>
|
115
163
|
</ul></li>
|
116
164
|
</ol>
|
117
165
|
|
118
166
|
<h2>TODO</h2>
|
119
167
|
|
120
|
-
<p><strong>Smart character set conversion</strong> Currently incoming records are assumed to be
|
168
|
+
<p><del><strong>Smart character set conversion</strong> Currently incoming records are assumed to be marc8 and are converted to utf8. This is complex. Let me know what you need here.</del> v. 0.0.3 checks leader byte 9 for character encoding and either keeps it as <span class="caps">UTF8</span> or convert from <span class="caps">MARC8</span> to <span class="caps">UTF8</span></p>
|
121
169
|
|
122
170
|
|
123
|
-
<p><strong>TUI</strong> If there is interest in this script, I’m hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal
|
171
|
+
<p><strong>TUI</strong> If there is interest in this script, I’m hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal. Since v. 0.0.3 there are some nicer <span class="caps">TUI</span> elements like highlighting</p>
|
124
172
|
|
125
173
|
|
126
174
|
<p><strong>Automatic retrieval of authority records.</strong> I already have a separate script in the works that can retrieve authority records for names (not subjects). I’d like to work that as an option into the main script.</p>
|
@@ -141,27 +189,7 @@ One line; that’s what I do.
|
|
141
189
|
<p>Create full <strong>rdoc documentation</strong>.</p>
|
142
190
|
|
143
191
|
|
144
|
-
<
|
145
|
-
|
146
|
-
<p><a href="http://ruby-lang.org/">Ruby</a> 1.8+ I’m not completely sure what versions of Ruby will work.</p>
|
147
|
-
|
148
|
-
|
149
|
-
<p><a href="http://www.indexdata.dk/yaz/">YAZ</a> I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. From a footnote to ruby-zoom: If you build from source, make sure you pass the—enable-shared option to the configure script before building <span class="caps">YAZ</span>, by default it does not build shared libraries required by Ruby/ZOOM.</p>
|
150
|
-
|
151
|
-
|
152
|
-
<p><a href="http://ruby-zoom.rubyforge.org/">ruby-zoom</a> Follow the instructions to install. Hopefully there will be a gem soon. To compile ruby1.8-dev must be installed.</p>
|
153
|
-
|
154
|
-
|
155
|
-
<p><a href="http://www.textualize.com/ruby_marc">ruby-marc</a> This one’s easy. As long as you have rubygems installed just issue the command: gem install marc</p>
|
156
|
-
|
157
|
-
|
158
|
-
<p>*nix? Zcc has only been tested on Linux (Debian Etch). It may work under other operating systems. Feedback is appreciated on how it functions under other operating systems. I’m willing to try to make it work if there is interest.</p>
|
159
|
-
|
160
|
-
|
161
|
-
<p>gem install unicode</p>
|
162
|
-
|
163
|
-
|
164
|
-
<p>The gems bin folder must be added to your <span class="caps">PATH</span>. For me it is /var/lib/gems/1.8.bin</p>
|
192
|
+
<p><strong>Subfield Editing</strong> <del>Allow subfield editing to take place in vim buffer?</del> As of 0.0.3 subfield editing is available though not well tested. Readline allows for nice editing. Still to do: Change the timestamp automatically and allow for adding subfields like 040d upon modification.</p>
|
165
193
|
|
166
194
|
|
167
195
|
<h2>Suggestions</h2>
|
data/website/zcc.txt
CHANGED
@@ -8,13 +8,51 @@ Z Copy Cataloging is a command line tool written in Ruby to make your MARC recor
|
|
8
8
|
|
9
9
|
h1. *THIS IS _alpha_ SOFTWARE. IT MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG.*
|
10
10
|
|
11
|
-
h2.
|
11
|
+
h2. Requirements
|
12
|
+
|
13
|
+
"Ruby":http://ruby-lang.org/ 1.8
|
14
|
+
|
15
|
+
"YAZ":http://www.indexdata.dk/yaz/ I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. -From a footnote to ruby-zoom: If you build from source, make sure you pass the --enable-shared option to the configure script before building YAZ, by default it does not build shared libraries required by Ruby/ZOOM.-
|
16
|
+
|
17
|
+
h3. Gems
|
18
|
+
|
19
|
+
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline</pre>
|
20
|
+
|
21
|
+
"ruby-marc":http://www.textualize.com/ruby_marc
|
22
|
+
|
23
|
+
*nix? Zcc has only been tested on Linux (Debian Etch). It may work under other operating systems. Feedback is appreciated on how it functions under other operating systems. I'm willing to try to make it work if there is enough interest.
|
24
|
+
|
25
|
+
The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8.bin
|
12
26
|
|
13
|
-
<pre syntax="ruby">sudo gem install zcc</pre>
|
14
27
|
|
15
28
|
h2. Repository
|
16
29
|
|
17
|
-
|
30
|
+
A new gem is super easy to release to rubyforge, so expect that the gem on rubyforge is up-to-date for working features, though not necessarily for small changes. If you want to build the gem yourself, it will also be super easy once you set things up.
|
31
|
+
|
32
|
+
To make sure you have all the dependencies needed to build the gem:
|
33
|
+
|
34
|
+
<pre syntax="ruby">$ sudo gem install newgem --include-dependencies</pre>
|
35
|
+
|
36
|
+
Grab the latest from the svn repository:
|
37
|
+
|
38
|
+
<pre syntax="ruby">$ svn co svn://208.78.97.122/zcc</pre>
|
39
|
+
|
40
|
+
To build and install the gem as a user most easily, the user must be added to the sudoers list. On my system I do this by running visudo as root. For more information on sudoers and possible settings that may be more secure consult: "Sudoers Manual":http://www.gratisoft.us/sudo/man/sudoers.html
|
41
|
+
|
42
|
+
You can add the following lines using visudo:
|
43
|
+
|
44
|
+
<pre syntax="ruby">Cmnd_Alias GEM=/usr/bin/gem
|
45
|
+
user ALL=GEM</pre>
|
46
|
+
|
47
|
+
Now as a user you can build and install the gem on your own system:
|
48
|
+
|
49
|
+
<pre syntax="ruby">$ cd zcc
|
50
|
+
$ rake local_deploy</pre>
|
51
|
+
|
52
|
+
For more tasks take a look at the output of:
|
53
|
+
|
54
|
+
<pre syntax="ruby">$ rake -T </pre>
|
55
|
+
|
18
56
|
|
19
57
|
h2. Features
|
20
58
|
|
@@ -36,6 +74,8 @@ h2. Features
|
|
36
74
|
|
37
75
|
*Output to CSV file.* Want to print labels or keep statistics? Zcc allows you to choose which subfields you would like to export into a CSV file. Programs like glabels can accept CSV files for custom labelmaking. CSV files can also be imported into spreadsheet programs like OpenOffice Calc or Excel. If a value is not found for a particular field Zcc will prompt the user for input, which can be blank.
|
38
76
|
|
77
|
+
*Light editing of subfields* Since version 0.0.3 there is a facility for editing subfields. Have you found a good record but one or two subfields are different than the item you have in hand? You can still accept the record and make small edits of existing subfields. It allows you to pick the subfield you want to edit when there are repeatable fields and subfields. Not a replacement for a MARC editor, but for copy cataloging probably good enough in many cases. Still lacking some features like timestamp change.
|
78
|
+
|
39
79
|
h2. Configuration
|
40
80
|
|
41
81
|
Because of all the scripting and csv features zcc requires a lot of configuration. Currently the configuration files are my own. I use them and they work for my purposes, but they will not work for yours. Once you have configured zcc, though, you should be copy cataloging much faster.
|
@@ -47,7 +87,7 @@ All of the configuration (as of 0.0.2) is looked for in the user's home director
|
|
47
87
|
~/.zcc/zcc.yaml</pre>
|
48
88
|
One line; that's what I do.
|
49
89
|
|
50
|
-
To get the program running right away also create a file called zoomer-iterator.txt and place
|
90
|
+
To get the program running right away also create a file called zoomer-iterator.txt, put any number in it, and place the file in .zcc as well. I use this to create item numbers and barcodes.
|
51
91
|
|
52
92
|
h2. Use
|
53
93
|
|
@@ -62,15 +102,18 @@ $ zcc
|
|
62
102
|
|
63
103
|
* Key in a number and hit Enter to select a record into your own set.
|
64
104
|
* Key 's' followed by a number to see the result. For instance 's3' would show you the full MARC for the 3rd record.
|
65
|
-
* To compare two records enter 'c
|
105
|
+
* To compare two records enter 'c#–#'. For instance 'c5–3' would compare record 5 to record 3. Matches are shown with 'm' at the beginning of a line. The first record is denoted with a '+' and the second with a minus sign.
|
66
106
|
* Enter 'n' to go to the next ztarget.
|
67
|
-
* Enter 'd' if you are done selecting records. This will skip
|
107
|
+
* Enter 'd' if you are done selecting records. This will skip the rest of the ztargets.
|
108
|
+
* If you have the linter turned on (and Perl modules instaled) 'l#' will give any USMARC errors such as incorrect indicators for a particular field.
|
109
|
+
* Once you select a final records it goes through scripting and csv creation if those are turned on.
|
110
|
+
* You are then prompted to conduct a new search.
|
68
111
|
|
69
112
|
h2. TODO
|
70
113
|
|
71
|
-
|
114
|
+
-*Smart character set conversion* Currently incoming records are assumed to be marc8 and are converted to utf8. This is complex. Let me know what you need here.- v. 0.0.3 checks leader byte 9 for character encoding and either keeps it as UTF8 or convert from MARC8 to UTF8
|
72
115
|
|
73
|
-
*TUI* If there is interest in this script, I'm hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal.
|
116
|
+
*TUI* If there is interest in this script, I'm hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal. Since v. 0.0.3 there are some nicer TUI elements like highlighting
|
74
117
|
|
75
118
|
*Automatic retrieval of authority records.* I already have a separate script in the works that can retrieve authority records for names (not subjects). I'd like to work that as an option into the main script.
|
76
119
|
|
@@ -84,21 +127,7 @@ h2. TODO
|
|
84
127
|
|
85
128
|
Create full *rdoc documentation*.
|
86
129
|
|
87
|
-
|
88
|
-
|
89
|
-
"Ruby":http://ruby-lang.org/ 1.8+ I'm not completely sure what versions of Ruby will work.
|
90
|
-
|
91
|
-
"YAZ":http://www.indexdata.dk/yaz/ I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. From a footnote to ruby-zoom: If you build from source, make sure you pass the --enable-shared option to the configure script before building YAZ, by default it does not build shared libraries required by Ruby/ZOOM.
|
92
|
-
|
93
|
-
"ruby-zoom":http://ruby-zoom.rubyforge.org/ Follow the instructions to install. Hopefully there will be a gem soon. To compile ruby1.8-dev must be installed.
|
94
|
-
|
95
|
-
"ruby-marc":http://www.textualize.com/ruby_marc This one's easy. As long as you have rubygems installed just issue the command: gem install marc
|
96
|
-
|
97
|
-
*nix? Zcc has only been tested on Linux (Debian Etch). It may work under other operating systems. Feedback is appreciated on how it functions under other operating systems. I'm willing to try to make it work if there is interest.
|
98
|
-
|
99
|
-
gem install unicode
|
100
|
-
|
101
|
-
The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8.bin
|
130
|
+
*Subfield Editing* -Allow subfield editing to take place in vim buffer?- As of 0.0.3 subfield editing is available though not well tested. Readline allows for nice editing. Still to do: Change the timestamp automatically and allow for adding subfields like 040d upon modification.
|
102
131
|
|
103
132
|
h2. Suggestions
|
104
133
|
|
data/website/zebra.html
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<title>
|
8
|
+
Very simple setup of local zebra server
|
9
|
+
</title>
|
10
|
+
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
+
<style>
|
12
|
+
|
13
|
+
</style>
|
14
|
+
<script type="text/javascript">
|
15
|
+
window.onload = function() {
|
16
|
+
settings = {
|
17
|
+
tl: { radius: 10 },
|
18
|
+
tr: { radius: 10 },
|
19
|
+
bl: { radius: 10 },
|
20
|
+
br: { radius: 10 },
|
21
|
+
antiAlias: true,
|
22
|
+
autoPad: true,
|
23
|
+
validTags: ["div"]
|
24
|
+
}
|
25
|
+
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
+
versionBox.applyCornersToAll();
|
27
|
+
}
|
28
|
+
</script>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="main">
|
32
|
+
|
33
|
+
<h1>Very simple setup of local zebra server</h1>
|
34
|
+
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/zcc"; return false'>
|
35
|
+
<p>Get Version</p>
|
36
|
+
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.0.3</a>
|
37
|
+
</div>
|
38
|
+
<p>These instructions are probably incomplete for this release. Please let me know if you find errors.</p>
|
39
|
+
|
40
|
+
|
41
|
+
<p>install all the dependencies to zcc and confirm that it is working</p>
|
42
|
+
|
43
|
+
|
44
|
+
<p>install <a href="http://www.indexdata.dk/zebra/">zebra</a> If using Debian or RedHat it is suggested that you add the indexdata repositories.</p>
|
45
|
+
|
46
|
+
|
47
|
+
<pre syntax="ruby">
|
48
|
+
$ cd ~/.zcc
|
49
|
+
$ cp -r /var/lib/gems/1.8/gems/zcc-0.0.3/examples/zebra .
|
50
|
+
$ cd zebra
|
51
|
+
$ zebraidx update ~/.zcc/zebra/records
|
52
|
+
$ zebrasrv &
|
53
|
+
$ yaz-client localhost:9999/zcc
|
54
|
+
Z> f @attr 1=4 theology
|
55
|
+
Z> show 1
|
56
|
+
</pre>
|
57
|
+
<p>You may want to open up a different terminal as zebrasrv (the server) will output messages to the terminal when you search it.</p>
|
58
|
+
|
59
|
+
|
60
|
+
<p>If you see a record displayed then it works! Congratulations.</p>
|
61
|
+
|
62
|
+
|
63
|
+
now you can configure your local zserver in the zcc.yaml file in ~/.zcc. Add (or uncomment) this line:
|
64
|
+
<pre>- [localhost, 9999, zcc]</pre>
|
65
|
+
<p>When you want to add records to the zebra database you will need to return to your ~/.zcc/zebra directory and reindex the whole bunk of records. Just drop marcxml records anywhere in the directory below ~/.zcc/zebra/records and they will be indexed. To make this the default place to save records choose ‘zebra’ under save_record_syntax in zcc.yaml. This reindexing could take some time, especially if you have a large number of files. We would like to add extended services for record insert and update to ruby-zoom (complete the <span class="caps">ZOOM C</span>-binding) so please let me know if you’re a developer willing to do the work (<a href="mailto:jronallo+zoom@gmail.com">jronallo+zoom@gmail.com</a>). But for now you’ll have to do it the slow way:</p>
|
66
|
+
|
67
|
+
|
68
|
+
<pre syntax="ruby">$ cd ~/.zcc/zebra
|
69
|
+
$ zebraidx update ~/.zcc/zebra/records</pre>
|
70
|
+
<p>If you shutdown your computer make sure to restart the zebrasrv!</p>
|
71
|
+
|
72
|
+
|
73
|
+
<p>If port 9999, the default zebrasrv port is exposed to the world, others will be able to search your database as well. You may find this a good thing :) or it may be a security risk?</p>
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<!-- insert site tracking codes here, like Google Urchin -->
|
78
|
+
|
79
|
+
</body>
|
80
|
+
</html>
|