# Copyright for the Uniform Repository Service (c) 1995 - 2023, # by Gerald Banon. All rights reserved. # Version 2.1 # metadata.tcl # Create a full reference # default is choice=full # metadata.tcl does a redirection # examples: # http://gjfb:1905/urlib.net/www/2012/10.03.22.58.51 # becomes: # http://gjfb:1905/col/dpi.inpe.br/banon/1999/06.19.17.00/doc/mirrorget.cgi?metadatarepository=urlib.net/www/2012/10.03.22.58.51&choice=full # http://gjfb:1905/urlib.net/www/2012/10.03.22.58.51?choice=fullBibINPE # becomes: # http://gjfb:1905/col/dpi.inpe.br/banon/1999/06.19.17.00/doc/mirrorget.cgi?metadatarepository=urlib.net/www/2012/10.03.22.58.51&choice=fullBibINPE # http://gjfb:1905/urlib.net/www/2012/10.03.22.58.51?choice=fullBibINPE&cssfileurl=http://gjfb:1905/iconet.com.br/banon/2003/05.31.10.45/mirrorStandard.css # becomes: # http://gjfb:1905/col/dpi.inpe.br/banon/1999/06.19.17.00/doc/mirrorget.cgi?metadatarepository=urlib.net/www/2012/10.03.22.58.51&cssfileurl=http://gjfb:1905/iconet.com.br/banon/2003/05.31.10.45/mirrorStandard.css&choice=fullBibINPE # http://gjfb:1905/col/urlib.net/www/2017/03.31.12.34.45/doc/metadata.cgi?choice=oai_dc # becomes: # http://gjfb:1905/col/iconet.com.br/banon/2003/11.21.21.08/doc/oai.cgi?verb=GetRecord&identifier=oai:urlib.net:urlib.net/www/2017/03.31.12.34.45-0&metadataPrefix=oai_dc # http://gjfb:1905/urlib.net/www/2017/03.31.12.34.45 # http://gjfb:1905/col/urlib.net/www/2017/03.31.12.34.45/doc/metadata.cgi # become: # http://gjfb:1905/col/dpi.inpe.br/banon/1999/06.19.17.00/doc/mirrorget.cgi?metadatarepository=urlib.net/www/2017/03.31.12.34.45&choice=full # ---------------------------------------------------------------------- ## CreateMetadata ;# commented by GJFB in 2023-02-21 because the CreateMetadata procedure name is already used in cgi/oai.tcl # DisplayMetadata proc DisplayMetadata {} { global env set col ../../../../.. set URLibServiceRepository dpi.inpe.br/banon/1998/08.02.08.56 source ../$col/$URLibServiceRepository/doc/utilities1.tcl source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl if [info exists env(QUERY_STRING)] { foreach {name value} [split $env(QUERY_STRING) &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } ConditionalSet requiredMirror cgi(requiredmirror) $env(LOBIMIREP) ConditionalSet choice cgi(choice) full set pathInfo [file split $env(PATH_INFO)] regsub -all { } [lrange $pathInfo 1 4] {/} currentRep set site $env(SERVER_NAME):$env(SERVER_PORT) # puts {Content-Type: text/html} # puts {} # puts --$env(QUERY_STRING)-- # exit if {$env(QUERY_STRING) == {}} { # no index and no site if [TestContentType $currentRep {Bibliography Data Base} $env(DOCUMENT_ROOT)] { puts "Location: http://$site/col/$currentRep/doc/@reference.bib" } else { puts "Location: http://$site/col/$requiredMirror/doc/mirrorget.cgi?metadatarepository=$currentRep&choice=full" } } else { if [info exists cgi(choice)] { if [string equal {oai_dc} $cgi(choice)] { puts "Location: http://$site/col/iconet.com.br/banon/2003/11.21.21.08/doc/oai.cgi?verb=GetRecord&identifier=oai:urlib.net:$currentRep-0&metadataPrefix=oai_dc" } else { puts "Location: http://$site/col/$requiredMirror/doc/mirrorget.cgi?metadatarepository=$currentRep&$env(QUERY_STRING)" } } else { puts "Location: http://$site/col/$requiredMirror/doc/mirrorget.cgi?metadatarepository=$currentRep&choice=full&$env(QUERY_STRING)" } } puts "" } # DisplayMetadata - end # ----------------------------------------------------------------------