package UR::Value::JSON;
use strict;
use warnings;
use JSON;
class UR::Value::JSON {
is => 'UR::Value',
};
my $_JS_CODEC = new JSON->allow_nonref;
sub __serialize_id__ {
shift;
return
ackage UR::Object::View::Default::Json;
use strict;
use warnings;
require UR;
our $VERSION = "0.47"; # UR $VERSION;
use JSON;
class UR::Object::View::Default::Json {
is => 'UR::Object::View::De
lue => 'json' },
],
has_optional => [
encode_options => { is => 'ARRAY', default_value => ['ascii', 'pretty', 'allow_nonref', 'canonical'], doc => 'Options to enable on the JSON object
; see the documentation for the JSON Perl module' },
],
};
my $json;
sub _json {
my ($self) = @_;
return $json if defined $json;
$json = JSON->new;
foreach my $opt ( @{ $self->en
eViews::Json;
use strict;
use warnings;
require UR;
our $VERSION = "0.47"; # UR $VERSION;
use UR::Object::Type::View::AvailableViews::Xml;
class UR::Object::Type::View::AvailableViews::Json {
is => 'UR::Object::View::Default::Json',
has_constant => [
perspective => { value => 'available-views' },
],
};
sub _jsobj {
my $self = shift;
my $subject = $self->subject;
ue::View::Default::Json;
use strict;
use warnings;
use UR;
# These Values inherit from Text which inherits from UR::Object::View::Default::Text
class UR::Value::View::Default::Json {
is => 'UR::V
View::Default::Json;
use strict;
use warnings;
require UR;
our $VERSION = "0.47"; # UR $VERSION;
class UR::Object::Set::View::Default::Json {
is => 'UR::Object::View::Default::Json',
has_con
package UR::Service::JsonRpcServer;
use strict;
use warnings;
use UR;
our $VERSION = "0.47"; # UR $VERSION;
UR::Object::Type->define(
class_name => __PACKAGE__,
is => 'UR::Object',
prop
ect serving as a web server to respond to JSON-RPC requests; wraps Net::HTTPServer',
);
=pod
=head1 NAME
UR::Service::JsonRpcServer - A self-contained JSON-RPC server for UR namespaces
=head1 SYNO
PSIS
use lib '/path/to/your/moduletree';
use YourNamespace;
my $rpc = UR::Service::JsonRpcServer->create(host => 'localhost',
port => '80
perty::View::ReferenceDescription::Text;
use UR::Object::Set;
use UR::Object::Set::View::Default::Json;
use UR::Object::Tag;
use UR::Object::Type;
use UR::Object::Type::AccessorWriter;
use UR::Object:
::Object::View::Default::Gtk;
use UR::Object::View::Default::Gtk2;
use UR::Object::View::Default::Json;
use UR::Object::View::Default::Text;
use UR::Object::View::Lister::Text;
use UR::Object::View::T
"use UR::Namespace::View::SchemaBrowser::CgiApp::Schema;"
&& eval "use UR::Service::JsonRpcServer;";
die $@ unless ($rv);
}
if (eval "use Xml::LibXSLT") {
my $rv = eval "use UR
sed for command-line tools,
and is the base class for other specific text formats like XML, HTML, JSON, etc.
=head1 WRITING A SUBCLASS
# In Acme/Product/View/OutstandingOrders/Text.pm
package A