$conn->password
);
}# end foreach()
=head1 JSON Config File
ASP4::ASP keeps all of its configuration inside of C</conf/asp4-config.json>
Here is an example:
{
"system": {
"po
like JSON rather than whitespace
separated fields.
For example, jcut is a simple version of cut(1) that understands JSON
objects rather than whitespace separated fields.
% head -1 sample.json
{"
node","channel":"#perl","nick":"dngor","karma":"120"}
% jcut -o network -o channel < eg/sample.json | sort | uniq
{"network":"efnet","channel":"#perl"}
{"network":"efnet","channel":"#poe"}
{"
channel":"#reflex"}
The jsonpath filter supports more complex expressions using
JSON::Path's variant of JSONPath.
curl -s 'http://api.duckduckgo.com/?q=poe&o=json' |
jsonpath -o '$..Topics.*.Fir
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
__PACKAGE__->set_primary_key(qw/ split_id /);
__PACKAGE__->belongs_to(
pp::PipeFilter::MysqlToJson;
use Moose;
extends 'App::PipeFilter::Generic';
with qw(
App::PipeFilter::Role::Reader::LineByLine
App::PipeFilter::Role::Output::Json
App::PipeFilter::
to whatever you set your config->data_connections->session->cookie_domain to
in your asp4-config.json. Otherwise defaults to C<$ENV{HTTP_HOST}>.
You can override the defaults by passing in a domain
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
__PACKAGE__->set_primary_key(qw/participant_id/);
__PACKAGE__->might_have(
$val = $self->next::method(@args);
return bless $val, 'BPM::Engine::DateTime';
}
sub TO_JSON {
my($self, $level) = @_;
my %parms = map { $_ => $self->$_ } grep { $self->$_ }
);
## no critic (ProhibitMultiplePackages)
{
package BPM::Engine::DateTime;
use strict;
use warnings;
use parent 'DateTime';
sub TO_JSON {
my $dt = shift;
return "$dt";
}
}
1;
__END__
my $field = (keys %{$type})[0];
my ($multi, $single) = @{ $type->{$field} };
my $json = '';
#warn "Storing field $field multi $multi single $single type $type container $conta
{
$json = delete $args->{$multi};
my @event_types = keys %{$json};
next unless scalar @event_types;
$json = scalar @event_types ? $json->{$event_types[
&& $args->{$multi}->{$single}) {
$json = delete $args->{$multi}->{$single};
delete $args->{$multi};
next unless $json->[0];
# get rid of XML::LibXML::E
d ASC' })->search(@args);
}
sub TO_JSON {
my $rs = shift;
my @instances = ();
while(my $row = $rs->next) {
my $instance = $row->TO_JSON;
$instance->{uri} = '/wfcs/acti
tion::OutputStream;
my $stream_with_options = new AMF::Connection::OutputStream('prefer_number, json_boolean');
$stream->writeInt(1);
$stream->writeLong(1);
# ..
=head1 DESCRIPTION
The AMF
ase verbosity of output.
--view or -V (actOnGroup) - view details for specified group in json format.
Options may be merged together. -- stops processing of options.
Space is not required be
to v2:
perl $0 -U http://localhost:8080 -a -r /test -P p1=v1 -P p2=v2 -u admin -p admin
* View json for node at /test:
perl $0 -U http://localhost:8080 -V -r /test
* Check whether node at /test
ontent->set_results( "$message", $res );
return $success;
}
#}}}
#{{{sub view_full_json
sub view_full_json {
my ( $content, $remote_dest ) = @_;
if ( !defined $remote_dest ) {
cr
#!/usr/bin/perl -w
package Apache::Sling::JsonQueryServletUtil;
use 5.008001;
use strict;
use warnings;
use Carp;
use Apache::Sling::URL;
require Exporter;
use base qw(Exporter);
our @EXPORT_OK =
( !defined $base_url ) { croak 'No base url defined!'; }
return "get $base_url/content.query.json?queryType=xpath&statement=//*";
}
#}}}
#{{{sub all_nodes_eval
sub all_nodes_eval {
my ($re
s) = @_;
return ( ${$res}->code eq '200' );
}
#}}}
1;
__END__
=head1 NAME
Apache::Sling::JsonQueryServletUtil - Methods to generate and check HTTP requests required for querying.
=head1 ABST
- view the full script documentation.
--me or -m - me returns json representing authenticated user.
--new-password or -n (newPassword) - Used with -c, new passwor
se verbosity of output.
--view or -V (actOnUser) - view details for specified user in json format.
Options may be merged together. -- stops processing of options.
Space is not required be
Output::JSON;
# or: use IRC::Indexer::Output::YAML;
# or: use IRC::Indexer::Output::Dumper;
## Convert trawler output into JSON, for example:
my $output = IRC::Indexer::Output::JSON->new(
as L<IRC::Indexer::Output::JSON>.
=head1 METHODS
=head2 new
Create an output encoder; the reference to serialize must be specified:
my $out = IRC::Indexer::Output::JSON->new(
Input => $ref,
);
=head2 dump
Return the serialized output as a scalar.
my $json = $out->dump;
=head2 write
Write serialized output to a file path or an opened FH.
$out->write($path);
Will croak() on er
package Apache::Sling::JsonQueryServlet;
use 5.008001;
use strict;
use warnings;
use Carp;
use Getopt::Long qw(:config bundling);
use Apache::Sling;
use Apache::Sling::JsonQueryServletUtil;
use Apa
authn provided!'; }
my $response;
$verbose = ( defined $verbose ? $verbose : 0 );
my $json_query_servlet = {
BaseURL => ${$authn}->{'BaseURL'},
Authn => $authn,
;
bless $json_query_servlet, $class;
return $json_query_servlet;
}
#}}}
#{{{sub set_results
sub set_results {
my ( $json_query_servlet, $message, $response ) = @_;
$json_query_servle
existence of defined!';
}
return "get $base_url/system/userManager/user/$act_on_user.tidy.json";
}
#}}}
#{{{sub exists_eval
sub exists_eval {
my ($res) = @_;
return ( ${$res}->code
urn "post $base_url/system/world/create $post_variables";
}
#}}}
#{{{sub add_eval
# TODO: check JSON that is returned for success, as a 200 status code is
# returned even if the world is not success
er;
use 5.008001;
use strict;
use warnings;
use Carp;
use Getopt::Long qw(:config bundling);
use JSON;
use Text::CSV;
use Apache::Sling;
use Apache::Sling::GroupUtil;
use Apache::Sling::GroupMemberUt
g::GroupUtil::view_eval($res);
my $message;
if ($success) {
my $group_info = from_json( ${$res}->content );
my $is_member = 0;
foreach my $member ( @{ $group_info->{'m
roupUtil::view_eval($res);
my $message;
if ($success) {
my $group_info = from_json( ${$res}->content );
my $number_members = @{ $group_info->{'members'} };
my $memb
};
__PACKAGE__->meta->make_immutable;
}
{
package Count;
use MooseX::Coro;
use JSON::Any qw(XS);
with qw(MooseX::Workers);
sub BUILD { POE::Kernel->run }
has sender =>
print JSON::Any->encode($count);
}
);
};
sub worker_stdout {
my ( $self, $out ) = @_;
warn $out;
my $count = JSON::Any->decode($out);
ra::GroupMember;
use Sakai::Nakamura::GroupRole;
use Sakai::Nakamura::Group;
use Sakai::Nakamura::JsonQueryServlet;
use Sakai::Nakamura::LDAPSynch;
use Sakai::Nakamura::User;
use Sakai::Nakamura::Worl
Nakamura::GroupRole',
'group', 'Sakai::Nakamura::Group',
'json_query_servlet', 'Sakai::Nakamura::JsonQueryServlet',
'ldap_synch', 'Sakai::Nakamura::LDAPSynch',
'us
- run group role related actions
group - run group related actions
json_query_servlet - run json query servlet related actions
ldap_synch - run ldap synchronization related