--- Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/26 01:54:42 155 +++ Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/27 05:07:01 178 @@ -68,9 +68,14 @@ $self->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } ); - my $db_path = $c->config->{webpac}->{db_path}; - my $template_path = $c->config->{webpac}->{template_path}; - $self->{template_path} = $template_path; + # save config parametars in object + foreach my $f (qw/db_path template_path hits_on_page/) { + $self->{$f} = $c->config->{hyperestraier}->{$f} || + $c->config->{webpac}->{$f}; + $log->debug("self->{$f} = " . $self->{$f}); + } + my $db_path = $self->{db_path}; + my $template_path = $self->{template_path}; $log->debug("using db path '$db_path', template path '$template_path'"); @@ -99,11 +104,6 @@ "'" ); - # save config parametars in object - foreach my $f (qw/hits_on_page/) { - $self->{$_} = $c->config->{$_}; - $log->debug("self->{$_} = " . $c->config->{$_}); - } return $self; @@ -119,13 +119,14 @@ sub iconv_on_save { my $self = shift; + my $content = shift || return; $self->{iconv_save} ||= new Text::Iconv( $self->config->{webpac}->{out_encoding}, $self->config->{webpac}->{webpac_encoding}, ); - $self->{iconv_save}->convert( @_ ); + return $self->{iconv_save}->convert( $content ); } @@ -235,6 +236,43 @@ return \@html_results; } +=head2 record + + my $html = $m->record( + mfn => 42, + template => 'foo.tt', + ); + +This will load one record, convert it to html using C