zcc 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +15 -0
- data/Manifest.txt +12 -19
- data/Rakefile +2 -1
- data/bin/zcc +228 -202
- data/examples/zcc.yaml +21 -12
- data/examples/zebra/{register/empty → key/remove_me} +1 -1
- data/examples/zebra/{key/empty → lock/remove_me} +1 -1
- data/examples/zebra/records/0.mrc +1 -0
- data/examples/zebra/{lock/empty → register/remove_me} +1 -1
- data/examples/zebra/tab/marc21.abs +67 -0
- data/examples/zebra/tab/record.abs +1 -0
- data/examples/zebra/zebra.cfg +2 -2
- data/examples/zservers.yaml +869 -0
- data/lib/zcc.rb +8 -0
- data/lib/zcc/ansicolorz.rb +26 -0
- data/lib/zcc/cli_display.rb +461 -0
- data/lib/zcc/query.rb +183 -0
- data/lib/zcc/record.rb +265 -0
- data/lib/zcc/resultset.rb +169 -0
- data/lib/zcc/version.rb +2 -2
- data/lib/zcc/zoomer.rb +16 -2
- data/lib/zcc/zserver.rb +38 -0
- data/website/index.html +1 -1
- data/website/koha.html +18 -10
- data/website/koha.txt +13 -8
- data/website/zcc.html +35 -33
- data/website/zcc.txt +30 -32
- data/website/zebra.html +57 -15
- data/website/zebra.txt +56 -15
- metadata +23 -21
- data/examples/zebra/README +0 -2
- data/examples/zebra/records/examples/0.xml +0 -1
- data/examples/zebra/records/examples/1.xml +0 -1
- data/examples/zebra/records/examples/2.xml +0 -1
- data/examples/zebra/records/examples/3.xml +0 -1
- data/examples/zebra/records/examples/4.xml +0 -1
- data/examples/zebra/records/examples/5.xml +0 -1
- data/examples/zebra/records/examples/6.xml +0 -1
- data/examples/zebra/records/examples/7.xml +0 -1
- data/examples/zebra/records/examples/8.xml +0 -1
- data/examples/zebra/records/examples/9.xml +0 -1
- data/examples/zebra/shadow/empty +0 -1
- data/examples/zebra/tab/kohalis +0 -1
- data/examples/zebra/tmp/empty +0 -1
- data/lib/zcc/marcadditions.rb +0 -221
- data/lib/zcc/pickers.rb +0 -176
data/lib/zcc/version.rb
CHANGED
data/lib/zcc/zoomer.rb
CHANGED
@@ -55,14 +55,28 @@ module ZCC
|
|
55
55
|
# If leader position 9 is ' ' then convert to UTF-8.
|
56
56
|
# If leader position 9 is 'a' then the record is already UTF-8.
|
57
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
|
+
|
58
72
|
def ZCC.convert_char rsetrec
|
59
73
|
rec = MARC::Record.new_from_marc(rsetrec.raw)
|
60
74
|
ldr9 = rec.leader[9, 1]
|
61
75
|
return_rec = ''
|
62
76
|
if ldr9 == ' '
|
63
|
-
return_rec = rsetrec.
|
77
|
+
return_rec = rsetrec.raw('MARC-8', 'UTF-8')
|
64
78
|
elsif ldr9 == 'a'
|
65
|
-
return_rec = rsetrec.
|
79
|
+
return_rec = rsetrec.raw
|
66
80
|
else
|
67
81
|
raise "Invalid value in leader 9 for MARC21"
|
68
82
|
end
|
data/lib/zcc/zserver.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module ZCC
|
2
|
+
class Zserver
|
3
|
+
attr_reader :host, :port, :database
|
4
|
+
attr_accessor :group, :explain, :options
|
5
|
+
|
6
|
+
def initialize(host, port, database, group=0, options={'charset'=>'UTF-8'}, *args)
|
7
|
+
@host = host
|
8
|
+
@port = port
|
9
|
+
@database = database
|
10
|
+
@group = group
|
11
|
+
@options = options
|
12
|
+
@user, @password = args
|
13
|
+
end
|
14
|
+
|
15
|
+
#create a REXML object representation of the explain document
|
16
|
+
#def explain=(xml)
|
17
|
+
|
18
|
+
#end
|
19
|
+
|
20
|
+
#is this how you create a singleton?
|
21
|
+
#def explain.something
|
22
|
+
|
23
|
+
#end
|
24
|
+
|
25
|
+
|
26
|
+
#other explain information
|
27
|
+
def get_explain #uses irspy?
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_s
|
32
|
+
"#{self.host}:#{self.port}/#{self.database}"
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
end
|
38
|
+
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.1.0</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.1.0</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
|
|
@@ -49,30 +49,38 @@
|
|
49
49
|
</ol>
|
50
50
|
|
51
51
|
<ol>
|
52
|
-
<li><a href="http://zcc.rubyforge.org/zcc.html">zcc</a> only creates utf-8 encoded records. If you want
|
52
|
+
<li><a href="http://zcc.rubyforge.org/zcc.html">zcc</a> only creates utf-8 encoded records. If you want <span class="caps">MARC</span>-8 encoded records you’re on your own. <span class="caps">MARC</span>-8 encoding has already caused enough problems in this world, so I encourage folks to move to <span class="caps">UTF</span>-8 <span class="caps">ASAP</span>. If you use a different encoding that you want supported, please let me know. To set up Koha properly for dealing with <span class="caps">UTF</span>-8 encoded records see <a href="http://wiki.koha.org/doku.php?id=encodingscratchpad&s=utf8">this wiki page</a></li>
|
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">PERL5LIB</span>=/usr/local/koha/intranet/modules” without the quotes to
|
56
|
+
<li><span class="caps">ZCC</span> currently only works with a default install as paths are hardcoded. If there’s a need I’ll make it configurable for someone. 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” and “export <span class="caps">KOHA</span>_CONF=/etc/koha.conf” without the quotes to my .bashrc (or add the path to /etc/profile for the root user). If your paths differ from the preceding saving to Koha will not work.</li>
|
57
57
|
</ol>
|
58
58
|
|
59
59
|
<ol>
|
60
|
-
<li>You can then have
|
61
|
-
<li>Using the Koha Administration interface you can “Upload <span class="caps">MARC</span> records to the resevoir.” Then complete processing on the records like adding items and barcodes within the Koha web interface.</li>
|
60
|
+
<li>You can then have 3 choices on how to get the records into koha:<ul>
|
61
|
+
<li>Using the Koha Administration interface you can “Upload <span class="caps">MARC</span> records to the resevoir.” Then complete processing on the records like adding items and barcodes within the Koha web interface. The resevoir may strip out some fields that usually hold local content.</li>
|
62
62
|
</ul>
|
63
63
|
|
64
64
|
<ul>
|
65
|
-
<li>If you have processed your records fully to include item numbers and barcodes, you can use the bulkmarcimport script to put the records directly into your database.
|
65
|
+
<li>If you have processed your records fully to include item numbers and barcodes, you can use the bulkmarcimport script to put the records directly into your database. I’ve used bulkmarcimport without modification without problem. You may have different results and I’d like to hear them.</li>
|
66
66
|
</ul>
|
67
67
|
|
68
|
-
<pre syntax="ruby">perl
|
69
|
-
-v -file
|
70
|
-
|
68
|
+
<pre syntax="ruby">perl
|
69
|
+
/usr/local/koha/intranet/scripts/misc/migration_tools/bulkmarcimport.pl -v -file
|
70
|
+
/path/to/marc-file.mrc</pre>
|
71
|
+
<p>That is all one line.</p>
|
72
|
+
|
73
|
+
|
74
|
+
<ul>
|
75
|
+
<li>Or configure the save_record_syntax of your zcc.yaml file to ‘koha2’. If this gives you errors make sure you have exported environment variables with: “export -p”. You may also need to change the permissions on /etc/koha.conf to allow all users to view the file. If you get errors you can (though it might not be the best solution) do the following as root:</li>
|
76
|
+
</ul>
|
77
|
+
|
78
|
+
<pre>chmod 644 /etc/koha.conf</pre></li>
|
71
79
|
</ol>
|
72
80
|
|
73
81
|
<h1>Contact</h1>
|
74
82
|
|
75
|
-
<p>I use
|
83
|
+
<p>I use <span class="caps">ZCC</span> and Koha for my own work. So I’m very interested in making <span class="caps">ZCC</span> work better with Koha. Please send your comments, suggestions and patches to <a href="mailto:jronallo+zcc@gmail.com">Jason Ronallo</a></p>
|
76
84
|
|
77
85
|
</div>
|
78
86
|
|
data/website/koha.txt
CHANGED
@@ -8,23 +8,28 @@ h2. Hints
|
|
8
8
|
|
9
9
|
# "zcc":wzcc is *not* a part of Koha and is not developed by the same folks.
|
10
10
|
|
11
|
-
# "zcc":wzcc only creates utf-8 encoded records. If you want
|
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 PERL5LIB=/usr/local/koha/intranet/modules" without the quotes to
|
13
|
+
# ZCC currently only works with a default install as paths are hardcoded. If there's a need I'll make it configurable for someone. Make sure the Koha modules are a part of your path. I accomplish this by adding "export PERL5LIB=/usr/local/koha/intranet/modules" and "export KOHA_CONF=/etc/koha.conf" without the quotes to my .bashrc (or add the path to /etc/profile for the root user). If your paths differ from the preceding saving to Koha will not work.
|
14
14
|
|
15
|
-
# You can then have
|
15
|
+
# You can then have 3 choices on how to get the records into koha:
|
16
16
|
|
17
|
-
* Using the Koha Administration interface you can "Upload MARC records to the resevoir." Then complete processing on the records like adding items and barcodes within the Koha web interface.
|
17
|
+
* Using the Koha Administration interface you can "Upload MARC records to the resevoir." Then complete processing on the records like adding items and barcodes within the Koha web interface. The resevoir may strip out some fields that usually hold local content.
|
18
18
|
|
19
|
-
* If you have processed your records fully to include item numbers and barcodes, you can use the bulkmarcimport script to put the records directly into your database.
|
19
|
+
* If you have processed your records fully to include item numbers and barcodes, you can use the bulkmarcimport script to put the records directly into your database. I've used bulkmarcimport without modification without problem. You may have different results and I'd like to hear them.
|
20
20
|
|
21
|
-
<pre syntax="ruby">perl
|
22
|
-
-v -file
|
21
|
+
<pre syntax="ruby">perl
|
22
|
+
/usr/local/koha/intranet/scripts/misc/migration_tools/bulkmarcimport.pl -v -file
|
23
|
+
/path/to/marc-file.mrc</pre>
|
23
24
|
|
24
25
|
That is all one line.
|
25
26
|
|
27
|
+
* Or configure the save_record_syntax of your zcc.yaml file to 'koha2'. If this gives you errors make sure you have exported environment variables with: "export -p". You may also need to change the permissions on /etc/koha.conf to allow all users to view the file. If you get errors you can (though it might not be the best solution) do the following as root:
|
28
|
+
|
29
|
+
<pre>chmod 644 /etc/koha.conf</pre>
|
30
|
+
|
26
31
|
h1. Contact
|
27
32
|
|
28
|
-
I use
|
33
|
+
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
34
|
|
30
35
|
[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.1.0</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘zcc’</h1>
|
39
39
|
|
@@ -54,14 +54,14 @@
|
|
54
54
|
|
55
55
|
<h3>Gems</h3>
|
56
56
|
|
57
|
-
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline</pre>
|
57
|
+
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline term-ansicolor</pre>
|
58
58
|
<p><a href="http://www.textualize.com/ruby_marc">ruby-marc</a></p>
|
59
59
|
|
60
60
|
|
61
|
-
<p
|
61
|
+
<p>Linux? <span class="caps">ZCC</span> has only been tested on Linux (Debian Etch). It probably won’t work under other operating systems, but hopefully works with different distros. 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
62
|
|
63
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
|
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
65
|
|
66
66
|
|
67
67
|
<h2>Repository</h2>
|
@@ -96,48 +96,53 @@ $ rake local_deploy</pre>
|
|
96
96
|
<pre syntax="ruby">$ rake -T </pre>
|
97
97
|
<h2>Features</h2>
|
98
98
|
|
99
|
-
<p
|
99
|
+
<p><strong>Z39.50 search for records.</strong> Configure <span class="caps">ZCC</span> for as many targets as you like grouped in order of preference. A relatively current list of targets is provided based on the targettest list (examples/zservers.yaml). If you find the perfect record with the first target other targets do not have to be searched.</p>
|
100
100
|
|
101
101
|
|
102
|
-
<p><strong>Search by Title or <span class="caps">
|
102
|
+
<p><strong>Search by Title, <span class="caps">ISBN</span> or <span class="caps">LCCN</span></strong> Currently three searches are supported. From the same prompt you may search either by Title, <span class="caps">ISBN</span> or <span class="caps">LCCN</span> (with dash).</p>
|
103
103
|
|
104
104
|
|
105
|
-
<p><strong>
|
105
|
+
<p><strong>Sort your result sets by relevancy (title search only), date, content (AACR, <span class="caps">ISBD</span>), or any chosen subfield (first instance only).</p>
|
106
106
|
|
107
107
|
|
108
|
-
<p
|
108
|
+
<p></strong>See the most important fields for copy cataloging when choosing correct records.* In the initial list view <span class="caps">ZCC</span> presents the user with the full 245 (title and statement of responsibility) and 300 (extent, which includes page numbers). This gives you a quick way to determine potential records. The fields displayed is configurable as of the 0.1.0 release.</p>
|
109
109
|
|
110
110
|
|
111
|
-
<p><strong>
|
111
|
+
<p><strong>View the full <span class="caps">MARC</span> record before choosing.</strong> ZCC allows you to see the full <span class="caps">MARC</span> record in a pretty line format. <span class="caps">ZCC</span> does not hide <span class="caps">MARC</span> from you, even as ugly as it can be.</p>
|
112
|
+
|
113
|
+
|
114
|
+
<p><strong>Compare two records and choose the best.</strong> ZCC compares field by field (ie line by line) for matched fields. You can quickly see what fields come from which record. The comparison is similar to the way diff works. Matches between records are denoted with an ‘m’ while one record is denoted with a plus-sign and the other with a minus-sign. <span class="caps">TODO</span>: a curses interface may allow for color coding differences.</p>
|
112
115
|
|
113
116
|
|
114
117
|
<p><strong>Optional: Check the record for common errors.</strong> If you have Perl’s <span class="caps">MARC</span>::Lint installed you can see if all your indicators have proper values and only repeatable fields repeat. An added feature is determining what encoding level (ISBD, <span class="caps">AACR2</span>) the record is in.</p>
|
115
118
|
|
116
119
|
|
117
|
-
<p><strong>Choose records from different targets and then choose among them to find the best record.</strong> In the end you just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on.</p>
|
120
|
+
<p><strong>Choose records from different targets and then choose among them to find the best record.</strong> In the end you may just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on.</p>
|
118
121
|
|
119
122
|
|
120
|
-
<p><strong>Scripted changes to records.</strong>
|
123
|
+
<p><strong>Scripted changes to records.</strong> ZCC is highly configurable for making scripted changes to each record like macros. Want to delete all 852 or 9XX fields from a record before importing into your library system? <span class="caps">ZCC</span> can do that and more. Add fields and subfields with pre-determined information or prompt for information. The previous examples are easy to configure. With a little Ruby scripting you can make more complex changes. A few sample scripts are provided that do things like take the dewey call number from the 082a field and copy it to the fields Koha uses for call numbers, and if there is no 082a field it prompts for the proper call number parts. Don’t need the feature? Just turn it off.</p>
|
121
124
|
|
122
125
|
|
123
|
-
<p><strong>Output to <span class="caps">CSV</span> file.</strong> Want to print labels or keep statistics?
|
126
|
+
<p><strong>Output to <span class="caps">CSV</span> file.</strong> Want to print labels or keep statistics? <span class="caps">ZCC</span> 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 <span class="caps">ZCC</span> will prompt the user for input, which can be blank.</p>
|
124
127
|
|
125
128
|
|
126
129
|
<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
130
|
|
128
131
|
|
132
|
+
<p>Sample simple <strong>zebra</strong> set up to enable a localhost. See: <a href="http://zcc.rubyforge.org/zebra.html">Very simple setup of local zebra server</a></p>
|
133
|
+
|
134
|
+
|
129
135
|
<h2>Configuration</h2>
|
130
136
|
|
131
137
|
<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>
|
132
138
|
|
133
139
|
|
134
|
-
<p>All of the configuration (as of 0.0.2) is looked for in the user’s home directory in
|
140
|
+
<p>All of the configuration (as of 0.0.2) is looked for in the user’s home directory in ~/.zcc/zcc.yaml. An example zcc.yaml config file can be found in the examples directory of the gem.</p>
|
135
141
|
|
136
142
|
|
137
|
-
<pre syntax="ruby">
|
138
|
-
|
139
|
-
|
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>
|
143
|
+
<pre syntax="ruby">cd ~/.zcc
|
144
|
+
cp -r /var/lib/gems/1.8/gems/zcc-0.0.4/examples/* .</pre>
|
145
|
+
<p>Now if you want your retrieved records to be indexed and searchable over <span class="caps">Z39</span>.50 via zebra check out this quick start page: <a href="http://zcc.rubyforge.org/zebra.html">Very simple setup of local zebra server</a></p>
|
141
146
|
|
142
147
|
|
143
148
|
<h2>Use</h2>
|
@@ -148,27 +153,16 @@ One line; that’s what I do.
|
|
148
153
|
<ol>
|
149
154
|
<li>Configure both ~/.zcc/zcc.yaml.</li>
|
150
155
|
<li>From the command line run zcc</li>
|
151
|
-
<li>
|
152
|
-
<li>
|
153
|
-
<li>Next to each shown result is a number. Numbering starts with zero. Use that number in the following way:</li>
|
154
|
-
<li>Zcc command line<ul>
|
155
|
-
<li>Key in a number and hit Enter to select a record into your own set.</li>
|
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>
|
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>
|
158
|
-
<li>Enter ‘n’ to go to the next ztarget.</li>
|
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>
|
163
|
-
</ul></li>
|
156
|
+
<li>Next to each shown result is a number. Numbering starts with zero. </li>
|
157
|
+
<li><span class="caps">ZCC</span> command line: type ‘help’ to see the possible help options.</li>
|
164
158
|
</ol>
|
165
159
|
|
166
160
|
<h2>TODO</h2>
|
167
161
|
|
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
|
162
|
+
<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>. Uses ruby-zoom’s xml method for conversion.</p>
|
169
163
|
|
170
164
|
|
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>
|
165
|
+
<p><strong>TUI</strong> <del>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</del> With version 0.1.0, there’s a much nicer configurable <span class="caps">TUI</span>.</p>
|
172
166
|
|
173
167
|
|
174
168
|
<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>
|
@@ -180,7 +174,7 @@ One line; that’s what I do.
|
|
180
174
|
<p><strong>Exception handling.</strong> Currently there’s not great exception handling in the script. This needs to change, but hasn’t caused problems for me yet.</p>
|
181
175
|
|
182
176
|
|
183
|
-
<p><strong>Internationalize</strong> This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user’s prefered <span class="caps">MARC</span> flavor
|
177
|
+
<p><strong>Internationalize</strong> <del>This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user’s prefered <span class="caps">MARC</span> flavor.</del> If there is interest, I’d be willing to try making other text translatable.</p>
|
184
178
|
|
185
179
|
|
186
180
|
<p><del>Move all configuration to <span class="caps">YAML</span> file. Currently some configuration is made in the main script and some in the <span class="caps">YAML</span> file.</del> v. 0.0.2</p>
|
@@ -207,6 +201,14 @@ One line; that’s what I do.
|
|
207
201
|
<p>email: <a href="mailto:jronallo+zcc@gmail.com">Jason Ronallo</a></p>
|
208
202
|
|
209
203
|
|
204
|
+
<p>For bug reports: If relevant, please include z-target, search term and error messages.</p>
|
205
|
+
|
206
|
+
|
207
|
+
<h2>Will work for Ruby books</h2>
|
208
|
+
|
209
|
+
<p>If you’d like to sponsor the addition of a feature to <span class="caps">ZCC</span> or need a change to better meet your workflow, I will work for Ruby books. Up to now I’ve, requested Programming Ruby, Ruby Cookbook, Agile Web Development with Rails and others from libraries via Inter-Library Loan. I never get to keep them as long as I’d like. I’d like to have my own copies of these invaluable resources.</p>
|
210
|
+
|
211
|
+
|
210
212
|
<h2>License</h2>
|
211
213
|
|
212
214
|
<p>Copyright© 2007 Jason Ronallo</p>
|
data/website/zcc.txt
CHANGED
@@ -16,13 +16,13 @@ h2. Requirements
|
|
16
16
|
|
17
17
|
h3. Gems
|
18
18
|
|
19
|
-
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline</pre>
|
19
|
+
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline term-ansicolor</pre>
|
20
20
|
|
21
21
|
"ruby-marc":http://www.textualize.com/ruby_marc
|
22
22
|
|
23
|
-
|
23
|
+
Linux? ZCC has only been tested on Linux (Debian Etch). It probably won't work under other operating systems, but hopefully works with different distros. 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
24
|
|
25
|
-
The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8
|
25
|
+
The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8/bin
|
26
26
|
|
27
27
|
|
28
28
|
h2. Repository
|
@@ -56,38 +56,41 @@ For more tasks take a look at the output of:
|
|
56
56
|
|
57
57
|
h2. Features
|
58
58
|
|
59
|
-
*Z39.50 search for records.* Configure
|
59
|
+
*Z39.50 search for records.* Configure ZCC for as many targets as you like grouped in order of preference. A relatively current list of targets is provided based on the targettest list (examples/zservers.yaml). If you find the perfect record with the first target other targets do not have to be searched.
|
60
60
|
|
61
|
-
*Search by Title or
|
61
|
+
*Search by Title, ISBN or LCCN* Currently three searches are supported. From the same prompt you may search either by Title, ISBN or LCCN (with dash).
|
62
62
|
|
63
|
-
*
|
63
|
+
*Sort your result sets by relevancy (title search only), date, content (AACR, ISBD), or any chosen subfield (first instance only).
|
64
64
|
|
65
|
-
*
|
65
|
+
*See the most important fields for copy cataloging when choosing correct records.* In the initial list view ZCC presents the user with the full 245 (title and statement of responsibility) and 300 (extent, which includes page numbers). This gives you a quick way to determine potential records. The fields displayed is configurable as of the 0.1.0 release.
|
66
66
|
|
67
|
-
*
|
67
|
+
*View the full MARC record before choosing.* ZCC allows you to see the full MARC record in a pretty line format. ZCC does not hide MARC from you, even as ugly as it can be.
|
68
|
+
|
69
|
+
*Compare two records and choose the best.* ZCC compares field by field (ie line by line) for matched fields. You can quickly see what fields come from which record. The comparison is similar to the way diff works. Matches between records are denoted with an 'm' while one record is denoted with a plus-sign and the other with a minus-sign. TODO: a curses interface may allow for color coding differences.
|
68
70
|
|
69
71
|
*Optional: Check the record for common errors.* If you have Perl's MARC::Lint installed you can see if all your indicators have proper values and only repeatable fields repeat. An added feature is determining what encoding level (ISBD, AACR2) the record is in.
|
70
72
|
|
71
|
-
*Choose records from different targets and then choose among them to find the best record.* In the end you just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on.
|
73
|
+
*Choose records from different targets and then choose among them to find the best record.* In the end you may just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on.
|
72
74
|
|
73
|
-
*Scripted changes to records.*
|
75
|
+
*Scripted changes to records.* ZCC is highly configurable for making scripted changes to each record like macros. Want to delete all 852 or 9XX fields from a record before importing into your library system? ZCC can do that and more. Add fields and subfields with pre-determined information or prompt for information. The previous examples are easy to configure. With a little Ruby scripting you can make more complex changes. A few sample scripts are provided that do things like take the dewey call number from the 082a field and copy it to the fields Koha uses for call numbers, and if there is no 082a field it prompts for the proper call number parts. Don't need the feature? Just turn it off.
|
74
76
|
|
75
|
-
*Output to CSV file.* Want to print labels or keep statistics?
|
77
|
+
*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.
|
76
78
|
|
77
79
|
*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
80
|
|
81
|
+
Sample simple *zebra* set up to enable a localhost. See: "Very simple setup of local zebra server":http://zcc.rubyforge.org/zebra.html
|
82
|
+
|
79
83
|
h2. Configuration
|
80
84
|
|
81
85
|
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.
|
82
86
|
|
83
87
|
|
84
|
-
All of the configuration (as of 0.0.2) is looked for in the user's home directory in
|
88
|
+
All of the configuration (as of 0.0.2) is looked for in the user's home directory in ~/.zcc/zcc.yaml. An example zcc.yaml config file can be found in the examples directory of the gem.
|
85
89
|
|
86
|
-
<pre syntax="ruby">
|
87
|
-
|
88
|
-
One line; that's what I do.
|
90
|
+
<pre syntax="ruby">cd ~/.zcc
|
91
|
+
cp -r /var/lib/gems/1.8/gems/zcc-0.0.4/examples/* .</pre>
|
89
92
|
|
90
|
-
|
93
|
+
Now if you want your retrieved records to be indexed and searchable over Z39.50 via zebra check out this quick start page: "Very simple setup of local zebra server":http://zcc.rubyforge.org/zebra.html
|
91
94
|
|
92
95
|
h2. Use
|
93
96
|
|
@@ -95,25 +98,14 @@ $ zcc
|
|
95
98
|
|
96
99
|
# Configure both ~/.zcc/zcc.yaml.
|
97
100
|
# From the command line run zcc
|
98
|
-
#
|
99
|
-
#
|
100
|
-
# Next to each shown result is a number. Numbering starts with zero. Use that number in the following way:
|
101
|
-
# Zcc command line
|
102
|
-
|
103
|
-
* Key in a number and hit Enter to select a record into your own set.
|
104
|
-
* Key 's' followed by a number to see the result. For instance 's3' would show you the full MARC for the 3rd record.
|
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.
|
106
|
-
* Enter 'n' to go to the next ztarget.
|
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.
|
101
|
+
# Next to each shown result is a number. Numbering starts with zero.
|
102
|
+
# ZCC command line: type 'help' to see the possible help options.
|
111
103
|
|
112
104
|
h2. TODO
|
113
105
|
|
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
|
106
|
+
-*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. Uses ruby-zoom's xml method for conversion.
|
115
107
|
|
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
|
108
|
+
*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- With version 0.1.0, there's a much nicer configurable TUI.
|
117
109
|
|
118
110
|
*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.
|
119
111
|
|
@@ -121,7 +113,7 @@ h2. TODO
|
|
121
113
|
|
122
114
|
*Exception handling.* Currently there's not great exception handling in the script. This needs to change, but hasn't caused problems for me yet.
|
123
115
|
|
124
|
-
*Internationalize* This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user's prefered MARC flavor
|
116
|
+
*Internationalize* -This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user's prefered MARC flavor.- If there is interest, I'd be willing to try making other text translatable.
|
125
117
|
|
126
118
|
-Move all configuration to YAML file. Currently some configuration is made in the main script and some in the YAML file.- v. 0.0.2
|
127
119
|
|
@@ -141,6 +133,12 @@ h2. Help/paches
|
|
141
133
|
|
142
134
|
email: "Jason Ronallo":mailto:jronallo+zcc@gmail.com
|
143
135
|
|
136
|
+
For bug reports: If relevant, please include z-target, search term and error messages.
|
137
|
+
|
138
|
+
h2. Will work for Ruby books
|
139
|
+
|
140
|
+
If you'd like to sponsor the addition of a feature to ZCC or need a change to better meet your workflow, I will work for Ruby books. Up to now I've, requested Programming Ruby, Ruby Cookbook, Agile Web Development with Rails and others from libraries via Inter-Library Loan. I never get to keep them as long as I'd like. I'd like to have my own copies of these invaluable resources.
|
141
|
+
|
144
142
|
h2. License
|
145
143
|
|
146
144
|
Copyright (C) 2007 Jason Ronallo
|