/[Z3950-HTML-Scraper]/server.pl
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 /server.pl

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

revision 9 by dpavlin, Sun Jun 21 08:16:41 2009 UTC revision 14 by dpavlin, Fri Oct 22 21:31:08 2010 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl
2    
3    use warnings;
4    use strict;
5    
6  use Net::Z3950::SimpleServer;  use Net::Z3950::SimpleServer;
7  use Net::Z3950::OID;  use Net::Z3950::OID;
8  use COBISS;  use COBISS;
 use strict;  
9    
10  my $max_records = 3; # XXX configure this  my $max_records = 3; # XXX configure this
11  my $max_result_sets = 10;  my $max_result_sets = 10;
# Line 44  diag "search for $query"; Line 46  diag "search for $query";
46    
47      my $setname  = $this->{SETNAME};      my $setname  = $this->{SETNAME};
48      my $repl_set = $this->{REPL_SET};      my $repl_set = $this->{REPL_SET};
49    diag "SETNAME $setname REPL_SET $repl_set";
50      my $result;      my $result;
51      unless ( $result = COBISS->search( $query ) ) {      unless ( $result = COBISS->search( $query ) ) {
52          $this->{ERR_CODE} = 108;          $this->{ERR_CODE} = 108;
# Line 157  sub render { Line 160  sub render {
160    
161  package Net::Z3950::RPN::Term;  package Net::Z3950::RPN::Term;
162    
163    use Data::Dump qw(dump);
164  use COBISS;  use COBISS;
165    
166  sub render {  sub render {
167      my $this       = shift;      my $this       = shift;
168    
169  print "render ", $this;  print "render ", dump($this);
170    
171    my $from = 'COBISS';
172    
173    my $usemap = eval "${from}::usemap;";
174    warn "# $from usermap ",dump($usemap);
175    
176      my $attributes = {};      my $attributes = {};
177      my $prefix     = "";      my $prefix     = "";
# Line 172  print "render ", $this; Line 181  print "render ", $this;
181          $attributes->{$type} = $value;          $attributes->{$type} = $value;
182      }      }
183      if ( defined( my $use = $attributes->{1} ) ) {      if ( defined( my $use = $attributes->{1} ) ) {
184          if ( defined( my $field = COBISS::usemap($use) ) ) {          if ( defined( my $field = $usemap->{$use} ) ) {
185              $prefix = $field;              $prefix = $field;
186          }          }
187          else {          else {

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

  ViewVC Help
Powered by ViewVC 1.1.26