bug fixes to make webgui work with the wre demo system
This commit is contained in:
parent
b3eff9623d
commit
a3b9509090
7 changed files with 14 additions and 8 deletions
|
|
@ -1,5 +1,6 @@
|
|||
6.99.1
|
||||
|
||||
- Bugfixes on dashboard to fix template errors.
|
||||
- Bug fixes to make WebGUI work with the WRE demo system.
|
||||
|
||||
6.99.0
|
||||
- Added a workflow system.
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ sub runTests {
|
|||
my $userAgent = new LWP::UserAgent;
|
||||
$userAgent->agent("Spectre");
|
||||
$userAgent->timeout(30);
|
||||
my $url = "http://".$configs->{$config}->get("sitename")->[0].":".$self->config->get("webguiPort")."/?op=spectreTest";
|
||||
my $url = "http://".$configs->{$config}->get("sitename")->[0].":".$self->config->get("webguiPort").$configs->{$config}->get("gateway")."?op=spectreTest";
|
||||
my $request = new HTTP::Request (GET => $url);
|
||||
my $response = $userAgent->request($request);
|
||||
if ($response->is_error) {
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ sub addJob {
|
|||
$self->{_jobs}{$params->{config}}{$params->{taskId}} = {
|
||||
taskId=>$params->{taskId},
|
||||
config=>$params->{config},
|
||||
gateway=>$params->{gateway},
|
||||
sitename=>$params->{sitename},
|
||||
schedule=>join(" ", $params->{minuteOfHour}, $params->{hourOfDay}, $params->{dayOfMonth}, $params->{monthOfYear}, $params->{dayOfWeek}),
|
||||
runOnce=>$params->{runOnce},
|
||||
|
|
@ -311,6 +312,7 @@ sub loadSchedule {
|
|||
my $params = JSON::jsonToObj($data->{parameters});
|
||||
$data->{parameters} = $params->{parameters};
|
||||
$data->{config} = $config;
|
||||
$data->{gateway} = $session->config->get("gateway");
|
||||
$data->{sitename} = $session->config->get("sitename")->[0];
|
||||
$kernel->yield("addJob", $data);
|
||||
}
|
||||
|
|
@ -373,7 +375,7 @@ sub runJob {
|
|||
$self->error("Warning: A scheduled task has corrupt information and is nat able to be run. Skipping execution.");
|
||||
$kernel->yield("deleteJob",{config=>$job->{config}, taskId=>$job->{taskId}}) if ($job->{config} ne "" && $job->{taskId} ne "");
|
||||
} else {
|
||||
my $url = "http://".$job->{sitename}.':'.$self->config->get("webguiPort").'/';
|
||||
my $url = "http://".$job->{sitename}.':'.$self->config->get("webguiPort").$job->{gateway};
|
||||
my $request = POST $url, [op=>"runCronJob", taskId=>$job->{taskId}];
|
||||
my $cookie = $self->{_cookies}{$job->{sitename}};
|
||||
$request->header("Cookie","wgSession=".$cookie) if (defined $cookie);
|
||||
|
|
@ -395,7 +397,7 @@ This method is called when the response from the runJob() method is received.
|
|||
=cut
|
||||
|
||||
sub runJobResponse {
|
||||
my ($self, $kernel) = @_[OBJECT, KERNEL];
|
||||
my ($self, $kernel) = @_[OBJECT, KERNEL];
|
||||
$self->debug("Retrieving response from scheduled job.");
|
||||
my ($request, $response, $entry) = @{$_[ARG1]};
|
||||
my $taskId = $request->header("X-taskId"); # got to figure out how to get this from the request, cuz the response may die
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ sub addInstance {
|
|||
$self->{_instances}{$params->{instanceId}} = {
|
||||
sitename=>$params->{sitename},
|
||||
instanceId=>$params->{instanceId},
|
||||
gateway => $params->{gateway},
|
||||
status=>"waiting",
|
||||
priority=>$params->{priority}
|
||||
};
|
||||
|
|
@ -261,7 +262,7 @@ sub loadWorkflows {
|
|||
my $session = WebGUI::Session->open($config->getWebguiRoot, $config->getFilename);
|
||||
my $result = $session->db->read("select instanceId,priority from WorkflowInstance");
|
||||
while (my ($id, $priority) = $result->array) {
|
||||
$kernel->yield("addInstance", {sitename=>$config->get("sitename")->[0], instanceId=>$id, priority=>$priority});
|
||||
$kernel->yield("addInstance", {gateway=>$config->get("gateway"), sitename=>$config->get("sitename")->[0], instanceId=>$id, priority=>$priority});
|
||||
}
|
||||
$session->close;
|
||||
}
|
||||
|
|
@ -333,7 +334,7 @@ sub runWorker {
|
|||
my ($kernel, $self, $instance, $session) = @_[KERNEL, OBJECT, ARG0, SESSION];
|
||||
$self->debug("Preparing to run workflow instance ".$instance->{instanceId}.".");
|
||||
POE::Component::Client::UserAgent->new;
|
||||
my $url = "http://".$instance->{sitename}.':'.$self->config->get("webguiPort").'/';
|
||||
my $url = "http://".$instance->{sitename}.':'.$self->config->get("webguiPort").$instance->{gateway};
|
||||
my $request = POST $url, [op=>"runWorkflow", instanceId=>$instance->{instanceId}];
|
||||
my $cookie = $self->{_cookies}{$instance->{sitename}};
|
||||
$request->header("Cookie","wgSession=".$cookie) if (defined $cookie);
|
||||
|
|
|
|||
|
|
@ -45,8 +45,9 @@ The Apache2::RequestRec object passed in by Apache's mod_perl.
|
|||
|
||||
sub handler {
|
||||
my $r = shift;
|
||||
my $configFile = shift || $r->dir_config('WebguiConfig');
|
||||
my $s = Apache2::ServerUtil->server;
|
||||
my $config = WebGUI::Config->new($s->dir_config('WebguiRoot'),$r->dir_config('WebguiConfig'));
|
||||
my $config = WebGUI::Config->new($s->dir_config('WebguiRoot'), $configFile);
|
||||
$r->push_handlers(PerlFixupHandler => \&fixupHandler) if (defined $config->get("passthruUrls"));
|
||||
foreach my $url ($config->get("extrasURL"), @{$config->get("passthruUrls")}) {
|
||||
return Apache2::Const::DECLINED if ($r->uri =~ m/^$url/);
|
||||
|
|
|
|||
|
|
@ -288,6 +288,7 @@ sub set {
|
|||
$params{parameters} = $self->get("parameters");
|
||||
$params{config} = $self->session->config->getFilename;
|
||||
$params{sitename} = $self->session->config->get("sitename")->[0];
|
||||
$params{gateway} = $self->session->config->get("gateway");
|
||||
$spectre->notify("cron/addJob", \%params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ sub set {
|
|||
if ($properties->{notifySpectre}) {
|
||||
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
||||
$spectre->notify("workflow/deleteInstance",$self->getId);
|
||||
$spectre->notify("workflow/addInstance", {sitename=>$self->session->config->get("sitename")->[0], instanceId=>$self->getId, priority=>$self->{_data}{priority}});
|
||||
$spectre->notify("workflow/addInstance", {gateway=>$self->session->config->get("gateway"), sitename=>$self->session->config->get("sitename")->[0], instanceId=>$self->getId, priority=>$self->{_data}{priority}});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue