Changeset 286 for trunk/gsdl/perllib
- Timestamp:
- 1999-06-24T17:25:43+12:00 (25 years ago)
- Location:
- trunk/gsdl/perllib/plugins
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/HBPlug.pm
r4 r286 5 5 use html; 6 6 use BasPlug; 7 7 use util; 8 8 9 9 sub BEGIN { … … 136 136 } 137 137 return 0 unless defined $jobnumber; 138 my $htmlfile = "$base_dir$file/$jobnumber.htm";138 my $htmlfile = &util::filename_cat($base_dir, $file, "$jobnumber.htm"); 139 139 return 0 unless -e $htmlfile; 140 140 … … 148 148 149 149 # copy the book cover if it exists 150 my $bookcover = "$base_dir$file/$jobnumber.jpg";150 my $bookcover = &util::filename_cat($base_dir, $file, "$jobnumber.jpg"); 151 151 $doc_obj->associate_file($bookcover, "cover.jpg", "image/jpeg") 152 152 if -e $bookcover; … … 190 190 191 191 # add the metadata to this section 192 if (!$firstsection || !defined($metadata->{'Title'})) { 193 $doc_obj->add_metadata ($cursection, "Title", $title); 194 } 192 $doc_obj->add_metadata ($cursection, "Title", $title); 193 195 194 if ($firstsection) { 196 195 foreach $field (keys(%$metadata)) { 197 # Subjects may be a colon separated list 198 if ($field eq "Subject") { 199 my @subjects = split /:/, $metadata->{'Subject'}; 200 foreach $subject (@subjects) { 201 $doc_obj->add_metadata ($cursection, 'Subject', $subject); 202 } 196 # $metadata->{$field} may be an array reference 197 if (ref ($metadata->{$field}) eq "ARRAY") { 198 map { 199 $doc_obj->add_metadata ($cursection, $field, $_); 200 } @{$metadata->{$field}}; 203 201 } else { 204 $doc_obj->add_metadata ($cursection, $field, $metadata->{$field}); 202 $doc_obj->add_metadata ($cursection, $field, $metadata->{$field}); 205 203 } 206 204 } … … 216 214 # split (/(_linkOID_\(_thisOID_\/[^\)]+\))/, $sectiontext); 217 215 218 map { $doc_obj->associate_file( "$base_dir$file/$1", $1)216 map { $doc_obj->associate_file(&util::filename_cat ($base_dir, $file, $1), $1) 219 217 if /_httpcollection_\/archives\/_thisOID_\/([^\"]+)\"/; 0; } 220 218 split (/(_httpcollection_\/archives\/_thisOID_\/[^\"]+\")/, $sectiontext); … … 233 231 $doc_obj->set_OID (); 234 232 235 print STDERR "OID: ", $doc_obj->get_OID(), "\n";236 237 233 # process the document 238 234 $processor->process($doc_obj);
Note:
See TracChangeset
for help on using the changeset viewer.