[open-ils-commits] SPAM: r7503 - in trunk:
Evergreen/src/extras/import Evergreen/src/support-scripts
Open-ILS/examples Open-ILS/src/extras
Open-ILS/src/extras/import Open-ILS/src/offline
Open-ILS/src/perlmods/OpenILS/Application
Open-ILS/src/perlmods/OpenILS/Application/Circ
Open-ILS/src/perlmods/OpenILS/Application/Search
Open-ILS/src/perlmods/OpenILS/Application/Storage
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher
Open-ILS/src/perlmods/OpenILS/SIP/Transaction
Open-ILS/src/perlmods/OpenILS/Template/Plugin
Open-ILS/src/perlmods/OpenILS/Utils
Open-ILS/src/perlmods/OpenILS/WWW
Open-ILS/src/perlmods/OpenILS/WWW/AddedContent
Open-ILS/src/reporter Open-ILS/src/support-scripts
Open-ILS/src/support-scripts/test-scripts
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jul 2 11:15:03 EDT 2007
Author: miker
Date: 2007-07-02 11:11:35 -0400 (Mon, 02 Jul 2007)
New Revision: 7503
Modified:
trunk/Evergreen/src/extras/import/object_dumper.pl
trunk/Evergreen/src/extras/import/parse_patron_xml.pl
trunk/Evergreen/src/support-scripts/eg_gen_overdue.pl
trunk/Open-ILS/examples/json-request-test.pl
trunk/Open-ILS/examples/reporter-sql-builder-test.pl
trunk/Open-ILS/src/extras/Perl2REST.pl
trunk/Open-ILS/src/extras/import/direct_ingest.pl
trunk/Open-ILS/src/extras/import/direct_loader.pl
trunk/Open-ILS/src/extras/import/marc2are.pl
trunk/Open-ILS/src/extras/import/marc2bre.pl
trunk/Open-ILS/src/extras/import/pg_loader.pl
trunk/Open-ILS/src/extras/org_tree_js.pl
trunk/Open-ILS/src/offline/offline.pl
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/HoldNotify.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Authority.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/WoRM.pm
trunk/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm
trunk/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm
trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
trunk/Open-ILS/src/perlmods/OpenILS/Utils/Editor.pm
trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm
trunk/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent/Syndetic.pm
trunk/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm
trunk/Open-ILS/src/reporter/clark-kent.pl
trunk/Open-ILS/src/support-scripts/fine_generator.pl
trunk/Open-ILS/src/support-scripts/hold_targeter.pl
trunk/Open-ILS/src/support-scripts/marc_export
trunk/Open-ILS/src/support-scripts/oils_header.pl
trunk/Open-ILS/src/support-scripts/test-scripts/notes.pl
trunk/Open-ILS/src/support-scripts/test-scripts/offline.pl
Log:
Patch from Dan Scott to move JSON to OpenSRF::Utils::JSON:
I noticed back when I was first installing OpenSRF that it includes a
module, JSON.pm, that exists at the root level of the package
directories. This would be fine, except it conflicts with a CPAN
module that is also named JSON, which confuses the CPAN installer when
you check for upgrades and conceivably could lead to a broken system.
I suggested to Mike that it would probably make sense to move the
OpenSRF version of the module into the OpenSRF/Utils/ package
namespace, and he agreed. Of course, there are ramifications
throughout the code, so I've tried to be extra-careful in catching and
correcting all of the places where the use of this module surfaces in
both OpenSRF and Evergreen.
Modified: trunk/Evergreen/src/extras/import/object_dumper.pl
===================================================================
--- trunk/Evergreen/src/extras/import/object_dumper.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Evergreen/src/extras/import/object_dumper.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -7,7 +7,7 @@
use strict;
use warnings;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::System;
use OpenILS::Utils::Fieldmapper;
use OpenSRF::Utils::SettingsClient;
@@ -24,5 +24,5 @@
$t =~ s/\./_/og;
my $m = "retrieve_all_$t";
my $d = $e->$m();
- print JSON->perl2JSON($_) . "\n" for @$d;
+ print OpenSRF::Utils::JSON->perl2JSON($_) . "\n" for @$d;
}
Modified: trunk/Evergreen/src/extras/import/parse_patron_xml.pl
===================================================================
--- trunk/Evergreen/src/extras/import/parse_patron_xml.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Evergreen/src/extras/import/parse_patron_xml.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -11,7 +11,7 @@
use OpenILS::Utils::Fieldmapper;
use Digest::MD5 qw/md5_hex/;
use Getopt::Long;
-use JSON;
+use OpenSRF::Utils::JSON;
use DateTime;
use Time::HiRes qw/time/;
use XML::LibXML;
@@ -302,7 +302,7 @@
}
print STDERR "\r$count ".$count/(time - $starttime) unless ($count % 100);
- print JSON->perl2JSON( $_ )."\n" for ($p,$card,$profile_sce, at addresses, at notes);
+ print OpenSRF::Utils::JSON->perl2JSON( $_ )."\n" for ($p,$card,$profile_sce, at addresses, at notes);
$count++;
}
Modified: trunk/Evergreen/src/support-scripts/eg_gen_overdue.pl
===================================================================
--- trunk/Evergreen/src/support-scripts/eg_gen_overdue.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Evergreen/src/support-scripts/eg_gen_overdue.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -21,6 +21,7 @@
use Email::Send;
use DateTime::Format::ISO8601;
use OpenSRF::Utils qw/:datetime/;
+use OpenSRF::Utils::JSON;
use Unicode::Normalize;
use OpenILS::Const qw/:const/;
@@ -445,7 +446,7 @@
if( my $set = $e->search_actor_org_unit_setting(
{ name => 'org.bounced_emails', org_unit => $org->id } )->[0] ) {
- my $bemail = JSON->JSON2perl($set->value);
+ my $bemail = OpenSRF::Utils::JSON->JSON2perl($set->value);
$errors_to = $bemail if $bemail;
}
Modified: trunk/Open-ILS/examples/json-request-test.pl
===================================================================
--- trunk/Open-ILS/examples/json-request-test.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/examples/json-request-test.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -4,7 +4,7 @@
use lib '../../OpenSRF/src/perlmods/';
use lib '../src/perlmods/OpenILS/Utils/';
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::System;
use OpenILS::Utils::ScriptRunner;
use OpenSRF::Utils::Logger;
@@ -27,8 +27,8 @@
OpenILS::Utils::ScriptRunner->add_path('../src/javascript/backend/libs/');
OpenILS::Utils::ScriptRunner->add_path('./');
- print JSON->perl2JSON( OpenILS::Utils::ScriptRunner->new( file => shift(@ARGV) )->run );
- #print JSON->perl2JSON( OpenILS::Utils::ScriptRunner->new->run( shift(@ARGV) ) );
+ print OpenSRF::Utils::JSON->perl2JSON( OpenILS::Utils::ScriptRunner->new( file => shift(@ARGV) )->run );
+ #print OpenSRF::Utils::JSON->perl2JSON( OpenILS::Utils::ScriptRunner->new->run( shift(@ARGV) ) );
} otherwise {
warn 'crap:'.shift();
Modified: trunk/Open-ILS/examples/reporter-sql-builder-test.pl
===================================================================
--- trunk/Open-ILS/examples/reporter-sql-builder-test.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/examples/reporter-sql-builder-test.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -3,7 +3,7 @@
use warnings;
use strict;
use OpenILS::Reporter::SQLBuilder;
-use JSON;
+use OpenSRF::Utils::JSON;
my $report = {
select => [
@@ -88,7 +88,7 @@
pivot_label => 2,
};
-$report = JSON->JSON2perl('{"select":[{"relation":"b312819df8fe889b50f70ea9fa054e72","path":"au-home_ou-aou-shortname","alias":"ILS User:Home Library:Short (Policy) Name","column":{"transform":"Bare","colname":"shortname"}},{"relation":"80bfa74cd4909b585f6187fe8f8591c5","path":"au-survey_responses-asvr-survey-asv-name","alias":"ILS User:Survey Responses:survey:name","column":{"transform":"Bare","colname":"name"}},{"relation":"8a6cb366f41b2b8186df7c7749ff41ba","path":"au-survey_responses-asvr-answer-asva-answer","alias":"ILS User:Survey Responses:answer:Answer Text","column":{"transform":"Bare","colname":"answer"}},{"relation":"8bcc25c96aa5a71f7a76309077753e67","path":"au-id","alias":"count","column":{"transform":"count","colname":"id"}}],"from":{"table":"actor.usr","path":"au","alias":"8bcc25c96aa5a71f7a76309077753e67","join":{"id-survey_responses":{"key":"usr","type":"left","table":"action.survey_response","path":"au-survey_responses-asvr","alias":"cab1b47d26fa649f9a795d191
bac0642","join":{"survey":{"key":"id","table":"action.survey","path":"au-survey_responses-asvr-survey-asv","alias":"80bfa74cd4909b585f6187fe8f8591c5"},"answer":{"key":"id","table":"action.survey_answer","path":"au-survey_responses-asvr-answer-asva","alias":"8a6cb366f41b2b8186df7c7749ff41ba"}}},"home_ou":{"key":"id","table":"actor.org_unit","path":"au-home_ou-aou","alias":"b312819df8fe889b50f70ea9fa054e72"}}},"where":[{"relation":"80bfa74cd4909b585f6187fe8f8591c5","path":"au-survey_responses-asvr-survey-asv-id","column":{"transform":"Bare","colname":"id"},"condition":{"in":"::P0"}},{"relation":"b312819df8fe889b50f70ea9fa054e72","path":"au-home_ou-aou-id","column":{"transform":"Bare","colname":"id"},"condition":{"in":"::P1"}}],"having":[],"order_by":[]}');
+$report = OpenSRF::Utils::JSON->JSON2perl('{"select":[{"relation":"b312819df8fe889b50f70ea9fa054e72","path":"au-home_ou-aou-shortname","alias":"ILS User:Home Library:Short (Policy) Name","column":{"transform":"Bare","colname":"shortname"}},{"relation":"80bfa74cd4909b585f6187fe8f8591c5","path":"au-survey_responses-asvr-survey-asv-name","alias":"ILS User:Survey Responses:survey:name","column":{"transform":"Bare","colname":"name"}},{"relation":"8a6cb366f41b2b8186df7c7749ff41ba","path":"au-survey_responses-asvr-answer-asva-answer","alias":"ILS User:Survey Responses:answer:Answer Text","column":{"transform":"Bare","colname":"answer"}},{"relation":"8bcc25c96aa5a71f7a76309077753e67","path":"au-id","alias":"count","column":{"transform":"count","colname":"id"}}],"from":{"table":"actor.usr","path":"au","alias":"8bcc25c96aa5a71f7a76309077753e67","join":{"id-survey_responses":{"key":"usr","type":"left","table":"action.survey_response","path":"au-survey_responses-asvr","alias":"cab1b47d2
6fa649f9a795d191bac0642","join":{"survey":{"key":"id","table":"action.survey","path":"au-survey_responses-asvr-survey-asv","alias":"80bfa74cd4909b585f6187fe8f8591c5"},"answer":{"key":"id","table":"action.survey_answer","path":"au-survey_responses-asvr-answer-asva","alias":"8a6cb366f41b2b8186df7c7749ff41ba"}}},"home_ou":{"key":"id","table":"actor.org_unit","path":"au-home_ou-aou","alias":"b312819df8fe889b50f70ea9fa054e72"}}},"where":[{"relation":"80bfa74cd4909b585f6187fe8f8591c5","path":"au-survey_responses-asvr-survey-asv-id","column":{"transform":"Bare","colname":"id"},"condition":{"in":"::P0"}},{"relation":"b312819df8fe889b50f70ea9fa054e72","path":"au-home_ou-aou-id","column":{"transform":"Bare","colname":"id"},"condition":{"in":"::P1"}}],"having":[],"order_by":[]}');
my $params = {
PARAM1 => [ 18, 19, 20, 21, 22, 23 ],
@@ -101,7 +101,7 @@
PARAM7 => 'f',
};
-$params = JSON->JSON2perl('{"P0":["1"],"P1":["1","17","18","20","19","22","24","25","27","21","29","26","28","23","30","226","227","229","230","228","221","222","130","131","132","231","232","233","234","235","223","224","225","135","137","136","138","139","140","141","277","280","279","283","281","282","284","278","133","134","262","263","265","266","264","268","267","43","44","45","46","47","48","285","286","287","296","288","289","299","290","291","292","293","294","295","298","297","300","301","302","31","32","33","34","41","42","121","122","123","125","129","126","124","127","128","168","169","170","171","172","173","194","195","151","154","155","152","153","164","165","167","166","236","237","238","240","239","269","270","271","272","273","274","275","276","118","119","120","243","251","256","244","245","246","247","248","249","250","252","253","255","257","254","258","259","260","261","10","12","11","13","15","14","16","108","109","110","111","112","113","241","242","
156","157","158","160","162","163","159","161","303","304","307","306","305","308","310","309","311","207","211","208","209","210","88","89","91","90","212","213","218","215","214","217","216","219","220","70","72","71","74","73","75","76","77","114","115","116","117","196","197","201","199","200","204","202","203","206","198","205","100","101","102","103","104","105","106","107","68","69","98","99","35","38","37","36","39","40","142","143","144","145","146","147","148","149","150","92","93","94","95","96","97","188","189","190","191","192","193","61","62","67","63","64","65","66","78","79","80","81","82","85","84","86","83","87","58","59","60","49","56","50","51","52","54","53","55","57","174","182","175","177","179","180","183","181","184","185","186","187","176","178"]}');
+$params = OpenSRF::Utils::JSON->JSON2perl('{"P0":["1"],"P1":["1","17","18","20","19","22","24","25","27","21","29","26","28","23","30","226","227","229","230","228","221","222","130","131","132","231","232","233","234","235","223","224","225","135","137","136","138","139","140","141","277","280","279","283","281","282","284","278","133","134","262","263","265","266","264","268","267","43","44","45","46","47","48","285","286","287","296","288","289","299","290","291","292","293","294","295","298","297","300","301","302","31","32","33","34","41","42","121","122","123","125","129","126","124","127","128","168","169","170","171","172","173","194","195","151","154","155","152","153","164","165","167","166","236","237","238","240","239","269","270","271","272","273","274","275","276","118","119","120","243","251","256","244","245","246","247","248","249","250","252","253","255","257","254","258","259","260","261","10","12","11","13","15","14","16","108","109","110","111","112","11
3","241","242","156","157","158","160","162","163","159","161","303","304","307","306","305","308","310","309","311","207","211","208","209","210","88","89","91","90","212","213","218","215","214","217","216","219","220","70","72","71","74","73","75","76","77","114","115","116","117","196","197","201","199","200","204","202","203","206","198","205","100","101","102","103","104","105","106","107","68","69","98","99","35","38","37","36","39","40","142","143","144","145","146","147","148","149","150","92","93","94","95","96","97","188","189","190","191","192","193","61","62","67","63","64","65","66","78","79","80","81","82","85","84","86","83","87","58","59","60","49","56","50","51","52","54","53","55","57","174","182","175","177","179","180","183","181","184","185","186","187","176","178"]}');
my $r = OpenILS::Reporter::SQLBuilder->new;
Modified: trunk/Open-ILS/src/extras/Perl2REST.pl
===================================================================
--- trunk/Open-ILS/src/extras/Perl2REST.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/Perl2REST.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;use warnings;
use OpenSRF::EX qw/:try/;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::System;
use OpenSRF::Application;
use OpenILS::Utils::Fieldmapper;
Modified: trunk/Open-ILS/src/extras/import/direct_ingest.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/direct_ingest.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/import/direct_ingest.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -14,7 +14,7 @@
use OpenILS::Application::AppUtils;
use OpenILS::Utils::Fieldmapper;
use Digest::MD5 qw/md5_hex/;
-use JSON;
+use OpenSRF::Utils::JSON;
use Data::Dumper;
use FileHandle;
@@ -57,7 +57,7 @@
while (my $rec = <>) {
next unless ($rec);
- my $bib = JSON->JSON2perl($rec);
+ my $bib = OpenSRF::Utils::JSON->JSON2perl($rec);
my $data;
try {
@@ -91,12 +91,12 @@
$bib->fingerprint( $fp->{fingerprint} ) unless ($auth);
$bib->quality( $fp->{quality} ) unless ($auth);
- print( JSON->perl2JSON($bib)."\n" );
+ print( OpenSRF::Utils::JSON->perl2JSON($bib)."\n" );
unless ($auth) {
- print( JSON->perl2JSON($rd)."\n" );
- print( JSON->perl2JSON($_)."\n" ) for (@$field_entries);
+ print( OpenSRF::Utils::JSON->perl2JSON($rd)."\n" );
+ print( OpenSRF::Utils::JSON->perl2JSON($_)."\n" ) for (@$field_entries);
}
- print( JSON->perl2JSON($_)."\n" ) for (@$full_rec);
+ print( OpenSRF::Utils::JSON->perl2JSON($_)."\n" ) for (@$full_rec);
}
Modified: trunk/Open-ILS/src/extras/import/direct_loader.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/direct_loader.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/import/direct_loader.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -14,7 +14,7 @@
use OpenILS::Application::AppUtils;
use OpenILS::Utils::Fieldmapper;
use Digest::MD5 qw/md5_hex/;
-use JSON;
+use OpenSRF::Utils::JSON;
use Data::Dumper;
use FileHandle;
@@ -57,7 +57,7 @@
while ( my $rec = <> ) {
next unless ($rec);
- my $row = JSON->JSON2perl($rec);
+ my $row = OpenSRF::Utils::JSON->JSON2perl($rec);
OpenSRF::Application->method_lookup( "$base.push" )->run($row);
Modified: trunk/Open-ILS/src/extras/import/marc2are.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/marc2are.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/import/marc2are.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -13,7 +13,7 @@
use OpenILS::Application::AppUtils;
use OpenILS::Utils::Fieldmapper;
use Digest::MD5 qw/md5_hex/;
-use JSON;
+use OpenSRF::Utils::JSON;
use Data::Dumper;
use Unicode::Normalize;
@@ -80,7 +80,7 @@
$bib->arn_value($count);
$bib->last_xact_id('IMPORT-'.$starttime);
- print JSON->perl2JSON($bib)."\n";
+ print OpenSRF::Utils::JSON->perl2JSON($bib)."\n";
$count++;
Modified: trunk/Open-ILS/src/extras/import/marc2bre.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/marc2bre.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/import/marc2bre.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -7,7 +7,7 @@
use Error qw/:try/;
use OpenILS::Utils::Fieldmapper;
use Digest::MD5 qw/md5_hex/;
-use JSON;
+use OpenSRF::Utils::JSON;
use Data::Dumper;
use Unicode::Normalize;
use Encode;
@@ -172,7 +172,7 @@
$bib->tcn_value($tcn_value);
$bib->last_xact_id('IMPORT-'.$starttime);
- print JSON->perl2JSON($bib)."\n";
+ print OpenSRF::Utils::JSON->perl2JSON($bib)."\n";
$dontuse_id{$tcn_value} = 1;
$count++;
Modified: trunk/Open-ILS/src/extras/import/pg_loader.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/pg_loader.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/import/pg_loader.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -7,7 +7,7 @@
use OpenSRF::EX qw/:try/;
use OpenSRF::Utils::SettingsClient;
use OpenILS::Utils::Fieldmapper;
-use JSON;
+use OpenSRF::Utils::JSON;
use FileHandle;
use Time::HiRes qw/time/;
@@ -38,7 +38,7 @@
my $row;
try {
- $row = JSON->JSON2perl($rec);
+ $row = OpenSRF::Utils::JSON->JSON2perl($rec);
} catch Error with {
my $e = shift;
warn "\n\n !!! Error : $e \n\n at or around line $count\n";
Modified: trunk/Open-ILS/src/extras/org_tree_js.pl
===================================================================
--- trunk/Open-ILS/src/extras/org_tree_js.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/extras/org_tree_js.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -3,7 +3,7 @@
use OpenSRF::AppSession;
use OpenSRF::System;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenILS::Utils::Fieldmapper;
use OpenSRF::Utils::SettingsClient;
use OpenSRF::Utils::Cache;
@@ -22,7 +22,7 @@
my $tree = $ses->request("open-ils.storage.direct.actor.org_unit.retrieve.all.atomic")->gather(1);
my $types = $ses->request("open-ils.storage.direct.actor.org_unit_type.retrieve.all.atomic")->gather(1);
-my $types_string = JSON->perl2JSON($types);
+my $types_string = OpenSRF::Utils::JSON->perl2JSON($types);
$types_string =~ s/\"/\\\"/g;
my $pile = "var _l = [";
Modified: trunk/Open-ILS/src/offline/offline.pl
===================================================================
--- trunk/Open-ILS/src/offline/offline.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/offline/offline.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict; use warnings;
use CGI;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::System;
use OpenSRF::Utils::Logger qw/$logger/;
use OpenILS::Application::AppUtils;
@@ -226,7 +226,7 @@
# --------------------------------------------------------------------
sub ol_handle_result {
my $obj = shift;
- my $json = JSON->perl2JSON($obj);
+ my $json = OpenSRF::Utils::JSON->perl2JSON($obj);
# Clear this so it's not remembered
$evt = undef;
@@ -417,7 +417,7 @@
open(F, "$fname") or ol_handle_event('OFFLINE_FILE_ERROR');
my @d = <F>;
my @p;
- push(@p, JSON->JSON2perl($_)) for @d;
+ push(@p, OpenSRF::Utils::JSON->JSON2perl($_)) for @d;
close(F);
return \@p;
}
@@ -492,7 +492,7 @@
my $obj = shift;
my $last = shift;
- $obj = JSON->perl2JSON($obj);
+ $obj = OpenSRF::Utils::JSON->perl2JSON($obj);
if(!$rhandle) {
open($rhandle, ">>$basedir/pending/$org/$seskey/results")
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -19,7 +19,7 @@
use OpenSRF::Utils::Cache;
-use JSON;
+use OpenSRF::Utils::JSON;
use DateTime;
use DateTime::Format::ISO8601;
use OpenILS::Const qw/:const/;
@@ -63,7 +63,7 @@
my @params = map {
[{ usr => $user->id, name => $_}, {value => $$settings{$_}}] } keys %$settings;
- $_->[1]->{value} = JSON->perl2JSON($_->[1]->{value}) for @params;
+ $_->[1]->{value} = OpenSRF::Utils::JSON->perl2JSON($_->[1]->{value}) for @params;
$logger->activity("User " . $staff->id . " updating user $uid settings with: " . Dumper(\@params));
@@ -92,7 +92,7 @@
my @params;
for my $set (keys %$settings) {
- my $json = JSON->perl2JSON($$settings{$set});
+ my $json = OpenSRF::Utils::JSON->perl2JSON($$settings{$set});
$logger->activity("updating org_unit.setting: $ouid : $set : $json");
push( @params,
@@ -128,7 +128,7 @@
'open-ils.cstore',
'open-ils.cstore.direct.actor.user_setting.search.atomic', { usr => $uid } );
- my $settings = { map { ( $_->name => JSON->JSON2perl($_->value) ) } @$s };
+ my $settings = { map { ( $_->name => OpenSRF::Utils::JSON->JSON2perl($_->value) ) } @$s };
return $$settings{$setting} if $setting;
return $settings;
@@ -149,7 +149,7 @@
'open-ils.cstore',
'open-ils.cstore.direct.actor.org_unit_setting.search.atomic', {org_unit => $ouid});
- return { map { ( $_->name => JSON->JSON2perl($_->value) ) } @$s };
+ return { map { ( $_->name => OpenSRF::Utils::JSON->JSON2perl($_->value) ) } @$s };
}
@@ -293,7 +293,7 @@
if( $opatron ) {
# Log the new and old patron for investigation
$logger->info("$user_session updating patron object. orig patron object = ".
- JSON->perl2JSON($opatron). " |||| new patron = ".JSON->perl2JSON($fuser));
+ OpenSRF::Utils::JSON->perl2JSON($opatron). " |||| new patron = ".OpenSRF::Utils::JSON->perl2JSON($fuser));
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -1224,7 +1224,7 @@
if( $setting ) {
$logger->info("found org_setting $name at org $orgid : " . $setting->value);
- return { org => $orgid, value => JSON->JSON2perl($setting->value) };
+ return { org => $orgid, value => OpenSRF::Utils::JSON->JSON2perl($setting->value) };
}
my $org = $e->retrieve_actor_org_unit($orgid) or return $e->event;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -7,7 +7,7 @@
use base qw/OpenSRF::Application/;
use Time::HiRes qw(time);
use OpenSRF::EX qw(:try);
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenILS::Utils::Fieldmapper;
use OpenILS::Event;
use OpenILS::Const qw/:const/;
@@ -768,7 +768,7 @@
my $override = $self->api_name =~ /override/;
$evt = update_fleshed_copies($editor, $override, undef, $copies, $delete_stats);
if( $evt ) {
- $logger->info("fleshed copy update failed with event: ".JSON->perl2JSON($evt));
+ $logger->info("fleshed copy update failed with event: ".OpenSRF::Utils::JSON->perl2JSON($evt));
$editor->rollback;
return $evt;
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/HoldNotify.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/HoldNotify.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/HoldNotify.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -20,6 +20,7 @@
use OpenSRF::EX qw(:try);
use vars q/$AUTOLOAD/;
use OpenILS::Event;
+use OpenSRF::Utils::JSON;
use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Utils::CStoreEditor q/:funcs/;
use OpenSRF::Utils::SettingsClient;
@@ -350,7 +351,7 @@
{ name => OILS_SETTING_ORG_BOUNCED_EMAIL,
org_unit => $self->pickup_lib->id } )->[0] ) {
- my $bemail = JSON->JSON2perl($set->value);
+ my $bemail = OpenSRF::Utils::JSON->JSON2perl($set->value);
$sender = $bemail if $bemail;
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -10,7 +10,7 @@
use OpenILS::Utils::ScriptRunner;
use OpenILS::Utils::Fieldmapper;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenILS::Utils::Fieldmapper;
@@ -933,7 +933,7 @@
my @rows = $self->method_lookup("open-ils.ingest.flat_marc.$type.xml")->run($r->marc);
for my $row (@rows) {
$client->respond($row);
- $log->debug(JSON->perl2JSON($row), DEBUG);
+ $log->debug(OpenSRF::Utils::JSON->perl2JSON($row), DEBUG);
}
return undef;
}
@@ -1871,7 +1871,7 @@
my $r = OpenILS::Application::Ingest->storage_req( "open-ils.storage.direct.biblio.record_entry.retrieve" => $rec );
my ($d) = $self->method_lookup("open-ils.worm.biblio_leader.xml")->run($r->marc);
- $log->debug("Record descriptor for bib rec $rec is ".JSON->perl2JSON($d), DEBUG);
+ $log->debug("Record descriptor for bib rec $rec is ".OpenSRF::Utils::JSON->perl2JSON($d), DEBUG);
return $d;
}
__PACKAGE__->register_method(
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Authority.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Authority.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Authority.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -9,7 +9,7 @@
use OpenILS::Utils::Editor q/:funcs/;
use OpenSRF::Utils::Logger qw/$logger/;
-use JSON;
+use OpenSRF::Utils::JSON;
use Time::HiRes qw(time);
use OpenSRF::EX qw(:try);
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -3,7 +3,7 @@
use strict; use warnings;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenILS::Utils::Fieldmapper;
use OpenILS::Utils::ModsParser;
use OpenSRF::Utils::SettingsClient;
@@ -13,7 +13,7 @@
use OpenSRF::Utils::Logger qw/:logger/;
-use JSON;
+use OpenSRF::Utils::JSON;
use Time::HiRes qw(time);
use OpenSRF::EX qw(:try);
@@ -478,7 +478,7 @@
my @search;
push( @search, ($_ => $$searchhash{$_})) for (sort keys %$searchhash);
- my $s = JSON->perl2JSON(\@search);
+ my $s = OpenSRF::Utils::JSON->perl2JSON(\@search);
my $ckey = $pfx . md5_hex($method . $s);
$logger->info("bib search for: $s");
@@ -526,7 +526,7 @@
}
@recs = @t;
- #$logger->debug("cache done .. returning $offset..$end : " . JSON->perl2JSON(\@recs));
+ #$logger->debug("cache done .. returning $offset..$end : " . OpenSRF::Utils::JSON->perl2JSON(\@recs));
}
return { ids => \@recs, count => $count };
@@ -654,7 +654,7 @@
# converts a metarecord to an mvr
sub _mr_to_mvr {
my $mr = shift;
- my $perl = JSON->JSON2perl($mr->mods());
+ my $perl = OpenSRF::Utils::JSON->JSON2perl($mr->mods());
return Fieldmapper::metabib::virtual_record->new($perl);
}
@@ -755,7 +755,7 @@
# now update the mods string in the db
- my $string = JSON->perl2JSON($mods->decast);
+ my $string = OpenSRF::Utils::JSON->perl2JSON($mods->decast);
$mr->mods($string);
#$e = OpenILS::Utils::Editor->new(xact => 1);
@@ -1035,7 +1035,7 @@
my @search;
push( @search, ($_ => $$args{$_}) ) for (sort keys %$args);
- my $ckey = $pfx . md5_hex($method . JSON->perl2JSON(\@search));
+ my $ckey = $pfx . md5_hex($method . OpenSRF::Utils::JSON->perl2JSON(\@search));
my $recs = search_cache($ckey, $offset, $limit);
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -1,7 +1,7 @@
package OpenILS::Application::Search;
use base qw/OpenSRF::Application/;
use strict; use warnings;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Utils::Fieldmapper;
@@ -34,7 +34,7 @@
# ------------------------------------------------------------------
-# Create custome dictionaries like so:
+# Create custom dictionaries like so:
# aspell --lang=en create master ./oils_authority.dict < /tmp/words
# where /tmp/words is a space separated list of words
# ------------------------------------------------------------------
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -14,7 +14,7 @@
use OpenILS::Application::Storage::CDBI::permission;
use OpenILS::Application::Storage::CDBI::container;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::Utils::Logger qw(:level);
use OpenSRF::EX qw/:try/;
@@ -237,7 +237,7 @@
my $self = shift;
my $arg = shift;
- $log->debug("CDBI->create: \$arg is $arg (".ref($arg)." : ".JSON->perl2JSON($arg).")",DEBUG);
+ $log->debug("CDBI->create: \$arg is $arg (".ref($arg)." : ".OpenSRF::Utils::JSON->perl2JSON($arg).")",DEBUG);
if (ref($arg) && UNIVERSAL::isa($arg => 'Fieldmapper')) {
return $self->create_from_fieldmapper($arg, at _);
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -4,7 +4,7 @@
#use OpenILS::Utils::Fieldmapper;
use OpenSRF::Utils::Logger qw/:level/;
use OpenSRF::EX qw/:try/;
-use JSON;
+use OpenSRF::Utils::JSON;
#
@@ -101,7 +101,7 @@
$org_cache{ $f->subfield( $map->{owning_lib} ) } = $ol;
} otherwise {
$log->debug('Could not find library with shortname ['.$f->subfield( $map->{owning_lib} ).'] : '. shift(), ERROR);
- $log->info('Failed holdings tag: ['.JSON->perl2JSON( $f ).']');
+ $log->info('Failed holdings tag: ['.OpenSRF::Utils::JSON->perl2JSON( $f ).']');
};
try {
@@ -112,7 +112,7 @@
$org_cache{ $f->subfield( $map->{circulating_lib} ) } = $cl;
} otherwise {
$log->debug('Could not find library with shortname ['.$f->subfield( $map->{circulating_lib} ).'] : '. shift(), ERROR);
- $log->info('Failed holdings tag: ['.JSON->perl2JSON( $f ).']');
+ $log->info('Failed holdings tag: ['.OpenSRF::Utils::JSON->perl2JSON( $f ).']');
};
next unless ($ol && $cl);
@@ -129,7 +129,7 @@
);
} otherwise {
$log->debug('Could not find or create callnumber ['.$f->subfield( $map->{call_number} )."] on record $record : ". shift(), ERROR);
- $log->info('Failed holdings tag: ['.JSON->perl2JSON( $f ).']');
+ $log->info('Failed holdings tag: ['.OpenSRF::Utils::JSON->perl2JSON( $f ).']');
};
next unless ($cn);
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -11,7 +11,7 @@
use OpenILS::Utils::FlatXML;
use OpenILS::Utils::Fieldmapper;
-use JSON;
+use OpenSRF::Utils::JSON;
use XML::LibXML;
use XML::LibXSLT;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -29,7 +29,7 @@
use XML::LibXSLT;
use Unicode::Normalize;
-use JSON;
+use OpenSRF::Utils::JSON;
our (
$_parser,
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/WoRM.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/WoRM.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/WoRM.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -10,7 +10,7 @@
use OpenILS::Utils::FlatXML;
use OpenILS::Utils::Fieldmapper;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenILS::Utils::Fieldmapper;
@@ -881,7 +881,7 @@
my $r = OpenILS::Application::WoRM->storage_req( "open-ils.storage.direct.biblio.record_entry.retrieve" => $rec );
my ($d) = $self->method_lookup("open-ils.worm.biblio_leader.xml")->run($r->marc);
- $log->debug("Record descriptor for bib rec $rec is ".JSON->perl2JSON($d), DEBUG);
+ $log->debug("Record descriptor for bib rec $rec is ".OpenSRF::Utils::JSON->perl2JSON($d), DEBUG);
return $d;
}
__PACKAGE__->register_method(
Modified: trunk/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -69,7 +69,7 @@
my $key;
- syslog('LOG_DEBUG', "OILS: Checkout permit returned event: " . JSON->perl2JSON($resp));
+ syslog('LOG_DEBUG', "OILS: Checkout permit returned event: " . OpenSRF::Utils::JSON->perl2JSON($resp));
if( @$resp == 1 and ! $U->event_code($$resp[0]) ) {
$key = $$resp[0]->{payload};
@@ -111,7 +111,7 @@
'open-ils.circ.checkout', $self->{authtoken}, $args );
- syslog('LOG_DEBUG', "OILS: Checkout returned event: " . JSON->perl2JSON($resp));
+ syslog('LOG_DEBUG', "OILS: Checkout returned event: " . OpenSRF::Utils::JSON->perl2JSON($resp));
# XXX Check for events
if( $resp ) {
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -8,7 +8,7 @@
use OpenSRF::System;
use XML::LibXML;
use OpenSRF::Utils::SettingsParser;
-use JSON;
+use OpenSRF::Utils::JSON;
sub new {
my ($class) = @_;
@@ -26,7 +26,7 @@
sub perl2JSON {
my( $self, $perl ) = @_;
- my $json = JSON->perl2JSON($perl);
+ my $json = OpenSRF::Utils::JSON->perl2JSON($perl);
warn "Created JSON from perl:\n$json\n";
return $json;
}
@@ -34,14 +34,14 @@
sub JSON2perl {
my( $self, $perl ) = @_;
warn "Turning JSON into perl:\n$perl\n";
- my $obj = JSON->JSON2perl($perl);
+ my $obj = OpenSRF::Utils::JSON->JSON2perl($perl);
warn "Created Perl from JSON: $obj \n";
return $obj;
}
sub perl2prettyJSON {
my( $self, $perl ) = @_;
- return JSON->perl2prettyJSON($perl);
+ return OpenSRF::Utils::JSON->perl2prettyJSON($perl);
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -6,7 +6,7 @@
use OpenILS::Utils::Fieldmapper;
use OpenILS::Event;
use Data::Dumper;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::Utils::Logger qw($logger);
my $U = "OpenILS::Application::AppUtils";
my %PERMS;
@@ -422,7 +422,7 @@
if( UNIVERSAL::isa($arg, "Fieldmapper") ) {
return (defined $arg->id) ? $arg->id : '<new object>';
}
- return JSON->perl2JSON($arg);
+ return OpenSRF::Utils::JSON->perl2JSON($arg);
return "";
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/Editor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/Editor.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/Editor.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -6,7 +6,7 @@
use OpenILS::Utils::Fieldmapper;
use OpenILS::Event;
use Data::Dumper;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::Utils::Logger qw($logger);
my $U = "OpenILS::Application::AppUtils";
@@ -337,7 +337,7 @@
my $arg = shift;
return "" unless defined $arg;
return $arg->id if UNIVERSAL::isa($arg, "Fieldmapper");
- return JSON->perl2JSON($arg);
+ return OpenSRF::Utils::JSON->perl2JSON($arg);
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -1,5 +1,5 @@
package Fieldmapper;
-use JSON;
+use OpenSRF::Utils::JSON;
use Data::Dumper;
use base 'OpenSRF::Application';
use OpenSRF::Utils::Logger;
@@ -97,7 +97,7 @@
}
}
- JSON->register_class_hint(
+ OpenSRF::Utils::JSON->register_class_hint(
hint => $pkg->json_hint,
name => $pkg,
type => 'array',
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -2,7 +2,7 @@
use strict; use warnings;
use OpenSRF::Utils::Logger qw(:logger);
use OpenSRF::EX qw(:try);
-use JSON;
+use OpenSRF::Utils::JSON;
use JavaScript::SpiderMonkey;
use LWP::UserAgent;
use XML::LibXML;
@@ -183,7 +183,7 @@
close(F);
$logger->debug( "script result is [$res]" );
- return JSON->JSON2perl( $res );
+ return OpenSRF::Utils::JSON->JSON2perl( $res );
}
sub remove_path {
@@ -469,7 +469,7 @@
my $blocking = shift;
my $params = shift;
- my @p = @{ JSON->JSON2perl($params) };
+ my @p = @{ OpenSRF::Utils::JSON->JSON2perl($params) };
my $ctx = $self->context;
@@ -484,7 +484,7 @@
if (!$req->failed) {
my $res = $req->recv->content;
- $ctx->property_by_path('__jsonopensrfreq_hash.id'.$id.'.responseText', JSON->perl2JSON($res));
+ $ctx->property_by_path('__jsonopensrfreq_hash.id'.$id.'.responseText', OpenSRF::Utils::JSON->perl2JSON($res));
$ctx->property_by_path('__jsonopensrfreq_hash.id'.$id.'.readyState', 4);
$ctx->property_by_path('__jsonopensrfreq_hash.id'.$id.'.statusText', 'OK');
$ctx->property_by_path('__jsonopensrfreq_hash.id'.$id.'.status', '200');
Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent/Syndetic.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent/Syndetic.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent/Syndetic.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -3,7 +3,7 @@
use LWP::UserAgent;
use OpenSRF::Utils::Logger qw/$logger/;
use OpenSRF::Utils::SettingsParser;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::EX qw/:try/;
use OpenILS::WWW::AddedContent;
@@ -184,7 +184,7 @@
return 0 unless $doc;
my $perl = OpenSRF::Utils::SettingsParser::XML2perl($doc->documentElement);
- my $json = JSON->perl2JSON($perl);
+ my $json = OpenSRF::Utils::JSON->perl2JSON($perl);
print "Content-type: text/plain\n\n";
print $json;
return 1;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm 2007-07-02 15:11:35 UTC (rev 7503)
@@ -9,7 +9,7 @@
use Apache2::RequestIO ();
use Apache2::RequestUtil;
-use JSON;
+use OpenSRF::Utils::JSON;
use CGI ();
@@ -47,7 +47,7 @@
}
if($err) {
- print JSON->perl2JSON($err);
+ print OpenSRF::Utils::JSON->perl2JSON($err);
return Apache2::Const::OK;
}
@@ -58,11 +58,11 @@
if(defined($cgi->param("param"))) {
for my $param ( $cgi->param("param")) {
- push( @param_array, JSON->JSON2perl( $param ));
+ push( @param_array, OpenSRF::Utils::JSON->JSON2perl( $param ));
}
} else {
for my $param ($cgi->param()) {
- $param_hash{$param} = JSON->JSON2perl($cgi->param($param))
+ $param_hash{$param} = OpenSRF::Utils::JSON->JSON2perl($cgi->param($param))
unless( $param eq "method" or $param eq "service" );
}
}
@@ -122,7 +122,7 @@
"Service: $service \nMethod: $method \nParams: @params \n" .
$response->stringify() . "\n",
};
- print JSON->perl2JSON($err);
+ print OpenSRF::Utils::JSON->perl2JSON($err);
$request->finish();
return 0;
}
@@ -140,7 +140,7 @@
"Service: $service \nMethod: $method \nParams: @params \n" .
"request->complete test failed in OpenILS::Web::Method\n"
};
- print JSON->perl2JSON($err);
+ print OpenSRF::Utils::JSON->perl2JSON($err);
$request->finish();
return 0;
}
@@ -151,7 +151,7 @@
warn "Results: \n";
warn Dumper \@results;
- print JSON->perl2JSON( \@results );
+ print OpenSRF::Utils::JSON->perl2JSON( \@results );
return 1;
}
Modified: trunk/Open-ILS/src/reporter/clark-kent.pl
===================================================================
--- trunk/Open-ILS/src/reporter/clark-kent.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/reporter/clark-kent.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -8,12 +8,12 @@
use Getopt::Long;
use DateTime;
use DateTime::Format::ISO8601;
-use JSON;
use Data::Dumper;
use Text::CSV_XS;
use Spreadsheet::WriteExcel::Big;
use OpenSRF::EX qw/:try/;
use OpenSRF::Utils qw/:daemon/;
+use OpenSRF::Utils::JSON;
#use OpenSRF::Utils::Logger qw/:level/;
use OpenSRF::System;
use OpenSRF::AppSession;
@@ -129,9 +129,9 @@
$r->{report} = $s3;
my $b = OpenILS::Reporter::SQLBuilder->new;
- $b->register_params( JSON->JSON2perl( $r->{report}->{data} ) );
+ $b->register_params( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{data} ) );
- $r->{resultset} = $b->parse_report( JSON->JSON2perl( $r->{report}->{template}->{data} ) );
+ $r->{resultset} = $b->parse_report( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{template}->{data} ) );
$r->{resultset}->relative_time($r->{run_time});
push @reports, $r;
}
Modified: trunk/Open-ILS/src/support-scripts/fine_generator.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/fine_generator.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/support-scripts/fine_generator.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -7,7 +7,7 @@
use strict;
use warnings;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::System;
my $config = shift || die "bootstrap config required\n";
Modified: trunk/Open-ILS/src/support-scripts/hold_targeter.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/hold_targeter.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/support-scripts/hold_targeter.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use JSON;
+use OpenSRF::Utils::JSON;
use OpenSRF::System;
my $config = shift || die "bootstrap config required\n";
Modified: trunk/Open-ILS/src/support-scripts/marc_export
===================================================================
--- trunk/Open-ILS/src/support-scripts/marc_export 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/support-scripts/marc_export 2007-07-02 15:11:35 UTC (rev 7503)
@@ -6,6 +6,7 @@
use OpenSRF::System;
use OpenSRF::EX qw/:try/;
use OpenSRF::AppSession;
+use OpenSRF::Utils::JSON;
use OpenSRF::Utils::SettingsClient;
use OpenILS::Application::AppUtils;
use OpenILS::Utils::Fieldmapper;
@@ -138,7 +139,7 @@
next unless $bib;
if (uc($format) eq 'BRE') {
- print JSON->perl2JSON($bib);
+ print OpenSRF::Utils::JSON->perl2JSON($bib);
stats();
next;
}
Modified: trunk/Open-ILS/src/support-scripts/oils_header.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/oils_header.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/support-scripts/oils_header.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use JSON;
+use OpenSRF::Utils::JSON;
use Data::Dumper;
use OpenSRF::System;
use OpenSRF::AppSession;
Modified: trunk/Open-ILS/src/support-scripts/test-scripts/notes.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/test-scripts/notes.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/support-scripts/test-scripts/notes.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -4,7 +4,7 @@
use strict; use warnings;
use Time::HiRes qw/time/;
use Data::Dumper;
-use JSON;
+use OpenSRF::Utils::JSON;
#-----------------------------------------------------------------------------
# Does a checkout, renew, and checkin
Modified: trunk/Open-ILS/src/support-scripts/test-scripts/offline.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/test-scripts/offline.pl 2007-07-02 14:32:40 UTC (rev 7502)
+++ trunk/Open-ILS/src/support-scripts/test-scripts/offline.pl 2007-07-02 15:11:35 UTC (rev 7503)
@@ -6,7 +6,7 @@
use LWP::UserAgent;
use HTTP::Request::Common;
use Data::Dumper;
-use JSON;
+use OpenSRF::Utils::JSON;
#-----------------------------------------------------------------------------
# Does a checkout, renew, and checkin
@@ -81,9 +81,9 @@
backdate => $t1
};
- $json .= JSON->perl2JSON($checkout) . "\n";
- $json .= JSON->perl2JSON($renew) . "\n" if $renew;
- $json .= JSON->perl2JSON($checkin) . "\n";
+ $json .= OpenSRF::Utils::JSON->perl2JSON($checkout) . "\n";
+ $json .= OpenSRF::Utils::JSON->perl2JSON($renew) . "\n" if $renew;
+ $json .= OpenSRF::Utils::JSON->perl2JSON($checkin) . "\n";
}
return $json;
@@ -106,7 +106,7 @@
my $url = "$baseurl/offline.pl$params&action=create&desc=test_d";
my $req = GET( $url );
my $res = $useragent->request($req);
- my $response = JSON->JSON2perl($res->{_content});
+ my $response = OpenSRF::Utils::JSON->JSON2perl($res->{_content});
oils_event_die($response);
$seskey = $response->{payload};
@@ -136,7 +136,7 @@
my $res = $useragent->request($req);
# Pass request to the user agent and get a response back
- my $event = JSON->JSON2perl($res->{_content});
+ my $event = OpenSRF::Utils::JSON->JSON2perl($res->{_content});
oils_event_die($event);
print "Upload succeeded to session $seskey...\n";
}
@@ -151,7 +151,7 @@
my $url = "$baseurl/offline.pl$params&action=status&status_type=scripts";
my $req = GET( $url );
my $res = $useragent->request($req);
- my $ses = JSON->JSON2perl($res->{_content});
+ my $ses = OpenSRF::Utils::JSON->JSON2perl($res->{_content});
my $scripts = $ses->{scripts};
delete $ses->{scripts};
@@ -184,7 +184,7 @@
my $req = GET( $url );
my $res = $useragent->request($req);
- my $event = JSON->JSON2perl($res->{_content});
+ my $event = OpenSRF::Utils::JSON->JSON2perl($res->{_content});
oils_event_die($event);
}
@@ -199,7 +199,7 @@
my $url = "$baseurl/offline.pl$params&action=status&status_type=summary";
my $req = GET( $url );
my $res = $useragent->request($req);
- my $blob = JSON->JSON2perl($res->{_content});
+ my $blob = OpenSRF::Utils::JSON->JSON2perl($res->{_content});
my $total = $blob->{total};
my $count = $blob->{num_complete} || "0";
@@ -216,7 +216,7 @@
my $url = "$baseurl/offline.pl$params&action=status&status_type=exceptions";
my $req = GET( $url );
my $res = $useragent->request($req);
- my $blob = JSON->JSON2perl($res->{_content});
+ my $blob = OpenSRF::Utils::JSON->JSON2perl($res->{_content});
my @events;
push(@events, $_->{event}) for @$blob;
More information about the open-ils-commits
mailing list