# Copyright for the Uniform Repository Service (c) 1995 - 2023 # by Gerald Banon. All rights reserved. # Version 2.1 # mirror.tcl # ---------------------------------------------------------------------- # CreateMirror # updateStageOfSubmit must be set to 1 for the update stage of Submit # enableOutput is set to 0 in Submit # extraCGIList is set to # [list ingestactor $cgi(ingestactor) reviewprocess $cgi(reviewprocess)] # in Submit proc CreateMirror {{updateStageOfSubmit 0} {enableOutput 1} {extraCGIList {}}} { if [catch { if 0 { # testing progressive loading in 2021-04 - progressive loading doesn't work with mirror.cgi and Apache 2.4 in urlib.net puts {Content-Type: text/html} puts {} # fconfigure stdout -buffering none # fconfigure stdout -buffersize 10 # puts [fconfigure stdout] puts 1 puts "" ;# to have the previous puts displayed set x 0; after 1000 {set x 1}; vwait x puts 2 return } global env if 0 { # testing Apache 2.0.54 puts {Content-Type: text/html} puts {} puts OK # puts [info exists env(URLIB_SERVICE_REP)] # exit } global cgi global col global currentRep ;# set in this procedure global numberOfSatisfiedQueries global numberOfSites ;# set in MultipleSubmit global listOfSites ;# set in MultipleSubmit global listOfActiveSites ;# set in MultipleSubmit global listOfInactiveSites ;# set in this procedure - used in ReturnDistributedCollectionTest global lastVersion ;# set in MultipleSubmit global mirrorHomePageRep ;# defined in FindLanguage (utilities1.tcl) global homePath ;# used in SynchronizeRepository, TestForTclPageUpdate, LoadService, Help, CheckSession, CreateOutput, ReturnDistributedCollectionTest and CreateOptionListForCopyright global language languageRep1 languageRep2 firstLanguageRep ;# used by ReturnTheMostRecentEntries and FindCurrentHTMLFileName global submissionFormRep global submissionFormLanguage submissionFormLanguageRep ;# used by Help and FindCurrentHTMLFileName global serverAddress ;# used by CreateOptionListForCopyright and SetFieldValue global serverAddressWithIP ;# used by SynchronizeRepository, CreateReviewButton, FindLanguageForSubmissionForm and CreateOptionListForCopyright global localSite ;# used by Help and CreateReviewButton global display global orderingTable ;# used to sort review fields global administratorUserName ;# used by CreateReturnButton global orderingFieldArray ;# used by CompareFieldName - set in this procedure global multipleLineReferFieldNamePattern global multipleLineReferFieldNamePattern2 global multipleLineReferFieldNamePatternForCreator global http global URLibServiceRepository ;# used by SynchronizeRepository and CheckSession global numberOfNotAccessibleSites ;# set in ReturnDistributedCollectionTest global codedPassword ;# used by CreateOptionListForCopyright global loCoInRep ;# needed with SynchronizeRepository and CreateOptionListForCopyright called in displayControl.tcl global loBiMiRep ;# used with ^Submit$ (SynchronizeRepository) and ^About$ (MultipleExecute) # array set environment [array get env] ;# used in MultipleSubmit # URLibServiceRepository (used by CheckSession) set URLibServiceRepository $env(URLIB_SERVICE_REP) # multipleLineReferFieldNamePattern set multipleLineReferFieldNamePattern $env(MULI_PATTERN) # multipleLineReferFieldNamePattern2 set multipleLineReferFieldNamePattern2 $env(MULI_PATTERN2) # multipleLineReferFieldNamePatternForCreator set multipleLineReferFieldNamePatternForCreator $env(MULI_PATTERN_FOR_CREATOR) # mirrorHomePageRepository # used in sourceDisplayControl and xxButton.html (now there is only one buttonBg.jpg in use which is in mirrorHomePageRepository) set mirrorHomePageRepository dpi.inpe.br/banon/2000/01.23.20.24 set col ../../../../.. source ../$col/$URLibServiceRepository/doc/utilities1.tcl source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl # homePath (used in LoadService and Help) set homePath $env(DOCUMENT_ROOT) # localSite # set localSite $env(SERVER_NAME):$env(SERVER_PORT) ;# commented by GJFB in 2021-12-24 set localSite [ReturnHTTPHost $env(SERVER_NAME):$env(SERVER_PORT)] ;# added by GJFB in 2021-12-24 - just to simplify, drop :80 if any # serverAddress set serverAddress [list $env(SERVER_NAME) $env(URLIB_PORT)] # serverAddressWithIP set serverAddressWithIP [list $env(IP_ADDR) $env(URLIB_PORT)] ;# needed in SynchronizeRepository # secureLocalSite (used in About only) set secureLocalSite $env(SERVER_NAME):$env(SERVER_PORT)1 # http set http http[expr [info exists env(HTTPS)]?{s}:{}] # loCoInRep set loCoInRep $env(LOCOINREP) # loBiMiRep set loBiMiRep $env(LOBIMIREP) ;# needed in SynchronizeRepository (^Submit$) and MultipleExecute (^About$) set currentProcedureName CreateMirror # set currentFileName $homePath/col/$URLibServiceRepository/doc/cgi/mirror.tcl set currentProcedureFileName $homePath/col/$URLibServiceRepository/doc/cgi/mirror.tcl # Check if the collection has been posted if [CheckCommunication] {return} ;# uses localSite # Check if the collection has been posted - end if 0 { puts {Content-Type: text/html} puts {} puts $updateStageOfSubmit return } if $updateStageOfSubmit { # update stage 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) &=] { if [regexp {\?} $value] {break} ;# ignore returnaddress set cgi([DecodeURL $name]) [DecodeURL $value] } } # cgi(frameinuse) value is yes if the display___xxx is itsef a frame set if 0 { if [info exists cgi(frameinuse)] { puts {Content-Type: text/html} puts {} puts OK1 # puts $cgi(metadatarepository) puts $env(QUERY_STRING) puts [array get cgi] } } # Get some metadata set localURLibClientSocketId [StartCommunication $env(SERVER_NAME) $env(URLIB_PORT)] # metadataRep if [info exists cgi(metadatarepository)] { set metadataRep $cgi(metadatarepository) ;# added by GJFB in 2013-02-11 because FindMetadataRep returns the first encountered, this metadata repository may not be the proper one for the current application } else { # set metadataRep [Submit $localURLibClientSocketId [list FindMetadataRep $rep] 0] ;# not async set metadataRep [Submit $localURLibClientSocketId [list FindMetadataRep $rep] 1] ;# async - needed, otherwise mirror.cgi randomly stall with banon-pc3 } if [string equal {} $metadataRep] { puts {Content-Type: text/html} puts {} puts "CreateMirror (1): no metadata repository found for $rep" puts
puts {the file .referenceTable.tcl may have been damaged} return } if 0 { if [info exists cgi(frameinuse)] { puts {Content-Type: text/html} puts {} puts OK2 puts --$metadataRep-- return } } if [info exists cgi(frameinuse)] {set d 0; after 100 {set d 1}; vwait d} ;# delay added by GJFB in 2013-02-16 - needed to fetch the Reference Update frame at banon-pc3 (127.0.0.1) for an unknown reason # referenceType if [info exists cgi(referencetype)] { set referenceType $cgi(referencetype) unset cgi(referencetype) } else { # default set referenceType [Submit $localURLibClientSocketId [list ReturnType metadataArray $metadataRep-0] 0] ;# not async } # keywords set keywords [Submit $localURLibClientSocketId [list GetFieldValue $metadataRep-0 keywords] 0] ;# not async # mirrorRepository if {![string equal {Misc} $referenceType] || [regexp {review} $keywords]} { # not Misc or review set mirrorRepository [Submit $localURLibClientSocketId [list GetFieldValue $metadataRep-0 mirrorrepository] 0] ;# not async } else { set mirrorRepository {} ;# use the default mirror } # size set size [Submit $localURLibClientSocketId [list GetFieldValue $metadataRep-0 size] 0] ;# not async # tertiaryMark set tertiaryMark [Submit $localURLibClientSocketId [list GetFieldValue $metadataRep-0 tertiarymark] 0] ;# not async close $localURLibClientSocketId # Get some metadata - end # Netscape doesn't work with regsub -all { } $referenceType {} referenceType2 ;# Conference Proceedings -> ConferenceProceedings if 1 { # new code by GJFB in 2013-05-23 # there are 3 levels of mirror repository, in decreasing priority: # mirrorRepository - defined at submit # cgi(requiredmirror) - mirror used for example within the brief search result page # env(LOBIMIREP) - default # currentRep (local mirror repository - contains @siteList.txt) # currentRep value is the mirrorrepository field value (if any) # otherwise is $cgi(requiredmirror) (if any) # otherwise is $env(LOBIMIREP) # cgi(expectedmirror) - is used in dpi.inpe.br/banon-pc2@1905/2006/02.16.12.09/doc/cgi/script only # if cgi(expectedmirror) != currentRep then a warning is displayed # cgi(expectedmirror) doesn't participate of the currentRep definition if {![string equal {} $mirrorRepository] && \ [file isdirectory $homePath/col/$mirrorRepository]} { set currentRep $mirrorRepository } else { if [info exists cgi(requiredmirror)] { set currentRep $cgi(requiredmirror) } else { # set currentRep $env(LOBIMIREP) set currentRep $loBiMiRep } } set cgi(requiredmirror) $currentRep ;# cgi(requiredmirror) used in xxSubmit.html and xxUpdateSubmission.html } else { # old code # currentRep (local mirror repository - contains @siteList.txt) # currentRep value is the mirrorrepository field value (if any) ## otherwise is $cgi(mirror) (if any) # otherwise is $cgi(requiredmirror) (if any) # otherwise is $env(LOBIMIREP) if {[string equal {} $mirrorRepository] || \ ![file isdirectory $homePath/col/$mirrorRepository]} { # if ![info exists cgi(mirror)] {set cgi(mirror) $env(LOBIMIREP)} if ![info exists cgi(requiredmirror)] {set cgi(requiredmirror) $env(LOBIMIREP)} } else { # set cgi(mirror) $mirrorRepository set cgi(requiredmirror) $mirrorRepository } # set currentRep $cgi(mirror) set currentRep $cgi(requiredmirror) # unset cgi(mirror) } if 0 { puts {Content-Type: text/html} puts {} puts $currentRep } } else { # not update stage if [info exists env(PATH_INFO)] { # may not exist when coming from Submit set pathInfo [file split $env(PATH_INFO)] # currentRep (local mirror repository - contains @siteList.txt) regsub -all { } [lrange $pathInfo 1 4] {/} currentRep } } # display set display [GetFrameName] ;# used in mirrorHomePage.html if {$updateStageOfSubmit || ![info exists pathInfo]} { # may not exist when coming form Submit set frameName Submit } else { set pathInfoLength [llength $pathInfo] if {$pathInfoLength == 5} { set frameName {} } else { set frameName [lindex $pathInfo 5] } } if ![string equal {} $frameName] { if [regexp {^(About|FillingInstructions|Language|Contributors|Word|Recent|Help|AdvancedHelp|DynamicHelp|Form|SimpleForm|Field|Inquiry|Register|NewPassword|Button)$} $frameName] { if [info exists env(QUERY_STRING)] { foreach {name value} [split $env(QUERY_STRING) &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } } } if 0 { puts {Content-Type: text/html} puts {} puts --$frameName-- puts $env(QUERY_STRING) puts [array get cgi] } # if {![info exists cgi(creatorfieldindex)] && \ (![regexp {^(SimpleForm|Button|Recent|Inquiry|FillingInstructions)$} $frameName] || \ ![info exists cgi(languagerep1)] || ![info exists cgi(languagebutton)])} # ;# commented by GJFB in 2020-07-14 if {![regexp {^(SimpleForm|Button|Recent|Inquiry|FillingInstructions)$} $frameName] || \ ![info exists cgi(languagerep1)] || ![info exists cgi(languagebutton)]} { ;# added by GJFB in 2020-07-14 - language required when returning from a duplicate submit/update warning (in this case, cgi(creatorfieldindex) exists) # Find the language and the language repository foreach {language languageRep1 languageRep2 firstLanguageRep \ submissionFormRep submissionFormLanguage submissionFormLanguageRep} \ [FindLanguage $currentRep] {break} # Find the language and the language repository - end } if ![info exists cgi(languagebutton)] { set cgi(languagebutton) $language ;# added by GJFB in 2019-12-12 - needed with the new version of mirrorHomePage.html without frame set } if 0 { puts {Content-Type: text/html} puts {} puts "currentRep = $currentRep
" puts "language = $language
" puts "languageRep1 = $languageRep1
" puts "languageRep2 = $languageRep2
" puts "firstLanguageRep = $firstLanguageRep
" puts "submissionFormRep = $submissionFormRep
" puts "submissionFormLanguage = $submissionFormLanguage
" puts "submissionFormLanguageRep = $submissionFormLanguageRep
" } if $updateStageOfSubmit { if [info exists cgi(expectedmirror)] { if [string equal $currentRep $cgi(expectedmirror)] { # expected mirror if [info exists cgi(fieldtobecompleted)] { if [string equal {size} $cgi(fieldtobecompleted)] { # size (filename) # examples: # http://gerald/update/urlib.net/www/2013/09.19.02.01?languagebutton=en&expectedmirror=dpi.inpe.br/banon/1999/06.19.17.00&fieldtobecompleted=size # http://gerald/update/urlib.net/www/2013/09.19.02.01?languagebutton=pt-BR&expectedmirror=dpi.inpe.br/banon/1999/06.19.17.00&fieldtobecompleted=size # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=en&expectedmirror=iconet.com.br/banon/2006/11.26.21.31&fieldtobecompleted=size # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=pt-BR&expectedmirror=iconet.com.br/banon/2006/11.26.21.31&fieldtobecompleted=size # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?metadatarepository=iconet.com.br/banon/2008/11.13.01.31.03&expectedmirror=sid.inpe.br/mtc-m19/2013/05.22.12.17&fieldtobecompleted=size # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=en&metadatarepository=iconet.com.br/banon/2008/11.13.01.31.03&expectedmirror=sid.inpe.br/mtc-m19/2013/05.22.12.17&fieldtobecompleted=size # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=pt-BR&metadatarepository=iconet.com.br/banon/2008/11.13.01.31.03&expectedmirror=sid.inpe.br/mtc-m19/2013/05.22.12.17&fieldtobecompleted=size regsub -all {/} ${currentRep}___$metadataRep {__} window regsub -all {\.|@|-} $window {_} window set window ${window}___0 if ![string equal {} $size] { puts {Content-Type: text/html} puts {} if [file exists $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}UploadDone.html] { # use include puts [subst [Include2 $submissionFormLanguageRep $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}UploadDone.html]] } else { # use default include puts [subst [Include2 $languageRep2 $homePath/col/$languageRep2/doc/include/${language}UploadDone.html]] } return } } if [string equal {tertiarymark} $cgi(fieldtobecompleted)] { # tertiarymark # examples: # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=en&expectedmirror=iconet.com.br/banon/2006/11.26.21.31&fieldtobecompleted=tertiarymark # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=pt-BR&expectedmirror=iconet.com.br/banon/2006/11.26.21.31&fieldtobecompleted=tertiarymark # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=en&expectedmirror=xxx&fieldtobecompleted=tertiarymark # http://gerald/update/iconet.com.br/banon/2008/11.13.01.31?languagebutton=pt-BR&expectedmirror=xxx&fieldtobecompleted=tertiarymark if ![string equal {} $tertiaryMark] { puts {Content-Type: text/html} puts {} if [file exists $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}TertiaryMarkCompleted.html] { # use include puts [subst [Include2 $submissionFormLanguageRep $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}TertiaryMarkCompleted.html]] } else { # use default include puts [subst [Include2 $languageRep2 $homePath/col/$languageRep2/doc/include/${language}TertiaryMarkCompleted.html]] } return } } } } else { # unexpected mirror # examples: # http://gerald/update/urlib.net/www/2013/09.19.02.01?languagebutton=en&expectedmirror=xxx # http://gerald/update/urlib.net/www/2013/09.19.02.01?languagebutton=pt-BR&expectedmirror=xxx puts {Content-Type: text/html} puts {} if [file exists $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}UnexpectedMirror.html] { # use include # puts [subst [Include $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}WithoutUpdateForm.html]] puts [subst [Include2 $submissionFormLanguageRep $homePath/col/$submissionFormLanguageRep/doc/include/${submissionFormLanguage}UnexpectedMirror.html]] } else { # use default include # puts [subst [Include $homePath/col/$languageRep2/doc/include/${language}WithoutUpdateForm.html]] puts [subst [Include2 $languageRep2 $homePath/col/$languageRep2/doc/include/${language}UnexpectedMirror.html]] } return } } } if 0 { puts {Content-Type: text/html} puts {} puts --$frameName-- } if ![string equal {} $frameName] { if {[regexp {^(SimpleForm|Button|Recent|Inquiry|FillingInstructions)$} $frameName] && [info exists cgi(languagerep1)]} { set language $cgi(languagebutton) set languageRep1 $cgi(languagerep1) set languageRep2 $cgi(languagerep2) set firstLanguageRep $cgi(firstlanguagerep) set submissionFormRep $cgi(submissionformrep) if [regexp {^FillingInstructions$} $frameName] { set submissionFormLanguage $cgi(submissionformlanguage) set submissionFormLanguageRep $cgi(submissionformlanguagerep) } if [info exists cgi(mirrorhomepagerep)] {set mirrorHomePageRep $cgi(mirrorhomepagerep)} } # returnInfo # puts $env(QUERY_STRING) set returnInfo ?languagebutton=$language if [regexp {^(About|FillingInstructions|Language|Contributors|Word|Recent|Help|AdvancedHelp|DynamicHelp|Form|SimpleForm|Field|Inquiry|Register|NewPassword)$} $frameName] { if [info exists env(QUERY_STRING)] { if [info exists cgi(returnbutton)] { append returnInfo &returnbutton=$cgi(returnbutton) } else { set cgi(returnbutton) no } } } } # puts 1==$returnInfo # puts [array get cgi] if 0 { # commented by GJFB in 2019-01-05 if ![file exists ../$col/$submissionFormRep/doc/submission.js] { Load ../$col/$mirrorHomePageRep/doc/submission.js fileContent Store fileContent ../$col/$submissionFormRep/doc/submission.js } } else { # added by GJFB in 2019-01-05 - Migration - now there is only one submission.js in use which is in mirrorHomePageRepository if ![string equal $mirrorHomePageRepository $submissionFormRep] { file delete ../$col/$submissionFormRep/doc/submission.js } } if {$updateStageOfSubmit || ![info exists pathInfo]} { # may not exist when coming from Submit # set frameName Submit set usePHP 0 } else { # set pathInfoLength [llength $pathInfo] if {$pathInfoLength == 5} { # set frameName {} Load ../$col/$mirrorHomePageRep/service/targetFile mirrorHomePageTargetFile set usePHP [regexp -nocase {\.php} $mirrorHomePageTargetFile] } else { # set frameName [lindex $pathInfo 5] set usePHP 0 } } if {$enableOutput && !$usePHP && $frameName != "Register" && $frameName != "Inquiry"} { puts {Content-Type: text/html} puts {} } # puts $pathInfo # puts $currentRep # puts OK # puts [array name cgi] # puts [array get cgi] # puts --$cgi(mirror)-- # puts $referenceType # puts --$frameName-- # puts [list $language
$languageRep1
$languageRep2
$firstLanguageRep \
$submissionFormRep
$submissionFormLanguage
$submissionFormLanguageRep \
$mirrorHomePageRep] if ![string equal {} $frameName] { # if ![regexp {Form|Language|Contributors|Recent|BannerSpace|Button2|Inquiry} $frameName] # # if [regexp {^Register$|^Button$|^Help$|^AdvancedHelp$|^DynamicHelp$|^Field$|^Word$|^About$} $frameName] # ;# Button drops by GJFB in 2012-03-10 if [regexp {^Register$|^Help$|^AdvancedHelp$|^DynamicHelp$|^Field$|^Word$|^About$} $frameName] { source ../$col/$languageRep2/doc/mirror/${language}$frameName.tcl global "${languageRep2}::currentVariableFileName" ;# for reverse engineering } # bgColor, background, bgProperties, fontTag and fontTag2 if 0 { # used in old mirror if [regexp {^Form$|^SimpleForm$|^Help$|^AdvancedHelp$|^DynamicHelp$|^Language$|^Field$|^Word$|^Submit$|^About$|^Inquiry$|^Register$} $frameName] { foreach {bgColor background bgProperties fontTag fontTag2} [GetBg $languageRep1 $language] {break} set background [subst $background] } } } # codedPassword Load $homePath/col/$loCoInRep/auxdoc/xxx data binary set data [UnShift $data] set codedPassword [lindex $data end] # The used frameName are: # Register BannerSpace Form SimpleForm Button Button2 Inquiry # Help AdvancedHelp DynamicHelp Language Contributors Field # Word Recent Submit FillingInstructions NewPassword About .+ default # puts --$frameName-- # > switch -regexp -- $frameName { ^Register$ { global "${languageRep2}::Cancel" global "${languageRep2}::Return" # global "${languageRep2}::forbidden registration" global "${languageRep2}::registration header" global "${languageRep2}::Please wait for the submission completion." global "${languageRep2}::User" global "${languageRep2}::eMail Address" global "${languageRep2}::Advanced User" global "${languageRep2}::update2" ;# update is used in displayControl.tcl # global "${languageRep2}::review" global "${languageRep2}::there are no reviews to display" global "${languageRep2}::there are no reviews to release" # global "${languageRep2}::no works" global "${languageRep2}::submit" global "${languageRep2}::there are no items to display" global "${languageRep2}::click" global "${languageRep2}::closed session" global "${languageRep2}::translationTable" # administratorUserName regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName # Source displayControl.tcl set enableOutput 1 eval $sourceDisplayControl # Source displayControl.tcl - end # regsub -all {"} $cellFont {\\"} cellFont2 ;# used inside the document.write JavaScript command set cellFont {} set cellFont2 {} if 0 { puts {Content-Type: text/html} puts {} puts [array get cgi] } # Create cgi array # usefull to recover the filled fields after a submit error CreateCGIArray # Create cgi array - end if 0 { puts {Content-Type: text/html} puts {} puts [array get cgi] } if ![info exists cgi(username)] {set cgi(username) {}} if ![info exists cgi(login)] {set cgi(login) {}} if ![info exists cgi(usertype)] {set cgi(usertype) readuser} if ![info exists cgi(__e_mailaddress_e_mailaddress)] {set cgi(__e_mailaddress_e_mailaddress) {}} if ![info exists cgi(formstate)] {set cgi(formstate) {}} # if ![info exists cgi(targetframe)] {set cgi(targetframe) _top} ;# _top is used when updating from a blank window # if ![info exists cgi(targetframe)] {set cgi(targetframe) _parent} ;# _parent is used when updating from a blank window if ![info exists cgi(targetframe)] {set cgi(targetframe) {}} # if ![info exists cgi(useraction)] {set cgi(useraction) accesspage} # if ![info exists cgi(useraction)] {set cgi(useraction) {}} if ![info exists cgi(registereduser)] {set cgi(registereduser) {no}} if ![info exists cgi(session)] {set cgi(session) {}} if ![info exists cgi(fullname)] {set cgi(fullname) {}} if ![info exists cgi(resumeid)] {set cgi(resumeid) {}} ;# required in xxRegister.html if ![info exists cgi(orcid)] {set cgi(orcid) {}} ;# required in xxRegister.html if ![info exists cgi(cpf)] {set cgi(cpf) {}} ;# required in xxRegister.html if ![info exists cgi(returnbutton)] {set cgi(returnbutton) {no}} if ![info exists cgi(delayedreturnbutton)] {set cgi(delayedreturnbutton) {no}} if ![info exists cgi(initialaction)] {set cgi(initialaction) {}} ;# used with return button if ![info exists cgi(displayedfieldlist)] {set cgi(displayedfieldlist) {fullname password subject}} ;# used in xxRegister.html regsub -all { } $cgi(displayedfieldlist) {+} displayedFieldList2 if 0 { puts {Content-Type: text/html} puts {} # puts [array get cgi] puts $review } if [regexp {register|review|seeworks|exportmetadata} $cgi(initialaction)] { if ![info exists cgi(useraction)] {set cgi(useraction) $cgi(initialaction)} } else { if ![info exists cgi(useraction)] {set cgi(useraction) {}} } # userName if {[regexp {register} $cgi(useraction)] && $restrictedSubmission} { set userName administrator } else { set userName $cgi(username) } if {[string equal {nothingtoupdate} $cgi(formstate)] && \ [regexp {update|review|register|seeworks|exportmetadata} $cgi(useraction)]} { # CHECK SESSION if [CheckSession $cgi(session) $userName] { set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel] puts {Content-Type: text/html} puts {} puts [subst [subst ${closed session}]] return } } # fileTable entries are: loginpage, accesspage, register, update, review and seeworks, exportmetadata if [string equal {} $cgi(session)] { set fileTable(review) EnterPassword set fileTable(seeworks) EnterPassword set fileTable(exportmetadata) EnterPassword # if $restrictedSubmission # ;# commented by GJFB in 2021-11-16 if {$restrictedSubmission && ![file exists ../$col/$URLibServiceRepository/auxdoc/messageForRegister]} { ;# added by GJFB in 2021-11-16 - messageForRegister created in post set fileTable(register) EnterAdmPassword } else { set fileTable(register) Register } } else { # CHECK SESSION if {[string equal {} $cgi(formstate)] && ![CheckSession $cgi(session) $userName]} { # a session is running # userArray if [file exists $homePath/col/$loCoInRep/auxdoc/.userArray.tcl] { source $homePath/col/$loCoInRep/auxdoc/.userArray.tcl } if {[info exists cgi(useraction)] && \ [string equal {update} $cgi(useraction)] && \ [regexp {^administrator$} $cgi(username)]} { # administrator -> administrator user name set userName $administratorUserName } else { # set userName $cgi(username) set userName $cgi(login) } # return the user data set userType $cgi(usertype) if ![string equal {} $cgi(useraction)] { if [regexp {update} $cgi(useraction)] { # UPDATE user action if [string equal {writeuser} $userType] { # write foreach {eMailAddress fullName2 theme2 resumeID orcid CPF} [ReturnUserData $userName write] {break} if [regexp {.*/.*/.*/.*} $fullName2] { set fullName3 {} } else { set fullName3 $fullName2 } # puts "Location: Register?languagebutton=$language&useraction=$cgi(useraction)&initialaction=$cgi(initialaction)&displayedfieldlist=$displayedFieldList2&session=$cgi(session)&usertype=$userType&username=$userName&fullname=$fullName3&__e_mailaddress_e_mailaddress=$eMailAddress&__subject_subject=$theme2&formstate=nothingtoupdate&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=$cgi(registereduser)&login=$cgi(login)" # puts "Location: Register?languagebutton=$language&useraction=$cgi(useraction)&initialaction=$cgi(initialaction)&displayedfieldlist=$displayedFieldList2&session=$cgi(session)&usertype=$userType&username=$userName&fullname=$fullName3&resumeid=$resumeID&__e_mailaddress_e_mailaddress=$eMailAddress&__subject_subject=$theme2&formstate=nothingtoupdate&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=$cgi(registereduser)&login=$cgi(login)" puts "Location: Register?languagebutton=$language&useraction=$cgi(useraction)&initialaction=$cgi(initialaction)&displayedfieldlist=$displayedFieldList2&session=$cgi(session)&usertype=$userType&username=$userName&fullname=$fullName3&resumeid=$resumeID&orcid=$orcid&cpf=$CPF&__e_mailaddress_e_mailaddress=$eMailAddress&__subject_subject=$theme2&formstate=nothingtoupdate&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=$cgi(registereduser)&login=$cgi(login)" } else { # read foreach {eMailAddress} [ReturnUserData $userName read] {break} puts "Location: Register?languagebutton=$language&useraction=$cgi(useraction)&session=$cgi(session)&usertype=$userType&username=$userName&__e_mailaddress_e_mailaddress=$eMailAddress&formstate=nothingtoupdate&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=$cgi(registereduser)&login=$cgi(login)" } puts "" return } elseif [regexp {review|seeworks|exportmetadata} $cgi(useraction)] { # REVIEW, SEEWORKS and EXPORTMETADATA user actions # puts "Location: Register?languagebutton=$language&useraction=$cgi(useraction)&session=$cgi(session)&usertype=$userType&username=$userName&formstate=nothingtoupdate&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=$cgi(registereduser)&login=$cgi(login)" ConditionalSet contents cgi(contents) {} ;# used with exportmetadata only ConditionalSet outputFormat cgi(outputformat) {} ;# used with exportmetadata only ConditionalSet mirrorRepository cgi(mirrorrepository) {} ;# used with exportmetadata only ConditionalSet conversionRepository cgi(conversionrepository) {} ;# used with exportmetadata only ConditionalSet pageTitle cgi(pagetitle) {} ;# used with exportmetadata only puts "Location: Register?languagebutton=$language&useraction=$cgi(useraction)&session=$cgi(session)&usertype=$userType&username=$userName&formstate=nothingtoupdate&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=$cgi(registereduser)&login=$cgi(login)&contents=$contents&outputformat=$outputFormat&mirrorrepository=$mirrorRepository&conversionrepository=$conversionRepository&pagetitle=$pageTitle" puts "" return } } } set fileTable(review) Review set fileTable(register) Register set fileTable(seeworks) SeeWorks set fileTable(exportmetadata) ExportMetadata } # set cgi(formstate) nothingtoupdate puts {Content-Type: text/html} puts {} if [string equal {} $cgi(formstate)] { set updateForRegister 0 ;# argument for ProcessKey set fileTable(update) EnterPassword } else { if {[info exists cgi(useraction)] && [regexp {register} $cgi(useraction)]} { set updateForRegister 0 } else { set updateForRegister 1 } set fileTable(update) Register } # puts $fileTable($cgi(useraction)) set userTable(readuser) ${User} set userTable(writeuser) ${Advanced User} if {[string equal {} $cgi(formstate)] || \ ([info exists cgi(useraction)] && [regexp {register} $cgi(useraction)])} { # first display (empty form) # submit set submissionType submit } else { # second display # update set submissionType update } set fileTable(loginpage) EnterLogin set cellBackgroundColors {#F1F1F1 #E3E3E3} # puts $cgi(usertype) if [string equal {writeuser} $cgi(usertype)] { # write user # set fieldName %9 # set field _9_theme set fieldName %@subject set field __subject_subject foreach {eMailAddress fullName2 theme2 resumeID orcid CPF} [ReturnUserData $cgi(username) write] {break} ;# added by GJFB in 2013-07-07 - resumeID, orcid and CPF are used in xxAdvancedUserPage.html set fileTable(accesspage) AdvancedUserPage if ![info exists cgi($field)] {set cgi($field) {}} set returnAddress http://$localSite/col/$currentRep/doc/mirror.cgi/Register?languagebutton=$language&usertype=$cgi(usertype)&username=$cgi(username)&fullname=$cgi(fullname)&__e_mailaddress_e_mailaddress=$cgi(__e_mailaddress_e_mailaddress)&$field=$cgi($field)&formstate=nothingtoupdate regsub -all { } $returnAddress {+} returnAddress if 0 { if $restrictedSubmission { if [info exists returnAddress] {set cgi(returnaddress) $returnAddress} ;# returnAddress may be defined in displayControl.tcl set header ${registration header} puts [subst [subst ${forbidden registration}]] return } } source ../$col/$languageRep2/doc/${submissionFormLanguage}FillingInstructions.tcl if [catch {source ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl} error] { puts "error in sourcing file <\;../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl>\;:" puts
puts $error } # translationTable source ../$col/$languageRep2/doc/mirror/${language}ReferenceTypeName.tcl ;# set translationTable - needed in xxAdvancedUserPage.html set referenceType {Advanced User Registration} set javaComment(fullname) {} if {[info exists displayTable($referenceType,$fieldName)] && $displayTable($referenceType,$fieldName)} { set openComment(theme) {} set closeComment(theme) {} set javaComment(theme) {} } else { set openComment(theme) {} set javaComment(theme) {//} } set inputRow {} set ifCondition {(0)} if [info exists displayTable($referenceType,$fieldName)] { set value $cgi($field) # if {[string compare 2.2 $displayTable($referenceType,$fieldName)] == 0} # if [string equal 2.2 $displayTable($referenceType,$fieldName)] { # check box set value [TurnIntoList $value] CreateCheckBox $fieldName $field $value inputRow set i 0 set boxValues $boxTable($referenceType,$fieldName) set conditionList {} if {[llength [lindex [lindex $boxValues 0] 1]] <= 1} { # without subitem foreach box $boxValues { if {[string compare {} [lindex $box 0]] == 0} {continue} lappend conditionList "!(document.$submissionType.$field\[$i\].checked)" incr i } } else { # with subitems (the first item has at least two subitems) foreach box $boxValues { foreach box2 [lindex $box 1] { lappend conditionList "!(document.$submissionType.$field\[$i\].checked)" incr i } } } set ifCondition "([join $conditionList { && }])" # # elseif {[string compare 3 $displayTable($referenceType,$fieldName)] == 0} # } elseif {[string equal 3 $displayTable($referenceType,$fieldName)]} { # select CreateSelect $fieldName $field $value inputRow set ifCondition {(document.$submissionType.$field.value == "")} } } # Create a review list if {[string compare {} $cgi(username)] != 0 && \ [info exists {displayTable(Advanced User Registration,reviewlist)}] && \ ![info exists cgi(passworderror)]} { # QUERY set query "username, $cgi(username) and keywords, review and referencetype, misc" set conferenceName [lindex $displayTable(Conference Proceedings,%B) 2] if {[string compare {} $conferenceName] != 0} { set query "$query and abstract, $conferenceName" } set reviewList2 [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword] if 0 { set reviewList {} foreach item $reviewList2 { SetFieldValue $serverAddressWithIP $item {title repository} lappend reviewList "
[lrange [split $title] 0 4][expr [llength [split $title]] > 5?{ ...}:{}]" } set reviews [join $reviewList
] if {[string compare {} $reviewList] == 0} { set reviews ${there are no reviews to release} } set numberOfReviews [llength $reviewList] } else { # display by subject, session, theme or format # referenceField value is subject, session, type, tertiarytype or {} if ![info exists referenceField] { set referenceField {} } if {[string compare {} $referenceField] == 0} { set {} x ;# used below in subst $$referenceField } if [info exist themeArray] {unset themeArray} # puts --$reviewList2-- foreach item $reviewList2 { SetFieldValue $serverAddressWithIP $item {parentrepositories repository} set parentWorkRepository [Execute $serverAddressWithIP [list FindMetadataRep $parentrepositories]] SetFieldValue $serverAddressWithIP $parentWorkRepository-0 [subst "$referenceField title author"] lappend themeArray([subst $$referenceField]) [list $title $author $repository] } set tableList {} set numberOfReviews 0 foreach theme [array names themeArray] { set themeTable "" if {[string compare {} $referenceField] != 0} {append themeTable ""} set reviewList {} set i 0 foreach workData [lsort -index 0 $themeArray($theme)] { foreach {title author repository} $workData {break} set author2 {} foreach name $author { regsub {,$} $name {} name; lappend author2 $name } set author2 [join $author2 {; }] set cellBackgroundColor [lindex $cellBackgroundColors [expr $i%2]] lappend reviewList "" incr i incr numberOfReviews } append themeTable [join $reviewList \n] append themeTable
$theme
$title
[expr $blindReview?{}:{$author2}]
$translationTable(review)
lappend tableList $themeTable } set reviews [join $tableList \n] if !$numberOfReviews { # set reviews ${there are no reviews to release} set reviewedWorks "
${there are no reviews to release}
" } } set openComment(reviewlist) {} set closeComment(reviewlist) {} } else { set reviewList {} set openComment(reviewlist) {} } set openComment(fullname) {} set closeComment(fullname) {} # Create a review list - end } else { # read user set fileTable(accesspage) UserPage set javaComment(fullname) {//} set javaComment(theme) {//} set ifCondition {} set reviewList {} set reviews {} set openComment(reviewlist) {} set openComment(fullname) {} set inputRow {} set openComment(theme) {} } set returnAddress http://$localSite/col/$currentRep/doc/mirror.cgi/Register?languagebutton=$language&usertype=$cgi(usertype)&username=$cgi(username)&__e_mailaddress_e_mailaddress=$cgi(__e_mailaddress_e_mailaddress)&formstate=nothingtoupdate regsub -all { } $returnAddress {+} returnAddress if 0 { puts {Content-Type: text/html} puts {} puts [array get cgi] } # action set action ${Please wait for the submission completion.} # seconds set seconds "" if {[string compare {no} $cgi(registereduser)] == 0 && \ ([string compare {} $cgi(useraction)] == 0 || \ [string compare {register} $cgi(useraction)] != 0)} { # loginpage # delayedreturnbutton says if the login page is with or without a return button set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel {} {} {} {} 0 $cgi(delayedreturnbutton)] set fileTableEntry loginpage } else { if {[string equal {} $cgi(formstate)] && $restrictedSubmission} { set currentPassword [regexp {register|update|review|seeworks|exportmetadata} $cgi(useraction)] } else { set currentPassword [regexp {update|review|seeworks|exportmetadata} $cgi(useraction)] } if [string equal {} $cgi(useraction)] { # cgi(returnaddress) is used by CreateReturnButton when called from xxEnterPassword.html, xxUserPage.html or xxAdvancedUserPage.html set cgi(returnaddress) Register?languagebutton=$language&usertype=$cgi(usertype)&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)&username=$cgi(login)®istereduser=no&login=$cgi(login) if ![string equal {} $cgi(session)] { # accesspage if {[info exists {displayTable(User Registration,reviewedworklist)}] || \ [info exists {displayTable(Advanced User Registration,reviewedworklist)}]} { set openComment(reviewaccess) {} set closeComment(reviewaccess) {} } else { set openComment(reviewaccess) {} } set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror Register?languagebutton=$language&usertype=$cgi(usertype)&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton) $cgi(targetframe) $Cancel] # set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel] # set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror {} $cgi(targetframe) $Cancel {} {} {} {} 1] ;# using history.back() set fileTableEntry accesspage } else { # passwordpage set currentPassword 1 set fileTable(passwordpage) EnterPassword set fileTableEntry passwordpage } } else { # user action # cgi(returnaddress) is used by CreateReturnButton when called from xxEnterPassword.html, xxUserPage.html, xxAdvancedUserPage.html or xxRegister.html # puts [array get cgi] if {[string equal {register} $cgi(useraction)] || \ ![string equal {} $cgi(initialaction)] || \ [string equal {} $cgi(session)]} { # returning to the loginpage # set cgi(returnaddress) Register?languagebutton=$language&usertype=$cgi(usertype)&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)&username=$cgi(login)&session=$cgi(session)®istereduser=no&login=$cgi(login)&useraction=$cgi(useraction)&initialaction=$cgi(initialaction)&displayedfieldlist=$displayedFieldList2 # set cgi(returnaddress) Register?languagebutton=$language&usertype=$cgi(usertype)&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)®istereduser=no&useraction=$cgi(useraction)&initialaction=$cgi(initialaction)&displayedfieldlist=$displayedFieldList2 set cgi(returnaddress) Register?languagebutton=$language&usertype=$cgi(usertype)&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)&useraction=update&initialaction=$cgi(initialaction)&displayedfieldlist=$displayedFieldList2 } else { # returning to the accesspage set cgi(returnaddress) Register?languagebutton=$language&usertype=$cgi(usertype)&returnbutton=$cgi(returnbutton)&delayedreturnbutton=$cgi(delayedreturnbutton)&targetframe=$cgi(targetframe)&username=$cgi(login)&session=$cgi(session)®istereduser=$cgi(registereduser)&login=$cgi(login) } if [regexp {register|update|review} $cgi(useraction)] { # register update review # puts [array get cgi] # Create a reviewed work list if {![string equal {} $cgi(username)] && \ [info exists {displayTable(User Registration,reviewedworklist)}] && \ ![info exists cgi(passworderror)]} { set themeLabelForQuery * ;# all # QUERY set query "usergroup, $cgi(username) and keywords, review and documentstage, closed" # puts $query set reviewList2 [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword] if 0 { set reviewedWorkList {} foreach item $reviewList2 { SetFieldValue $serverAddressWithIP $item {parentrepositories} set workMetadataRep [Execute $serverAddressWithIP [list FindMetadataRep $parentrepositories]] SetFieldValue $serverAddressWithIP $workMetadataRep-0 {title repository} lappend reviewedWorkList "[lrange [split $title] 0 4][expr [llength [split $title]] > 5?{ ...}:{}]" } set reviewedWorks [join $reviewedWorkList
] if {[string compare {} $reviewedWorkList] == 0} { set reviewedWorks ${there are no reviews to display} } set numberOfReviewedWorks [llength $reviewedWorkList] } else { # display by subject, session, theme or format # referenceField value is subject, session, type, tertiarytype or {} if ![info exists referenceFielreviewsd] { set referenceField {} } if {[string compare {} $referenceField] == 0} { set {} x ;# used below in subst $$referenceField } if [info exist themeArray] {unset themeArray} # puts --$reviewList2-- foreach item $reviewList2 { SetFieldValue $serverAddressWithIP $item {parentrepositories} set parentWorkRepository [Execute $serverAddressWithIP [list FindMetadataRep $parentrepositories]] SetFieldValue $serverAddressWithIP $parentWorkRepository-0 [subst "$referenceField title author repository"] lappend themeArray([subst $$referenceField]) [list $title $author $repository] } set tableList {} set numberOfReviewedWorks 0 # puts --[array names themeArray]-- foreach theme [array names themeArray] { set themeTable "" if {[string compare {} $referenceField] != 0} {append themeTable ""} set reviewList {} set i 0 foreach workData [lsort -index 0 $themeArray($theme)] { foreach {title author repository} $workData {break} set author2 {} foreach name $author { regsub {,$} $name {} name; lappend author2 $name } set author2 [join $author2 {; }] set cellBackgroundColor [lindex $cellBackgroundColors [expr $i%2]] # translationTable(review) is defined in mirror/xxRegister.tcl lappend reviewList "" incr i incr numberOfReviewedWorks } append themeTable [join $reviewList \n] append themeTable
$theme
$title
$author2
$translationTable(review)
lappend tableList $themeTable } set reviewedWorks [join $tableList \n] if !$numberOfReviewedWorks { # set reviewedWorks ${there are no reviews to display} set reviewedWorks "
${there are no reviews to display}
" } } } # Create a reviewed work list - end } elseif {![string equal {} $cgi(session)] && [string equal {seeworks} $cgi(useraction)]} { # seeworks # QUERY # puts $currentRep set conferenceName [lindex $displayTable(Conference Proceedings,%B) 2] # puts --$conferenceName-- if [string equal {} $conferenceName] { # set query "mark 1 or not mark * and username, $cgi(username) and mirrorrepository, $currentRep" set query "username, $cgi(username)" } else { regsub -all { and | and, } $conferenceName { } conferenceNameForQuery ;# in case of the english language # set query "mark 1 or not mark * and username, $cgi(username) and mirrorrepository, $currentRep and conferencename, $conferenceNameForQuery" # set query "username, $cgi(username) and conferencename, $conferenceNameForQuery" set query "username, $cgi(username) and mirrorrepository $currentRep and conferencename, $conferenceNameForQuery" } # set query {usern banon and rep urlib.net/www*} # set workList2 [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword] ;# adm coded password to see the hidden records as well set workList2 [FindMetadataRepositories $query 0 {} $codedPassword no no 1] ;# adm coded password to see the hidden records as well # puts --$workList2-- if [string equal {no} $cgi(returnbutton)] { # open a new window set target { TARGET=_blank} } else { set target {} } # translationTable source ../$col/$languageRep2/doc/mirror/${language}ReferenceTypeName.tcl ;# set translationTable set referenceTypeList {} foreach item $workList2 { # puts $item foreach {site rep-i} $item {break} ;# site is actually serverAddress # SetFieldValue $serverAddressWithIP $item {title author editor programmer reporter repository mirrorrepository childrepositories referencetype nextedition mark size} SetFieldValue $site ${rep-i} {title author editor programmer reporter repository metadatarepository index mirrorrepository childrepositories referencetype nextedition mark size} lappend referenceTypeList $referencetype set author [EscapeUntrustedData $author] ;# added by GJFB in 2018-06-14 set author2 {} foreach name $author { regsub {,$} $name {} name lappend author2 $name } if {[string compare {} $author] == 0} { foreach name $editor { regsub {,$} $name {} name lappend author2 $name } } foreach name $programmer { regsub {,$} $name {} name lappend author2 $name } foreach name $reporter { regsub {,$} $name {} name lappend author2 $name } set author2 [join $author2 {; }] if {[string compare {} $author2] == 0} {set author2 {-}} set buttonList {} # window regsub -all {/} ${currentRep}___$metadatarepository {__} window regsub -all {\.|@|-} $window {_} window set window ${window}___$index regsub { } $site {+} site2 # http://plutao.dpi.inpe.br/col/dpi.inpe.br/plutao@80/2008/08.19.15.01.21/doc/mirrorget.cgi?languagebutton=pt-BR&metadatarepository=dpi.inpe.br/banon-pc@1905/2005/02.19.00.40.44&index=0&serveraddress=plutao.dpi.inpe.br+800&choice=fullbibtex&lastupdate=2013:07.16.22.42.14+dpi.inpe.br/banon/1999/01.09.22.14+banon+{D+{}}&continue=yes # http://bibdigital.sid.inpe.br/col/sid.inpe.br/bibdigital@80/2006/04.07.15.50.13/doc/mirrorget.cgi?languagebutton=pt-BR&metadatarepository=sid.inpe.br/mtc-m19/2013/08.01.19.43.38&index=0&serveraddress=mtc-m19.sid.inpe.br+800&choice=fullbibtex&lastupdate=2013:08.01.20.04.43+sid.inpe.br/mtc-m19@80/2009/08.21.17.02+administrator+{D+2012}&continue=no lappend buttonList "BibTeX" if {![string equal {Conference Proceedings} $referencetype] || \ ![info exists {closedUpdateTable(Conference Proceedings)}] || \ !$closedUpdateTable(Conference Proceedings)} { # update button if [string equal {no} $cgi(returnbutton)] { # drop return address lappend buttonList "$update2" } else { lappend buttonList "$update2" } } if {[info exists displayReviewButton] && $displayReviewButton} { # review button set reviewButton [CreateReviewButton $item $repository $mirrorrepository $childrepositories] if ![string equal {} $reviewButton] { lappend buttonList [subst $reviewButton] } } if {[string equal {Conference Proceedings} $referencetype] && \ [string equal {} $nextedition] && \ ![string equal {} $mark] && $mark && \ [info exists addAudiovisualMaterialSubmissionOption] && $addAudiovisualMaterialSubmissionOption} { # audiovisual material button lappend buttonList "$submit $translationTable(Audiovisual Material)" } set title [EscapeUntrustedData $title] ;# added by GJFB in 2018-06-14 if [string equal {} $size] { set titleLine $title } else { set titleLine "$title" } lappend $referencetype " $titleLine
$author2
[join $buttonList { | }]
" } if [string equal {} $referenceTypeList] { append works "    
${there are no items to display}
" } else { foreach refType [lsort -unique $referenceTypeList] { append works " ${cellFont}$translationTable($refType)
${cellFont}$click ->
[join [subst $[list $refType]]
] " } } } elseif {![string equal {} $cgi(session)] && \ [string equal {exportmetadata} $cgi(useraction)]} { # exportmetadata source ../$col/$URLibServiceRepository/doc/utilities3.tcl ;# DisplaySearch # puts [array get cgi] set fullName [join [GetUserData $userName write {fullname2}]] set CPF [GetUserData $userName write {cpf}] # puts [GetUserData banon@dpi.inpe.br write {cpf}] # puts $cgi(contents) foreach item $cgi(contents) { # puts $item # puts $cgi(outputformat) foreach {searchExpression sectionTitle} $item {break} # puts $searchExpression set searchExpression "referencetype, Journal Article or referencetype, Conference or referencetype, Book Section and author, $fullName and $searchExpression" # linType values are 0, 1, ..., 9 # # 0 is for absolute link with col (default) # 1 is for absolute link with rep # 2 is for absolute link with rep- # 3 is for relative link with ../../../../.. # 4 is for relative link with ../../../../../../col # 5 is for relative link with goto # 6 is for relative link with goto- # 7 is for no link # 8 is for absolute link http://urlib.net/ # 9 is for absolute link http://urlib.net/rep/ # set searchExpression "y 2013" # --------------------------------------------------- set accent {yes} set case {yes} set choice {briefTitleAuthorMisc} set title "
$sectionTitle (\$numberOfEntries)
" set excludedFields {} set localSearch {0} set numbering {} set siteList [ComputeSiteList] set page {no} set linkType {1} set displayEverything {1} set sort {} # set outputFormat {referencetype checkbox} set outputFormat $cgi(outputformat) # set targetValue {_blank} ;# commented by GJFB in 2013-06-18 set targetValue {_parent} ;# added by GJFB in 2013-06-18 in order to navigate from the same window set mirrorRep {} set nameFormat {short} set nameSeparator {; } ;# default set latexOptionList {} set multipleSearch {0} set imageFlag {0} # DISPLAYSEARCH lappend searchResult [DisplaySearch $searchExpression $accent $case $choice $title $excludedFields $localSearch $numbering $siteList $page $linkType $displayEverything $sort $outputFormat $targetValue $mirrorRep $nameFormat $nameSeparator $latexOptionList $multipleSearch $imageFlag] } } set fileTableEntry $cgi(useraction) } } # LOAD # puts $fileTableEntry # => passwordpage # => accesspage # => update # puts $fileTable($fileTableEntry) # => EnterPassword # => AdvancedUserPage # => EnterPassword or Register set currentFileName [FindCurrentHTMLFileName $fileTable($fileTableEntry)] # puts $currentFileName Load $currentFileName fileContent if [string equal {EnterLogin} $fileTable($fileTableEntry)] { set loginFieldName "${eMail Address}" } if [string equal {EnterPassword} $fileTable($fileTableEntry)] { # formAction is used in register.tcl to make the Return Button for wrong password warning set formAction http://$localSite/col/$currentRep/doc/mirror.cgi/Register?$env(QUERY_STRING) if {[info exists {submissionPolicyTable(Conference Proceedings)}] && \ $submissionPolicyTable(Conference Proceedings) == 2} { # create a password for the user set loginFieldName "${eMail Address}" } else { set loginFieldName "$User" } if ![string equal {} $cgi(login)] { set loginRow " ${cellFont}$loginFieldName (Login) $cgi(login) " } else { set loginRow " ${cellFont}$loginFieldName (Login) " } } if [string equal {Register} $fileTable($fileTableEntry)] { if [regexp {^([^<\s@]+)@([^@\s>]+)$} $cgi(login)] { # login is an e-mail address set cgi(__e_mailaddress_e_mailaddress) $cgi(login) ;# new procedure - user name must be an e-mail address } else { # set cgi(__e_mailaddress_e_mailaddress) {} } # set displayEMailField [expr \ [string compare $cgi(__e_mailaddress_e_mailaddress) $cgi(login)] != 0 && \ (![info exists cgi(passworderror)] || !$cgi(passworderror)) && \ [string compare {yes} $cgi(displayemailfield)] == 0] set displayEMailField [expr [string compare $cgi(__e_mailaddress_e_mailaddress) $cgi(login)] != 0] } # Used by JavaScript # if ![info exists cgi(wrongpassword)] {set cgi(wrongpassword) {no}} set cgi(wrongpassword) {no} # Used by JavaScript - end if [string equal {administrator} $cgi(username)] {set cgi(username) {}} # puts $currentFileName # => c:/users/geral/urlib 2/col/dpi.inpe.br/banon/1999/06.19.22.43/doc/pt-BREnterPassword.html # => c:/users/geral/urlib 2/col/dpi.inpe.br/banon/1999/06.19.22.43/doc/pt-BREnterAdmPassword.html # puts $fileTable($fileTableEntry) if [regexp {EnterPassword|EnterAdmPassword|Register} $fileTable($fileTableEntry)] { # sessionTime # symmetricKey # regexp {(.*)-(.*)} [OpenSession $env(REMOTE_ADDR) symmetricKey] m sessionTime symmetricKey foreach {sessionTime symmetricKey} [OpenSession [list $env(REMOTE_ADDR) administrator] symmetricKey] {break} } # SUBST # catch {subst $fileContent} output ;# returnButton is set in xxRegister.html set output [subst $fileContent] ;# returnButton is set in xxRegister.html # set output $fileContent ;# returnButton is set in xxRegister.html } ^BannerSpace$ { set output [CreateBannerSpace $languageRep2 $language] } ^Form$ { if [file exists ../$col/$languageRep1/doc/${language}Form.html] { Load ../$col/$languageRep1/doc/${language}Form.html body } else { Load ../$col/$languageRep2/doc/${language}Form.html body } # Add Banner with INPE filter if 0 { if ![regexp {^150.163} $env(IP_ADDR)] { regsub {} $body "[BannerScript ../mirror.cgi/BannerSpace]" body } } # Add Banner with INPE filter - end # puts [array get cgi] # puts $env(QUERY_STRING) if [info exists cgi(query)] { ProcessQuery ;# reset cgi(query) set formValue $cgi(query) } else { set formValue {} } # Source displayControl.tcl set enableOutput 1 eval $sourceDisplayControl # Source displayControl.tcl - end # query2 ConditionalSet query2 secondarySearchExpression {} ;# set in displayControl.tcl if ![info exists cgi(choice)] {set cgi(choice) brief} if ![info exists cgi(sort)] {set cgi(sort) key} if ![info exists cgi(accent)] {set cgi(accent) false} if ![info exists cgi(case2)] {set cgi(case2) false} # puts --$cgi(choice)-- # puts --$cgi(sort)-- # puts $body regsub "