24 |
|
|
25 |
my $thes = new WebPAC::Index( |
my $thes = new WebPAC::Index( |
26 |
log => 'log4perl.conf', |
log => 'log4perl.conf', |
27 |
|
name => 'index name', |
28 |
); |
); |
29 |
|
|
30 |
C<log> is optional parametar which specify filename of L<Log::Log4Perl> |
C<log> is optional parametar which specify filename of L<Log::Log4Perl> |
31 |
config file. Default is C<log.conf>. |
config file. Default is C<log.conf>. |
32 |
|
|
33 |
|
C<name> is optional parametar used to mark lines in log file with index |
34 |
|
name. |
35 |
|
|
36 |
Default sort function is my C<headline>, non case sensitive. It can't be |
Default sort function is my C<headline>, non case sensitive. It can't be |
37 |
changed right now without editing of source. |
changed right now without editing of source. |
38 |
|
|
58 |
Insert data into index |
Insert data into index |
59 |
|
|
60 |
$index->insert( |
$index->insert( |
|
path => 'path', |
|
61 |
headline => 'headline text', |
headline => 'headline text', |
62 |
|
mfn => '99', |
63 |
); |
); |
64 |
|
|
65 |
=cut |
=cut |
69 |
|
|
70 |
my $data = {@_}; |
my $data = {@_}; |
71 |
|
|
|
confess("need path and headline!") unless (defined($data->{'path'}) && defined($data->{'headline'})); |
|
|
|
|
72 |
my $log = $self->_get_logger(); |
my $log = $self->_get_logger(); |
73 |
|
|
74 |
|
$log->logconfess("need headline and mfn!") unless (defined($data->{'headline'}) && defined($data->{'mfn'})); |
75 |
|
|
76 |
push @{$self->{'index'}}, $data; |
push @{$self->{'index'}}, $data; |
77 |
|
|
78 |
$log->debug("stored path: ",$data->{'path'}," headline: ",$data->{'headline'}); |
my $name = ''; |
79 |
|
$name = $self->{'name'}." " if ($self->{'name'}); |
80 |
|
|
81 |
|
$log->debug("stored ",$name,$data->{'mfn'},": ",$data->{'headline'}); |
82 |
|
|
83 |
} |
} |
84 |
|
|