# Copyright for the Uniform Repository Service (c) 1995 - 2002, # by Gerald Banon. All rights reserved. # Version 2.1 # update.tcl # redirects url for online user repository update # Example: # http://banon-pc.dpi.inpe.br:1905/update/iconet.com.br/banon/2002/10.31.22.47?languagebutton=en # is redirected to # http://banon-pc.dpi.inpe.br:1905/col/dpi.inpe.br/banon/1999/06.19.17.00/doc/mirror.cgi/Submit/Misc?languagebutton=en&metadatarepository=iconet.com.br/banon/2002/10.31.22.47.13>. # the attribute referenceType is optional; the default value is given # by the reference type of the document in the specified repository # Example: # http://banon-pc.dpi.inpe.br:1905/update/iconet.com.br/banon/2002/10.31.22.47?referencetype=Journal+Article&languagebutton=en # Migration 5/11/04 # not used any more proc Update {} { global env set col ../../../../.. set URLibServiceRepository $env(URLIB_SERVICE_REP) source ../$col/$URLibServiceRepository/doc/cgi/mirror.tcl CreateMirror 1 } # Migration 5/11/04 - end # not used proc Update2 {} { global env set col ../../../../.. set URLibServiceRepository $env(URLIB_SERVICE_REP) source ../$col/$URLibServiceRepository/doc/utilities1.tcl source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl set pathInfo [file split $env(PATH_INFO)] # rep (repository to be updated) regsub -all { } [lrange $pathInfo 1 4] {/} rep if [info exists env(QUERY_STRING)] { foreach {name value} [split $env(QUERY_STRING) &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } # Get some metadata set localURLibClientSocketId \ [StartCommunication $env(SERVER_NAME) $env(URLIB_PORT)] # metadataRep set metadataRep [Submit $localURLibClientSocketId \ [list FindMetadataRep $rep]] # referenceType if [info exists cgi(referencetype)] { set referenceType $cgi(referencetype) } else { # default set referenceType [Submit $localURLibClientSocketId \ [list ReturnType metadataArray $metadataRep-0]] } # Netscape doesn't work with regsub -all { } $referenceType {} referenceType ;# Conference Proceedings -> ConferenceProceedings close $localURLibClientSocketId # Get some metadata - end if ![info exists cgi(mirror)] {set cgi(mirror) $env(LOBIMIREP)} if 0 { puts {Content-Type: text/html} puts {} puts http://$env(SERVER_NAME):$env(SERVER_PORT)/col/$cgi(mirror)/doc/mirror.cgi/Submit/$referenceType?$env(QUERY_STRING)&metadatarepository=$metadataRep exit } # puts "Location: http://$env(SERVER_NAME):$env(SERVER_PORT)/col/$env(LOBIMIREP)/doc/mirror.cgi/Submit/$referenceType?$env(QUERY_STRING)&metadatarepository=$metadataRep" puts "Location: http://$env(SERVER_NAME):$env(SERVER_PORT)/col/$cgi(mirror)/doc/mirror.cgi/Submit/$referenceType?$env(QUERY_STRING)&metadatarepository=$metadataRep" puts "" }