/[webpac2]/trunk/lib/WebPAC/Output/Webpacus.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 /trunk/lib/WebPAC/Output/Webpacus.pm

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

revision 932 by dpavlin, Wed Oct 31 11:26:10 2007 UTC revision 936 by dpavlin, Wed Oct 31 12:14:03 2007 UTC
# Line 7  use base qw/WebPAC::Common WebPAC::Outpu Line 7  use base qw/WebPAC::Common WebPAC::Outpu
7  __PACKAGE__->mk_accessors(qw(  __PACKAGE__->mk_accessors(qw(
8          path          path
9          database          database
10            input
11  ));  ));
12    
13  use File::Path;  use File::Path;
# Line 14  use Data::Dump qw/dump/; Line 15  use Data::Dump qw/dump/;
15  use WebPAC::Common qw/force_array/;  use WebPAC::Common qw/force_array/;
16  use Carp qw/confess/;  use Carp qw/confess/;
17  use Cwd;  use Cwd;
18    use File::Slurp;
19    
20  use Jifty;  use Jifty;
21    
# Line 133  sub finish { Line 135  sub finish {
135          my $count = 0;          my $count = 0;
136    
137          foreach my $field ( keys %$fields ) {          foreach my $field ( keys %$fields ) {
138                  $log->debug("adding search field: $field");                  my $items = $fields->{$field} || confess "no field?";
139                  $o->create( name => $field ); # || $log->logdie("can't add $field");                  $log->debug("adding search field: $field [$items]");
140                    $o->load_or_create(
141                            name => $field,
142                            items => $items,
143                    ); # || $log->logdie("can't add $field");
144                  $count++;                  $count++;
145          }          }
146    
147            $log->info("synced $count search fields with Webpacus");
148    
149            my $glue_path = "$path/lib/Webpacus/Webpac.pm";
150    
151            $log->info("creating clue class Webpacus::Webpac at $glue_path");
152    
153            my $glue = <<"_END_OF_GLUE_";
154    package Webpacus::Webpac;
155    
156    =head1 NAME
157    
158    Webpacus::Webpac - configuration exported from WebPAC
159    
160    =cut
161    
162    use strict;
163    use warnings;
164    
165    sub index_path { '/data/webpac2/var/kinosearch/webpacus' };
166    
167    1;
168    _END_OF_GLUE_
169    
170            $log->debug("glue source:\n$glue");
171    
172            write_file( $glue_path, $glue ) || $log->logdie("can't create $glue_path: $!");
173    
174          return $count;          return $count;
175    
176  }  }

Legend:
Removed from v.932  
changed lines
  Added in v.936

  ViewVC Help
Powered by ViewVC 1.1.26