Skip to content

Commit

Permalink
Item11402:
Browse files Browse the repository at this point in the history
   * fixed DEPENDENCIES
   * added configure checkers (thanks Paul) 



git-svn-id: http://svn.foswiki.org/trunk/SolrPlugin@14075 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Feb 24, 2012
1 parent f17183f commit e82b314
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 5 deletions.
53 changes: 53 additions & 0 deletions lib/Foswiki/Configure/Checkers/SolrPlugin/SolrHome.pm
@@ -0,0 +1,53 @@
# See bottom of file for license and copyright information
package Foswiki::Configure::Checkers::SolrPlugin::SolrHome;

use strict;
use warnings;

use File::Spec();
use Foswiki::Configure::Checker ();
our @ISA = ('Foswiki::Configure::Checker');

sub check {
my $this = shift;
my $mess = '';

if (
$Foswiki::cfg{SolrPlugin}{AutoStartDaemon}
&& ( !$Foswiki::cfg{SolrPlugin}{SolrHome}
|| $Foswiki::cfg{SolrPlugin}{SolrHome} ne 'NOT SET' )
)
{
my ( $vol, $dir ) =
File::Spec->splitpath( $Foswiki::cfg{ScriptUrlPath}, 1 );
my @dirs = File::Spec->splitdir($dir);

pop(@dirs);
$Foswiki::cfg{SolrPlugin}{SolrHome} =
File::Spec->catpath( $vol, File::Spec->catdir( @dirs, 'solr' ), '' );
$mess .= $this->guessed(0);
}
$mess .= $this->showExpandedValue( $Foswiki::cfg{SolrPlugin}{SolrHome} );

return $mess;
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2012-2012 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
35 changes: 35 additions & 0 deletions lib/Foswiki/Configure/Checkers/SolrPlugin/SolrStartCmd.pm
@@ -0,0 +1,35 @@
# See bottom of file for license and copyright information
package Foswiki::Configure::Checkers::SolrPlugin::SolrStartCmd;

use strict;
use warnings;

use File::Spec();
use Foswiki::Configure::Checker ();
our @ISA = ('Foswiki::Configure::Checker');

sub check {
my $this = shift;

return $this->showExpandedValue( $Foswiki::cfg{SolrPlugin}{SolrStartCmd} );
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2012-2012 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
71 changes: 71 additions & 0 deletions lib/Foswiki/Configure/Checkers/SolrPlugin/SupportedLanguages.pm
@@ -0,0 +1,71 @@
# See bottom of file for license and copyright information
package Foswiki::Configure::Checkers::SolrPlugin::SupportedLanguages;

use strict;
use warnings;

use Foswiki::Configure::Checker ();
our @ISA = ('Foswiki::Configure::Checker');

sub check {
my $this = shift;

unless ( $Foswiki::cfg{SolrPlugin}{SupportedLanguages}
&& ref( $Foswiki::cfg{SolrPlugin}{SupportedLanguages} ) )
{
$Foswiki::cfg{SolrPlugin}{SupportedLanguages} = {
'en' => 'en',
'english' => 'en',
'cjk' => 'cjk',
'chinese' => 'cjk',
'japanese' => 'cjk',
'korean' => 'cjk',
'da' => 'da',
'danish' => 'da',
'de' => 'de',
'german' => 'de',
'es' => 'es',
'spanish' => 'es',
'fi' => 'fi',
'finish' => 'fi',
'fr' => 'fr',
'french' => 'fr',
'it' => 'it',
'italian' => 'it',
'nl' => 'nl',
'dutch' => 'nl',
'pt' => 'pt',
'portuguese' => 'pt',
'ru' => 'ru',
'russian' => 'ru',
'se' => 'se',
'swedish' => 'se',
'tr' => 'tr',
'turkish' => 'tr'
};

return $this->guessed(0);
}

return;
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2012-2012 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
6 changes: 3 additions & 3 deletions lib/Foswiki/Plugins/SolrPlugin/Config.spec
Expand Up @@ -64,14 +64,14 @@ $Foswiki::cfg{SolrPlugin}{SearchUrl} = '';
# Enable this flag to automatically start a solr instance coming with this plugin
$Foswiki::cfg{SolrPlugin}{AutoStartDaemon} = 0;

# **COMMAND**
# **COMMAND DISPLAY_IF {SolrPlugin}{AutoStartDaemon}**
# Command used to start the solr instance. Note that <code>solrstart</code> is a shell script wrapping
# around the actual startup routine
$Foswiki::cfg{SolrPlugin}{SolrStartCmd} = '$Foswiki::cfg{ToolsDir}/solrstart %SOLRHOME|F%';

# **PATH**
# **PATH DISPLAY_IF {SolrPlugin}{AutoStartDaemon}**
# Path to the directory containing the <code>start.jar</code> file. That's where the jetty engine is
# located and where solr puts its data further down the directory structure
# located and where solr puts its data further down the directory structure.
$Foswiki::cfg{SolrPlugin}{SolrHome} = '';

# **STRING**
Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/SolrPlugin/DEPENDENCIES
Expand Up @@ -2,10 +2,10 @@ Foswiki::Plugins::AutoTemplatePlugin,>=1.0,perl,Optional.
Foswiki::Plugins::FilterPlugin,>=2.0,perl,Required.
Foswiki::Contrib::StringifierContrib,>=1.20,perl,Required.
Foswiki::Plugins::TagCloudPlugin,>=1.0,perl,Required.
Foswiki::Plugins::JQSerialPagerContrib,>=0,perl,Required.
Foswiki::Contrib::JQSerialPagerContrib,>=1.0,perl,Required.
Foswiki::Plugins::ClassificationPlugin,>=1.0,perl,Optional.
Foswiki::Plugins::DBCachePlugin,>=1,perl,Optional
Foswiki::Plugins::InfiniteScrollContrib,>=0,perl,Optional.
Foswiki::Contrib::InfiniteScrollContrib,>=1.0,perl,Optional.
Foswiki::Plugins::MimeIconPlugin,>=0,perl,Optional.
JSON::XS,>=2.231,cpan,Required.
LWP::UserAgent,>=5.820,cpan,Required.
Expand Down
3 changes: 3 additions & 0 deletions lib/Foswiki/Plugins/SolrPlugin/MANIFEST
Expand Up @@ -12,6 +12,9 @@ data/System/SolrSearch.txt 0644
data/System/SolrSearchViewTemplate.txt 0644
data/System/WebChangesViewTemplate.txt 0644
lib/CharsetDetector.pm 0644
lib/Foswiki/Configure/Checkers/SolrPlugin/SolrHome.pm 0644
lib/Foswiki/Configure/Checkers/SolrPlugin/SolrStartCmd.pm 0644
lib/Foswiki/Configure/Checkers/SolrPlugin/SupportedLanguages.pm 0644
lib/Foswiki/Plugins/SolrPlugin/Base.pm 0644
lib/Foswiki/Plugins/SolrPlugin/Config.spec 0644
lib/Foswiki/Plugins/SolrPlugin/Index.pm 0644
Expand Down

0 comments on commit e82b314

Please sign in to comment.