TORY = 'tarball/RecordStream';
my $BIN_DIRECTORY = $DIRECTORY . '/bin';
my @EXTRAS = qw(
JSON::Syck
JSON::PP
GD::Graph::lines
GD::Graph::bars
GD::Graph::points
NetPacket::Ethernet
NetPa
ct;
use warnings;
use base qw(App::RecordStream::Operation);
use MongoDB;
use Data::Dumper;
use JSON::PP;
sub init {
my $this = shift;
my $args = shift;
my ($host, $user, $pass, $db_name, $q
ssword'} = $pass if defined $pass;
# This will come closer to allowing mongo-hq style json
my $json = JSON::PP->new()
->allow_barekey() # Allow {navItem:[]} instead of {'navItem':[]}
->al
ME'} = $db_name;
$this->{'COLLECTION'} = $collection;
$this->{'QUERY'} = $json->decode($query);
}
sub wants_input {
return 0;
}
sub stream_done {
my $this = shift;
my
use strict;
use warnings;
use utf8;
package App::RecordStream::Operation::tojsonarray;
use base qw(App::RecordStream::Operation);
sub init {
my $this = shift;
my $args = shift;
$this->parse_op
return <<USAGE;
Usage: recs tojsonarray [files]
__FORMAT_TEXT__
This command outputs the record stream as a single JSON array. It
complements the fromjsonarray command.
__FORMAT_TEXT__
Examples
# Save the record stream to a file suitable for loading by any JSON parser
... | recs tojsonarray > recs.json
USAGE
}
1;
s_string($options);
return <<USAGE;
Usage: recs-fromps <args>
__FORMAT_TEXT__
Prints out JSON records converted from the process table.
__FORMAT_TEXT__
$args_string
Default fields:
__
epresentation of the object using only scalars, hashes, and
arrays. Some implementations support JSON serialization via dump() and
its companion method, load(); for others, dump() is only a debugging
head1 NAME
recs-fromps
=head1 recs-fromps --help-all
Usage: recs-fromps <args>
Prints out JSON records converted from the process table.
--keys <fields> Fields to output. Ma
$server, $VERSION, $report->{instance_id};
# my $query = {
# instance_id =>
# data => JSON::encode_json($report),
# };
# TO DO: Enable as soon as the server is functional:
# $self->task_requ
#!/usr/local/bin/perl
use strict;
use warnings;
use Carp;
use SVN::Class;
use FindBin;
use JSON::XS;
use Email::Stuff;
use Sys::Hostname;
my $config = {
src => Path::Class::Dir->new( $FindBin::Bi
) {
my $config_file = Path::Class::File->new( shift @ARGV );
my $supplied_conf = decode_json( $config_file->slurp );
$config = { %$config, %$supplied_conf };
}
if (!$config->{src}) {
ull
system and test summary is printed to stdout.
You may specify an alternate path to test in a JSON-formatted config file.
Use the 'src' config option to specify a path. Example:
{ 'src' : '/pat
x-perl',
'application/x-php' => 'application/perl', # Temporary solution
'application/json' => 'application/javascript',
'application/javascript' => 'text/x-csrc',
'text/x-java'
application/javascript' => Wx::Scintilla::Constant::SCLEX_ESCRIPT, # CONFIRMED
'application/json' => Wx::Scintilla::Constant::SCLEX_ESCRIPT, # CONFIRMED
'application/x-latex' =
shift;
my $options = [
['key|-k|--key <keyspec>', 'Specify keys that correlate to keys in JSON data'],
['option|-o option=val', 'Specify custom command for GD::Graph'],
['label-x <val>
ngs
return 0 if $_->{name} =~ /^(?:blib|_build|inc|Makefile(?:\.old)?|pm_to_blib|MYMETA\.(?:yml|json))\z/;
# It is fairly common to get bogged down in NYTProf output
return 0 if $_->{name} =~ /
ild files
push @$rule, '(?:^|\\/)(?:blib|_build|inc|Makefile(?:\.old)?|pm_to_blib|MYMETA\.(?:yml|json))\z';
# Ignore the enormous NYTProf output
push @$rule, '(?:^|\\/)nytprof(?:\.out)?\z';
retu
art.
Recs, or RecordStream is a collection of scripts that facilitates the parsing
of files into JSON records and the transformation of those records. Many common
UNIX programs like grep, sort, and u
eral
the tools fall into three categories: those that produce JSON records, those
that operate on JSON records, and those that convert JSON records into output.
A typical use of recs will consist of o
nd one of the third type. To begin using recs, you'll have to
decide on how to get your data into JSON. There are several scripts available
to do this, one of the most powerful of which is recs-frommu
pshot_XXX.json
|--schema_XXX.json
|--write.lock
|
|--seg_1--|
| |--segmeta.json
| |--cfmeta.json
ons]
|
|--seg_2--|
| |--segmeta.json
| |--cfmeta.json
| |--cf.dat-------|
|
the
entire index rather than to a particular segment.
=head2 snapshot_XXX.json
A "snapshot" file, e.g. C<snapshot_m7p.json>, is list of index files and
directories. Because index files, once writt
val {
require MongoDB;
require JSON::PP;
};
if ( $@ ) {
require Test::More;
import Test::More skip_all => 'Missing modules! (MongoDB or JSON::PP)!';
}
else {
require Test:
art.
Recs, or RecordStream is a collection of scripts that facilitates the parsing
of files into JSON records and the transformation of those records. Many common
UNIX programs like grep, sort, and u
eral
the tools fall into three categories: those that produce JSON records, those
that operate on JSON records, and those that convert JSON records into output.
A typical use of recs will consist of o
nd one of the third type. To begin using recs, you'll have to
decide on how to get your data into JSON. There are several scripts available
to do this, one of the most powerful of which is recs-frommu
austed
=back
=cut
our $VERSION = "3.4";
use strict;
use warnings;
use IO::String;
use JSON qw(decode_json);
use App::RecordStream::Record;
require App::RecordStream::Operation;
my $ONE_OF = [qw
->call_next_record();
}
# Direct bless done in the name of performance
my $record = decode_json($line);
bless $record, 'App::RecordStream::Record';
return $record;
}
sub call_next_record
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
n of the same resource such as B<tucker.myplace.com/book/list> and
B<tucker.myplace.com/book/list.json> are considered as separate requests and so are
cached separately.
=head2 Cache backends
This
#!/usr/bin/perl -w
package Sakai::Nakamura::JsonQueryServlet;
use 5.008008;
use strict;
use warnings;
use Carp;
use base qw(Apache::Sling::JsonQueryServlet);
use Sakai::Nakamura;
use Sakai::Nakamura
}}}
1;
__END__
=head1 NAME
Sakai::Nakamura::JsonQueryServlet - Manipulate the JSON query servlet in a Sakai Nakamura instance.
=head1 ABSTRACT
json query servlet related functionality for nakamu
er rest APIs.
=head1 USAGE
use Sakai::Nakamura::JsonQueryServlet;
=head1 DESCRIPTION
Perl library providing a layer of abstraction to the REST json query servlet methods
=head1 REQUIRED ARGUMENTS