Changeset 15013


Ignore:
Timestamp:
2008-02-27T16:36:05+13:00 (16 years ago)
Author:
davidb
Message:

Adjustment to Fedora and METS plugouts so they can handle Fedora v2.x or Fedora v3.x

Location:
gsdl/trunk/perllib/plugouts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugouts/FedoraMETSPlugout.pm

    r14970 r15013  
    8484    my $collection = $ENV{'GSDLCOLLECTION'};
    8585
    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\"";
    90 
    91     $self->output_mets_xml_header_extra_attribute($handle,$extra_attr);
     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\"";
     90
     91    my $extra_schema = undef;
     92
     93    if ($ENV{'FEDORA2_HOME'}) {
     94    $extra_schema = "http://www.fedora.info/definitions/1/0/mets-fedora-ext.xsd";
     95    }
     96    else {
     97    $extra_attr .= " EXT_VERSION=\"1.1\"";
     98    }
     99   
     100    $self->output_mets_xml_header_extra_attribute($handle,$extra_attr,$extra_schema);
    92101
    93102    print $handle '<mets:metsHdr RECORDSTATUS="A"/>'. "\n"; # A = active
  • gsdl/trunk/perllib/plugouts/METSPlugout.pm

    r14970 r15013  
    192192{
    193193    my $self = shift(@_);
    194     my ($handle, $extra_attr) = @_;
     194    my ($handle, $extra_attr, $extra_schema) = @_;
    195195
    196196    print $handle '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . "\n";
     
    198198    print $handle '           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n";
    199199    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";
    201     print $handle '           xmlns:xlink="http://www.w3.org/1999/xlink"' ."\n";
     200    if ($ENV{'FEDORA2_HOME'}) {
     201    print $handle '           xmlns:xlink="http://www.w3.org/TR/xlink"' ."\n";
     202    }
     203    else {
     204    print $handle '           xmlns:xlink="http://www.w3.org/1999/xlink"' ."\n";
     205    }
    202206    print $handle '           xsi:schemaLocation="http://www.loc.gov/METS/' . "\n";
    203207    print $handle '           http://www.loc.gov/standards/mets/mets.xsd' . "\n";
     208    print $handle " $extra_schema\n" if (defined $extra_schema);
    204209    print $handle '           http://www.greenstone.org/namespace/gsdlmetadata/1.0/' . "\n";
    205210    print $handle '           http://www.greenstone.org/namespace/gsdlmetadata/1.0/gsdl_metadata.xsd"' . "\n";
Note: See TracChangeset for help on using the changeset viewer.