Changeset 14970


Ignore:
Timestamp:
2008-02-12T15:27:17+13:00 (14 years ago)
Author:
davidb
Message:

Changes made to generated files to support Fedora3 syntax

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

Legend:

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

    r14927 r14970  
    8484    my $collection = $ENV{'GSDLCOLLECTION'};
    8585
    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\"";
    8790
    8891    $self->output_mets_xml_header_extra_attribute($handle,$extra_attr);
     
    216219
    217220
     221sub 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
    218261#
    219262#  Print out docmets.xml file
     
    226269    # print out the dmdSection
    227270    print $handle $self->buffer_mets_dmdSection_section_xml($doc_obj,$section);
     271
     272    print $handle $self->buffer_mets_relsext_xml($doc_obj);
    228273
    229274    print $handle "<mets:fileSec>\n";
     
    453498    my $xlink_href;
    454499
    455     my $fedora_prefix = $ENV{'FEDORA_PREFIX'};
     500    my $fedora_prefix = $ENV{'FEDORA_HOME'};
    456501    if (!defined $fedora_prefix) {
    457502    $xlink_href  = "file:$fname";
     
    532577    my $opt_owner_id = "OWNERID=\"M\"";
    533578
     579
     580    my $first_assocfile = 1;
    534581
    535582    foreach my $data (@{$section_ptr->{'metadata'}}){
     
    542589       my $mime_type  = $2;
    543590       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
    546600       $id_root =~ s/\//_/g;
    547601       $all_text .= "  <mets:fileGrp ID=\"$id_root\">\n";
     
    556610       my $xlink_href;
    557611
    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'};
    561615       if (!defined $fedora_prefix) {
    562616           $xlink_href  = "xlink:href=\"$assfilePath\"";
  • gsdl/trunk/perllib/plugouts/METSPlugout.pm

    r14927 r14970  
    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";
     200##    print $handle '           xmlns:xlink="http://www.w3.org/TR/xlink"' ."\n";
     201    print $handle '           xmlns:xlink="http://www.w3.org/1999/xlink"' ."\n";
    201202    print $handle '           xsi:schemaLocation="http://www.loc.gov/METS/' . "\n";
    202203    print $handle '           http://www.loc.gov/standards/mets/mets.xsd' . "\n";
Note: See TracChangeset for help on using the changeset viewer.