/[webpac]/branches/fsb/WebPac.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/fsb/WebPac.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9 by dpavlin, Sat Jan 11 19:55:30 2003 UTC revision 10 by dpavlin, Thu Jan 16 17:35:54 2003 UTC
# Line 6  use strict; Line 6  use strict;
6  use HTML::Pager;  use HTML::Pager;
7  use HTML::FillInForm;  use HTML::FillInForm;
8  use SWISH;  use SWISH;
9  use Unicode::String qw(utf8 utf16);  use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);
 require Unicode::Map8;  
10  use DBI;  use DBI;
11    
12  # configuration options  # configuration options
13  # FIX: they really should go in configuration file!  # FIX: they really should go in configuration file!
14  my $TEMPLATE_PATH = '/data/webpac/template_html';  my $TEMPLATE_PATH = '/data/webpac/template_html';
15  my $CHARSET = 'ISO-8859-2';  my $CHARSET = 'ISO-8859-2';
16  my $SWISH = '/data/swish/swish-e';  my $SWISH = '/usr/local/bin/swish-e';
17  my $INDEX = '/data/webpac/index/isis.index';  my $INDEX = '/data/webpac/index/isis.index';
18  my $MAX_HITS = 500;  my $MAX_HITS = 500;
19  my $ON_PAGE = 10;  my $ON_PAGE = 10;
# Line 91  sub show_results_list { Line 90  sub show_results_list {
90    
91          my $tmpl = $self->load_tmpl('results.html');          my $tmpl = $self->load_tmpl('results.html');
92    
         my $l2_map = Unicode::Map8->new($CHARSET) || die;  
         my $us = Unicode::String->new();  
   
93          # call swish          # call swish
94          my $sh = SWISH->connect('Fork',          my $sh = SWISH->connect('Fork',
95                  prog     => $SWISH,                  prog     => $SWISH,
# Line 102  sub show_results_list { Line 98  sub show_results_list {
98                  results  => sub {                  results  => sub {
99                          my ($sh,$hit) = @_;                          my ($sh,$hit) = @_;
100    
                         $us->utf8($hit->swishtitle);  
   
101                          push @swish_results, {                          push @swish_results, {
102                                  nr => ($#swish_results + 2),                                  nr => ($#swish_results + 2),
103                                  path => $hit->swishdocpath,                                  path => $hit->swishdocpath,
104                                  title => $l2_map->to8($us->utf16),                                  title => to_utf8({ -string => $hit->swishtitle, -charset => $CHARSET }),
105                                  rank => $hit->swishrank };                                  rank => $hit->swishrank };
106    
107  #                       my @fields = $hit->field_names;  #                       my @fields = $hit->field_names;

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26