From: Shawn Boyette Date: Tue, 17 Mar 2009 16:55:49 +0000 (+0000) Subject: removing what i believe to be dead example directory X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=6c25f0626b026e59b9051c31d3eddfb6105f3c56 removing what i believe to be dead example directory --- diff --git a/csv_ripper b/csv_ripper index 99e047c..bf787ff 100755 --- a/csv_ripper +++ b/csv_ripper @@ -1,7 +1,7 @@ #!/usr/bin/perl # TODO -# +# # * add getopt support # * use tag generator to expand list of wanted fields? # * insertion of constant-value fields @@ -14,7 +14,7 @@ use warnings; use Text::CSV; -my $csv = Text::CSV->new({escape_char => "+", allow_loose_quotes => 1}); +my $csv = Text::CSV->new(); open CSV, '<', shift or die "Can't open file $!\n"; diff --git a/doc/LocalAdminkgsreview1.xml b/doc/LocalAdminkgsreview1.xml deleted file mode 100644 index 300f501..0000000 --- a/doc/LocalAdminkgsreview1.xml +++ /dev/null @@ -1,492 +0,0 @@ - - - - - - - Administration - - This chapter describes administrative features on the staff client. - They include: - - - - Operator Change - - - - Offline Transaction Management - - - - Download Offline Patron List - - - - Local System - Administration - - - - Server Settings - - - - User Permission - - - - Receipt Template - - - - Survey Wizard - - - - Features for Developers - - - - - -
- Local System Administration - - The following administrative functions are available: - - - - Workstation Configuration - - - - Library - Configuration - - - - Maintenance Reports - - - -
- Library Configuration - - You can configure the following settings: - - - - Closed Dates - - - - Copy Locations - - - - Library Settings or Organization Unit??? - - - - Non-cataloged Types - - - - Statistical Categories - - - -
- Closed Dates - - -
- -
- Copy Locations - - -
- - - -
- Library Settings - - - -
- Alert on Empty Bib Records - -
- Introduction to Empty Bib Records - - This setting is used to alert staff when the last copy for a - record is being deleted. (Text is coming from the GUI, but should - it be "last copy of a record???") The default value is True??? It - can be changed through the Local System - Administration menu. -
- -
- Changing the Alert Status on Empty Bib Records - - To change the alert status on empty bib records: - - - - On the Local System Administration screen, click the - Library Settings Editor link. - - - - On the Organization Unit Settings screen, find the - setting Alert on empty bib records, and - click Edit. - - - - In the Edit Setting pop-up window, select a location - from the Context list. - - - - From the Value list, select a - value. - - - - - Changing Value of Empty Bib Records - - To change the value to false, select - False from the Value - list. - -
- -
- References for the Alert Status on Empty Bib - Records - - - - -this - Permissions Galore - - -
-
- - - -
- Credit Card Payments - -
- Introduction to Credit Card Payments - - If enabled, patrons will be able to pay fines accrued at - this location via credit card. The default value is True??? It can - be changed through the Local System - Administration menu. -
- -
- Allowing Credit Card Payments - - To allow credit card payments: - - - - From the Local System Administration screen, click the - Library Settings Editor link. - - - - On the Organization Unit Settings screen, find the - setting Allow Credit Card Payments (May - want to standarize on style in GUI - caps on first letter of - each word or caps of first letter of first work), and click - Edit. - - - - In the Edit Setting pop-up window, select a location - from the Context list. - - - - In the Value box, select a - value. - - - - - Changing Credit Card Payment Status - - To change the credit card payment status to false, select - False from the Value - list. - -
- -
- References for Credit Card Payments - - - - - -this - -Permissions - - -
-
- - - -
- Reshelving Status Interval - -
- Introduction to the Reshelving Status Interval - - What kind of preamble do we need here??? -
- -
- Changing the Reshelving Status Interval - - To change the reshelving status interval: - Overview of Editing Settings for Pop-Up Windows - - - - Context - - Value - - - LEDDY - - 0.00 - - - - Alabama - - Montgomery - - - - Alaska - - Anchorage - - - - - - From the Local System Administration screen, click the - Library Settings Editor link. - - - - On the Organization Unit Settings screen, find the - setting Change reshelving status - interval, and click - Edit. - - - - In the Edit Setting pop-up window, enter a location from - the Context list. - - - - In the Value box, enter a value in - seconds, hours, or days. The value cannot be zero; however, a - value of 1 second is valid. What are the default units when - none are entered with the value??? - - For example, to change the reshelving status interval to - four hours, enter 4 hours in the - Value box. - - - - Click on Update Setting. - - - - You can see the selected organization unit displayed - under the Context column and the reshelving status interval - displayed under the Value column. - - - - To delete both Context and Value for the reshelving - status interval, click on Delete - Setting. - - -
- -
- References for the Reshelving Status Interval - - - - http://open-ils.org/dokuwiki/doku.php?id=evergreen-user:permission_list - - -
- - - -
- Reshelving Intervals and Permissions - - - The reshelving status interval is not inherited from the - parent organizational unit at run time. The default value is 24 - hours??? and can be changed through the Local System - Administration menu. - - - - Permissions for organization unit settings are not - automatically created at install time, which means the - permission will have to be created before it can be - applied. - -
-
- -
- Default Item Price - - -
- -
- Default Locale - - -
- -
- Deletion of Empty Bib Records - - -
- -
- Holds: Expire Alert Interval - - -
- -
- Holds: Expire Interval - - -
- -
- Holds: Hard Boundary - - -
- -
- Holds: Soft Boundary - - -
- -
- Lost Materials Processing Fee - - -
- -
- Maximum Previous Checkouts Displayed - - -
- -
- OPAC Inactivity Timeout - - -
- -
- Patron Barcode Format - - -
- -
- Selfcheck: Patron Login Timeout - - -
- -
- Selfcheck: Pop-up Alert for Errors - - -
- -
- Selfcheck: Require Patron Password - - -
- -
- Sending Email Address for Patron Notices - - -
- -
- Staff Login Inactivity Timeout - - -
- -
- Void Overdue Fines - - -
-
-
-
-
diff --git a/doc/hello_world.txt b/doc/hello_world.txt deleted file mode 100644 index e7a0aa2..0000000 --- a/doc/hello_world.txt +++ /dev/null @@ -1,7 +0,0 @@ -howdy i can haz changes. - -Now I have a second paragraph. With cheese. - -here are my changes. - - diff --git a/extract_holdings b/extract_holdings index d140a24..eea0465 100755 --- a/extract_holdings +++ b/extract_holdings @@ -4,16 +4,17 @@ use warnings; use XML::Twig; use YAML::Tiny; -use JSON; +use Getopt::Long; -my $marcxml = shift || help(); -my $htag = shift || help(); -open HOLDINGS, '>', "holdings"; -open X, '>', "holdings.x"; -open Z, '>', "holdings.z"; +my $conf = initialize(); +my $marcxml = shift; + +open HOLDINGS, '>', $conf->{output}; +open X, '>', $conf->{pubnotesfile}; +open Z, '>', $conf->{privnotesfile}; my $holdings = {}; -my %all852 = ( x => {}, z => {} ); # hash of all subfields in all 852s +my %sample = ( x => {}, z => {} ); # hash of all subfields in all 852s my $copyid = 0; @@ -26,7 +27,7 @@ my $prevper = -1; my $yaml = YAML::Tiny->new; my $t = XML::Twig->new( twig_handlers => { record => \&record } ); $t->parsefile($marcxml); -$yaml->[0] = \%all852; +$yaml->[0] = \%sample; $yaml->write('holdings.sample'); print "\n\n"; @@ -57,7 +58,7 @@ sub process_datafields { } # and holdings data - if ($d->{'att'}->{'tag'} == $htag) { + if ($d->{'att'}->{'tag'} == $conf->{tag}) { push @{$holdings->{copies}}, { x =>[], z => [] }; $holdings->{copies}[-1]{copyid} = $copyid; my @subs = $d->children('subfield'); @@ -74,13 +75,13 @@ sub process_subs { my $code = $s->{'att'}->{'code'}; my $value = $s->text; - if ($code eq 'x' or $code eq 'z') { + if ($code eq $conf->{pubnotes} or $code eq $conf->{privnotes}) { push @{$copy->{$code}}, $value; my ($k,$v) = split /:/, $value; - $all852{$code}{$k} = $v; + $sample{$code}{$k} = $v; } else { $copy->{$code} = $value; - $all852{$code} = $value; + $sample{$code} = $value; } } @@ -97,14 +98,75 @@ sub print_reports { print Z join("\t", $holdings->{id}, $copy->{copyid}, $note, $_), "\n"; $note++; } - for (qw( copyid b p h 9 )) - { $copy->{$_} = '' unless defined $copy->{$_} } - print HOLDINGS join("\t", $holdings->{id}, $copy->{copyid}, - $copy->{b}, $copy->{p}, $copy->{h}, $copy->{9}), "\n"; + my @fields = (); + for ( @{$conf->{fields}} ) + { $copy->{$_} = '' unless defined $copy->{$_}; push @fields, $copy->{$_} } + print HOLDINGS join("\t", $holdings->{id}, $copy->{copyid}, @fields), "\n"; +} + + +#------------------------------------------------ + + +sub initialize { + my $c = {}; + my @missing = (); + + # set mode on existing filehandles + binmode(STDIN, ':utf8'); + + my $rc = GetOptions( $c, + 'fields|f=s', + 'output|o=s', + 'prefix|p=s', + 'pubnotes|pub=i', + 'pubnotesfile=s', + 'privnotes|priv=s', + 'privnotesfile=s', + 'tag|t=i', + 'help|h', + ); + show_help() unless $rc; + show_help() if ($c->{help}); + + # set defaults + $c->{prefix} = (defined $c->{prefix}) ? ($c->{prefix} . '.') : ''; + $c->{tag} = $c->{tag} || '852'; + $c->{output} = + $c->{output} || join('', $c->{prefix}, "holdings.pg"); + $c->{pubnotes} = $c->{pubnotes} || 'x'; + $c->{pubnotesfile} = + $c->{pubnotesfile} || join('', $c->{prefix}, "holdings.pubnote.pg"); + $c->{privnotes} = $c->{privnotes} || 'z'; + $c->{privnotesfile} = + $c->{privnotesfile} || join('', $c->{prefix}, "holdings.privnote.pg"); + + my @keys = keys %{$c}; + show_help() unless (@ARGV and @keys); + for my $key ('fields', 'tag') + { push @missing, $key unless $c->{$key} } + if (@missing) { + print "Required option: ", join(', ', @missing), " missing!\n"; + show_help(); + } + + # explode and validate fields string + process_fields($c); + return $c; } +sub process_fields { + my ($c) = @_; + my @holdings_fields = split /,/, $c->{fields}; + for (@holdings_fields) { + die "Field names must be alphanumeric!\n" if /\W/; + die "Field names must be single characters!\n" + if /\w{2,}/; + } + $c->{fields} = \@holdings_fields; +} -sub help { +sub show_help { print <