improve debug output of 404 errors
[sgn.git] / cgi-bin / sedm / target.pl
blobd1b8c40afac3ecd8eedd2d5a868957bd4750fb7b
1 #!/usr/bin/perl
3 =head1 NAME
5 target.pl
6 Code to show the web_page for target 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;
29 use CXGN::Page;
31 ## Use of CXGN::Page to take the arguments from the URL
33 my $page = CXGN::Page->new();
34 my %args = $page->get_all_encoded_arguments();
36 ## It get the hostname to create the right links in the MASON pages
38 my $hostname = $page->get_hostname();
40 my $m = CXGN::MasonFactory->new;
42 ## There are two ways to access to the page, using id=int or
43 ## name=something. If use other combinations give an error message
45 if (exists $args{'id'} && defined $args{'id'} && $args{'id'} =~ m/^\d+$/) {
46 $m->exec( '/sedm/target_detail.mas',
47 hostname => $hostname,
48 id => $args{'id'},
50 } elsif (exists $args{'name'} && defined $args{'name'}) {
51 $m->exec( '/sedm/target_detail.mas',
52 hostname => $hostname,
53 name => $args{'name'},
55 } else {
56 $m->exec( '/sedm/sedm_page_error.mas',
57 hostname => $hostname,
58 object => 'target',