Changeset 785

Show
Ignore:
Timestamp:
05/14/06 16:54:22 (3 years ago)
Author:
dom
Message:

Use Wiki::Toolkit. Note that CGI::Wiki::Plugin::Diff hasn't been converted yet,
so tests will be broken for now.

Location:
trunk
Files:
51 modified

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r784 r785  
    216216    license => "perl", 
    217217    requires => { 
    218         'Algorithm::Diff'                 => '0.13',  # for sdiff  
    219         'CGI'                             => '2.92',  # avoid escapeHTML bug 
    220         'CGI::Carp'                       => 0, 
    221         'CGI::Cookie'                     => 0, 
    222         'CGI::Wiki'                       => '0.62',  # fixed delete version 
    223         'CGI::Wiki::Formatter::UseMod'    => '0.16',  # macros 
    224         'CGI::Wiki::Plugin::Atom'         => 0, 
    225         'CGI::Wiki::Plugin::Categoriser'  => 0, 
    226         'CGI::Wiki::Plugin::Diff'         => '0.08',  # earlier buggy 
    227         'CGI::Wiki::Plugin::Locator::Grid'=> '0.02',  # cope with sqlite 3 
    228         'CGI::Wiki::Plugin::RSS::ModWiki' => '0.09',  # fixes date formatting bug 
    229         'CGI::Wiki::Plugin::RSS::Reader'  => '1.3',   # earlier versions don't support RSS 2.0 
    230         'Class::Accessor'                 => 0, 
    231         'Config::Tiny'                    => 0, 
    232         'Data::Dumper'                    => 0, 
    233         $drivers{$dbtype}                 => 0, 
    234         'File::Spec::Functions'           => 0, 
    235         'File::Temp'                      => 0, 
    236         'Geography::NationalGrid'         => 0, 
    237         'LWP::Simple'                     => 0, 
    238         'Parse::RecDescent'               => 0, 
    239         $search_module                    => 0, 
    240         'POSIX'                           => 0, 
    241         'Template'                        => 0, 
    242         'Test::MockObject'                => '0.07', # earlier doesn't use 'mock' 
    243         'Time::Piece'                     => 0, 
    244         'URI::Escape'                     => 0, 
    245         'XML::RSS'                        => 0, 
     218        'Algorithm::Diff'                     => '0.13',  # for sdiff  
     219        'CGI'                                 => '2.92',  # avoid escapeHTML bug 
     220        'CGI::Carp'                           => 0, 
     221        'CGI::Cookie'                         => 0, 
     222        'Wiki::Toolkit'                       => 0, 
     223        'Wiki::Toolkit::Feed::Atom'           => 0, 
     224        'Wiki::Toolkit::Feed::RSS'            => 0, 
     225        'Wiki::Toolkit::Formatter::UseMod'    => 0, 
     226        'Wiki::Toolkit::Plugin::Categoriser'  => 0, 
     227        'Wiki::Toolkit::Plugin::Diff'         => 0, 
     228        'Wiki::Toolkit::Plugin::Locator::Grid'=> 0, 
     229        'Wiki::Toolkit::Plugin::RSS::Reader'  => 0, 
     230        'Class::Accessor'                     => 0, 
     231        'Config::Tiny'                        => 0, 
     232        'Data::Dumper'                        => 0, 
     233        $drivers{$dbtype}                     => 0, 
     234        'File::Spec::Functions'               => 0, 
     235        'File::Temp'                          => 0, 
     236        'Geography::NationalGrid'             => 0, 
     237        'LWP::Simple'                         => 0, 
     238        'Parse::RecDescent'                   => 0, 
     239        $search_module                        => 0, 
     240        'POSIX'                               => 0, 
     241        'Template'                            => 0, 
     242        'Test::MockObject'                    => '0.07', # earlier doesn't use 'mock' 
     243        'Time::Piece'                         => 0, 
     244        'URI::Escape'                         => 0, 
     245        'XML::RSS'                            => 0, 
    246246        }, 
    247247    build_requires => { 
  • trunk/Changes

    r784 r785  
    11"#" items refer to tickets. See <http://dev.openguides.org/report/9> for details. 
    22 
    3 0.55    ??? 
     30.54_01 ??? 
    44        Support for Atom feeds for RecentChanges. 
    5         #118 Use Wiki::Toolkit 
     5        #118 Use Wiki::Toolkit. NOTE this is a development snapshot and is 
     6        not suitable for production use. It may eat your data! Tests on 
     7        development mirrors of live data are highly welcomed; the underlying 
     8        database schema provided by Wiki::Toolkit has changed and the upgrade 
     9        process needs some rigorous testing. 
    610 
    7110.54    21 April 2006 
  • trunk/INSTALL

    r777 r785  
    105105to index your wiki instead of Search::InvertedIndex.  If you answer 
    106106yes to this question, you will need to make sure you have installed 
    107 both Plucene, and CGI::Wiki version 0.56 or later. 
     107both Plucene, and Wiki::Toolkit version 0.56 or later. 
    108108 
    109109If you are changing to Plucene from Search::InvertedIndex, you will 
     
    351351programs, it isn't appropriate to run them again. So we will make use of 
    352352the utility program "cgi-wiki-setupdb" which is included with the 
    353 CGI::Wiki distribution. Documentation for this command can be found in 
     353Wiki::Toolkit distribution. Documentation for this command can be found in 
    354354its man page; run this with the appropriate arguments to create the 
    355355new database. 
  • trunk/PREREQUISITES

    r784 r785  
    1 Modules required by OpenGuides 0.54 
    2 =================================== 
     1Modules required by OpenGuides 0.54_01 
     2====================================== 
    33 
    44Algorithm::Diff (version 0.13 or later. Note that the latest version uses  
     
    77CGI::Carp 
    88CGI::Cookie 
    9 CGI::Wiki (version 0.62 or later) 
    10 CGI::Wiki::Formatter::UseMod (version 0.16 or later) 
    11 CGI::Wiki::Plugin::Atom 
    12 CGI::Wiki::Plugin::Categoriser 
    13 CGI::Wiki::Plugin::Diff (version 0.08 or later) 
    14 CGI::Wiki::Plugin::Locator::Grid (version 0.02 or later) 
    15 CGI::Wiki::Plugin::RSS::ModWiki (version 0.09 or later) 
    16 CGI::Wiki::Plugin::RSS::Reader (version 1.3 or later) 
     9Wiki::Toolkit 
     10Wiki::Toolkit::Feed::Atom 
     11Wiki::Toolkit::Feed::RSS 
     12Wiki::Toolkit::Formatter::UseMod 
     13Wiki::Toolkit::Plugin::Categoriser 
     14Wiki::Toolkit::Plugin::Diff 
     15Wiki::Toolkit::Plugin::Locator::Grid 
     16Wiki::Toolkit::Plugin::RSS::Reader 
    1717Class::Accessor 
    1818Config::Tiny 
  • trunk/README

    r736 r785  
    2323    * http://london.openguides.org/, the first and biggest OpenGuides site. 
    2424    * http://openguides.org/, with a list of all live OpenGuides installs. 
    25     * CGI::Wiki, the Wiki toolkit which does the heavy lifting for 
     25    * Wiki::Toolkit, the Wiki toolkit which does the heavy lifting for 
    2626    OpenGuides 
    2727 
  • trunk/lib/OpenGuides.pm

    r784 r785  
    44use Carp "croak"; 
    55use CGI; 
    6 use CGI::Wiki::Plugin::Diff; 
    7 use CGI::Wiki::Plugin::Locator::Grid; 
     6use Wiki::Toolkit::Plugin::Diff; 
     7use Wiki::Toolkit::Plugin::Locator::Grid; 
    88use OpenGuides::CGI; 
    99use OpenGuides::Feed; 
     
    5151    my $locator; 
    5252    if ( $geo_handler == 1 ) { 
    53         $locator = CGI::Wiki::Plugin::Locator::Grid->new( 
     53        $locator = Wiki::Toolkit::Plugin::Locator::Grid->new( 
    5454                                             x => "os_x",    y => "os_y" ); 
    5555    } elsif ( $geo_handler == 2 ) { 
    56         $locator = CGI::Wiki::Plugin::Locator::Grid->new( 
     56        $locator = Wiki::Toolkit::Plugin::Locator::Grid->new( 
    5757                                             x => "osie_x",  y => "osie_y" ); 
    5858    } else { 
    59         $locator = CGI::Wiki::Plugin::Locator::Grid->new( 
     59        $locator = Wiki::Toolkit::Plugin::Locator::Grid->new( 
    6060                                             x => "easting", y => "northing" ); 
    6161    } 
    6262    $wiki->register_plugin( plugin => $locator ); 
    6363    $self->{locator} = $locator; 
    64     my $differ = CGI::Wiki::Plugin::Diff->new; 
     64    my $differ = Wiki::Toolkit::Plugin::Diff->new; 
    6565    $wiki->register_plugin( plugin => $differ ); 
    6666    $self->{differ} = $differ; 
     
    7070=item B<wiki> 
    7171 
    72 An accessor, returns the underlying L<CGI::Wiki> object. 
     72An accessor, returns the underlying L<Wiki::Toolkit> object. 
    7373 
    7474=cut 
     
    9292=item B<locator> 
    9393 
    94 An accessor, returns the underlying L<CGI::Wiki::Plugin::Locator::UK> object. 
     94An accessor, returns the underlying L<Wiki::Toolkit::Plugin::Locator::UK> object. 
    9595 
    9696=cut 
     
    103103=item B<differ> 
    104104 
    105 An accessor, returns the underlying L<CGI::Wiki::Plugin::Diff> object. 
     105An accessor, returns the underlying L<Wiki::Toolkit::Plugin::Diff> object. 
    106106 
    107107=cut 
     
    958958    $metadata{host} = $ENV{REMOTE_ADDR}; 
    959959 
    960     # CGI::Wiki::Plugin::RSS::ModWiki wants "major_change" to be set. 
     960    # Wiki::Toolkit::Plugin::RSS::ModWiki wants "major_change" to be set. 
    961961    $metadata{major_change} = ( $metadata{edit_type} eq "Normal edit" ) 
    962962                            ? 1 
     
    11361136=item * L<http://openguides.org/|The OpenGuides website>, with a list of all live OpenGuides installs. 
    11371137 
    1138 =item * L<CGI::Wiki>, the Wiki toolkit which does the heavy lifting for OpenGuides 
     1138=item * L<Wiki::Toolkit>, the Wiki toolkit which does the heavy lifting for OpenGuides 
    11391139 
    11401140=back 
  • trunk/lib/OpenGuides/Build.pm

    r606 r785  
    2727                          sqlite   => "SQLite" ); 
    2828 
    29     my $cgi_wiki_module = "CGI::Wiki::Setup::" . $cgi_wiki_exts{$dbtype}; 
     29    my $cgi_wiki_module = "Wiki::Toolkit::Setup::" . $cgi_wiki_exts{$dbtype}; 
    3030    eval "require $cgi_wiki_module"; 
    3131    die "There was a problem: $@" if $@; 
  • trunk/lib/OpenGuides/Feed.pm

    r784 r785  
    66$VERSION = '0.01'; 
    77 
    8 use CGI::Wiki::Plugin::Atom; 
    9 use CGI::Wiki::Plugin::RSS::ModWiki; 
     8use Wiki::Toolkit::Feed::Atom; 
     9use Wiki::Toolkit::Feed::RSS; 
    1010use Time::Piece; 
    1111use URI::Escape; 
     
    2424    my $wiki = $args{wiki}; 
    2525     
    26     unless ( $wiki && UNIVERSAL::isa( $wiki, "CGI::Wiki" ) ) { 
    27        croak "No CGI::Wiki object supplied."; 
     26    unless ( $wiki && UNIVERSAL::isa( $wiki, "Wiki::Toolkit" ) ) { 
     27       croak "No Wiki::Toolkit object supplied."; 
    2828    } 
    2929    $self->{wiki} = $wiki; 
     
    8282   
    8383    unless ($self->{atom_maker}) { 
    84         $self->{atom_maker} = CGI::Wiki::Plugin::Atom->new( 
     84        $self->{atom_maker} = Wiki::Toolkit::Feed::Atom->new( 
    8585            wiki                => $self->{wiki}, 
    8686            site_name           => $self->{site_name}, 
     
    103103 
    104104    unless ($self->{rss_maker}) { 
    105         $self->{rss_maker} = CGI::Wiki::Plugin::RSS::ModWiki->new( 
     105        $self->{rss_maker} = Wiki::Toolkit::Feed::RSS->new( 
    106106            wiki                => $self->{wiki}, 
    107107            site_name           => $self->{site_name}, 
     
    140140=head1 SYNOPSIS 
    141141 
    142     use CGI::Wiki; 
     142    use Wiki::Toolkit; 
    143143    use OpenGuides::Config; 
    144144    use OpenGuides::Feed; 
    145145 
    146     my $wiki = CGI::Wiki->new( ... ); 
     146    my $wiki = Wiki::Toolkit->new( ... ); 
    147147    my $config = OpenGuides::Config->new( file => "wiki.conf" ); 
    148148    my $feed = OpenGuides::Feed->new( wiki       => $wiki, 
     
    167167                                      og_version => '1.0', );  
    168168 
    169 C<wiki> must be a L<CGI::Wiki> object and C<config> must be an 
     169C<wiki> must be a L<Wiki::Toolkit> object and C<config> must be an 
    170170L<OpenGuides::Config> object.  Both of these arguments are mandatory. 
    171171C<og_version> is an optional argument specifying the version of 
     
    174174=item B<rss_maker> 
    175175 
    176 Returns a raw L<CGI::Wiki::Plugin::RSS::ModWiki> object created with the values you 
     176Returns a raw L<Wiki::Toolkit::Feed::RSS> object created with the values you 
    177177invoked this module with. 
    178178 
    179179=item B<atom_maker> 
    180180 
    181 Returns a raw L<CGI::Wiki::Plugin::Atom> object created with the values you 
     181Returns a raw L<Wiki::Toolkit::Feed::Atom> object created with the values you 
    182182invoked this module with. 
    183183 
     
    216216=over 4 
    217217 
    218 =item * L<CGI::Wiki>, L<CGI::Wiki::Plugin::RSS::ModWiki> and L<CGI::Wiki::Plugin::Atom> 
     218=item * L<Wiki::Toolkit>, L<Wiki::Toolkit::Feed::RSS> and L<Wiki::Toolkit::Feed::Atom> 
    219219 
    220220=item * L<http://openguides.org/> 
  • trunk/lib/OpenGuides/RDF.pm

    r767 r785  
    66$VERSION = '0.09'; 
    77 
    8 use CGI::Wiki::Plugin::RSS::ModWiki; 
    98use Time::Piece; 
    109use URI::Escape; 
     
    2322    my $wiki = $args{wiki}; 
    2423     
    25     unless ( $wiki && UNIVERSAL::isa( $wiki, "CGI::Wiki" ) ) { 
    26       croak "No CGI::Wiki object supplied."; 
     24    unless ( $wiki && UNIVERSAL::isa( $wiki, "Wiki::Toolkit" ) ) { 
     25      croak "No Wiki::Toolkit object supplied."; 
    2726    } 
    2827    $self->{wiki} = $wiki; 
     
    106105     
    107106    # Make a Time::Piece object. 
    108     my $timestamp_fmt = $CGI::Wiki::Store::Database::timestamp_fmt; 
     107    my $timestamp_fmt = $Wiki::Toolkit::Store::Database::timestamp_fmt; 
    109108 
    110109    if ( $timestamp ) { 
     
    228227=head1 SYNOPSIS 
    229228 
    230     use CGI::Wiki; 
     229    use Wiki::Toolkit; 
    231230    use OpenGuides::Config; 
    232231    use OpenGuides::RDF; 
    233232 
    234     my $wiki = CGI::Wiki->new( ... ); 
     233    my $wiki = Wiki::Toolkit->new( ... ); 
    235234    my $config = OpenGuides::Config->new( file => "wiki.conf" ); 
    236235    my $rdf_writer = OpenGuides::RDF->new( wiki   => $wiki, 
     
    250249                                           config => $config );  
    251250 
    252 C<wiki> must be a L<CGI::Wiki> object and C<config> must be an 
     251C<wiki> must be a L<Wiki::Toolkit> object and C<config> must be an 
    253252L<OpenGuides::Config> object.  Both arguments mandatory. 
    254253 
     
    269268B<Note:> Some of the fields emitted by the RDF/XML generator are taken 
    270269from the node metadata. The form of this metadata is I<not> mandated 
    271 by L<CGI::Wiki>. Your wiki application should make sure to store some or 
     270by L<Wiki::Toolkit>. Your wiki application should make sure to store some or 
    272271all of the following metadata when calling C<write_node>: 
    273272 
     
    296295=over 4 
    297296 
    298 =item * L<CGI::Wiki> 
     297=item * L<Wiki::Toolkit> 
    299298 
    300299=item * L<http://openguides.org/> 
  • trunk/lib/OpenGuides/Search.pm

    r716 r785  
    44 
    55use CGI qw( :standard ); 
    6 use CGI::Wiki::Plugin::Locator::Grid; 
     6use Wiki::Toolkit::Plugin::Locator::Grid; 
    77use File::Spec::Functions qw(:ALL); 
    88use OpenGuides::Template; 
     
    6565    } 
    6666 
    67     my $locator = CGI::Wiki::Plugin::Locator::Grid->new( %locator_params ); 
     67    my $locator = Wiki::Toolkit::Plugin::Locator::Grid->new( %locator_params ); 
    6868    $wiki->register_plugin( plugin => $locator ); 
    6969    $self->{locator} = $locator; 
     
    7676  my $wiki = $search->wiki; 
    7777 
    78 An accessor; returns the underlying L<CGI::Wiki> object. 
     78An accessor; returns the underlying L<Wiki::Toolkit> object. 
    7979 
    8080=cut 
     
    430430 
    431431    # Rationalise the scores a little.  The scores returned by 
    432     # CGI::Wiki::Search::Plucene are simply a ranking. 
     432    # Wiki::Toolkit::Search::Plucene are simply a ranking. 
    433433    my $num_results = scalar keys %contents_res; 
    434434    foreach my $node ( keys %contents_res ) { 
  • trunk/lib/OpenGuides/Template.pm

    r782 r785  
    238238 
    239239Picks out things like categories, locales, phone number etc from 
    240 EITHER the metadata hash returned by L<CGI::Wiki> OR the query 
     240EITHER the metadata hash returned by L<Wiki::Toolkit> OR the query 
    241241parameters in a L<CGI> object, and packages them nicely for passing to 
    242 templates or storing in L<CGI::Wiki> datastore.  If you supply both 
     242templates or storing in L<Wiki::Toolkit> datastore.  If you supply both 
    243243C<metadata> and C<cgi_obj> then C<metadata> will take precedence, but 
    244244don't do that. 
  • trunk/lib/OpenGuides/Test.pm

    r594 r785  
    6868    ); 
    6969 
    70     eval { require CGI::Wiki::Search::Plucene; }; 
     70    eval { require Wiki::Toolkit::Search::Plucene; }; 
    7171    if ( $@ ) { $config->use_plucene ( 0 ) }; 
    7272         
  • trunk/lib/OpenGuides/UK/PubCrawl.pm

    r202 r785  
    66 
    77use Carp qw( croak ); 
    8 use CGI::Wiki::Plugin; 
    9 use CGI::Wiki::Plugin::Locator::UK; 
     8use Wiki::Toolkit::Plugin; 
     9use Wiki::Toolkit::Plugin::Locator::UK; 
    1010 
    11 @ISA = qw( CGI::Wiki::Plugin ); 
     11@ISA = qw( Wiki::Toolkit::Plugin ); 
    1212 
    1313=head1 NAME 
     
    2424=head1 SYNOPSIS 
    2525 
    26   use CGI::Wiki; 
    27   use CGI::Wiki::Plugin::Locator::UK; 
     26  use Wiki::Toolkit; 
     27  use Wiki::Toolkit::Plugin::Locator::UK; 
    2828  use OpenGuides::UK::PubCrawl; 
    2929 
    30   my $wiki = CGI::Wiki->new( ... ); 
    31   my $locator = CGI::Wiki::Plugin::Locator::UK->new; 
     30  my $wiki = Wiki::Toolkit->new( ... ); 
     31  my $locator = Wiki::Toolkit::Plugin::Locator::UK->new; 
    3232  $wiki->register_plugin( plugin => $locator ); 
    33   my $categoriser = CGI::Wiki::Plugin::Categoriser->new; 
     33  my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new; 
    3434  $wiki->register_plugin( plugin => $categoriser ); 
    3535 
     
    5151  my $crawler = OpenGuides::UK::PubCrawl->new( locator => $locator ); 
    5252 
    53 Croaks unless a C<CGI::Wiki::Plugin::Locator::UK> object and a 
    54 C<CGI::Wiki::Plugin::Categoriser> object are supplied. 
     53Croaks unless a C<Wiki::Toolkit::Plugin::Locator::UK> object and a 
     54C<Wiki::Toolkit::Plugin::Categoriser> object are supplied. 
    5555 
    5656=cut 
     
    6060    my $locator = $args{locator} 
    6161      or croak "No locator parameter supplied"; 
    62     croak "Locator parameter is not a CGI::Wiki::Plugin::Locator::UK" 
    63       unless UNIVERSAL::isa( $locator, "CGI::Wiki::Plugin::Locator::UK" ); 
     62    croak "Locator parameter is not a Wiki::Toolkit::Plugin::Locator::UK" 
     63      unless UNIVERSAL::isa( $locator, "Wiki::Toolkit::Plugin::Locator::UK" ); 
    6464    my $categoriser = $args{categoriser} 
    6565      or croak "No categoriser parameter supplied"; 
    66     croak "Categoriser parameter is not a CGI::Wiki::Plugin::Categoriser" 
    67       unless UNIVERSAL::isa( $categoriser, "CGI::Wiki::Plugin::Categoriser" ); 
     66    croak "Categoriser parameter is not a Wiki::Toolkit::Plugin::Categoriser" 
     67      unless UNIVERSAL::isa( $categoriser, "Wiki::Toolkit::Plugin::Categoriser" ); 
    6868    my $self = { _locator     => $locator, 
    6969                 _categoriser => $categoriser }; 
  • trunk/lib/OpenGuides/Utils.pm

    r730 r785  
    66 
    77use Carp qw( croak ); 
    8 use CGI::Wiki; 
    9 use CGI::Wiki::Formatter::UseMod; 
    10 use CGI::Wiki::Plugin::RSS::Reader; 
     8use Wiki::Toolkit; 
     9use Wiki::Toolkit::Formatter::UseMod; 
     10use Wiki::Toolkit::Plugin::RSS::Reader; 
    1111use URI::Escape; 
    1212 
     
    4040 
    4141Croaks unless an C<OpenGuides::Config> object is supplied.  Returns a 
    42 C<CGI::Wiki> object made from the given config file on success, 
     42C<Wiki::Toolkit> object made from the given config file on success, 
    4343croaks if any other error occurs. 
    4444 
     
    7878                        ); 
    7979 
    80     my $cgi_wiki_module = "CGI::Wiki::Store::" . $cgi_wiki_exts{$dbtype}; 
     80    my $cgi_wiki_module = "Wiki::Toolkit::Store::" . $cgi_wiki_exts{$dbtype}; 
    8181    eval "require $cgi_wiki_module"; 
    8282    croak "Can't 'require' $cgi_wiki_module.\n" if $@; 
     
    9696              || $config->use_plucene == 1 ) 
    9797       ) { 
    98         require CGI::Wiki::Search::Plucene; 
    99