package OpenILS::Application::AppUtils;
use strict; use warnings;
-use MARC::Record;
-use MARC::File::XML (BinaryEncoding => 'utf8', RecordFormat => 'USMARC');
use OpenILS::Application;
use base qw/OpenILS::Application/;
use OpenSRF::Utils::Cache;
# Pile of utilty methods used accross applications.
# ---------------------------------------------------------------------------
my $cache_client = "OpenSRF::Utils::Cache";
-my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
+
# ---------------------------------------------------------------------------
# on sucess, returns the created session, on failure throws ERROR exception
}
-# generate a MARC XML document from a MARC XML string
-sub marc_xml_to_doc {
- my ($class, $xml) = @_;
- my $marc_doc = XML::LibXML->new->parse_string($xml);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE);
- return $marc_doc;
-}
-
-
-
1;
use OpenILS::Const qw/:const/;
use OpenILS::Event;
my $U = 'OpenILS::Application::AppUtils';
+my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
+
# generate a MARC XML document from a MARC XML string
sub marc_xml_to_doc {
my $xml = shift;
- return $U->marc_xml_to_doc($xml);
+ my $marc_doc = XML::LibXML->new->parse_string($xml);
+ $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1);
+ $marc_doc->documentElement->setNamespace($MARC_NAMESPACE);
+ return $marc_doc;
}
+
__PACKAGE__->register_method(
method => 'import_authority_record',
api_name => 'open-ils.cat.authority.record.import',