2 # turns the orgTree and orgTypes into js files
4 use OpenSRF::AppSession;
7 OpenSRF::System->bootstrap_client(config_file => "/pines/conf/bootstrap.conf");
10 my $ses = OpenSRF::AppSession->create("open-ils.search");
11 my $req = $ses->request("open-ils.search.actor.org_tree.slim.retrieve");
12 my $tree = $req->gather(1);
14 my $ses2 = OpenSRF::AppSession->create("open-ils.storage");
15 my $req2 = $ses2->request("open-ils.storage.direct.actor.org_unit_type.retrieve.all.atomic");
16 my $types = $req2->gather(1);
19 my $tree_string = JSON->perl2JSON($tree);
20 my $types_string = JSON->perl2JSON($types);
22 $tree_string =~ s/\"/\\\"/g;
23 $types_string =~ s/\"/\\\"/g;
25 $tree_string = "var globalOrgTree = JSON2js(\"$tree_string\");";
26 $types_string = "var globalOrgTypes = JSON2js(\"$types_string\");";
28 print "$tree_string\n\n$types_string\n";