Changeset 37159


Ignore:
Timestamp:
2023-01-18T23:51:57+13:00 (9 days ago)
Author:
davidb
Message:

Additional metadata set (SASShortID) to help with creating IIIF Manifest files in the XSLT to support within-doc searching

Location:
gs3-extensions/structured-image/trunk/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/structured-image/trunk/perllib/plugins/GoogleVisionImagePlugin.pm

    r37065 r37159  
    3535use utf8;
    3636use JSON qw( from_json );
    37 
    38 #use Data::Dumper;
     37use Digest::MD5 qw( md5_hex );
    3938
    4039use gsprintf;
     
    10099    #$ret_val_ok = $self->opt_run_gen_webannotation($doc_obj);
    101100    }
     101
     102    # Compute SimpleAnnotationServer short_id (md5_hex hash on OID)
     103    # and store as metadata for later use
     104    my $OID= $doc_obj->get_OID();
     105
     106    my $sas_manifest_url = "http-greenstone://intermuse/programmes-and-performers/$OID/manifest";
     107    my $sas_short_id = md5_hex($sas_manifest_url);
     108
     109    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(),"SASShortID",$sas_short_id);
    102110   
    103111    return $ret_val_ok;
  • gs3-extensions/structured-image/trunk/perllib/plugins/GoogleVisionPagedImagePlugin.pm

    r37065 r37159  
    3131package GoogleVisionPagedImagePlugin;
    3232
    33 #use Encode;
    34 #use ReadXMLFile;
    35 #use ReadTextFile;
     33use strict;
     34no  strict 'refs'; # allow filehandles to be variables and viceversa
     35
     36use Digest::MD5 qw( md5_hex );
     37
    3638use GoogleVisionAPIConverter;
    3739use PagedImagePlugin;
    3840
    39 use strict;
    40 no  strict 'refs'; # allow filehandles to be variables and viceversa
    4141
    4242sub BEGIN {
     
    121121    #$ret_val_ok = $self->opt_run_gen_webannotation($doc_obj);
    122122    }
    123    
     123
     124    # Compute SimpleAnnotationServer short_id (md5_hex hash on OID)
     125    # and store as metadata for later use
     126    my $OID= $doc_obj->get_OID();
     127
     128    my $sas_manifest_url = "http-greenstone://intermuse/programmes-and-performers/$OID/manifest";
     129    my $sas_short_id = md5_hex($sas_manifest_url);
     130
     131    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(),"SASShortID",$sas_short_id);
     132
    124133    return $ret_val_ok;
    125134}
Note: See TracChangeset for help on using the changeset viewer.