[open-ils-commits] r9589 - in branches/acq-experiment: .
Open-ILS/src/perlmods/OpenILS/Application Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 13 16:34:39 EDT 2008
Author: erickson
Date: 2008-05-13 16:34:35 -0400 (Tue, 13 May 2008)
New Revision: 9589
Added:
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
Modified:
branches/acq-experiment/
branches/acq-experiment/Open-ILS/src/sql/Pg/040.schema.asset.sql
Log:
Merged revisions 9577,9584,9587 via svnmerge from
svn://svn.open-ils.org/ILS/trunk
........
r9577 | dbs | 2008-05-13 10:52:21 -0400 (Tue, 13 May 2008) | 2 lines
Missed a deferrable constraint
........
r9584 | miker | 2008-05-13 15:50:02 -0400 (Tue, 13 May 2008) | 1 line
stub of vandelay ML
........
r9587 | miker | 2008-05-13 16:29:58 -0400 (Tue, 13 May 2008) | 1 line
create queues and add records to them
........
Property changes on: branches/acq-experiment
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-9570
+ /trunk:1-9588
Copied: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm (from rev 9587, trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm)
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm (rev 0)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm 2008-05-13 20:34:35 UTC (rev 9589)
@@ -0,0 +1,180 @@
+package OpenILS::Application::Vandelay;
+use OpenILS::Application;
+use base qw/OpenILS::Application/;
+
+use Unicode::Normalize;
+use OpenSRF::EX qw/:try/;
+
+use OpenSRF::AppSession;
+use OpenSRF::Utils::SettingsClient;
+
+use OpenILS::Utils::Fieldmapper;
+use OpenILS::Utils::CStoreEditor qw/:funcs/;
+
+use MARC::Record;
+use MARC::File::XML;
+
+use OpenILS::Utils::Fieldmapper;
+
+use Time::HiRes qw(time);
+
+use OpenSRF::Utils::Logger qw/:level/;
+my $log = 'OpenSRF::Utils::Logger';
+
+sub initialize {}
+sub child_init {}
+
+sub entityize {
+ my $self = shift;
+ my $stuff = shift;
+ my $form = shift;
+
+ if ($form eq 'D') {
+ $stuff = NFD($stuff);
+ } else {
+ $stuff = NFC($stuff);
+ }
+
+ $stuff =~ s/([\x{0080}-\x{fffd}])/sprintf('&#x%X;',ord($1))/sgoe;
+ return $stuff;
+}
+
+# --------------------------------------------------------------------------------
+# Biblio ingest
+
+sub create_bib_queue {
+ my $self = shift;
+ my $client = shift;
+ my $auth = shift;
+ my $name = shift;
+ my $owner = shift;
+ my $type = shift;
+ my $purpose = shift;
+
+ my $e = new_editor(authtoken => $auth, xact => 1);
+
+ return $e->die_event unless $e->checkauth;
+ return $e->die_event unless $e->allowed('CREATE_BIB_IMPORT_QUEUE', $owner);
+
+ my $queue = new Fieldmapper::vandelay::bib_queue();
+ $queue->name( $name );
+ $queue->owner( $owner );
+ $queue->queue_type( $type ) if ($type);
+ $queue->queue_purpose( $purpose ) if ($purpose);
+
+ my $new_id = $e->create_vandelay_bib_queue( $queue );
+ $e->die_event unless ($new_id);
+
+ $queue->id($new_id);
+ return $queue;
+}
+__PACKAGE__->register_method(
+ api_name => "open-ils.vandelay.bib_queue.create",
+ method => "create_bib_queue",
+ api_level => 1,
+ argc => 3,
+);
+
+
+sub create_auth_queue {
+ my $self = shift;
+ my $client = shift;
+ my $auth = shift;
+ my $name = shift;
+ my $owner = shift;
+ my $type = shift;
+ my $purpose = shift;
+
+ my $e = new_editor(authtoken => $auth, xact => 1);
+
+ return $e->die_event unless $e->checkauth;
+ return $e->die_event unless $e->allowed('CREATE_AUTHORITY_IMPORT_QUEUE', $owner);
+
+ my $queue = new Fieldmapper::vandelay::authority_queue();
+ $queue->name( $name );
+ $queue->owner( $owner );
+ $queue->queue_type( $type ) if ($type);
+ $queue->queue_purpose( $purpose ) if ($purpose);
+
+ my $new_id = $e->create_vandelay_authority_queue( $queue );
+ $e->die_event unless ($new_id);
+
+ $queue->id($new_id);
+ return $queue;
+}
+__PACKAGE__->register_method(
+ api_name => "open-ils.vandelay.authority_queue.create",
+ method => "create_auth_queue",
+ api_level => 1,
+ argc => 3,
+);
+
+sub add_record_to_bib_queue {
+ my $self = shift;
+ my $client = shift;
+ my $auth = shift;
+ my $queue = shift;
+ my $marc = shift;
+
+ my $e = new_editor(authtoken => $auth, xact => 1);
+
+ $queue = $e->retrieve_vandelay_bib_queue($queue)
+
+ return $e->die_event unless $e->checkauth;
+ return $e->die_event unless
+ ($e->allowed('CREATE_BIB_IMPORT_QUEUE', undef, $queue) ||
+ $e->allowed('CREATE_BIB_IMPORT_QUEUE', $queue->owner));
+
+ my $rec = new Fieldmapper::vandelay::queued_bib_record();
+ $rec->marc( $marc );
+ $rec->queue( $queue->id );
+
+ my $new_id = $e->create_vandelay_queued_bib_record( $rec );
+ $e->die_event unless ($new_id);
+
+ $rec->id($new_id);
+ return $rec;
+}
+__PACKAGE__->register_method(
+ api_name => "open-ils.vandelay.queued_bib_record.create",
+ method => "add_record_to_bib_queue",
+ api_level => 1,
+ argc => 3,
+);
+
+sub add_record_to_authority_queue {
+ my $self = shift;
+ my $client = shift;
+ my $auth = shift;
+ my $queue = shift;
+ my $marc = shift;
+
+ my $e = new_editor(authtoken => $auth, xact => 1);
+
+ $queue = $e->retrieve_vandelay_authority_queue($queue)
+
+ return $e->die_event unless $e->checkauth;
+ return $e->die_event unless
+ ($e->allowed('CREATE_AUTHORITY_IMPORT_QUEUE', undef, $queue) ||
+ $e->allowed('CREATE_AUTHORITY_IMPORT_QUEUE', $queue->owner));
+
+ my $rec = new Fieldmapper::vandelay::queued_authority_record();
+ $rec->marc( $marc );
+ $rec->queue( $queue->id );
+
+ my $new_id = $e->create_vandelay_queued_authority_record( $rec );
+ $e->die_event unless ($new_id);
+
+ $rec->id($new_id);
+ return $rec;
+}
+__PACKAGE__->register_method(
+ api_name => "open-ils.vandelay.queued_authority_record.create",
+ method => "add_record_to_authority_queue",
+ api_level => 1,
+ argc => 3,
+);
+
+
+1;
+
Modified: branches/acq-experiment/Open-ILS/src/sql/Pg/040.schema.asset.sql
===================================================================
--- branches/acq-experiment/Open-ILS/src/sql/Pg/040.schema.asset.sql 2008-05-13 20:30:16 UTC (rev 9588)
+++ branches/acq-experiment/Open-ILS/src/sql/Pg/040.schema.asset.sql 2008-05-13 20:34:35 UTC (rev 9589)
@@ -7,7 +7,7 @@
CREATE TABLE asset.copy_location (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
- owning_lib INT NOT NULL REFERENCES actor.org_unit (id),
+ owning_lib INT NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
holdable BOOL NOT NULL DEFAULT TRUE,
opac_visible BOOL NOT NULL DEFAULT TRUE,
circulate BOOL NOT NULL DEFAULT TRUE
More information about the open-ils-commits
mailing list