package JCRSearch; # -------------------------------------------------------------------- # The copyright and all other proprietary rights in this Database # (including software - SEE LICENSING AGREEMENT) are the sole and # exclusive property of the Institute for Scientific Information # (ISI). This Database and source code, or any derivative works # thereof, are confidential and proprietary to ISI . Therefore, # duplication, reuse, redistribution, reverse assembling, reverse # compiling, or translation of the Database, source code, or any # portion thereof IS NOT PERMITTED. Consult Licensing Agreement. # -------------------------------------------------------------------- # $Id: JCRSearch.pm,v 1.17 2006/07/28 16:04:45 pfoley Exp $ use strict; use ISIBench; use JCRErrorList; use JCRUtil; use Log::Log4perl qw(get_logger); use base qq(JCRPage); sub build_page { ISIBench::start(); my $logger = get_logger("JCRSearch"); my $self = shift; my $args = (ref $_[0] eq 'HASH') ? shift : { @_ }; # Snag our parameters my $db = $self->{db}; my $session = $self->{session}; my $request = $self->{request}; # Have the limits been changed? if ($request->{change_limits} eq 'true') { JCRUtil::purge_marked_list( 'session' => $self->{session}, 'db' => $self->{db}, ); } # Build the JCRSearch page template $logger->debug("Loading jcr_search.html template"); my $ret = $self->set_template( 'template' => "jcr_search.html" ); if ($ret) { ISIBench::stop(); return $ret; } # If an error is in the URI display it if (exists $request->{error}) { $logger->debug("Displaying error: #$request->{error}"); my $errorlist = JCRErrorList->new(); my $error = $errorlist->map( 'error' => $request->{error} ); $self->set( 'name' => 'error', 'value' => qq|***** $error->{error} *****|, ); } # Set the page title $self->set_title( 'title' => 'Search' ); my $search_select_box = JCRUtil::build_search_box(); $self->set( 'name' => 'search_select_box', 'value' => $search_select_box->{html}, ); # Add the toolbar my $toolbar = $self->build_toolbar( 'help' => '2.5' ); unless (defined($toolbar) && (ref($toolbar) =~ /toolbar/i)) { ISIBench::stop(); return $toolbar; } # get edition name my $edition = $session->get( 'value' => 'edition' ); my $log_edition = $edition->{'edition'}; my $data_string = qq{$log_edition}; # Log the Journal Search event $session->log_event( 'event' => 'event_query', 'data' => { 'limits' => $data_string, }, ); # error checking my $error_string = $session->getError(); if ( length($error_string) > 1 ) { $logger->error("WURS Event not logged: $error_string"); } ISIBench::stop(); return 0; } 1;