Skip to content

Commit

Permalink
fix controller reference for multivisualizers
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Jan 6, 2015
1 parent ba7cbb6 commit 307122f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion software/backend/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PM := $(shell find lib/ -name "*.pm")

POD := $(shell find lib/ -name "*.pod")

RES := $(shell test -d public/resource && find public/resource -type f)
RES := $(shell test -d public/resource && find public/resource -type f)

TEMPL := $(shell test -d templates && find templates -type f)

Expand Down
2 changes: 1 addition & 1 deletion software/backend/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ ETC = etc/extopus.cfg.dist
BIN = bin/$(MJ_SCRIPT).pl bin/run.sh
PM := $(shell find lib/ -name "*.pm")
POD := $(shell find lib/ -name "*.pod")
RES := $(shell test -d public/resource && find public/resource -type f)
RES := $(shell test -d public/resource && find public/resource -type f)
TEMPL := $(shell test -d templates && find templates -type f)
PUB = public/script/$(QX_CLASS).js public/index.html $(RES)
EXTRA_DIST = $(wildcard t/*.t) $(ETC) $(BIN) $(PM) $(POD) $(PUB) $(TEMPL)
Expand Down
17 changes: 8 additions & 9 deletions software/backend/lib/EP/Visualizer/TorrusData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ sub matchRecord {
};
}

=head2 getData(recId,end,interval,count)
=head2 getData(controller,recId,end,interval,count)
use the AGGREGATE_DS rpc call to pull some statistics from the server.
Expand Down Expand Up @@ -364,18 +364,17 @@ sub addProxyRoute {
my $self = shift;
my $routes = $self->app->routes;
$routes->get($self->app->prefix.$self->root, sub {
my $ctrl = shift;
my $controller = shift;
# make sure the rest of the object knows what we are doing here
$self->controller($ctrl);
my $req = $ctrl->req;
my $req = $controller->req;
my $recId = $req->param('recid');
my $end = $req->param('end');
my $interval = $req->param('interval');
my $count = $req->param('count') || 1;
my $format = $req->param('format');
my $data = $self->getData($recId,$end,$interval,$count);
my $data = $self->getData($controller,$recId,$end,$interval,$count);
if (not $data->{status}){
$ctrl->render(
$controller->render(
status => 401,
text => $data->{error},
);
Expand All @@ -384,7 +383,7 @@ sub addProxyRoute {
}
my $rp = Mojo::Message::Response->new;
$rp->code(200);
my $cache = $ctrl->cache;
my $cache = $controller->cache;
my $wbname = $self->getWbName($cache,$recId,$data);

my $name = $wbname . ' - '.strftime('%Y-%m-%d',localtime($end));
Expand All @@ -408,8 +407,8 @@ sub addProxyRoute {
$rp->headers->last_modified(Mojo::Date->new(time-24*3600));
$rp->headers->add('Content-Disposition',$fileData->{contentDisposition});
$rp->body($fileData->{body});
$ctrl->tx->res($rp);
$ctrl->rendered;
$controller->tx->res($rp);
$controller->rendered;
});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions software/backend/lib/EP/Visualizer/TorrusMultiData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ sub getWbName {
return $data->{title};
}

=head2 getData(recId[],end,interval)
=head2 getData($controller,recId[],end,interval)
run get data for multiple records
Expand All @@ -108,7 +108,7 @@ sub getData {
my $stamp;
my $cache = EP::Cache->new(controller=>$controller);
for my $recId (@$recIds){
my $data = $self->SUPER::getData($recId,$end,$interval,1);
my $data = $self->SUPER::getData($controller,$recId,$end,$interval,1);
if ($data->{status}){
$stamp = $data->{stepLabels}[0];
push @ret, $data->{data}[0];
Expand Down
1 change: 0 additions & 1 deletion software/backend/lib/EP/Visualizer/base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ custom rpc service of this visualizer. accessible via the C<visualize(visualizer

sub rpcService { ## no critic (RequireArgUnpacking)
my $self = shift;
my $instance = shift;
my $controller = shift;
my @args = @_;
die "sorry, no rpc service support";
Expand Down
20 changes: 10 additions & 10 deletions software/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for extopus 0.5.0.
# Generated by GNU Autoconf 2.69 for extopus 0.5.2.
#
# Report bugs to <support@oetiker.ch>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='extopus'
PACKAGE_TARNAME='extopus'
PACKAGE_VERSION='0.5.0'
PACKAGE_STRING='extopus 0.5.0'
PACKAGE_VERSION='0.5.2'
PACKAGE_STRING='extopus 0.5.2'
PACKAGE_BUGREPORT='support@oetiker.ch'
PACKAGE_URL=''

Expand Down Expand Up @@ -1220,7 +1220,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures extopus 0.5.0 to adapt to many kinds of systems.
\`configure' configures extopus 0.5.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1286,7 +1286,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of extopus 0.5.0:";;
short | recursive ) echo "Configuration of extopus 0.5.2:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1379,7 +1379,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
extopus configure 0.5.0
extopus configure 0.5.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand All @@ -1396,7 +1396,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by extopus $as_me 0.5.0, which was
It was created by extopus $as_me 0.5.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2263,7 +2263,7 @@ fi
# Define the identity of the package.
PACKAGE='extopus'
VERSION='0.5.0'
VERSION='0.5.2'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -3381,7 +3381,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by extopus $as_me 0.5.0, which was
This file was extended by extopus $as_me 0.5.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -3434,7 +3434,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
extopus config.status 0.5.0
extopus config.status 0.5.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
3 changes: 1 addition & 2 deletions software/frontend/source/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<head>
<!-- Extopus #VERSION# / #DATE# -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- enable chrome frame if available -->
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="SHORTCUT ICON" href="resource/ep/favicon.ico"/>
<title> Extopus </title>
</head>
Expand Down

0 comments on commit 307122f

Please sign in to comment.