[4726] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
| 3 | # OAIPlug.pm -- basic Open Archives Initiative (OAI) plugin
|
---|
| 4 | #
|
---|
| 5 | # A component of the Greenstone digital library software
|
---|
| 6 | # from the New Zealand Digital Library Project at the
|
---|
| 7 | # University of Waikato, New Zealand.
|
---|
| 8 | #
|
---|
| 9 | # Copyright (C) 1999 New Zealand Digital Library Project
|
---|
| 10 | #
|
---|
| 11 | # This program is free software; you can redistribute it and/or modify
|
---|
| 12 | # it under the terms of the GNU General Public License as published by
|
---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | # (at your option) any later version.
|
---|
| 15 | #
|
---|
| 16 | # This program is distributed in the hope that it will be useful,
|
---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | # GNU General Public License for more details.
|
---|
| 20 | #
|
---|
| 21 | # You should have received a copy of the GNU General Public License
|
---|
| 22 | # along with this program; if not, write to the Free Software
|
---|
| 23 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 24 | #
|
---|
| 25 | ###########################################################################
|
---|
| 26 |
|
---|
| 27 | package OAIPlug;
|
---|
| 28 |
|
---|
| 29 | use BasPlug;
|
---|
| 30 | use unicode;
|
---|
| 31 | use util;
|
---|
| 32 |
|
---|
[10254] | 33 | use strict;
|
---|
| 34 | no strict 'refs'; # allow filehandles to be variables and viceversa
|
---|
| 35 |
|
---|
[9958] | 36 | use XMLPlug;
|
---|
| 37 |
|
---|
[4726] | 38 | sub BEGIN {
|
---|
[9958] | 39 | @OAIPlug::ISA = ('XMLPlug');
|
---|
[4726] | 40 | }
|
---|
| 41 |
|
---|
[9958] | 42 |
|
---|
[6408] | 43 | my $arguments =
|
---|
| 44 | [ { 'name' => "process_exp",
|
---|
| 45 | 'desc' => "{BasPlug.process_exp}",
|
---|
| 46 | 'type' => "regexp",
|
---|
| 47 | 'reqd' => "no",
|
---|
| 48 | 'deft' => &get_default_process_exp() },
|
---|
| 49 | ];
|
---|
| 50 |
|
---|
[4747] | 51 | my $options = { 'name' => "OAIPlug",
|
---|
[5680] | 52 | 'desc' => "{OAIPlug.desc}",
|
---|
[6408] | 53 | 'abstract' => "no",
|
---|
| 54 | 'inherits' => "yes",
|
---|
| 55 | 'args' => $arguments };
|
---|
[4747] | 56 |
|
---|
[10254] | 57 |
|
---|
[4726] | 58 | sub new {
|
---|
[10218] | 59 | my ($class) = shift (@_);
|
---|
| 60 | my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
|
---|
| 61 | push(@$pluginlist, $class);
|
---|
[4873] | 62 |
|
---|
[10218] | 63 | if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
|
---|
| 64 | if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
|
---|
[4726] | 65 |
|
---|
[12169] | 66 | my $self = new XMLPlug($pluginlist, $inputargs, $hashArgOptLists);
|
---|
[4726] | 67 |
|
---|
| 68 | return bless $self, $class;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | sub get_default_process_exp {
|
---|
| 72 | my $self = shift (@_);
|
---|
| 73 |
|
---|
| 74 | return q^(?i)(\.oai)$^;
|
---|
| 75 | }
|
---|
| 76 |
|
---|
[13222] | 77 | sub get_doctype {
|
---|
| 78 | my $self = shift(@_);
|
---|
| 79 |
|
---|
| 80 | return "OAI-PMH";
|
---|
| 81 | }
|
---|
| 82 |
|
---|
[9958] | 83 | sub xml_start_document {
|
---|
[10254] | 84 | my $self = shift (@_);
|
---|
[9958] | 85 | $self->{'in_metadata_node'} = 0;
|
---|
| 86 | $self->{'rawxml'} = "";
|
---|
| 87 | }
|
---|
[4726] | 88 |
|
---|
[9958] | 89 | sub xml_end_document {
|
---|
| 90 | }
|
---|
[4726] | 91 |
|
---|
[9958] | 92 | sub xml_doctype {
|
---|
| 93 | my $self = shift(@_);
|
---|
| 94 |
|
---|
| 95 | my ($expat, $name, $sysid, $pubid, $internal) = @_;
|
---|
| 96 |
|
---|
[13886] | 97 | ##die "" if ($name !~ /^OAI-PMH$/);
|
---|
[9958] | 98 |
|
---|
[4726] | 99 | my $outhandle = $self->{'outhandle'};
|
---|
[9958] | 100 | print $outhandle "OAIPlug: processing $self->{'file'}\n" if $self->{'verbosity'} > 1;
|
---|
| 101 | print STDERR "<Processing n='$self->{'file'}' p='OAIPlug'>\n" if $self->{'gli'};
|
---|
[4726] | 102 |
|
---|
[9958] | 103 | }
|
---|
[4726] | 104 |
|
---|
[9958] | 105 |
|
---|
| 106 | sub xml_start_tag {
|
---|
| 107 | my $self = shift(@_);
|
---|
| 108 | my ($expat,$element) = @_;
|
---|
| 109 |
|
---|
| 110 | my %attr_hash = %_;
|
---|
| 111 |
|
---|
| 112 | my $attr = "";
|
---|
| 113 | map { $attr .= " $_=$attr_hash{$_}"; } keys %attr_hash;
|
---|
| 114 |
|
---|
| 115 | $self->{'rawxml'} .= "<$element$attr>";
|
---|
| 116 |
|
---|
| 117 | if ($element eq "metadata") {
|
---|
| 118 | $self->{'in_metadata_node'} = 1;
|
---|
| 119 | $self->{'metadata_xml'} = "";
|
---|
[4726] | 120 | }
|
---|
[9958] | 121 |
|
---|
| 122 | if ($self->{'in_metadata_node'}) {
|
---|
| 123 | $self->{'metadata_xml'} .= "<$element$attr>";
|
---|
[4726] | 124 | }
|
---|
[9958] | 125 | }
|
---|
[4726] | 126 |
|
---|
[9958] | 127 | sub xml_end_tag {
|
---|
| 128 | my $self = shift(@_);
|
---|
| 129 | my ($expat, $element) = @_;
|
---|
[4726] | 130 |
|
---|
[9958] | 131 | $self->{'rawxml'} .= "</$element>";
|
---|
[4726] | 132 |
|
---|
[9958] | 133 | if ($self->{'in_metadata_node'}) {
|
---|
| 134 | $self->{'metadata_xml'} .= "</$element>";
|
---|
[4726] | 135 | }
|
---|
| 136 |
|
---|
[9958] | 137 | if ($element eq "metadata") {
|
---|
| 138 | my $textref = \$self->{'metadata_xml'};
|
---|
| 139 | my $metadata = $self->{'metadata'};
|
---|
| 140 | $self->extract_oai_metadata($textref,$metadata);
|
---|
[4726] | 141 |
|
---|
[9958] | 142 | $self->{'in_metadata_node'} = 0;
|
---|
| 143 | }
|
---|
[4726] | 144 |
|
---|
| 145 |
|
---|
[9958] | 146 | }
|
---|
[4726] | 147 |
|
---|
[9958] | 148 | sub xml_text {
|
---|
| 149 | my $self = shift(@_);
|
---|
| 150 | my ($expat) = @_;
|
---|
[8684] | 151 |
|
---|
[9958] | 152 | $self->{'rawxml'} .= $_;
|
---|
[4726] | 153 |
|
---|
[9958] | 154 | if ($self->{'in_metadata_node'}) {
|
---|
| 155 | $self->{'metadata_xml'} .= $_;
|
---|
[4726] | 156 | }
|
---|
[9958] | 157 | }
|
---|
[4726] | 158 |
|
---|
[8121] | 159 |
|
---|
[4726] | 160 |
|
---|
[5919] | 161 |
|
---|
[9958] | 162 | sub read {
|
---|
| 163 | my $self = shift (@_);
|
---|
| 164 |
|
---|
| 165 | my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
|
---|
[4726] | 166 |
|
---|
[9958] | 167 | my $outhandle = $self->{'outhandle'};
|
---|
[4726] | 168 |
|
---|
[9958] | 169 | my $filename = $file;
|
---|
| 170 | $filename = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/;
|
---|
[4726] | 171 |
|
---|
[9958] | 172 | return 0 if ((-d $filename) && ($filename =~ m/srcdocs$/));
|
---|
[4726] | 173 |
|
---|
[9958] | 174 | if ($self->SUPER::read(@_)) {
|
---|
| 175 |
|
---|
| 176 | # Do encoding stuff
|
---|
| 177 | my ($language, $encoding) = $self->textcat_get_language_encoding ($filename);
|
---|
| 178 |
|
---|
| 179 | my $url_array = $metadata->{'URL'};
|
---|
[10254] | 180 | my $num_urls = (defined $url_array) ? scalar(@$url_array) : 0;
|
---|
[9958] | 181 |
|
---|
| 182 | my $srcdoc_exists = 0;
|
---|
| 183 | my $srcdoc_pos = 0;
|
---|
| 184 | my $filename_dir = &util::filename_head($filename);
|
---|
| 185 |
|
---|
| 186 | for (my $i=0; $i<$num_urls; $i++) {
|
---|
| 187 |
|
---|
| 188 | if ($url_array->[$i] !~ m/^(http|ftp):/) {
|
---|
| 189 |
|
---|
| 190 | my $src_filename = &util::filename_cat($filename_dir, $url_array->[$i]);
|
---|
| 191 |
|
---|
| 192 | if (-e $src_filename) {
|
---|
| 193 | $srcdoc_pos = $i;
|
---|
| 194 | $srcdoc_exists = 1;
|
---|
| 195 | }
|
---|
| 196 | }
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 | if ($srcdoc_exists)
|
---|
| 200 | {
|
---|
| 201 | print $outhandle "OAIPlug: passing metadata on to $url_array->[0]\n"
|
---|
| 202 | if ($self->{'verbosity'}>1);
|
---|
| 203 |
|
---|
| 204 |
|
---|
| 205 | # Make pretty print metadata table stick with src filename
|
---|
| 206 | my $ppmd_table = $self->{'ppmd_table'};
|
---|
| 207 | $metadata->{'prettymd'} = [ $ppmd_table ];
|
---|
| 208 | $self->{'ppmd_table'} = undef;
|
---|
| 209 |
|
---|
| 210 | return &plugin::read ($pluginfo, $filename_dir, $url_array->[0],
|
---|
| 211 | $metadata, $processor, $maxdocs, $total_count, $gli);
|
---|
| 212 | }
|
---|
| 213 | else
|
---|
| 214 | {
|
---|
| 215 | # create a new document
|
---|
| 216 | my $doc_obj = new doc ($filename, "indexed_doc");
|
---|
| 217 | my $top_section = $doc_obj->get_top_section;
|
---|
| 218 | my $plugin_type = $self->{'plugin_type'};
|
---|
| 219 |
|
---|
| 220 | $doc_obj->add_utf8_metadata($top_section, "Language", $language);
|
---|
| 221 | $doc_obj->add_utf8_metadata($top_section, "Encoding", $encoding);
|
---|
| 222 | $doc_obj->add_utf8_metadata($top_section, "Plugin", $plugin_type);
|
---|
| 223 | $doc_obj->add_metadata($top_section, "FileFormat", "OAI");
|
---|
| 224 | $doc_obj->add_metadata($top_section, "FileSize", (-s $filename));
|
---|
| 225 |
|
---|
| 226 | # include any metadata passed in from previous plugins
|
---|
| 227 | # note that this metadata is associated with the top level section
|
---|
| 228 | $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata);
|
---|
| 229 |
|
---|
| 230 | # do plugin specific processing of doc_obj
|
---|
| 231 | my $textref = \$self->{'rawxml'};
|
---|
| 232 | unless (defined ($self->process($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj))) {
|
---|
| 233 | print STDERR "<ProcessingError n='$file'>\n" if ($gli);
|
---|
| 234 | return -1;
|
---|
| 235 | }
|
---|
| 236 |
|
---|
| 237 | # do any automatic metadata extraction
|
---|
| 238 | $self->auto_extract_metadata ($doc_obj);
|
---|
| 239 |
|
---|
| 240 | # add an OID
|
---|
| 241 | $doc_obj->set_OID();
|
---|
| 242 |
|
---|
| 243 | my $ppmd_table = $self->{'ppmd_table'};
|
---|
| 244 | $doc_obj->add_utf8_metadata($top_section,"prettymd",$ppmd_table);
|
---|
| 245 | $self->{'ppmd_table'} = undef;
|
---|
| 246 |
|
---|
| 247 | # process the document
|
---|
| 248 | $processor->process($doc_obj);
|
---|
| 249 |
|
---|
| 250 | $self->{'num_processed'} ++;
|
---|
| 251 |
|
---|
| 252 | return 1; # processed the file
|
---|
| 253 | }
|
---|
[4726] | 254 | }
|
---|
[9958] | 255 | else {
|
---|
| 256 | return undef;
|
---|
| 257 | }
|
---|
[4726] | 258 | }
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 | # do plugin specific processing of doc_obj
|
---|
| 262 | sub process {
|
---|
| 263 | my $self = shift (@_);
|
---|
[6332] | 264 | my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
|
---|
[4726] | 265 | my $outhandle = $self->{'outhandle'};
|
---|
| 266 |
|
---|
[6332] | 267 | print STDERR "<Processing n='$file' p='OAIPlug'>\n" if ($gli);
|
---|
[4726] | 268 | print $outhandle "OAIPlug: processing $file\n"
|
---|
| 269 | if $self->{'verbosity'} > 1;
|
---|
| 270 |
|
---|
| 271 | my $cursection = $doc_obj->get_top_section();
|
---|
| 272 |
|
---|
| 273 | ## $self->extract_metadata ($textref, $metadata, $doc_obj, $cursection);
|
---|
| 274 |
|
---|
| 275 | # add text to document object
|
---|
| 276 |
|
---|
| 277 | # $$textref =~ s/<(.*?)>/$1 /g;
|
---|
| 278 | $$textref =~ s/</</g;
|
---|
| 279 | $$textref =~ s/>/>/g;
|
---|
| 280 |
|
---|
| 281 | ## print STDERR "*** adding text: $$textref\n";
|
---|
| 282 |
|
---|
| 283 | $doc_obj->add_utf8_text($cursection, $$textref);
|
---|
| 284 |
|
---|
| 285 | return 1;
|
---|
| 286 | }
|
---|
| 287 |
|
---|
| 288 |
|
---|
[9958] | 289 | # Improvement is to merge this with newer version in MetadataPass
|
---|
[4726] | 290 |
|
---|
[9958] | 291 | sub open_prettyprint_metadata_table
|
---|
| 292 | {
|
---|
| 293 | my $self = shift(@_);
|
---|
| 294 |
|
---|
| 295 | my $att = "width=100% cellspacing=2";
|
---|
| 296 | my $style = "style=\'border-bottom: 4px solid #000080\'";
|
---|
| 297 |
|
---|
| 298 | $self->{'ppmd_table'} = "\n<table $att $style>";
|
---|
| 299 | }
|
---|
| 300 |
|
---|
| 301 | sub add_prettyprint_metadata_line
|
---|
| 302 | {
|
---|
| 303 | my $self = shift(@_);
|
---|
| 304 | my ($metaname, $metavalue_utf8) = @_;
|
---|
| 305 |
|
---|
[14949] | 306 | ### $metavalue_utf8 =~ s/hdl\.handle\.net/mcgonagall.cs.waikato.ac.nz:8080\/dspace\/handle/;
|
---|
[9958] | 307 | $metavalue_utf8 = &util::hyperlink_text($metavalue_utf8);
|
---|
| 308 |
|
---|
| 309 | $self->{'ppmd_table'} .= " <tr bgcolor=#b5d3cd>\n";
|
---|
| 310 | $self->{'ppmd_table'} .= " <td width=30%>\n";
|
---|
| 311 | $self->{'ppmd_table'} .= " $metaname\n";
|
---|
| 312 | $self->{'ppmd_table'} .= " </td>\n";
|
---|
| 313 | $self->{'ppmd_table'} .= " <td>\n";
|
---|
| 314 | $self->{'ppmd_table'} .= " $metavalue_utf8\n";
|
---|
| 315 | $self->{'ppmd_table'} .= " </td>\n";
|
---|
| 316 | $self->{'ppmd_table'} .= " </tr>\n";
|
---|
| 317 |
|
---|
| 318 | }
|
---|
| 319 |
|
---|
| 320 | sub close_prettyprint_metadata_table
|
---|
| 321 | {
|
---|
| 322 | my $self = shift(@_);
|
---|
| 323 |
|
---|
| 324 | $self->{'ppmd_table'} .= "</table>\n";
|
---|
| 325 | }
|
---|
| 326 |
|
---|
| 327 |
|
---|
[14940] | 328 | sub remap_dcterms_metadata
|
---|
| 329 | {
|
---|
| 330 | my $self = shift(@_);
|
---|
[9958] | 331 |
|
---|
[14940] | 332 | my ($metaname) = @_;
|
---|
[9958] | 333 |
|
---|
[14940] | 334 | my $dcterm_mapping = {
|
---|
| 335 | "alternative" => "dc.title",
|
---|
| 336 | "tableOfContents" => "dc.description",
|
---|
| 337 | "abstract" => "dc.description",
|
---|
| 338 | "created" => "dc.date",
|
---|
| 339 | "valid" => "dc.date",
|
---|
| 340 | "available" => "dc.date",
|
---|
| 341 | "issued" => "dc.date",
|
---|
| 342 | "modified" => "dc.date",
|
---|
| 343 | "dateAccepted" => "dc.date",
|
---|
| 344 | "dateCopyrighted" => "dc.date",
|
---|
| 345 | "dateSubmitted" => "dc.date",
|
---|
| 346 | "extent" => "dc.format",
|
---|
| 347 | "medium" => "dc.format",
|
---|
| 348 | "isVersionOf" => "dc.relation",
|
---|
| 349 | "hasVersion" => "dc.relation",
|
---|
| 350 | "isReplacedBy" => "dc.relation",
|
---|
| 351 | "replaces" => "dc.relation",
|
---|
| 352 | "isRequiredBy" => "dc.relation",
|
---|
| 353 | "requires" => "dc.relation",
|
---|
| 354 | "isPartOf" => "dc.relation",
|
---|
| 355 | "hasPart" => "dc.relation",
|
---|
| 356 | "isReferencedBy" => "dc.relation",
|
---|
| 357 | "references" => "dc.relation",
|
---|
| 358 | "isFormatOf" => "dc.relation",
|
---|
| 359 | "hasFormat" => "dc.relation",
|
---|
| 360 | "conformsTo" => "dc.relation",
|
---|
| 361 | "spatial" => "dc.coverage",
|
---|
| 362 | "temporal" => "dc.coverage",
|
---|
| 363 | "audience" => "dc.any",
|
---|
| 364 | "accrualMethod" => "dc.any",
|
---|
| 365 | "accrualPeriodicity" => "dc.any",
|
---|
| 366 | "accrualPolicy" => "dc.any",
|
---|
| 367 | "instructionalMethod" => "dc.any",
|
---|
| 368 | "provenance" => "dc.any",
|
---|
| 369 | "rightsHolder" => "dc.any",
|
---|
| 370 | "mediator" => "audience",
|
---|
| 371 | "educationLevel" => "audience",
|
---|
| 372 | "accessRights" => "dc.rights",
|
---|
| 373 | "license" => "dc.rights",
|
---|
| 374 | "bibliographicCitation" => "dc.identifier"
|
---|
| 375 | };
|
---|
| 376 |
|
---|
| 377 | my ($prefix,$name) = ($metaname =~ m/^(.*?)\.(.*?)$/);
|
---|
| 378 |
|
---|
| 379 | if ($prefix eq "dcterms")
|
---|
| 380 | {
|
---|
| 381 | if (defined $dcterm_mapping->{$name})
|
---|
| 382 | {
|
---|
| 383 | return $dcterm_mapping->{$name}."^".$name;
|
---|
| 384 | }
|
---|
| 385 |
|
---|
| 386 | }
|
---|
| 387 | return $metaname; # didn't get a match, return param passed in unchanged
|
---|
| 388 | }
|
---|
| 389 |
|
---|
| 390 |
|
---|
[4726] | 391 | sub extract_oai_metadata {
|
---|
| 392 | my $self = shift (@_);
|
---|
| 393 | my ($textref, $metadata) = @_;
|
---|
| 394 | my $outhandle = $self->{'outhandle'};
|
---|
| 395 |
|
---|
[9958] | 396 | # Only handles DC metadata
|
---|
| 397 |
|
---|
| 398 | $self->open_prettyprint_metadata_table();
|
---|
| 399 |
|
---|
| 400 | if ($$textref =~ m/<metadata\s*>(.*?)<\/metadata\s*>/s)
|
---|
[4726] | 401 | {
|
---|
[10254] | 402 | my $metadata_text = $1;
|
---|
[4726] | 403 |
|
---|
[14940] | 404 | # locate and remove outermost tag (ignoring any attribute information in top-level tag)
|
---|
| 405 | my ($wrapper_metadata_xml,$inner_metadata_text) = ($metadata_text =~ m/<([^ >]+).*?>(.*?)<\/\1>/s);
|
---|
| 406 |
|
---|
| 407 | # split tag into namespace and tag name
|
---|
| 408 | my($namespace,$top_level_prefix) = ($wrapper_metadata_xml =~ m/^(.*?):(.*?)$/);
|
---|
| 409 |
|
---|
| 410 | if ($top_level_prefix !~ /dc$/) {
|
---|
| 411 | print $outhandle "Warning: OAIPlug currently only designed for Dublin Core (or variant) metadata\n";
|
---|
| 412 | print $outhandle " This recorded metadata section '$top_level_prefix' does not appear to match.\n";
|
---|
| 413 | print $outhandle " Metadata assumed to be in form: <prefix:tag>value</prefix:tag> and will be converted\n";
|
---|
| 414 | print $outhandle " into Greenstone metadata as prefix.tag = value\n";
|
---|
| 415 | }
|
---|
| 416 |
|
---|
[14949] | 417 | while ($inner_metadata_text =~ m/<([^ >]+).*?>(.*?)<\/\1>(.*)/s)
|
---|
[4726] | 418 | {
|
---|
| 419 | # if URL given for document as identifier metadata, store it ...
|
---|
| 420 | # $doc_obj->add_utf8_metadata($cursection, "URL", $web_url);
|
---|
[9958] | 421 |
|
---|
[4726] | 422 | my $metaname = $1;
|
---|
| 423 | my $metavalue = $2;
|
---|
[14949] | 424 | $inner_metadata_text = $3;
|
---|
| 425 |
|
---|
| 426 | # print STDERR "*** metaname = $metaname\n";
|
---|
| 427 | # print STDERR "*** metavalue = $metavalue\n";
|
---|
| 428 |
|
---|
[14940] | 429 | # $metaname =~ s/^(dc:)?(.)/\u$2/; # strip of optional prefix and uppercase first letter
|
---|
| 430 | $metaname =~ s/:/\./;
|
---|
| 431 | if ($metaname !~ m/\./)
|
---|
[4726] | 432 | {
|
---|
[14940] | 433 | $metaname = "$top_level_prefix.$metaname";
|
---|
[4726] | 434 | }
|
---|
| 435 |
|
---|
[14940] | 436 |
|
---|
| 437 | $metaname = $self->remap_dcterms_metadata($metaname);
|
---|
| 438 |
|
---|
| 439 | # if ($metaname eq "Identifier")
|
---|
| 440 | # {
|
---|
| 441 | # # name clashes with GSDL reserved metadata name for hash id
|
---|
| 442 | # $metaname = "URL";
|
---|
| 443 | # }
|
---|
| 444 |
|
---|
[4726] | 445 | if (defined $metadata->{$metaname})
|
---|
| 446 | {
|
---|
| 447 | push(@{$metadata->{$metaname}},$metavalue);
|
---|
[8121] | 448 |
|
---|
[4726] | 449 | }
|
---|
| 450 | else
|
---|
| 451 | {
|
---|
| 452 | $metadata->{$metaname} = [ $metavalue ];
|
---|
| 453 | }
|
---|
| 454 |
|
---|
[9958] | 455 | $self->add_prettyprint_metadata_line($metaname, $metavalue);
|
---|
| 456 |
|
---|
[4726] | 457 | }
|
---|
| 458 | }
|
---|
[9958] | 459 |
|
---|
| 460 | $self->close_prettyprint_metadata_table();
|
---|
[4726] | 461 | }
|
---|
| 462 |
|
---|
[13886] | 463 | ## we know from the file extension, so doesn't need to check the doctype
|
---|
| 464 | sub check_doctype {
|
---|
| 465 |
|
---|
| 466 | return 1;
|
---|
| 467 | }
|
---|
| 468 |
|
---|
[4726] | 469 | 1;
|
---|