mixed in enumerable to result set class. added result set method to get the size...
[zcc.git] / website / zcc.html
blob59baa3eb83d34df6e4b41bf32a54c527d5dc3502
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 zcc
9 </title>
10 <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11 <style>
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"]
25 var versionBox = new curvyCorners(settings, document.getElementById("version"));
26 versionBox.applyCornersToAll();
28 </script>
29 </head>
30 <body>
31 <div id="main">
33 <h1>zcc</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.4</a>
37 </div>
38 <h1>&#x2192; &#8216;zcc&#8217;</h1>
41 <h2>What</h2>
44 <p>Z Copy Cataloging is a command line tool written in Ruby to make your <span class="caps">MARC</span> record copy cataloging faster and more accurate. The &#8216;Z&#8217; may stand for Zippy if you really want it to.</p>
47 <h1><strong><span class="caps">THIS IS</span> <em>alpha</em> SOFTWARE. <span class="caps">IT MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG</span>.</strong></h1>
50 <h2>Requirements</h2>
53 <p><a href="http://ruby-lang.org/">Ruby</a> 1.8</p>
56 <p><a href="http://www.indexdata.dk/yaz/"><span class="caps">YAZ</span></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&#8212;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>
59 <h3>Gems</h3>
62 <pre syntax="ruby">sudo gem install zcc marc zoom unicode highline</pre>
64 <p><a href="http://www.textualize.com/ruby_marc">ruby-marc</a></p>
67 <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&#8217;m willing to try to make it work if there is enough interest.</p>
70 <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>
73 <h2>Repository</h2>
76 <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>
79 <p>To make sure you have all the dependencies needed to build the gem:</p>
82 <pre syntax="ruby">$ sudo gem install newgem --include-dependencies</pre>
84 <p>Grab the latest from the svn repository:</p>
87 <pre syntax="ruby">$ svn co svn://208.78.97.122/zcc</pre>
89 <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>
92 <p>You can add the following lines using visudo:</p>
95 <pre syntax="ruby">Cmnd_Alias GEM=/usr/bin/gem
96 user ALL=GEM</pre>
98 <p>Now as a user you can build and install the gem on your own system:</p>
101 <pre syntax="ruby">$ cd zcc
102 $ rake local_deploy</pre>
104 <p>For more tasks take a look at the output of:</p>
107 <pre syntax="ruby">$ rake -T </pre>
109 <h2>Features</h2>
112 <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>
115 <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>
118 <p><strong>See the most important fields for copy cataloging when choosing correct records.</strong> 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. <span class="caps">TODO</span>: Make the fields displayed configurable, especially for other <span class="caps">MARC</span> flavors.</p>
121 <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. Zcc does not hide <span class="caps">MARC</span> from you, even as ugly as it can be.</p>
124 <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 &#8216;m&#8217; 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>
127 <p><strong>Optional: Check the record for common errors.</strong> If you have Perl&#8217;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>
130 <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>
133 <p><strong>Scripted changes to records.</strong> Zcc is highly configurable for making scripted changes to each record like macros. Want to delete all 900 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&#8217;t need the feature? Just turn it off.</p>
136 <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>
139 <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>
142 <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>
145 <h2>Configuration</h2>
148 <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>
151 <p>All of the configuration (as of 0.0.2) is looked for in the user&#8217;s home directory in .zcc/zcc.yaml. An example zcc.yaml config file can be found in the examples directory of the gem.</p>
154 <pre syntax="ruby">cp /var/lib/gems/1.8/gems/zcc-0.0.1/examples/zcc.yaml
155 ~/.zcc/zcc.yaml</pre>
156 One line; that&#8217;s what I do.
158 <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>
161 <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>
164 <h2>Use</h2>
167 <p>$ zcc</p>
170 <ol>
171 <li>Configure both ~/.zcc/zcc.yaml.</li>
172 <li>From the command line run zcc</li>
173 <li>Enter a title or <span class="caps">ISBN</span> to search for.</li>
174 <li>rset.length is the number of results found in the target. Depending on configuration you may not be presented with all results.</li>
175 <li>Next to each shown result is a number. Numbering starts with zero. Use that number in the following way:</li>
176 <li>Zcc command line
178 <ul>
179 <li>Key in a number and hit Enter to select a record into your own set.</li>
180 <li>Key &#8217;s&#8217; followed by a number to see the result. For instance &#8216;s3&#8217; would show you the full <span class="caps">MARC</span> for the 3rd record.</li>
181 <li>To compare two records enter &#8216;c#&#8211;#&#8217;. For instance &#8216;c5&#8211;3&#8217; would compare record 5 to record 3. Matches are shown with &#8216;m&#8217; at the beginning of a line. The first record is denoted with a &#8217;+&#8217; and the second with a minus sign.</li>
182 <li>Enter &#8216;n&#8217; to go to the next ztarget.</li>
183 <li>Enter &#8216;d&#8217; if you are done selecting records. This will skip the rest of the ztargets.</li>
184 <li>If you have the linter turned on (and Perl modules instaled) &#8216;l#&#8217; will give any <span class="caps">USMARC</span> errors such as incorrect indicators for a particular field.</li>
185 <li>Once you select a final records it goes through scripting and csv creation if those are turned on.</li>
186 <li>You are then prompted to conduct a new search.</li>
187 </ul></li>
188 </ol>
191 <h2><span class="caps">TODO</span></h2>
194 <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>
197 <p><strong><span class="caps">TUI</span></strong> If there is interest in this script, I&#8217;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>
200 <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&#8217;d like to work that as an option into the main script.</p>
203 <p><strong>Unit Testing.</strong> While I&#8217;ve tested the script in my own work, I need to do more formal testing of the methods.</p>
206 <p><strong>Exception handling.</strong> Currently there&#8217;s not great exception handling in the script. This needs to change, but hasn&#8217;t caused problems for me yet.</p>
209 <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&#8217;s prefered <span class="caps">MARC</span> flavor. If there is interest, I&#8217;d be willing to try making other text translatable.</p>
212 <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>
215 <p>Create full <strong>rdoc documentation</strong>.</p>
218 <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>
221 <h2>Suggestions</h2>
224 <p>Perl and <span class="caps">MARC</span>::Lint To have error checking of records turned on you must also have Perl and <span class="caps">MARC</span>::Lint installed.</p>
227 <h2>Using Koha with zcc</h2>
230 <p>There is no integration yet between Koha and zcc, but I use both so am working towards that end. For now you can find some help on this page: <a href="http://zcc.rubyforge.org/koha.html">using Koha with zcc</a></p>
233 <h2>Help/paches</h2>
236 <p>email: <a href="mailto:jronallo+zcc@gmail.com">Jason Ronallo</a></p>
239 <h2>License</h2>
242 <p>Copyright&#169; 2007 Jason Ronallo</p>
245 <p>This program is free software; you can redistribute it and/or modify it under the terms of the <span class="caps">GNU</span> General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>
248 <p>This program is distributed in the hope that it will be useful, but <span class="caps">WITHOUT ANY WARRANTY</span>; without even the implied warranty of <span class="caps">MERCHANTABILITY</span> or <span class="caps">FITNESS FOR A PARTICULAR PURPOSE</span>. See the <span class="caps">GNU</span> General Public License for more details.</p>
251 <p>You should have received a copy of the <span class="caps">GNU</span> General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, <span class="caps">MA 02110</span>-1301, <span class="caps">USA</span></p>
254 <h2>Contact</h2>
257 <p>Comments are welcome. Send an email to <a href="mailto:jronallo+zcc@gmail.com">Jason Ronallo</a>.</p>
259 </div>
261 <!-- insert site tracking codes here, like Google Urchin -->
263 </body>
264 </html>