{'username'}, $c->req->params->{'password'});
$c->stash->{current_view} = 'RapidApp::JSON';
$c->stash->{json} = $self->do_login($c,$user,$pass) ?
{ success => 1, msg => $user . ' logged in.'
};
if (not defined $id and $self->c->req->params->{orig_params}) {
my $orig_params = $self->json->decode($self->c->req->params->{orig_params});
$id = $orig_params->{$self->record_pk};
}
::Writer::XLSX;
use RapidApp::Spreadsheet::ExcelTableWriter;
use RapidApp::Util qw(:all);
require JSON;
require Text::CSV;
use DateTime;
sub BUILD {}
before 'BUILD' => sub {
my $self = shift;
$se
'Download As...',
hideOnClick => \0,
iconCls => 'ra-icon-document-save',
menu => RapidApp::JSONFunc->new( func => 'new Ext.ux.RapidApp.AppTab.AppGrid2.ExcelExportMenu',
parm => {
url =>
tsv', renderer => 'export_render_tsv' },
{ mime => 'application/json', file_ext => '.json', renderer => 'export_render_json' },
{ mime => $xlsx_mime, file_ext => '.xlsx',
ommands
plx --commands c # all commands starting with c
plx --commands /json/ # all commands matching /json/
Lists available commands, name first, then full path.
If a filter argument is
local $| = 1;
use strict;
use JSON;
use SelectPdf;
print "This is SelectPdf-$SelectPdf::VERSION.\n";
my $url = "https://selectpdf.com/";
my $local_file = "Test.pdf";
my $apiKey = "Your AP
f::UsageClient($apiKey);
my $usage = $usageClient->getUsage();
print("Usage: " . encode_json($usage) . "\n");
print("Conversions remained this month: ". $usage->{"available"});
};
i
params} = $self->json->encode($params);
my $items = $self->$orig(@_) || [];
push @$items, {
text => 'Save Search',
iconCls => 'ra-icon-save-as',
handler => RapidApp::JSONFunc->new( raw =>
f->json->encode($save_cnf) . '); }'
)
};
if ($self->c->req->params->{search_id}) {
push @$items, {
text => 'Delete Search',
iconCls => 'ra-icon-delete',
handler => RapidApp::JSONFun
# Merge in params, even though the request is already underway:
my $search_params = try{$self->json->decode($Search->get_column('params'))} || {};
# TODO: this is now duplicated in the /view Req
lf->json->encode({
$cdta->{self} => $val,
$rev_rel => $val,
});
}
}
}
# ---
%{$c->req->params} = ( %$p, base_params => $self->json->en
ext or return undef;
my $lk_enc = $c->req->params->{rs_lock_keys} or return undef;
try{$self->json->decode($lk_enc)}
}
before 'store_init_onrequest' => sub {
my $self = shift;
if(my $lock_k
converts [[ 'foo' ]] into \[ 'foo' ] and is needed because the later cannot
## be expressed in JSON. This allows the client to send a literal col name
if(ref($attr->{select}) eq 'ARRAY') {
my
::Signatures;
use MooseX::Types::Path::Tiny qw(Path);
use MooseX::Types::URI qw(Uri);
use Cpanel::JSON::XS;
use LWP::UserAgent::Determined;
use MIME::Base64;
use Mozilla::CA;
use Path::Tiny;
use Ref::
s/', $self->hostname ) ); }
method _build_default_accept_header () {
return ( 'application/*+json;version=' . $self->api_version );
}
method _debug (@parameters) { warn join( '', '# ', @parameter
--------------
has _json => (
is => 'ro',
isa => 'Cpanel::JSON::XS',
lazy => 1,
builder => '_build_json',
);
method _build_json () { return Cpanel::JSON::XS->new->utf8->al
local $| = 1;
use strict;
use JSON;
use SelectPdf;
print "This is SelectPdf-$SelectPdf::VERSION.\n";
my $test_url = "https://selectpdf.com/demo/files/selectpdf.pdf";
my $test_pdf = "Input.
sults};
print("Number of search results: " . $count . "\n");
print("Results: " . encode_json($results) . "\n");
print "Finished! Number of pages processed: " . $client->getNumberOfPag
::UsageClient($apiKey);
my $usage = $usageClient->getUsage(0);
print("Usage: " . encode_json($usage) . "\n");
print("Conversions remained this month: ". $usage->{"available"});
};
i
</a2b>.
=head1 DEPENDENCIES
=over
=item L<Carp>
Carp is used to print errors.
=item L<JSON::Parse>
JSON::Parse is used to read in the file of spelling data.
=item L<Convert::Moji/make_regex>
T
e, the ambiguity data about which words
are ambiguous (vice/vise etc.) was not being put into the JSON data
file, and yet it was passing all its tests, so there cannot be any
tests of this.
=back
=h
VMware vCloud Director REST API.
This differs from L<VMware::vCloudDirector> in that it uses the JSON flavoured
version of the API, which has subtly different naming conventions (which is why
I didn'
use JSON::Parse 'read_json';
use Convert::Moji 'make_regex';
our $VERSION = '0.12';
# Load the data from the file.
my $json = __FILE__;
$json =~ s!\.pm$!/abc.json!;
my $abc = read_json ($json);
#
> 'ro', isa => 'Str', predicate => 'has_name' );
has type => ( is => 'ro', isa => 'Str' );
has is_json => ( is => 'ro', isa => 'Bool' );
# ------------------------------------------------------------
if ( $type =~ m!^application/vnd\..*\.(\w+)\+(json|xml)$! ) {
$params->{type} = $1;
$params->{is_json} = ( $2 eq 'json' ) ? 1 : 0;
}
}
}
resenting the event name, and the
# remaining elements representing 1 or more handlers (RapidApp::JSONFunc
# objects). Unlike "listeners" which is a built-in config param associated
# with all Ext.Obs
le::PerRequestBuildDefReset'
],
is => 'ro',
isa => 'HashRef[ArrayRef[RapidApp::JSONFunc]]',
default => sub { {} },
handles => {
apply_listener_callbacks => 'set',
$list, $func;
}
else {
# Auto convert strings into RapidApp::JSONFunc objects:
push @$list, RapidApp::JSONFunc->new( raw => 1, func => $func );
}
}
return $self->apply_l
ord_url or defined $self->add_record_class) {
$self->add_listener( beforerender => RapidApp::JSONFunc->new( raw => 1, func =>
'Ext.ux.RapidApp.AppTab.cnt_init_loadTarget'
));
}
2Def:
#if (defined $self->open_record_url) {
# $self->add_listener( rowdblclick => RapidApp::JSONFunc->new( raw => 1, func =>
# 'Ext.ux.RapidApp.AppTab.gridrow_nav'
# ));
#}
# --
extconfig( init_quick_search_mode => $qs_mode );
}
#$self->apply_config(store => $self->JsonStore);
$self->apply_extconfig(tbar => $self->tbar_items) if (defined $self->tbar_items);
}
s
s 'DataStore' => (
is => 'rw',
isa => 'RapidApp::Module::DatStor',
handles => {
JsonStore => 'JsonStore',
# store_read => 'store_read',
# store_read_raw => 'store_read_raw',
the 'store'
# key predeclared as the first key. Because the ExtJS client decodes and processes
# JSON in order, we want to make sure the store is processed before other parts
# which may need to refe
DataStore->getStore_func );
}
else {
$self->apply_extconfig( store => $self->Module('store')->JsonStore );
}
}
has 'add_edit_formpanel_defaults', is => 'ro', isa => 'HashRef', lazy => 1, defaul
der => '_build_id' );
has _partial_object => ( is => 'rw', isa => 'Bool', default => 0 );
has is_json => ( is => 'rw', isa => 'Bool', default => 0 );
# --------------------------------------
if ( $hash->{type} =~ m!^application/vnd\..*\.(\w+)\+(json|xml)$! );
$params->{is_json} = ( $2 eq 'json' ) ? 1 : 0;
}
# if this has a links section it is a
ndles => { all_links => 'elements', },
);
method _build_links () {
my @links = grep { $_->is_json } $self->all_links;
return \@links;
}
method _build_all_links () {
my @links;
if ( e
=> 'destroy' ) if (defined $self->destroy_handler);
$self->add_listener( write => RapidApp::JSONFunc->new( raw => 1, func =>
'function(store, action, result, res, rs) { store.reload(); }'
b JsonStore {
my $self = shift;
return {
%{ $self->content },
xtype => 'jsonstore'
} if ($self->store_use_xtype);
return RapidApp::JSONFunc->new(
func => 'new Ext.data.JsonS
se_params};
if (defined $encoded) {
my $decoded = $self->json->decode($encoded) or die "Failed to decode base_params JSON";
foreach my $k (keys %$decoded) {
$params->{$k} = $decod
tv_interval);
use Catalyst::Utils;
use Scalar::Util qw(blessed weaken);
use RapidApp::JSONFunc;
use RapidApp::JSON::MixedEncoder;
use RapidApp::Util qw(:all);
has 'base_params' => ( is => 'r
ams->{'X-RapidApp-CustomPrompt-Data'};
return {} unless (defined $rawdata);
return $self->json->decode($rawdata);
}
);
##################################
#### Original Controller Role ####
ult => sub {{}} );
has 'default_action' => ( is => 'ro', default => undef );
has 'render_as_json' => ( is => 'rw', default => 1, traits => [ 'RapidApp::Role::PerRequestBuildDefReset' ] );
package RapidApp::JSONFunc;
use strict;
use warnings;
use Moose;
# This object allows returning functions within JSON. To prevent the function from being
# quoted (i.e. turned into a string), thi
be encoded with RapidApp::JSON::MixedEncoder
# which extends JSON::PP and modifies the behavior to return TO_JSON_RAW as-is
use RapidApp::Util qw(:all);
use RapidApp::JSON::MixedEncoder;
has 'func'
=> 'ro', default => 0 );
has 'json' => ( is => 'ro', lazy_build => 1 );
sub _build_json {
my $self = shift;
return RapidApp::JSON::MixedEncoder->new;
}
sub TO_JSON {
my $self = shift;
return $