6 Controller to show the web_page for unigene build using MASON.
15 This is the script to show the web_page using MASON
21 Aureliano Bombarely Gomez
31 use CXGN
::MasonFactory
;
35 use CXGN
::DB
::Connection
;
36 use CXGN
::DB
::DBICFactory
;
39 use CXGN
::Transcript
::Unigene
;
41 ## Create mason object
43 my $m = CXGN
::MasonFactory
->new();
45 ## Use of CXGN::Page to take the arguments from the URL
47 my $page = CXGN
::Page
->new();
49 my %args = $page->get_all_encoded_arguments();
51 ## It create a MASON path and transmite it to let the dependient MASON
52 ## code access to the MASON components (using the only mason dir give
55 ## Create the gem schema object (used to get data from expression to samples)
59 ## There are one way to access to the page using id as integer. If use
60 ## other combinations give an error message
62 my $psqlv = `psql --version`;
65 my @schema_list = ('sgn');
66 if ($psqlv =~ /8\.1/) {
67 push @schema_list, 'tsearch2';
70 my $schema = CXGN
::DB
::DBICFactory
->open_schema( 'SGN::Schema', search_path
=> \
@schema_list, );
72 my @schema_list2 = ('public');
73 if ($psqlv =~ /8\.1/) {
74 push @schema_list2, 'tsearch2';
77 my $bcs = CXGN
::DB
::DBICFactory
->open_schema( 'Bio::Chado::Schema', search_path
=> \
@schema_list2, );
79 my $dbh = CXGN
::DB
::Connection
->new();
81 ## Get unigene build object
83 my $unigene_build = CXGN
::Transcript
::UnigeneBuild
->new($dbh);
84 if (exists $args{'id'} && $args{'id'} =~ m/^\d+$/) {
85 $unigene_build = CXGN
::Transcript
::UnigeneBuild
->new($dbh, $args{'id'});
89 ## There are one way to access to the page using id as integer. If use other combinations give an error message
91 if (defined $unigene_build) {
92 $m->exec('/transcript/unigene_build_detail.mas',
95 unigene_build
=> $unigene_build );
98 $m->exec('/transcript/transcript_page_error.mas',
99 object
=> $unigene_build );