Changeset 8121


Ignore:
Timestamp:
2004-09-15T16:18:06+12:00 (20 years ago)
Author:
chi
Message:

Add the "FileFormat" metadata to each of the Plugins.

Location:
trunk/gsdl/perllib/plugins
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/BibTexPlug.pm

    r6408 r8121  
    140140         'copyright', 'Copyright',
    141141         'note', 'Note',
    142 );
     142         );
    143143
    144144    # Metadata fields
     
    219219    # Add the Entry type as metadata
    220220    $doc_obj->add_utf8_metadata ($cursection, "EntryType", $EntryType);
     221   
     222    #Add the fileformat as metadata
     223    $doc_obj->add_metadata($cursection, "FileFormat", "BibTex");
     224
    221225
    222226    # Add the various field as metadata
  • trunk/gsdl/perllib/plugins/BookPlug.pm

    r6408 r8121  
    113113    my $cursection = $doc_obj->get_top_section();
    114114
     115    # Add FileFormat as the metadata
     116    $doc_obj->add_metadata($doc_obj->get_top_section(),"FileFormat", "Book");
     117
    115118    my $filename = &util::filename_cat($base_dir, $file);
    116119    my $absdir = $filename;
  • trunk/gsdl/perllib/plugins/ConvertToPlug.pm

    r7570 r8121  
    363363    $doc_obj->associate_file($filename, "doc.$doc_ext", undef, $cursection);
    364364
     365    my $file_type;
     366
     367    if ($doc_ext eq "doc") {
     368        $file_type = "Word";
     369    } elsif ($doc_ext eq "xls") {
     370    $file_type = "Excel";
     371    } elsif ($doc_ext eq "ppt") {
     372    $file_type = "PPT";
     373    } elsif ($doc_ext eq "pdf") {
     374    $file_type = "PDF";
     375    } elsif ($doc_ext eq "rtf") {
     376    $file_type = "RTF";
     377    }
     378
     379    my $file_format = $file_type || "unknown";
     380   
     381    $doc_obj->add_metadata($cursection, "FileFormat", $file_format);
     382
    365383    my $doclink = "<a href=\"_httpcollection_/index/assoc/[archivedir]/doc.$doc_ext\">";
    366384    $doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink);
  • trunk/gsdl/perllib/plugins/DBPlug.pm

    r8119 r8121  
    269269    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    270270
     271    $doc_obj->add_metadata($doc_obj->get_top_section(), "FileFormat", "DB");
    271272
    272273    # include any metadata passed in from previous plugins
  • trunk/gsdl/perllib/plugins/EMAILPlug.pm

    r7830 r8121  
    450450    $doc_obj->add_utf8_metadata ($cursection, "Title", $Title);
    451451   
     452    # Add FileFormat metadata
     453    $doc_obj->add_metadata($cursection, "FileFormat", "EMAIL");
    452454
    453455    # Add text to document object
  • trunk/gsdl/perllib/plugins/FOXPlug.pm

    r7508 r8121  
    244244    $doc_obj->set_OIDtype ($processor->{'OIDtype'});
    245245    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    246 
    247246    my $section = $doc_obj->get_top_section();
     247
     248    $doc_obj->add_metadata($section, "FileFormat", "FOX");
    248249
    249250    # start of document
  • trunk/gsdl/perllib/plugins/GMLPlug.pm

    r7362 r8121  
    193193        $section = $doc_obj->get_parent_section ($section);
    194194    } # while (1) section level
     195   
     196    # add the FileFormat as the metadata
     197    $doc_obj->add_metadata($doc_obj->get_top_section(), "FileFormat", "GML");
    195198
    196199    # add the associated files
    197200    my $assoc_files = $doc_obj->get_metadata($doc_obj->get_top_section(), "gsdlassocfile");
    198201    my ($assoc_file_info);
    199 
     202   
    200203    foreach $assoc_file_info (@$assoc_files)
    201204    {
  • trunk/gsdl/perllib/plugins/HBPlug.pm

    r7508 r8121  
    267267
    268268    my $cursection = $doc_obj->get_top_section();
     269   
     270    $doc_obj->add_metadata($cursection, "FileFormat", "HB");
    269271
    270272    # add metadata for top level of document
  • trunk/gsdl/perllib/plugins/HTMLPlug.pm

    r8071 r8121  
    707707        if ($self->{'verbosity'} > 2);
    708708    }
     709   
     710    # add FileFormat metadata
     711    $doc_obj->add_metadata($section,"FileFormat", "HTML");
    709712
    710713    # Special, for metadata names such as tagH1 - extracts
  • trunk/gsdl/perllib/plugins/ISISPlug.pm

    r7693 r8121  
    282282    }
    283283    # print "\n";
    284 
     284    # Add fileFormat as the metadata
     285    $doc_obj->add_metadata($cursection, "FileFormat", "CDS/ISIS");
    285286    # Add the full record as the document text
    286287    $$textref =~ s/\</&lt;/g;
  • trunk/gsdl/perllib/plugins/ImagePlug.pm

    r7555 r8121  
    152152    my $type = "unknown";
    153153
     154
    154155    if ($converttotype ne "" && $filename =~ m/$converttotype$/) {
    155156
     
    179180
    180181    $self->title_fallback($doc_obj,$section,$file);
    181     $doc_obj->add_metadata ($section, "FileFormat", $type);
    182182
    183183    my ($image_type, $image_width, $image_height, $image_size)
    184184    = &identify($filename, $outhandle, $verbosity);
     185
     186    if ($image_type ne " ") {
     187    $type = $image_type;
     188    }
     189   
     190    $doc_obj->add_metadata ($section, "FileFormat", $type);
    185191
    186192    $doc_obj->add_metadata ($section, "ImageType",   $image_type);
     
    189195    $doc_obj->add_metadata ($section, "ImageSize",   $image_size);
    190196
    191    
    192197    $doc_obj->add_metadata ($section, "srclink",
    193198                "<a href=_httpcollection_/index/assoc/[assocfilepath]/[Image]>");
  • trunk/gsdl/perllib/plugins/LaTeXPlug.pm

    r8098 r8121  
    118118
    119119    ###### find metadata ######
     120
     121    ## FileFormat metadata ##
     122    $doc_obj->add_metadata($cursection, "FileFormat", "LaTeX");
    120123
    121124    ### title metadata ###
  • trunk/gsdl/perllib/plugins/MACROPlug.pm

    r7353 r8121  
    149149    $doc_obj->add_utf8_metadata($thissection, "Title", &ghtml::dmsafe($filemeta));
    150150   
     151    # FileFormat metadata
     152    $doc_obj->add_metadata($thissection, "FileFormat", "MACRO");
     153
    151154    return 1;
    152155}
  • trunk/gsdl/perllib/plugins/MARCPlug.pm

    r7553 r8121  
    231231    my $cursection = $doc_obj->get_top_section();
    232232
     233    # Add fileFormat as the metadata
     234    $doc_obj->add_metadata($cursection, "FileFormat", "MARC");
     235   
    233236    my $marc_entries = $self->{'marc_entries'};
    234237    my $marc = shift(@$marc_entries);
  • trunk/gsdl/perllib/plugins/METSPlug.pm

    r7901 r8121  
    137137    if ($element eq "mets:dmdSec" || $element eq "gsdl:Metadata"){
    138138    $self->xml_dmd_start_tag (@_);
    139     } elsif ($element eq "mets:FLocate"){
     139    } elsif ($element eq "mets:FLocat"){
    140140    #***deal with fileSection
    141141    $self->xml_file_start_tag (@_);
     
    154154    $self->{'dmdSec_table'}->{"$section_num"}=[];
    155155    $self->{'dmdSec_table'}->{'section_num'}=$section_num;
    156 
    157156    } elsif ($element eq "gsdl:Metadata") {
    158157    $self->{'metadata_name'} = $_{'name'};
  • trunk/gsdl/perllib/plugins/OAIPlug.pm

    r7508 r8121  
    141141    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Encoding", $encoding);
    142142    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     143    $doc_obj->add_metadata($doc_obj->get_top_section(), "FileFormat", "OAI");
     144
    143145
    144146    # include any metadata passed in from previous plugins
     
    223225        {
    224226        push(@{$metadata->{$metaname}},$metavalue);
     227
    225228        }
    226229        else
  • trunk/gsdl/perllib/plugins/PDFPlug.pm

    r7353 r8121  
    213213    $doc_obj->add_utf8_metadata($cursection, "Date", "$1$2$3");
    214214    }
     215   
     216    # Add FileFormat metadata
     217    $doc_obj->add_metadata($cursection, "FileFormat", "PDF");
    215218
    216219    return $result;
  • trunk/gsdl/perllib/plugins/PSPlug.pm

    r7353 r8121  
    177177    &extract_metadata_from_postscript($self,"$path/$file", $doc);
    178178    #$doc->add_utf8_metadata($doc->get_top_section(), "PSPlug", 1);
     179
     180    #Add FileFormat metadata
     181    $doc->add_metadata($doc->get_top_section(), "FileFormat", "PS");
     182
     183
    179184    return ConvertToPlug::process_type($self,"ps",@_);
    180185}
  • trunk/gsdl/perllib/plugins/PagedImgPlug.pm

    r8117 r8121  
    321321    $doc_obj->add_metadata ($section, "ImageHeight", $image_height);
    322322    $doc_obj->add_metadata ($section, "ImageSize",   $image_size);
     323    $doc_obj->add_metadata ($section, "FileFormat", "PagedImg");
    323324   
    324325    if ($type eq "unknown" && $image_type) {
  • trunk/gsdl/perllib/plugins/ProCitePlug.pm

    r7195 r8121  
    191191    $doc_obj->add_utf8_metadata($cursection, "pc.Workform", $workform_indicator);
    192192    $doc_obj->add_utf8_metadata($cursection, "pc.RecordNumber", $recordnum);
     193   
     194    # Store FileFormat metadata
     195    $doc_obj->add_metadata($cursection, "FileFormat", "ProCite");
    193196
    194197    $html_record .= "<tr><td valign=top><b>Record Number: </b></td><td valign=top>$recordnum</td></tr>";
  • trunk/gsdl/perllib/plugins/ReferPlug.pm

    r6408 r8121  
    185185        }
    186186    }
     187    # Add FileFormat as the metadata
     188    $doc_obj->add_metadata($cursection,"FileFormat","Refer");
    187189
    188190    # Add individual keywords.
  • trunk/gsdl/perllib/plugins/RogPlug.pm

    r7508 r8121  
    191191    $doc_obj->add_metadata($cursection, "TitleSafe",     $title_safe);
    192192    $doc_obj->add_metadata($cursection, "TVal",          $song->{'tval'});
     193    $doc_obj->add_metadata($cursection, "FileFormat",   "Rog");
    193194
    194195    foreach $md ( @{$song->{'metadata'}} )
  • trunk/gsdl/perllib/plugins/SRCPlug.pm

    r7353 r8121  
    141141    }
    142142    $doc_obj->add_utf8_metadata ($cursection, "Title", $title);
     143    $doc_obj->add_metadata ($cursection, "FileFormat", "SRC");
     144
    143145    # remove the gsdl prefix from the filename
    144146    my $relative_filename=$file;
  • trunk/gsdl/perllib/plugins/SplitPlug.pm

    r7830 r8121  
    183183    }
    184184    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     185    #$doc_obj->add_metadata($doc_obj->get_top_section(), "FileFormat", "Split");
     186
    185187    # Calculate a "base" document ID.
    186188    if (!defined $id) {
  • trunk/gsdl/perllib/plugins/TEXTPlug.pm

    r7498 r8121  
    113113    $doc_obj->add_utf8_metadata ($cursection, "Title", $title);
    114114    }
     115    # Add FileFormat metadata
     116    $doc_obj->add_metadata($cursection, "FileFormat", "TEXT");
     117   
    115118
    116119    # we need to escape the escape character, or else mg will convert into
  • trunk/gsdl/perllib/plugins/W3ImgPlug.pm

    r7362 r8121  
    555555    $doc_obj->add_metadata($section, "ThumbURL",
    556556               "_httpcollection_/index/assoc/[archivedir]/$fn.thumb.jpg");
     557    $doc_obj->add_metadata($section, "FileFormat", "W3Img");
    557558
    558559    if ( $self->{'document_text'} ) {
  • trunk/gsdl/perllib/plugins/XMLPlug.pm

    r8069 r8121  
    246246   
    247247    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     248    $doc_obj->add_metadata($doc_obj->get_top_section(), "FileFormat", "XML");
    248249
    249250    # process the document
Note: See TracChangeset for help on using the changeset viewer.