Changeset 717


Ignore:
Timestamp:
Nov 24, 2005, 8:12:31 PM (16 years ago)
Author:
Earle Martin
Message:

Sorry, I screwed up the last commit - tests pass now. This fixes bug #17.

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r716 r717  
    257257# Tell OpenGuides::Build which additional scripts and templates to install.
    258258$build->{config}{__extra_scripts}     =
    259                       [ "wiki.conf", "preferences.cgi", "supersearch.cgi",
     259                      [ "wiki.conf", "preferences.cgi", "search.cgi",
    260260                        "newpage.cgi" ];
    261261$build->{config}{__templates}         = [
     
    283283                      "search_results.tt",
    284284                      "site_index.tt",
    285                       "supersearch.tt",
     285                      "search.tt",
    286286                      "userstats.tt",
    287287                      "wanted_pages.tt"
  • trunk/README.CSS

    r716 r717  
    3131input.form_button
    3232    Used in: differences.tt, edit_form.tt, footer.tt, navbar.tt, newpage.tt,
    33              node.tt, preferences.tt, supersearch.tt
     33             node.tt, preferences.tt, search.tt
    3434    Purpose: A standard form button
    3535
     
    8686
    8787div.hit_summary
    88     Used in: supersearch.tt
     88    Used in: search.tt
    8989    Purpose: One-line summary of individual search result.
    9090
     
    102102             home_node.tt, newpage.tt, node.tt, preferences.tt,
    103103             recent_changes.tt, search_results.tt, site_index.tt,
    104              supersearch.tt, userstats.tt, wanted_pages.tt
     104             search.tt, userstats.tt, wanted_pages.tt
    105105    Purpose: Defines the main textual content of the page
    106106             content includes the navbar and footer; maincontent does not
     
    220220
    221221input#search_lower
    222     Used in: supersearch.tt
     222    Used in: search.tt
    223223    Purpose: An iput field for the lower search in the main search page
    224224
    225225input#search_upper
    226     Used in: supersearch.tt
     226    Used in: search.tt
    227227    Purpose: An input field for the upper search in the main search page
    228228
  • trunk/lib/OpenGuides.pm

    r716 r717  
    416416    my $long = $data{metadata}{longitude}[0];
    417417    my $script_url = $self->config->script_url;
    418     print CGI->redirect( $script_url . "supersearch.cgi?lat=$lat;long=$long;distance_in_metres=$metres" );
     418    print CGI->redirect( $script_url . "search.cgi?lat=$lat;long=$long;distance_in_metres=$metres" );
    419419}
    420420
  • trunk/lib/OpenGuides/Utils.pm

    r716 r717  
    112112    # Make formatter.
    113113    my $script_name = $config->script_name;
    114     my $search_url = $config->script_url . "supersearch.cgi";
     114    my $search_url = $config->script_url . "search.cgi";
    115115
    116116    my %macros = (
  • trunk/t/31_search.t

    r716 r717  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use OpenGuides::SuperSearch;
     3use OpenGuides::Search;
    44use OpenGuides::Test;
    55use Test::More;
     
    2424    if ( $@ ) { $config->use_plucene( 0 ) };
    2525
    26     my $search = OpenGuides::SuperSearch->new( config => $config );
    27     isa_ok( $search, "OpenGuides::SuperSearch" );
     26    my $search = OpenGuides::Search->new( config => $config );
     27    isa_ok( $search, "OpenGuides::Search" );
    2828
    2929    my $output = $search->run( return_output => 1 );
  • trunk/t/32_search_simple_metadata.t

    r716 r717  
    22use CGI::Wiki::Setup::SQLite;
    33use OpenGuides::Config;
    4 use OpenGuides::SuperSearch;
     4use OpenGuides::Search;
    55use Test::More tests => 10;
    66
     
    3333    if ( $@ ) { $config->use_plucene( 0 ) };
    3434
    35     my $search = OpenGuides::SuperSearch->new( config => $config );
     35    my $search = OpenGuides::Search->new( config => $config );
    3636
    3737    # Add some data.  We write it twice to avoid hitting the redirect.
  • trunk/t/33_search_advanced_search.t

    r716 r717  
    33use CGI::Wiki::Setup::SQLite;
    44use OpenGuides::Config;
    5 use OpenGuides::SuperSearch;
     5use OpenGuides::Search;
    66use OpenGuides::Test;
    77use Test::More;
     
    4242           }
    4343);
    44 my $search = OpenGuides::SuperSearch->new( config => $config );
     44my $search = OpenGuides::Search->new( config => $config );
    4545my $guide = OpenGuides->new( config => $config );
    4646
  • trunk/t/33_search_advanced_search_utm.t

    r716 r717  
    22use CGI::Wiki::Setup::SQLite;
    33use OpenGuides::Config;
    4 use OpenGuides::SuperSearch;
     4use OpenGuides::Search;
    55use OpenGuides::Test;
    66use Test::More;
     
    4242           }
    4343);
    44 my $search = OpenGuides::SuperSearch->new( config => $config );
     44my $search = OpenGuides::Search->new( config => $config );
    4545my $guide = OpenGuides->new( config => $config );
    4646
  • trunk/t/34_search_paging.t

    r716 r717  
    22use CGI::Wiki::Setup::SQLite;
    33use OpenGuides::Config;
    4 use OpenGuides::SuperSearch;
     4use OpenGuides::Search;
    55use OpenGuides::Test;
    66use Test::More;
     
    2525my $config = OpenGuides::Test->make_basic_config;
    2626$config->use_plucene( 1 );
    27 my $search = OpenGuides::SuperSearch->new( config => $config );
     27my $search = OpenGuides::Search->new( config => $config );
    2828my $guide = OpenGuides->new( config => $config );
    2929
     
    5252                                                },
    5353                             );
    54     like( $output, qr/supersearch.cgi\?.*os_x=523500.*Next.*results/s,
     54    like( $output, qr/search.cgi\?.*os_x=523500.*Next.*results/s,
    5555          "os_x retained in next page link" );
    56     like( $output, qr/supersearch.cgi\?.*os_y=177500.*Next.*results/s,
     56    like( $output, qr/search.cgi\?.*os_y=177500.*Next.*results/s,
    5757          "os_y retained in next page link" );
    58     like( $output, qr/supersearch.cgi\?.*os_dist=1500.*Next.*results/s,
     58    like( $output, qr/search.cgi\?.*os_dist=1500.*Next.*results/s,
    5959          "os_dist retained in next page link" );
    6060}
     
    6868    # in order to force it to create a fresh locator.
    6969    $config->geo_handler( 2 );
    70     my $search = OpenGuides::SuperSearch->new( config => $config );
     70    my $search = OpenGuides::Search->new( config => $config );
    7171
    7272    foreach my $i ( 1 .. 30 ) {
     
    8787                                                },
    8888                             );
    89     like( $output, qr/supersearch.cgi\?.*osie_x=100000.*Next.*results/s,
     89    like( $output, qr/search.cgi\?.*osie_x=100000.*Next.*results/s,
    9090          "osie_x retained in next page link" );
    91     like( $output, qr/supersearch.cgi\?.*osie_y=200000.*Next.*results/s,
     91    like( $output, qr/search.cgi\?.*osie_y=200000.*Next.*results/s,
    9292          "osie_y retained in next page link" );
    93     like( $output, qr/supersearch.cgi\?.*osie_dist=1500.*Next.*results/s,
     93    like( $output, qr/search.cgi\?.*osie_dist=1500.*Next.*results/s,
    9494          "osie_dist retained in next page link" );
    9595}
     
    103103    # in order to force it to create a fresh locator.
    104104    $config->geo_handler( 3 );
    105     my $search = OpenGuides::SuperSearch->new( config => $config );
     105    my $search = OpenGuides::Search->new( config => $config );
    106106
    107107    foreach my $i ( 1 .. 30 ) {
     
    122122                                                },
    123123                             );
    124     like( $output, qr/supersearch.cgi\?.*latitude=51.5.*Next.*results/s,
     124    like( $output, qr/search.cgi\?.*latitude=51.5.*Next.*results/s,
    125125          "latitude retained in next page link" );
    126     like( $output, qr/supersearch.cgi\?.*longitude=-0.12.*Next.*results/s,
     126    like( $output, qr/search.cgi\?.*longitude=-0.12.*Next.*results/s,
    127127          "longitude retained in next page link" );
    128     like( $output, qr/supersearch.cgi\?.*latlong_dist=1500.*Next.*results/s,
     128    like( $output, qr/search.cgi\?.*latlong_dist=1500.*Next.*results/s,
    129129          "latlong_dist retained in next page link" );
    130130}
  • trunk/t/35_search_two_searches.t

    r716 r717  
    22use CGI::Wiki::Setup::SQLite;
    33use OpenGuides::Config;
    4 use OpenGuides::SuperSearch;
     4use OpenGuides::Search;
    55use Test::More;
    66
     
    5353if ( $@ ) { $config->use_plucene( 0 ) };
    5454
    55 my $search = OpenGuides::SuperSearch->new( config => $config );
     55my $search = OpenGuides::Search->new( config => $config );
    5656
    5757# Write some data.
     
    106106# Now with Irish National Grid.
    107107$config->geo_handler( 2 );
    108 $search = OpenGuides::SuperSearch->new( config => $config );
     108$search = OpenGuides::Search->new( config => $config );
    109109$search->run(
    110110              return_output => 1,
     
    121121$config->geo_handler( 3 );
    122122$config->ellipsoid( "Airy" );
    123 $search = OpenGuides::SuperSearch->new( config => $config );
     123$search = OpenGuides::Search->new( config => $config );
    124124$search->run(
    125125              return_output => 1,
  • trunk/t/36_search_order.t

    r716 r717  
    22use CGI::Wiki::Setup::SQLite;
    33use OpenGuides::Config;
    4 use OpenGuides::SuperSearch;
     4use OpenGuides::Search;
    55use Test::More;
    66
     
    3737);
    3838
    39 my $search = OpenGuides::SuperSearch->new( config => $config );
    40 isa_ok( $search, "OpenGuides::SuperSearch" );
     39my $search = OpenGuides::Search->new( config => $config );
     40isa_ok( $search, "OpenGuides::Search" );
    4141
    4242# Write some data.
  • trunk/t/37_search_summaries.t

    r716 r717  
    22use CGI::Wiki::Setup::SQLite;
    33use OpenGuides::Config;
    4 use OpenGuides::SuperSearch;
     4use OpenGuides::Search;
    55use Test::More;
    66
     
    3232    if ( $@ ) { $config->use_plucene( 0 ) };
    3333
    34     my $search = OpenGuides::SuperSearch->new( config => $config );
    35     isa_ok( $search, "OpenGuides::SuperSearch" );
     34    my $search = OpenGuides::Search->new( config => $config );
     35    isa_ok( $search, "OpenGuides::Search" );
    3636    my $wiki = $search->wiki;
    3737    $wiki->write_node( "Pub Crawls", "The basic premise of the pub crawl is to visit a succession of pubs, rather than spending the entire evening or day in a single establishment. London offers an excellent choice of themes for your pub crawl.", undef, { category => "Pubs" } ) or die "Can't write node";
  • trunk/t/38_search_params.t

    r716 r717  
    33use CGI::Wiki::Setup::SQLite;
    44use OpenGuides::Config;
    5 use OpenGuides::SuperSearch;
     5use OpenGuides::Search;
    66use Test::More;
    77
     
    6060$q->param( -name => "latlong_dist", -value => 700    );
    6161my %vars = $q->Vars();
    62 my $search = OpenGuides::SuperSearch->new( config => $config );
     62my $search = OpenGuides::Search->new( config => $config );
    6363$search->run( vars => \%vars, return_output => 1 );
    6464is( $search->{distance_in_metres}, 500,
     
    7474$q->param( -name => "latlong_dist", -value => 700    );
    7575%vars = $q->Vars();
    76 $search = OpenGuides::SuperSearch->new( config => $config );
     76$search = OpenGuides::Search->new( config => $config );
    7777$search->run( vars => \%vars, return_output => 1 );
    7878ok( !defined $search->{distance_in_metres},
     
    8686$q->param( -name => "latlong_dist", -value => 700 );
    8787%vars = $q->Vars();
    88 $search = OpenGuides::SuperSearch->new( config => $config );
     88$search = OpenGuides::Search->new( config => $config );
    8989$search->run( vars => \%vars, return_output => 1 );
    9090is( $search->{distance_in_metres}, 700,
     
    104104$q->param( -name => "latlong_dist", -value => 700    );
    105105%vars = $q->Vars();
    106 $search = OpenGuides::SuperSearch->new( config => $config );
     106$search = OpenGuides::Search->new( config => $config );
    107107$search->run( vars => \%vars, return_output => 1 );
    108108is( $search->{distance_in_metres}, 600,
     
    118118$q->param( -name => "latlong_dist", -value => 700    );
    119119%vars = $q->Vars();
    120 $search = OpenGuides::SuperSearch->new( config => $config );
     120$search = OpenGuides::Search->new( config => $config );
    121121$search->run( vars => \%vars, return_output => 1 );
    122122ok( !defined $search->{distance_in_metres},
     
    130130$q->param( -name => "latlong_dist", -value => 700 );
    131131%vars = $q->Vars();
    132 $search = OpenGuides::SuperSearch->new( config => $config );
     132$search = OpenGuides::Search->new( config => $config );
    133133$search->run( vars => \%vars, return_output => 1 );
    134134is( $search->{distance_in_metres}, 700,
     
    149149$q->param( -name => "latlong_dist", -value => 700    );
    150150%vars = $q->Vars();
    151 $search = OpenGuides::SuperSearch->new( config => $config );
     151$search = OpenGuides::Search->new( config => $config );
    152152$search->run( vars => \%vars, return_output => 1 );
    153153ok( !defined $search->{distance_in_metres},
     
    161161$q->param( -name => "latlong_dist", -value => 700    );
    162162%vars = $q->Vars();
    163 $search = OpenGuides::SuperSearch->new( config => $config );
     163$search = OpenGuides::Search->new( config => $config );
    164164$search->run( vars => \%vars, return_output => 1 );
    165165ok( !defined $search->{distance_in_metres},
     
    173173$q->param( -name => "latlong_dist", -value => 700 );
    174174%vars = $q->Vars();
    175 $search = OpenGuides::SuperSearch->new( config => $config );
     175$search = OpenGuides::Search->new( config => $config );
    176176$search->run( vars => \%vars, return_output => 1 );
    177177is( $search->{distance_in_metres}, 700,
  • trunk/t/39_search_form.t

    r716 r717  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use OpenGuides::SuperSearch;
     3use OpenGuides::Search;
    44use OpenGuides::Test;
    55use Test::More;
     
    4646
    4747# British National Grid guides should have os and latlong search fields.
    48 my $search = OpenGuides::SuperSearch->new( config => $config );
     48my $search = OpenGuides::Search->new( config => $config );
    4949my $output = $search->run( return_output => 1 );
    5050# Strip Content-Type header to stop Test::HTML::Content getting confused.
     
    7272# Irish National Grid guides should have osie and latlong.
    7373$config->geo_handler( 2 );
    74 $search = OpenGuides::SuperSearch->new( config => $config );
     74$search = OpenGuides::Search->new( config => $config );
    7575$output = $search->run( return_output => 1 );
    7676$output =~ s/^Content-Type.*[\r\n]+//m;
     
    9898$config->geo_handler( 3 );
    9999$config->ellipsoid( "Airy" );
    100 $search = OpenGuides::SuperSearch->new( config => $config );
     100$search = OpenGuides::Search->new( config => $config );
    101101$output = $search->run( return_output => 1 );
    102102$output =~ s/^Content-Type.*[\r\n]+//m;
Note: See TracChangeset for help on using the changeset viewer.