Ignore:
Timestamp:
2005-01-12T16:10:16+13:00 (19 years ago)
Author:
chi
Message:

Modification of the validated METS format in the docmets.xml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/doc.pm

    r8797 r8894  
    88# Copyright (C) 1999 New Zealand Digital Library Project
    99#
    10 # This program is free software; you can redistribute it and/or modify
     10# This program is free software; you can redistr   te it and/or modify
    1111# it under the terms of the GNU General Public License as published by
    1212# the Free Software Foundation; either version 2 of the License, or
     
    273273sub buffer_mets_fileSection_section_xml() {
    274274    my $self = shift(@_);
    275     my ($section, $doc_Dir) = @_;
    276 
    277     $section="" unless defined $section;
     275    my ($section) = @_;
     276
     277    #$section="" unless defined $section;
    278278   
    279279
     
    301301    $all_text .=  $xpath;
    302302
    303     $all_text .= ']/text())" ID="FILE'. $section_num. '" />' . "\n";
     303    $all_text .= ']/text())" />' . "\n";
    304304    $all_text .= "    </mets:file>\n";
    305305    $all_text .= "  </mets:fileGrp>\n";
     
    307307
    308308    foreach my $subsection (@{$section_ptr->{'subsection_order'}}){
    309        $all_text .= $self->buffer_mets_fileSection_section_xml("$section.$subsection",$doc_Dir);
     309    $all_text .= $self->buffer_mets_fileSection_section_xml("$section.$subsection");
    310310    }
    311311   
     
    339339          $all_text .= '    <mets:file MIMETYPE="text/xml" ID="default.'.$fileID.'">'. "\n";
    340340       
    341       $all_text .= '      <mets:FLocat LOCTYPE="URL" xlink:href="file:'.$data->[1].'" ID="default.'.$fileID.'" />'."\n";
     341      $all_text .= '      <mets:FLocat LOCTYPE="URL" xlink:href="file:'.$data->[1].'" />'."\n";
    342342     
    343343          $all_text .= "    </mets:file>\n";
     
    351351
    352352      $all_text .= '    <mets:file MIMETYPE="'.$2.'" ID="default.'.$fileID. '">'. "\n";
    353       $all_text .= '      <mets:FLocat LOCTYPE="URL" xlink:href="file:'.$assfilePath.'" ID="default.'. $fileID.'" />'."\n";
     353      $all_text .= '      <mets:FLocat LOCTYPE="URL" xlink:href="file:'.$assfilePath.'" />'."\n";
    354354         
    355355      $all_text .= "    </mets:file>\n";
     
    379379    my $dmd_num = $section_num;
    380380
    381     #**output the dmdSection details 
    382     if ($section_num eq "1") {
    383     $dmd_num = "0";
    384     }
     381    ##**output the dmdSection details 
     382    #if ($section_num eq "1") {
     383    #   $dmd_num = "0";
     384    #}
    385385
    386386    #**output the StruMap details
     
    414414    my $all_text="" unless defined $all_txt;   
    415415    my $fileID=0;
     416    my $order_num = 0;
    416417
    417418    $all_text .= '<mets:structMap ID="All" TYPE="Whole Document" LABEL="All">'."\n";
    418     $all_text .= '  <mets:div ID="All" TYPE="Document" ORDER="All" ORDERLABEL="All" LABEL="Whole Documemt" DMDID="DM1">' . "\n";
     419    $all_text .= '  <mets:div ID="DSAll" TYPE="Document" ORDER="'.$order_num.'" ORDERLABEL="All" LABEL="Whole Documemt" DMDID="DM1">' . "\n";
    419420 
    420421
     
    456457    my $dmd_num = $section_num;
    457458
    458     #**output the dmdSection details 
    459     if ($section_num eq "1") {
    460     $dmd_num = "0";
    461     }
     459    # #**output the dmdSection details 
     460    # if ($section_num eq "1") {
     461    #   $dmd_num = "0";
     462    # }
    462463    my $all_text = '<mets:dmdSec ID="DM'.$dmd_num.'" GROUPID="'.$section_num.'">'. "\n";
    463     $all_text .= '  <mets:mdWrap MDType="gsdl3" ID="'.$section_num.'">'."\n";
     464    $all_text .= '  <mets:mdWrap MDTYPE="OTHER" OTHERMDTYPE="gsdl3" ID="gsdl'.$section_num.'">'."\n";
    464465    $all_text .= "    <mets:xmlData>\n";
    465466    foreach my $data (@{$section_ptr->{'metadata'}}){
     
    530531sub output_mets_section {
    531532    my $self = shift(@_);
    532     my ($handle, $section, $doc_Dir) = @_;
    533    
     533    my ($handle, $section) = @_;
     534
    534535    #***print out the dmdSection
    535536    print $handle $self->buffer_mets_dmdSection_section_xml($section);
     
    537538    #***print out the fileSection by sections
    538539    print $handle "<mets:fileSec>\n";
    539     print $handle $self->buffer_mets_fileSection_section_xml($section,$doc_Dir);
     540    print $handle $self->buffer_mets_fileSection_section_xml($section);
    540541
    541542    #***print out the whole fileSection
     
    11921193    }
    11931194   
     1195    #print STDERR "###$field=$value\n";
    11941196    # double check that the value is utf-8
    11951197    if (unicode::ensure_utf8(\$value)) {
Note: See TracChangeset for help on using the changeset viewer.