1 ######################################################################
3 # Search the expression database and display the results.
5 # Adapted to the search framework by Aureliano Bombarely, 18/01/10
7 ######################################################################
12 use CXGN
::Page
::FormattingHelpers qw
/blue_section_html info_section_html page_title_html columnar_table_html/;
13 use CXGN
::Search
::CannedForms
;
14 use CXGN
::Searches
::GemPlatform
;
16 my $page=CXGN
::Page
->new("Expression search results by platform", "Aure");
19 print page_title_html
('Expression search results by platform');
21 #create the search and query objects
22 my $search = CXGN
::Searches
::GemPlatform
->new();
23 my $query = $search->new_query();
24 $search->page_size(20); #results shown per page
27 my %params = $page->get_all_encoded_arguments();
29 $query->from_request(\
%params);
33 my $result = $search->do_search($query); #execute the search
34 my @test = $query->to_sql();
37 while(my $r = $result->next_result())
39 #fields in result objs appear in the order in which they're registered with has_parameter() in the query class
40 push @results, ["<a href=\"/gem/platform.pl?id=" . $r->[0] . "\">" . $r->[1] . "</a>"];
43 #build the HTML to output
44 my $pagination_html = $search->pagination_buttons_html($query, $result);
46 my $results_html = <<EOH;
47 <div id="searchresults">
50 $results_html .= columnar_table_html
(headings
=> ['Platform'],
51 data
=> \
@results, __alt_freq
=> 2);
53 $results_html .= <<EOH;
60 print blue_section_html
('Results', , sprintf('<span class="paginate_summary">%s matches </span>', $result->total_results(), $result->time), $results_html);
64 print '<span class=""><h4>No matches found</h4></span>';
66 print info_section_html
(title
=> 'Search again', contents
=>CXGN
::Search
::CannedForms
::expr_platform_search_form
($page, $query));