Changeset 14970 for gsdl/trunk/perllib/plugouts
- Timestamp:
- 2008-02-12T15:27:17+13:00 (16 years ago)
- Location:
- gsdl/trunk/perllib/plugouts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugouts/FedoraMETSPlugout.pm
r14927 r14970 84 84 my $collection = $ENV{'GSDLCOLLECTION'}; 85 85 86 my $extra_attr = "OBJID=\"$oid_namespace:$collection-$OID\" TYPE=\"FedoraObject\" LABEL=\"$doc_title\""; 86 # Might need the following in the schemeLocation attribute for Fedora3 87 # http://www.fedora.info/definitions/1/0/mets-fedora-ext1-1.xsd 88 89 my $extra_attr = "OBJID=\"$oid_namespace:$collection-$OID\" TYPE=\"FedoraObject\" LABEL=\"$doc_title\" EXT_VERSION=\"1.1\""; 87 90 88 91 $self->output_mets_xml_header_extra_attribute($handle,$extra_attr); … … 216 219 217 220 221 sub buffer_mets_relsext_xml 222 { 223 my $self = shift(@_); 224 my ($doc_obj) = @_; 225 226 my $OID = $doc_obj->get_OID(); 227 228 my $fnamespace = $self->{'fedora_namespace'}; 229 my $oid_namespace = (defined $fnamespace) ? $fnamespace : "test"; 230 my $collection = $ENV{'GSDLCOLLECTION'}; 231 232 my $fed_id = "$oid_namespace:$collection-$OID"; 233 234 my $all_text = ""; 235 236 my $top_section = $doc_obj->get_top_section(); 237 my $plugin_type = $doc_obj->get_metadata_element($top_section,"Plugin"); 238 239 if ((defined $plugin_type) && ($plugin_type eq "ImagePlug")) 240 { 241 242 $all_text .= "<mets:amdSec ID=\"RELS-EXT\">\n"; 243 $all_text .= " <mets:techMD ID=\"RELS-EXT1.0\" STATUS=\"A\">\n"; 244 $all_text .= " <mets:mdWrap LABEL=\"RELS-EXT - RDF formatted relationship metadata\" MDTYPE=\"OTHER\" MIMETYPE=\"text/xml\">\n"; 245 $all_text .= " <mets:xmlData>\n"; 246 $all_text .= " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:fedora-model=\"info:fedora/fedora-system:def/model#\">\n"; 247 $all_text .= " <rdf:Description rdf:about=\"info:fedora/$fed_id\">\n"; 248 $all_text .= " <fedora-model:hasContentModel rdf:resource=\"info:fedora/demo:UVA_STD_IMAGE\"/>\n"; 249 $all_text .= " </rdf:Description>\n"; 250 $all_text .= " </rdf:RDF>\n"; 251 $all_text .= " </mets:xmlData>\n"; 252 $all_text .= " </mets:mdWrap>\n"; 253 $all_text .= " </mets:techMD>\n"; 254 $all_text .= "</mets:amdSec>\n"; 255 } 256 257 return $all_text; 258 } 259 260 218 261 # 219 262 # Print out docmets.xml file … … 226 269 # print out the dmdSection 227 270 print $handle $self->buffer_mets_dmdSection_section_xml($doc_obj,$section); 271 272 print $handle $self->buffer_mets_relsext_xml($doc_obj); 228 273 229 274 print $handle "<mets:fileSec>\n"; … … 453 498 my $xlink_href; 454 499 455 my $fedora_prefix = $ENV{'FEDORA_ PREFIX'};500 my $fedora_prefix = $ENV{'FEDORA_HOME'}; 456 501 if (!defined $fedora_prefix) { 457 502 $xlink_href = "file:$fname"; … … 532 577 my $opt_owner_id = "OWNERID=\"M\""; 533 578 579 580 my $first_assocfile = 1; 534 581 535 582 foreach my $data (@{$section_ptr->{'metadata'}}){ … … 542 589 my $mime_type = $2; 543 590 my $assoc_dir = $3; 544 545 $id_root = $assoc_file; 591 592 if ($first_assocfile) { 593 $id_root = "url"; 594 $first_assocfile = 0; 595 } 596 else { 597 $id_root = "FG$assoc_file"; 598 } 599 546 600 $id_root =~ s/\//_/g; 547 601 $all_text .= " <mets:fileGrp ID=\"$id_root\">\n"; … … 556 610 my $xlink_href; 557 611 558 $id_attr = "ID=\" $id_root.0\"";559 560 my $fedora_prefix = $ENV{'FEDORA_ PREFIX'};612 $id_attr = "ID=\"F$id_root.0\""; 613 614 my $fedora_prefix = $ENV{'FEDORA_HOME'}; 561 615 if (!defined $fedora_prefix) { 562 616 $xlink_href = "xlink:href=\"$assfilePath\""; -
gsdl/trunk/perllib/plugouts/METSPlugout.pm
r14927 r14970 198 198 print $handle ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n"; 199 199 print $handle ' xmlns:gsdl3="http://www.greenstone.org/namespace/gsdlmetadata/1.0/"' . "\n"; 200 print $handle ' xmlns:xlink="http://www.w3.org/TR/xlink"' ."\n"; 200 ## print $handle ' xmlns:xlink="http://www.w3.org/TR/xlink"' ."\n"; 201 print $handle ' xmlns:xlink="http://www.w3.org/1999/xlink"' ."\n"; 201 202 print $handle ' xsi:schemaLocation="http://www.loc.gov/METS/' . "\n"; 202 203 print $handle ' http://www.loc.gov/standards/mets/mets.xsd' . "\n";
Note:
See TracChangeset
for help on using the changeset viewer.