updated webgui to run with Config::JSON 2.04
This commit is contained in:
parent
fb434a8b3a
commit
34fd8c9245
20 changed files with 56 additions and 51 deletions
|
|
@ -25,7 +25,7 @@ use WebGUI::DateTime;
|
|||
use DateTime::TimeZone;
|
||||
|
||||
use LWP::UserAgent;
|
||||
use JSON qw(objToJson jsonToObj);
|
||||
use JSON qw(to_json from_json);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -92,8 +92,8 @@ sub execute {
|
|||
my $eventList = [];
|
||||
my $feedList;
|
||||
if ($instance->getScratch('events')) {
|
||||
$eventList = jsonToObj($instance->getScratch('events'));
|
||||
$feedList = jsonToObj($instance->getScratch('feeds'));
|
||||
$eventList = from_json($instance->getScratch('events'));
|
||||
$feedList = from_json($instance->getScratch('feeds'));
|
||||
}
|
||||
else {
|
||||
my $ua = LWP::UserAgent->new(agent => "WebGUI");
|
||||
|
|
@ -356,8 +356,8 @@ sub execute {
|
|||
}
|
||||
while (@$eventList) {
|
||||
if ($startTime + 55 < time()) {
|
||||
$instance->setScratch('events', objToJson($eventList));
|
||||
$instance->setScratch('feeds', objToJson($feedList));
|
||||
$instance->setScratch('events', to_json($eventList));
|
||||
$instance->setScratch('feeds', to_json($feedList));
|
||||
return $self->WAITING;
|
||||
}
|
||||
my $eventData = shift @$eventList;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ sub execute {
|
|||
|
||||
# See if we're done
|
||||
if (scalar(@arrayCopy) > 0) {
|
||||
$instance->setScratch("syndicatedUrls", objToJson(@arrayCopy));
|
||||
$instance->setScratch("syndicatedUrls", JSON::to_json(@arrayCopy));
|
||||
return $self->WAITING;
|
||||
}
|
||||
|
||||
|
|
@ -139,11 +139,11 @@ sub getSyndicatedUrls {
|
|||
asset.state='published'"
|
||||
);
|
||||
|
||||
$instance->setScratch("syndicatedUrls", objToJson($urls));
|
||||
$instance->setScratch("syndicatedUrls", JSON::to_json($urls));
|
||||
return $urls;
|
||||
}
|
||||
|
||||
return jsonToObj($syndicatedUrls);
|
||||
return JSON::from_json($syndicatedUrls);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ sub get {
|
|||
my $self = shift;
|
||||
my $name = shift;
|
||||
if ($name eq "parameters") {
|
||||
my $parameters = JSON::jsonToObj($self->{_data}{$name});
|
||||
my $parameters = JSON::from_json($self->{_data}{$name});
|
||||
return $parameters->{parameters};
|
||||
}
|
||||
return $self->{_data}{$name};
|
||||
|
|
@ -298,7 +298,7 @@ sub set {
|
|||
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
|
||||
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
|
||||
if (exists $properties->{parameters}) {
|
||||
$self->{_data}{parameters} = JSON::objToJson({parameters => $properties->{parameters}},{pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
$self->{_data}{parameters} = JSON->new->pretty->encode({parameters => $properties->{parameters}});
|
||||
}
|
||||
$self->{_data}{enabled} = 0 unless ($self->{_data}{workflowId});
|
||||
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ sub create {
|
|||
my ($isSingleton) = $session->db->quickArray("select count(*) from Workflow where workflowId=? and
|
||||
mode='singleton'",[$properties->{workflowId}]);
|
||||
my $params = (exists $properties->{parameters})
|
||||
? JSON::objToJson({parameters => $properties->{parameters}}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1})
|
||||
? JSON->new->pretty->encode({parameters => $properties->{parameters}})
|
||||
: undef;
|
||||
my ($count) = $session->db->quickArray("select count(*) from WorkflowInstance where workflowId=? and parameters=?",[$properties->{workflowId},$params]);
|
||||
return undef if ($isSingleton && $count);
|
||||
|
|
@ -147,7 +147,7 @@ sub get {
|
|||
my $self = shift;
|
||||
my $name = shift;
|
||||
if ($name eq "parameters") {
|
||||
my $parameters = JSON::jsonToObj($self->{_data}{$name});
|
||||
my $parameters = JSON::from_json($self->{_data}{$name});
|
||||
return $parameters->{parameters};
|
||||
}
|
||||
return $self->{_data}{$name};
|
||||
|
|
@ -416,7 +416,7 @@ sub set {
|
|||
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
|
||||
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
|
||||
if (exists $properties->{parameters}) {
|
||||
$self->{_data}{parameters} = JSON::objToJson({parameters => $properties->{parameters}}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
$self->{_data}{parameters} = JSON->new->pretty->encode({parameters => $properties->{parameters}});
|
||||
}
|
||||
$self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId};
|
||||
$self->{_data}{lastUpdate} = time();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue