replace access token example with ... so that lint is happy (this is in the POD and...
[sgn.git] / lib / SGN / Controller / Vector.pm
blob7abafa66764b7082d8183530339e51df98fc8d4f
1 package SGN::Controller::Vector;
3 =head1 NAME
5 SGN::Controller::Stock - Catalyst controller for pages dealing with
6 stocks (e.g. accession, population, etc.)
8 =cut
10 use Moose;
11 use namespace::autoclean;
12 use YAML::Any qw/LoadFile/;
14 use URI::FromHash 'uri';
15 use List::Compare;
16 use File::Temp qw / tempfile /;
17 use File::Slurp;
18 use JSON::Any;
19 use JSON;
21 use CXGN::Chado::Stock;
22 use SGN::View::Stock qw/stock_link stock_organisms stock_types breeding_programs /;
23 use Bio::Chado::NaturalDiversity::Reports;
24 use SGN::Model::Cvterm;
25 use Data::Dumper;
26 use CXGN::Chado::Publication;
27 use CXGN::Genotype::DownloadFactory;
29 BEGIN { extends 'Catalyst::Controller' }
30 with 'Catalyst::Component::ApplicationAttribute';
32 has 'schema' => (
33 is => 'rw',
34 isa => 'DBIx::Class::Schema',
35 lazy_build => 1,
37 sub _build_schema {
38 shift->_app->dbic_schema( 'Bio::Chado::Schema', 'sgn_chado' )
41 has 'default_page_size' => (
42 is => 'ro',
43 default => 20,
46 =head1 PUBLIC ACTIONS
48 =head2 create new vector
50 =cut
52 sub vector_new :Path('/vector/new') Args(0) {
53 my ($self, $c ) = @_;
54 my @editable_vector_props = split ',',$c->get_conf('editable_vector_props');
55 $c->stash(
58 stock_types => stock_types($self->schema),
59 sp_person_autocomplete_uri => '/ajax/people/autocomplete',
60 editable_vector_props => \@editable_vector_props,
61 template => '/stock/add_vector.mas'
66 =head2 stock search using jQuery data tables
68 =cut
70 sub vector_search :Path('/search/vectors') Args(0) {
71 my ($self, $c ) = @_;
72 my @editable_vector_props = split ',',$c->get_conf('editable_vector_props');
73 $c->stash(
74 template => '/search/vectors.mas',
76 stock_types => stock_types($self->schema),
77 sp_person_autocomplete_uri => '/ajax/people/autocomplete',
78 editable_vector_props => \@editable_vector_props
85 # sub _validate_pair {
86 # my ($self,$c,$key,$value) = @_;
87 # $c->throw( is_client_error => 1, public_message => "$value is not a valid value for $key" )
88 # if ($key =~ m/_id$/ and $value !~ m/\d+/);
89 # }
94 __PACKAGE__->meta->make_immutable;