Skip to content

Commit

Permalink
Item10461: begin to remove the SearchAlgo class, infavour of a single…
Browse files Browse the repository at this point in the history
… Algo API - which is what we already had in a way

	   refactor the 3 core Algo::query to use iterator style, and put most of the reusable 'default' code into the common Interface
           if only search algo's were an object so we could use OO rather than hardcoding entire classnames into the code and so duplicating it.

git-svn-id: http://svn.foswiki.org/trunk/MongoDBPlugin@11946 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jun 17, 2011
1 parent 30caa90 commit e76fa6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
17 changes: 0 additions & 17 deletions lib/Foswiki/Plugins/MongoDBPlugin.pm
Expand Up @@ -477,23 +477,6 @@ sub _MONGODB {
);
}

# getListOfWebs was moved after 1.1, see Item9814. Should it use Foswiki::Func?
sub _getListOfWebs {
my ( $webNames, $recurse, $searchAllFlag ) = @_;

if ( defined &Foswiki::Search::InfoCache::_getListOfWebs ) {

# Foswiki 1.1
return Foswiki::Search::InfoCache::_getListOfWebs( $webNames, $recurse,
$searchAllFlag );
}
else {
require Foswiki::Store::Interfaces::SearchAlgorithm;
return Foswiki::Store::Interfaces::SearchAlgorithm::getListOfWebs(
$webNames, $recurse, $searchAllFlag );
}
}

1;
__END__
This copyright information applies to the MongoDBPlugin:
Expand Down
5 changes: 2 additions & 3 deletions lib/Foswiki/Store/QueryAlgorithms/MongoDB.pm
Expand Up @@ -63,9 +63,8 @@ sub query {
my $isAdmin = $session->{users}->isAdmin( $session->{user} );

my $searchAllFlag = ( $webNames =~ /(^|[\,\s])(all|on)([\,\s]|$)/i );
my @webs =
Foswiki::Plugins::MongoDBPlugin::_getListOfWebs( $webNames, $recurse,
$searchAllFlag );
my @webs = Foswiki::Store::Interfaces::QueryAlgorithm::getListOfWebs(
$webNames, $recurse, $searchAllFlag );

my @resultCacheList;
foreach my $web (@webs) {
Expand Down
5 changes: 2 additions & 3 deletions lib/Foswiki/Store/SearchAlgorithms/MongoDB.pm
Expand Up @@ -107,9 +107,8 @@ sub query {
my $isAdmin = $session->{users}->isAdmin( $session->{user} );

my $searchAllFlag = ( $webNames =~ /(^|[\,\s])(all|on)([\,\s]|$)/i );
my @webs =
Foswiki::Plugins::MongoDBPlugin::_getListOfWebs( $webNames, $recurse,
$searchAllFlag );
my @webs = Foswiki::Store::Interfaces::QueryAlgorithm::getListOfWebs(
$webNames, $recurse, $searchAllFlag );

my @resultCacheList;
foreach my $web (@webs) {
Expand Down

0 comments on commit e76fa6f

Please sign in to comment.