NAME

CGI::Application::NetNewsIface::Cache::DBI - an internally used class to form a fast cache of the NNTP data.

SYNOPSIS

use CGI::Application::NetNewsIface::Cache::DBI;

my $cache = CGI::Application::NetNewsIface::Cache::DBI->new(
    {
        'nntp' => $nntp,
        'dsn' => "dbi:SQLite:dbname=foo.sqlite",
    },
);

FUNCTIONS

new({ %params })

Constructs a new cache object. Accepts a single argument - a hash ref with named parameters. Required parameters are:

'nntp'

A handle to the Net::NNTP object that will be used for querying the NNTP server.

'dsn'

The DBI 'dsn' for the DBI initialization.

$cache->select( $group )

Selects the newsgroup $group.

$cache->get_index_of_id($id)

Retrieves the index of the message with the id $id.

($thread, $coords) = $cache->get_thread($index);

Gets the thread for the message indexed $index. Thread is:

$thread looks like this:

{
    'idx' => $index,
    'subject' => "Problem with Test::More",
    'date' => $date,
    'from' => "Shlomi Fish <shlomif@iglu.org.il>",
    'subs' =>
    [
        {
            'idx' => $index,
            .
            'subs' =>
            [
                .
                .
                .
            ],
        }
        .
        .
        .
    ],
}

$coords is the coordinates leading to the current article within the thread. To access the current article from the coords use:

$thread->{'subs'}->[$coords[0]]->{'subs'}->[$coords[1]]->...

AUTHOR

Shlomi Fish, <shlomif@iglu.org.il>

BUGS

Please report any bugs or feature requests to bug-cgi-application-netnewsiface@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-NetNewsIface. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2006 Shlomi Fish, all rights reserved.

This program is released under the following license: MIT X11.