1 use strict; use warnings;
2 package OpenILS::Application::Cat;
3 use OpenSRF::Application;
4 use OpenILS::Application::Cat::Utils;
5 use base qw/OpenSRF::Application/;
7 my $utils = "OpenILS::Application::Cat::Utils";
12 __PACKAGE__->register_method(
13 method => "record_tree_retrieve",
14 api_name => "open-ils.cat.record.tree.retrieve",
16 note => "Returns the tree associated with the nodeset of the given doc id"
19 sub record_tree_retrieve {
20 my( $self, $client, $recordid ) = @_;
22 my $name = "open-ils.storage.biblio.record_entry.nodeset.retrieve";
23 my $method = $self->method_lookup($name);
26 throw OpenSRF::EX::PANIC ("Could not lookup method $name");
29 my ($nodes) = $method->run($recordid);
31 if(UNIVERSAL::isa($nodes,"OpenSRF::EX")) {
35 return undef unless $nodes;
37 return $utils->nodeset2tree( $nodes );
41 __PACKAGE__->register_method(
42 method => "record_tree_commit",
43 api_name => "open-ils.cat.record.tree.commit",
45 note => "Walks the tree and commits any changed nodes " .
46 "adds any new nodes, and deletes any deleted nodes",
49 sub record_tree_commit {
50 my( $self, $client, $tree ) = @_;
51 my $nodeset = $utils->tree2nodeset($tree);
52 $utils->commit_nodeset( $nodeset );