}
return @targets;
-
-=head comment
- if( $app eq "settings" ) { # we have to load from the bootstrap config file
-
- if(!$conf) { die("No transport target for $app!"); }
- $targets = $conf->targets->$app || die("No transport target for $app!");
-
- } else {
- $targets = $config_client->config_value("apps",$app,"transport_targets", "router_target");
- if( !ref($targets) ) { $targets = [ $targets ]; }
- }
-
- return @$targets;
-=cut
}
# When we're a client and we want to connect to a remote service
sub add_1 {
my $self = shift;
my $client = shift;
- my @args = @_;
- $log->debug("Adding @args", INTERNAL);
- $log->debug("AppRequest is $client", INTERNAL);
- my $n1 = shift; my $n2 = shift;
- $n1 =~ s/\s+//; $n2 =~ s/\s+//;
- my $a = $n1 + $n2;
- return JSON::number::new($a);
+ my $n1 = shift;
+ my $n2 = shift;
+ my $a = $n1 + $n2;
+ return JSON::number->new($a);
}
__PACKAGE__->register_method( method => 'sub_1', api_name => 'dbmath.sub' );
sub sub_1 {
my $self = shift;
my $client = shift;
- my @args = @_;
- $log->debug("Subbing @args", INTERNAL);
- $log->debug("AppRequest is $client", INTERNAL);
- my $n1 = shift; my $n2 = shift;
- $n1 =~ s/\s+//; $n2 =~ s/\s+//;
+
+ my $n1 = shift;
+ my $n2 = shift;
my $a = $n1 - $n2;
- return JSON::number::new($a);
+ return JSON::number->new($a);
}
__PACKAGE__->register_method( method => 'mult_1', api_name => 'dbmath.mult' );
sub mult_1 {
my $self = shift;
my $client = shift;
- my @args = @_;
- $log->debug("Multiplying @args", INTERNAL);
- $log->debug("AppRequest is $client", INTERNAL);
- my $n1 = shift; my $n2 = shift;
- $n1 =~ s/\s+//; $n2 =~ s/\s+//;
+
+ my $n1 = shift;
+ my $n2 = shift;
my $a = $n1 * $n2;
- return JSON::number::new($a);
+ return JSON::number->new($a);
}
__PACKAGE__->register_method( method => 'div_1', api_name => 'dbmath.div' );
sub div_1 {
my $self = shift;
my $client = shift;
- my @args = @_;
- $log->debug("Dividing @args", INTERNAL);
- $log->debug("AppRequest is $client", INTERNAL);
- my $n1 = shift; my $n2 = shift;
- $n1 =~ s/\s+//; $n2 =~ s/\s+//;
+
+ my $n1 = shift;
+ my $n2 = shift;
my $a = $n1 / $n2;
- return JSON::number::new($a);
+ return JSON::number->new($a);
}
1;
__PACKAGE__->register_method( method => 'xpath_get', api_name => 'opensrf.settings.xpath.get' );
+
+__PACKAGE__->register_method(
+ method => 'xpath_get',
+ api_name => 'opensrf.settings.xpath.get.raw' );
+
sub xpath_get {
my($self, $client, $xpath) = @_;
warn "*************** Received XPATH $xpath\n";