Merge branch 'master' of https://github.com/solgenomics/sgn
[sgn.git] / cgi-bin / sedm / sample.pl
blobfa2e524cdac0bd874bf00a819498fd37c5cdc929
1 #!/usr/bin/perl
3 =head1 NAME
5 sample.pl
6 Code to show the web_page for sample information using MASON.
8 =cut
10 =head1 SYNOPSIS
13 =head1 DESCRIPTION
15 This is the script to show the web_page using MASON
17 =cut
19 =head1 AUTHORS
21 Aureliano Bombarely Gomez
22 (ab782@cornell.edu)
24 =cut
27 use strict;
28 use warnings;
30 use CXGN::MasonFactory;
31 use CXGN::Page;
33 my $m = CXGN::MasonFactory->new;
35 ## Use of CXGN::Page to take the arguments from the URL
37 my $page = CXGN::Page->new();
38 my %args = $page->get_all_encoded_arguments();
40 ## There are two ways to access to the page, using id=int or
41 ## name=something. If use other combinations give an error message
43 if (exists $args{'id'} && defined $args{'id'} && $args{'id'} =~ m/^\d+$/) {
44 $m->exec( '/sedm/sample_detail.mas',
45 id => $args{'id'},
47 } elsif (exists $args{'name'} && defined $args{'name'}) {
48 $m->exec( '/sedm/sample_detail.mas',
49 name => $args{'name'}
51 } else {
52 $m->exec( '/sedm/sedm_page_error.mas',
53 object => 'sample',