Author: earle
Date: 2005-11-24 20:12:31 +0000 (Thu, 24 Nov 2005)
New Revision: 717
Modified:
trunk/Build.PL
trunk/README.CSS
trunk/lib/OpenGuides.pm
trunk/lib/OpenGuides/Utils.pm
trunk/t/31_search.t
trunk/t/32_search_simple_metadata.t
trunk/t/33_search_advanced_search.t
trunk/t/33_search_advanced_search_utm.t
trunk/t/34_search_paging.t
trunk/t/35_search_two_searches.t
trunk/t/36_search_order.t
trunk/t/37_search_summaries.t
trunk/t/38_search_params.t
trunk/t/39_search_form.t
Log:
Sorry, I screwed up the last commit - tests pass now. This fixes bug #17.
Modified: trunk/Build.PL
===================================================================
--- trunk/Build.PL 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/Build.PL 2005-11-24 20:12:31 UTC (rev 717)
@@ -256,7 +256,7 @@
# Tell OpenGuides::Build which additional scripts and templates to install.
$build->{config}{__extra_scripts} =
- [ "wiki.conf", "preferences.cgi", "supersearch.cgi",
+ [ "wiki.conf", "preferences.cgi", "search.cgi",
"newpage.cgi" ];
$build->{config}{__templates} = [
"backlink_results.tt",
@@ -282,7 +282,7 @@
"recent_changes.tt",
"search_results.tt",
"site_index.tt",
- "supersearch.tt",
+ "search.tt",
"userstats.tt",
"wanted_pages.tt"
];
Modified: trunk/README.CSS
===================================================================
--- trunk/README.CSS 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/README.CSS 2005-11-24 20:12:31 UTC (rev 717)
@@ -30,7 +30,7 @@
input.form_button
Used in: differences.tt, edit_form.tt, footer.tt, navbar.tt, newpage.tt,
- node.tt, preferences.tt, supersearch.tt
+ node.tt, preferences.tt, search.tt
Purpose: A standard form button
label.hidden
@@ -85,7 +85,7 @@
Purpose: User who made a change
div.hit_summary
- Used in: supersearch.tt
+ Used in: search.tt
Purpose: One-line summary of individual search result.
IDs
@@ -101,7 +101,7 @@
delete_password_wrong.tt, edit_conflict.tt, edit_form.tt,
home_node.tt, newpage.tt, node.tt, preferences.tt,
recent_changes.tt, search_results.tt, site_index.tt,
- supersearch.tt, userstats.tt, wanted_pages.tt
+ search.tt, userstats.tt, wanted_pages.tt
Purpose: Defines the main textual content of the page
content includes the navbar and footer; maincontent does not
@@ -219,11 +219,11 @@
Purpose: An input field for the search at the bottom of the page
input#search_lower
- Used in: supersearch.tt
+ Used in: search.tt
Purpose: An iput field for the lower search in the main search page
input#search_upper
- Used in: supersearch.tt
+ Used in: search.tt
Purpose: An input field for the upper search in the main search page
input#show_minor
Modified: trunk/lib/OpenGuides/Utils.pm
===================================================================
--- trunk/lib/OpenGuides/Utils.pm 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/lib/OpenGuides/Utils.pm 2005-11-24 20:12:31 UTC (rev 717)
@@ -111,7 +111,7 @@
# Make formatter.
my $script_name = $config->script_name;
- my $search_url = $config->script_url . "supersearch.cgi";
+ my $search_url = $config->script_url . "search.cgi";
my %macros = (
'@SEARCHBOX' =>
Modified: trunk/lib/OpenGuides.pm
===================================================================
--- trunk/lib/OpenGuides.pm 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/lib/OpenGuides.pm 2005-11-24 20:12:31 UTC (rev 717)
@@ -415,7 +415,7 @@
my $lat = $data{metadata}{latitude}[0];
my $long = $data{metadata}{longitude}[0];
my $script_url = $self->config->script_url;
- print CGI->redirect( $script_url . "supersearch.cgi?lat=$lat;long=$long;distance_in_metres=$metres" );
+ print CGI->redirect( $script_url . "search.cgi?lat=$lat;long=$long;distance_in_metres=$metres" );
}
=item B<show_backlinks>
Modified: trunk/t/31_search.t
===================================================================
--- trunk/t/31_search.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/31_search.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,6 +1,6 @@
use strict;
use CGI::Wiki::Setup::SQLite;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use OpenGuides::Test;
use Test::More;
@@ -23,8 +23,8 @@
eval { require CGI::Wiki::Search::Plucene; };
if ( $@ ) { $config->use_plucene( 0 ) };
- my $search = OpenGuides::SuperSearch->new( config => $config );
- isa_ok( $search, "OpenGuides::SuperSearch" );
+ my $search = OpenGuides::Search->new( config => $config );
+ isa_ok( $search, "OpenGuides::Search" );
my $output = $search->run( return_output => 1 );
unlike( $output, qr/no items matched/i,
Modified: trunk/t/32_search_simple_metadata.t
===================================================================
--- trunk/t/32_search_simple_metadata.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/32_search_simple_metadata.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,7 +1,7 @@
use strict;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use Test::More tests => 10;
eval { require DBD::SQLite; };
@@ -32,7 +32,7 @@
eval { require CGI::Wiki::Search::Plucene; };
if ( $@ ) { $config->use_plucene( 0 ) };
- my $search = OpenGuides::SuperSearch->new( config => $config );
+ my $search = OpenGuides::Search->new( config => $config );
# Add some data. We write it twice to avoid hitting the redirect.
my $wiki = $search->{wiki}; # white boxiness
Modified: trunk/t/33_search_advanced_search.t
===================================================================
--- trunk/t/33_search_advanced_search.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/33_search_advanced_search.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -2,7 +2,7 @@
use CGI::Wiki::Plugin::Locator::Grid; # use directly to help debug
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use OpenGuides::Test;
use Test::More;
@@ -41,7 +41,7 @@
geo_handler => 1,
}
);
-my $search = OpenGuides::SuperSearch->new( config => $config );
+my $search = OpenGuides::Search->new( config => $config );
my $guide = OpenGuides->new( config => $config );
# Write some data.
Modified: trunk/t/33_search_advanced_search_utm.t
===================================================================
--- trunk/t/33_search_advanced_search_utm.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/33_search_advanced_search_utm.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,7 +1,7 @@
use strict;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use OpenGuides::Test;
use Test::More;
@@ -41,7 +41,7 @@
ellipsoid => "Airy",
}
);
-my $search = OpenGuides::SuperSearch->new( config => $config );
+my $search = OpenGuides::Search->new( config => $config );
my $guide = OpenGuides->new( config => $config );
# Write some data.
Modified: trunk/t/34_search_paging.t
===================================================================
--- trunk/t/34_search_paging.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/34_search_paging.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,7 +1,7 @@
use strict;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use OpenGuides::Test;
use Test::More;
@@ -24,7 +24,7 @@
my $config = OpenGuides::Test->make_basic_config;
$config->use_plucene( 1 );
-my $search = OpenGuides::SuperSearch->new( config => $config );
+my $search = OpenGuides::Search->new( config => $config );
my $guide = OpenGuides->new( config => $config );
# Test with OS co-ords.
@@ -51,11 +51,11 @@
os_y => 177500,
},
);
- like( $output, qr/supersearch.cgi\?.*os_x=523500.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*os_x=523500.*Next.*results/s,
"os_x retained in next page link" );
- like( $output, qr/supersearch.cgi\?.*os_y=177500.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*os_y=177500.*Next.*results/s,
"os_y retained in next page link" );
- like( $output, qr/supersearch.cgi\?.*os_dist=1500.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*os_dist=1500.*Next.*results/s,
"os_dist retained in next page link" );
}
@@ -67,7 +67,7 @@
# We must create a new search object after changing the geo_handler
# in order to force it to create a fresh locator.
$config->geo_handler( 2 );
- my $search = OpenGuides::SuperSearch->new( config => $config );
+ my $search = OpenGuides::Search->new( config => $config );
foreach my $i ( 1 .. 30 ) {
OpenGuides::Test->write_data(
@@ -86,11 +86,11 @@
osie_y => 200000,
},
);
- like( $output, qr/supersearch.cgi\?.*osie_x=100000.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*osie_x=100000.*Next.*results/s,
"osie_x retained in next page link" );
- like( $output, qr/supersearch.cgi\?.*osie_y=200000.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*osie_y=200000.*Next.*results/s,
"osie_y retained in next page link" );
- like( $output, qr/supersearch.cgi\?.*osie_dist=1500.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*osie_dist=1500.*Next.*results/s,
"osie_dist retained in next page link" );
}
@@ -102,7 +102,7 @@
# We must create a new search object after changing the geo_handler
# in order to force it to create a fresh locator.
$config->geo_handler( 3 );
- my $search = OpenGuides::SuperSearch->new( config => $config );
+ my $search = OpenGuides::Search->new( config => $config );
foreach my $i ( 1 .. 30 ) {
OpenGuides::Test->write_data(
@@ -121,10 +121,10 @@
longitude => -0.12,
},
);
- like( $output, qr/supersearch.cgi\?.*latitude=51.5.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*latitude=51.5.*Next.*results/s,
"latitude retained in next page link" );
- like( $output, qr/supersearch.cgi\?.*longitude=-0.12.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*longitude=-0.12.*Next.*results/s,
"longitude retained in next page link" );
- like( $output, qr/supersearch.cgi\?.*latlong_dist=1500.*Next.*results/s,
+ like( $output, qr/search.cgi\?.*latlong_dist=1500.*Next.*results/s,
"latlong_dist retained in next page link" );
}
Modified: trunk/t/35_search_two_searches.t
===================================================================
--- trunk/t/35_search_two_searches.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/35_search_two_searches.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,7 +1,7 @@
use strict;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use Test::More;
eval { require DBD::SQLite; };
@@ -52,7 +52,7 @@
eval { require CGI::Wiki::Search::Plucene; };
if ( $@ ) { $config->use_plucene( 0 ) };
-my $search = OpenGuides::SuperSearch->new( config => $config );
+my $search = OpenGuides::Search->new( config => $config );
# Write some data.
my $wiki = $search->{wiki};
@@ -105,7 +105,7 @@
# Now with Irish National Grid.
$config->geo_handler( 2 );
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run(
return_output => 1,
vars => { osie_x => 100000, osie_y => 200000, osie_dist => 100 },
@@ -120,7 +120,7 @@
# Now with UTM.
$config->geo_handler( 3 );
$config->ellipsoid( "Airy" );
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run(
return_output => 1,
vars => { latitude => 10, longitude => 0, latlong_dist => 1000 },
Modified: trunk/t/36_search_order.t
===================================================================
--- trunk/t/36_search_order.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/36_search_order.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,7 +1,7 @@
use strict;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use Test::More;
eval { require DBD::SQLite; };
@@ -36,8 +36,8 @@
}
);
-my $search = OpenGuides::SuperSearch->new( config => $config );
-isa_ok( $search, "OpenGuides::SuperSearch" );
+my $search = OpenGuides::Search->new( config => $config );
+isa_ok( $search, "OpenGuides::Search" );
# Write some data.
my $wiki = $search->{wiki};
Modified: trunk/t/37_search_summaries.t
===================================================================
--- trunk/t/37_search_summaries.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/37_search_summaries.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,7 +1,7 @@
use strict;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use Test::More;
eval { require DBD::SQLite; };
@@ -31,8 +31,8 @@
eval { require CGI::Wiki::Search::Plucene; };
if ( $@ ) { $config->use_plucene( 0 ) };
- my $search = OpenGuides::SuperSearch->new( config => $config );
- isa_ok( $search, "OpenGuides::SuperSearch" );
+ my $search = OpenGuides::Search->new( config => $config );
+ isa_ok( $search, "OpenGuides::Search" );
my $wiki = $search->wiki;
$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";
Modified: trunk/t/38_search_params.t
===================================================================
--- trunk/t/38_search_params.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/38_search_params.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -2,7 +2,7 @@
use CGI;
use CGI::Wiki::Setup::SQLite;
use OpenGuides::Config;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use Test::More;
eval { require DBD::SQLite; };
@@ -59,7 +59,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
my %vars = $q->Vars();
-my $search = OpenGuides::SuperSearch->new( config => $config );
+my $search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
is( $search->{distance_in_metres}, 500,
"os_dist picked up when OS co-ords given and using British grid" );
@@ -73,7 +73,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
ok( !defined $search->{distance_in_metres},
"OSIE co-ords ignored when using British grid" );
@@ -85,7 +85,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
is( $search->{distance_in_metres}, 700,
"latlong_dist picked up when lat/long given and using British grid" );
@@ -103,7 +103,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
is( $search->{distance_in_metres}, 600,
"osie_dist picked up when OS co-ords given and using Irish grid" );
@@ -117,7 +117,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
ok( !defined $search->{distance_in_metres},
"OS co-ords ignored when using Irish grid" );
@@ -129,7 +129,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
is( $search->{distance_in_metres}, 700,
"latlong_dist picked up when lat/long given and using Irish grid" );
@@ -148,7 +148,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
ok( !defined $search->{distance_in_metres},
"OS co-ords ignored when using UTM" );
@@ -160,7 +160,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
ok( !defined $search->{distance_in_metres},
"OSIE co-ords ignored when using UTM" );
@@ -172,7 +172,7 @@
$q->param( -name => "osie_dist", -value => 600 );
$q->param( -name => "latlong_dist", -value => 700 );
%vars = $q->Vars();
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$search->run( vars => \%vars, return_output => 1 );
is( $search->{distance_in_metres}, 700,
"latlong_dist picked up when lat/long given and using UTM" );
Modified: trunk/t/39_search_form.t
===================================================================
--- trunk/t/39_search_form.t 2005-11-24 20:01:09 UTC (rev 716)
+++ trunk/t/39_search_form.t 2005-11-24 20:12:31 UTC (rev 717)
@@ -1,6 +1,6 @@
use strict;
use CGI::Wiki::Setup::SQLite;
-use OpenGuides::SuperSearch;
+use OpenGuides::Search;
use OpenGuides::Test;
use Test::More;
@@ -45,7 +45,7 @@
$config->use_plucene( 1 );
# British National Grid guides should have os and latlong search fields.
-my $search = OpenGuides::SuperSearch->new( config => $config );
+my $search = OpenGuides::Search->new( config => $config );
my $output = $search->run( return_output => 1 );
# Strip Content-Type header to stop Test::HTML::Content getting confused.
$output =~ s/^Content-Type.*[\r\n]+//m;
@@ -71,7 +71,7 @@
# Irish National Grid guides should have osie and latlong.
$config->geo_handler( 2 );
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$output = $search->run( return_output => 1 );
$output =~ s/^Content-Type.*[\r\n]+//m;
@@ -97,7 +97,7 @@
# UTM guides should have latitude/longitude/latlong_dist only.
$config->geo_handler( 3 );
$config->ellipsoid( "Airy" );
-$search = OpenGuides::SuperSearch->new( config => $config );
+$search = OpenGuides::Search->new( config => $config );
$output = $search->run( return_output => 1 );
$output =~ s/^Content-Type.*[\r\n]+//m;