Changeset 810 for trunk/gsdl/perllib/mgbuildproc.pm
- Timestamp:
- 1999-12-07T10:45:27+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/mgbuildproc.pm
r780 r810 51 51 $self->{'classifiers'} = []; 52 52 $self->{'mode'} = "text"; 53 $self->{'assocdir'} = $build_dir; 53 54 $self->{'dontgdbm'} = {}; 54 55 $self->{'index'} = "section:text"; … … 102 103 103 104 $self->{'mode'} = $mode; 105 } 106 107 sub set_assocdir { 108 my $self = shift (@_); 109 my ($assocdir) = @_; 110 111 $self->{'assocdir'} = $assocdir; 104 112 } 105 113 … … 177 185 } 178 186 187 sub assoc_files { 188 my $self = shift (@_); 189 my ($doc_obj) = @_; 190 191 foreach $assoc_file (@{$doc_obj->get_assoc_files()}) { 192 $afile = &util::filename_cat($self->{'assocdir'}, $assoc_file->[1]); 193 &util::hard_link ($assoc_file->[0], $afile); 194 } 195 } 196 179 197 sub infodb { 180 198 my $self = shift (@_); … … 183 201 # $handle = "main::STDOUT"; 184 202 203 $self->assoc_files ($doc_obj); 204 185 205 my $doctype = $doc_obj->get_doc_type(); 186 206 … … 197 217 my $doc_OID = $doc_obj->get_OID(); 198 218 my $first = 1; 219 my $url = ""; 199 220 while (defined $section) { 200 221 # update a few statistics … … 222 243 223 244 if ($field ne "Identifier" && $field !~ /^gsdl/ && 224 defined $value && $value ne "" &&225 !defined $self->{'dontgdbm'}->{$field}) { 245 defined $value && $value ne "") { 246 226 247 # escape problematic stuff 227 248 $value =~ s/\\/\\\\/g; 228 249 $value =~ s/\n/\\n/g; 229 250 $value =~ s/\r/\\r/g; 230 231 print $handle "<$field>$value\n"; 232 } 233 } 234 251 252 # special case for URL metadata 253 if ($field =~ /^URL$/i) { 254 $url .= "[$value]\n"; 255 if ($section eq "") {$url .= "<section>$doc_OID\n";} 256 else {$url .= "<section>$doc_OID.$section\n";} 257 $url .= '-' x 70 . "\n"; 258 } 259 260 if (!defined $self->{'dontgdbm'}->{$field}) { 261 print $handle "<$field>$value\n"; 262 } 263 } 264 } 265 235 266 # output archivedir if at top level 236 267 if ($section eq $doc_obj->get_top_section()) { … … 242 273 print $handle "<archivedir>$archivedir\n"; 243 274 } 244 275 245 276 # output document display type 246 277 if ($first) { … … 280 311 else { print $handle "<section>$doc_OID.$section\n"; } 281 312 print $handle '-' x 70, "\n"; 313 314 # output entry for url 315 if ($url ne "") { 316 print $handle $url; 317 } 282 318 283 319 $first = 0;
Note:
See TracChangeset
for help on using the changeset viewer.