# Copyright for the Uniform Repository Service (c) 1995 - 2011, # 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 { set currentProcedureName CreateMirror global env if 0 { # testing Apache 2.0.54 puts {Content-Type: text/html} puts {} # puts [info exists env(URLIB_SERVICE_REP)] # exit } global cgi global col global currentRep ;# set in Submit 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 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 Help, 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 CompareName - set in displayControl.tcl global multipleLineReferFieldNamePattern global multipleLineReferFieldNamePatternForCreator global http global URLibServiceRepository ;# used by CheckSession and ReturnFullServerNameIP global numberOfNotAccessibleSites ;# set in ReturnDistributedCollectionTest global codedPassword ;# used by CreateOptionListForCopyright global loBiMiRep ;# used with About global loCoInRep ;# needed with CreateOptionListForCopyright called in displayControl.tcl # array set environment [array get env] ;# used in MultipleSubmit # > # URLibServiceRepository (used by CheckSession and ReturnFullServerNameIP) set URLibServiceRepository $env(URLIB_SERVICE_REP) # multipleLineReferFieldNamePattern set multipleLineReferFieldNamePattern $env(MULI_PATTERN) # multipleLineReferFieldNamePatternForCreator set multipleLineReferFieldNamePatternForCreator $env(MULI_PATTERN_FOR_CREATOR) # mirrorHomePageRepository # used in sourceDisplayControl 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) # Check if the collection has been posted if [CheckCommunication] {return} # Check if the collection has been posted - end 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] } } # Get some metadata set localURLibClientSocketId [StartCommunication $env(SERVER_NAME) $env(URLIB_PORT)] # metadataRep # 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: no metadata repository found for $rep" puts
puts {the file .referenceTable.tcl may have been damaged} return } # 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 } close $localURLibClientSocketId # Get some metadata - end # Netscape doesn't work with regsub -all { } $referenceType {} referenceType2 ;# Conference Proceedings -> ConferenceProceedings if {[string equal {} $mirrorRepository] || \ ![file isdirectory $homePath/col/$mirrorRepository]} { if ![info exists cgi(mirror)] {set cgi(mirror) $env(LOBIMIREP)} } else { set cgi(mirror) $mirrorRepository } # currentRep (local mirror repository - contains @siteList.txt) # currentRep is the mirrorrepository field value (if any) # otherwise is cgi(mirror) (if any) # otherwise is $env(LOBIMIREP) set currentRep $cgi(mirror) # 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] 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$|^Button$|^NewPassword$} $frameName] { if [info exists env(QUERY_STRING)] { foreach {name value} [split $env(QUERY_STRING) &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } } } if {![info exists cgi(creatorfieldindex)] && \ (![regexp {^SimpleForm$|^Button$|^Recent$|^Inquiry$|^FillingInstructions$} $frameName] || ![info exists cgi(languagerep1)])} { # 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 0 { puts {Content-Type: text/html} puts {} puts $currentRep # puts $submissionFormLanguageRep } 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 ![file exists ../$col/$submissionFormRep/doc/submission.js] { Load ../$col/$mirrorHomePageRep/doc/submission.js fileContent Store fileContent ../$col/$submissionFormRep/doc/submission.js } if {$updateStageOfSubmit || ![info exists pathInfo]} { # may not exist when coming form 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] { 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] } } } # serverAddress set serverAddress [list $env(SERVER_NAME) $env(URLIB_PORT)] # serverAddressWithIP set serverAddressWithIP [list $env(IP_ADDR) $env(URLIB_PORT)] # 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) # 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 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.tc - end # regsub -all {"} $cellFont {\\"} cellFont2 ;# used inside the document.write JavaScript command set cellFont {} set cellFont2 {} # Create cgi array # usefull to recover the filled fields after a submit error CreateCGIArray # Create cgi array - end 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(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} $cgi(initialaction)] { if ![info exists cgi(useraction)] {set cgi(useraction) $cgi(initialaction)} } else { if ![info exists cgi(useraction)] {set cgi(useraction) {}} } 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} $cgi(useraction)]} { # CHECK SESSION if [string equal {administrator} $userName] { # administrator 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 } } else { 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 if [string equal {} $cgi(session)] { set fileTable(review) EnterPassword set fileTable(seeworks) EnterPassword if $restrictedSubmission { 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 compare {update} $cgi(useraction)] == 0 && \ [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 compare {} $cgi(useraction)] != 0} { if [regexp {update} $cgi(useraction)] { # UPDATE user action if {[string compare {writeuser} $userType] == 0} { # write foreach {eMailAddress fullName2 theme2} [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)" } 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} $cgi(useraction)] { # REVIEW and SEEWORKS 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)" puts "" return } } } set fileTable(review) Review set fileTable(register) Register set fileTable(seeworks) SeeWorks } # set cgi(formstate) nothingtoupadte puts {Content-Type: text/html} puts {} if {[string compare {} $cgi(formstate)] == 0} { 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 compare {} $cgi(formstate)] == 0 || \ ([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} if {[string compare {writeuser} $cgi(usertype)] == 0} { # write user # set fieldName %9 # set field _9_theme set fieldName %@subject set field __subject_subject 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 } } if [catch {source ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl} error] { puts "error in sourcing file <\;../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl>\;:" puts
puts $error } 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} { # 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} { # 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} $cgi(useraction)] } else { set currentPassword [regexp {update|review|seeworks} $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 compare {} $cgi(session)] != 0} { # 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 compare {register} $cgi(useraction)] == 0 || \ [string compare {} $cgi(initialaction)] != 0 || \ [string compare {} $cgi(session)] == 0} { # 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 compare {} $cgi(username)] != 0 && \ [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 set conferenceName [lindex $displayTable(Conference Proceedings,%B) 2] if {[string compare {} $conferenceName] == 0} { # 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 workList2 [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword] # puts --$workList2-- if {[string compare {no} $cgi(returnbutton)] == 0} { # open a new window set target { TARGET=_blank} } else { set target {} } # translationTable source ../$col/$languageRep2/doc/mirror/${language}ReferenceTypeName.tcl ;# set translationTable # global referencetype::translationTable set referenceTypeList {} foreach item $workList2 { SetFieldValue $serverAddressWithIP $item {title author editor programmer reporter repository mirrorrepository childrepositories referencetype nextedition mark} lappend referenceTypeList $referencetype 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 {} if {![string equal {Conference Proceedings} $referencetype] || \ ([info exists {closedUpdateTable(Conference Proceedings)}] && \ !$closedUpdateTable(Conference Proceedings))} { # update button if {[string compare {no} $cgi(returnbutton)] == 0} { # 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)" } lappend $referencetype " $title
$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]]
] " } } } set fileTableEntry $cgi(useraction) } } # LOAD # puts $fileTableEntry # => passwordpage # puts $fileTable($fileTableEntry) # => EnterPassword set currentFileName [FindCurrentHTMLFileName $fileTable($fileTableEntry)] # puts $currentFileName Load $currentFileName fileContent if [string equal {EnterLogin} $fileTable($fileTableEntry)] { set loginFieldName "${eMail Address}" } if {[string compare {EnterPassword} $fileTable($fileTableEntry)] == 0} { # 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 compare {administrator} $cgi(username)] == 0} {set cgi(username) {}} # 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 $env(QUERY_STRING) if [info exists cgi(query)] { ProcessQuery set formValue $cgi(query) } else { set formValue {} } 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(sort) regsub "OPTION VALUE=$cgi(choice)" $body "OPTION SELECTED VALUE=$cgi(choice)" body regsub "OPTION VALUE=$cgi(sort)" $body "OPTION SELECTED VALUE=$cgi(sort)" body if {[string compare {true} $cgi(accent)] == 0} { set checkedAccent { CHECKED} } else { set checkedAccent {} } if {[string compare {true} $cgi(case2)] == 0} { set checkedCase { CHECKED} } else { set checkedCase {} } if [catch {set hiddenInput " "}] { set hiddenInput {} } ## administratorUserName # regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName # it is better to use administrator instead of its user name because # in case of name change we don't need do reload the frame set output [subst $body] } ^SimpleForm$ { set timeZone [expr ([clock scan [clock format [clock seconds] -format %H:%M:%S] -gmt 1] - [clock seconds]) / 3600] if [file exists ../$col/$languageRep1/doc/${language}SimpleForm.html] { Load ../$col/$languageRep1/doc/${language}SimpleForm.html body } else { Load ../$col/$languageRep2/doc/${language}SimpleForm.html body } # puts $body if [info exists cgi(query)] { ProcessQuery set formValue $cgi(query) regsub -all { } $cgi(query) {+} query } else { set formValue {} } # puts $formValue if [info exists cgi(startsearch)] { set onLoad " ONLOAD=\"window.open('http://$env(HTTP_HOST)/col/$currentRep/doc/mirrorsearch.cgi?query=$query&languagebutton=$language&returnbutton=yes', '$display')\"" } else { set onLoad {} } if [catch {set infoQuery prefixqueryfield=$cgi(prefixqueryfield)&queryfield=$cgi(queryfield)&suffixqueryfield=$cgi(suffixqueryfield)&suffixquery2field=$cgi(suffixquery2field)&suffixquery3field=$cgi(suffixquery3field)&referencetypefield=$cgi(referencetypefield)&languagebutton=$language&returnbutton=yes}] { set infoQuery languagebutton=$language set hiddenInput {} } else { regsub -all { } $infoQuery {+} infoQuery set hiddenInput " " } 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} ## administratorUserName # regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName # it is better to use administrator instead of its user name because # in case of name change we don't need do reload the frame # insertionOn # glob -nocomplain ../../auxdoc/insertionOn-* if [file exists ../../auxdoc/insertionOn-] { Load ../../auxdoc/insertionOn- time set insertionOn "$time" } else { set insertionOn { } } set output [subst $body] } ^Button$ { # targetFrame set targetFrame _top if [info exists env(QUERY_STRING)] { regexp {targetframe=([^&]*)} $env(QUERY_STRING) m targetFrame } # Drop some buttons for the main site global "${languageRep2}::|urlib.net" set urlibServerAddress [Execute $serverAddressWithIP GetURLibServerAddress] ;# 150.163.x.xx:80 foreach {urlibServerName urlibPort} [ReturnCommunicationAddress $urlibServerAddress] {break} if {"$env(IP_ADDR) $env(URLIB_PORT)" == "$urlibServerName $urlibPort"} { # Main Site set {|urlib.net} "" } # Drop some buttons for the main site - end if [file exists ../$col/$languageRep1/doc/${language}Button.html] { Load ../$col/$languageRep1/doc/${language}Button.html body } else { Load ../$col/$languageRep2/doc/${language}Button.html body } # set output $body # set output [subst $body] set output [subst [subst $body]] } ^Button2$ { # Get number of visits # set numberOfVisits [Execute $serverAddressWithIP [list GetNumberOfVisits $env(LOBIMIREP)]] set numberOfVisits [Execute $serverAddressWithIP [list GetNumberOfVisits $currentRep]] # Get number of visits - end if [file exists ../$col/$languageRep1/doc/${language}Button2.html] { Load ../$col/$languageRep1/doc/${language}Button2.html body } else { Load ../$col/$languageRep2/doc/${language}Button2.html body } set output [subst [subst $body]] } ^Inquiry$ { while {[EnterQueue [pid] inquiry]} { set x 0; after 100 {set x 1}; vwait x } if [file exists $env(DOCUMENT_ROOT)/col/$currentRep/auxdoc/inquiry] { source $env(DOCUMENT_ROOT)/col/$currentRep/auxdoc/inquiry } if ![info exists low] { # the inquiry file might have been corrupted set low 0 set medium 2 set high 0 } if [info exists cgi(inquiry)] { if [string equal low $cgi(inquiry)] {incr low} if [string equal medium $cgi(inquiry)] {incr medium} if [string equal high $cgi(inquiry)] {incr high} set fileContent "set low $low; set medium $medium; set high $high" Store fileContent $env(DOCUMENT_ROOT)/col/$currentRep/auxdoc/inquiry LeaveQueue [pid] inquiry puts "Location: Inquiry?justranking=yes&languagebutton=$language" ;# could be anything else instead of yes puts "" return } LeaveQueue [pid] inquiry puts {Content-Type: text/html} puts {} if [file exists ../$col/$languageRep1/doc/${language}Inquiry.html] { Load ../$col/$languageRep1/doc/${language}Inquiry.html body } else { Load ../$col/$languageRep2/doc/${language}Inquiry.html body } # set output $body set output [subst $body] # set output [subst [subst $body]] } ^Help$ { GetConversionTable $languageRep2 $language CreateAbbreviation ^a|^t|^y|^k|^r|^i|^u|^m global field::conversionTable global abbreviationArray set output [subst [set ${languageRep2}::body]] # set output [set ${languageRep2}::body] } ^AdvancedHelp$ { GetConversionTable $languageRep2 $language set fieldList [CreateAbbreviation ^v] global field::conversionTable global abbreviationArray foreach field $fieldList { lappend fLE $field } # fieldListExample set fieldListExample [join $fLE " [set ${languageRep2}::and] "] set output [SetFont [subst [set ${languageRep2}::body]]] } ^DynamicHelp$ { GetConversionTable $languageRep2 $language CreateAbbreviation .* global field::conversionTable global abbreviationArray if ![info exists cgi(prefixqueryfield)] {set cgi(prefixqueryfield) $abbreviationArray(author)} if ![info exists cgi(queryfield)] {set cgi(queryfield) {}} if ![info exists cgi(suffixqueryfield)] {set cgi(suffixqueryfield) and} if ![info exists cgi(suffixquery2field)] {set cgi(suffixquery2field) $abbreviationArray(title)} if ![info exists cgi(suffixquery3field)] {set cgi(suffixquery3field) {}} if ![info exists cgi(referencetypefield)] {set cgi(referencetypefield) {}} foreach {index value} [array get conversionTable] { if {[string compare {referencetype} $index] != 0} {set inverseTable($value) $index} } foreach value [lsort -dictionary [array names inverseTable ?*]] { set selected1 { } set selected2 { } # if {[string compare {author} $inverseTable($value)] == 0} {set selected1 { SELECTED }} if {[string compare $cgi(prefixqueryfield) $abbreviationArray($inverseTable($value))] == 0} {set selected1 { SELECTED }} # if {[string compare {title} $inverseTable($value)] == 0} {set selected2 { SELECTED }} if {[string compare $cgi(suffixquery2field) $abbreviationArray($inverseTable($value))] == 0} {set selected2 { SELECTED }} lappend fieldNameList1 " $value" lappend fieldNameList2 " $value" } set fieldNameList1 [join $fieldNameList1] set fieldNameList2 [join $fieldNameList2] set referenceTypeList [Execute $serverAddressWithIP CreateReferenceTypeList] foreach referenceType [lsort $referenceTypeList] { if [regexp {Generic} $referenceType] {continue} set selected { } # puts [list $cgi(referencetype) $referenceType] if {[string compare $cgi(referencetypefield) $referenceType] == 0} {set selected { SELECTED }} lappend fieldValueList " $referenceType" } set fieldValueList [join $fieldValueList] set output [set ${languageRep2}::body] regsub "OPTION VALUE=\"$cgi(suffixqueryfield)\"" $output "OPTION SELECTED VALUE=\"$cgi(suffixqueryfield)\"" output # puts $output set hiddenInput " " set output [SetFont [subst $output]] } ^Language$ { set englishMirrorRepository $env(ENGLISH_MIRROR_REP) source ../$col/$englishMirrorRepository/doc/mirror/language.tcl # administratorUserName regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName set output [SetFont [subst [set ${englishMirrorRepository}::body]]] } ^Contributors$ { # contributorList # set query {list GetMetadataRepositories $currentRep 2 "targetfile @reference.bib [join $loCoInRepList]" yes yes 1 metadatalastupdate} set query {list GetMetadataRepositories $currentRep 3 "contenttype Bibliography Data Base [join $loCoInRepList]" yes yes 1 metadatalastupdate} # set query2String {query2=targetfile @reference.bib [join $loCoInRepList]&choice2=brief&accent2=yes&case2=yes} # set query2String {from=contributors} ;# no used anymore in MirrorGet set query2String {} ;# needed because it an argument of CreateOutput global cgi set cgi(continue) yes ;# to force continue set cgi(choice) brief CreateOutput $language $languageRep1 $languageRep2 $query $query2String Contributors ../ return } ^Field$ { # fieldNameList GetConversionTable $languageRep2 $language ;# set field::conversionTable CreateAbbreviation .* ;# need field::conversionTable - set abbreviationArray global field::conversionTable global abbreviationArray foreach {index value} [array get conversionTable] { set inverseTable($value) $index } # displayControl.tcl is used to set the table attributes if [catch {source ../$col/$submissionFormRep/doc/displayControl.tcl} error] { puts "error in sourcing file <\;$env(DOCUMENT_ROOT)/col/$submissionFormRep/doc/displayControl.tcl>\;:" puts
puts $error } foreach value [lsort -dictionary [array names inverseTable ?*]] { # lappend fieldNameList  \;$value \; \; \;$abbreviationArray($inverseTable($value)) lappend fieldNameList  \;$value \; \; \;$abbreviationArray($inverseTable($value)) } set fieldNameList [join $fieldNameList] set output [SetFont [subst [set ${languageRep2}::body]]] } ^Word$ { ## wordOccurrenceList # global wordOccurrenceList # maximumNumberOfWords # empty maximumNumberOfWords means to return all the keywords if ![file exists $homePath/col/$currentRep/doc/@maximumNumberOfWords] { set fileContent {# empty maximumNumberOfWords means to return all the keywords # set maximumNumberOfWords {} set maximumNumberOfWords 30} Store fileContent $homePath/col/$currentRep/doc/@maximumNumberOfWords } source $homePath/col/$currentRep/doc/@maximumNumberOfWords Load $homePath/col/$currentRep/doc/@wordOccurrence wordOccurrenceList if {[string compare {} $wordOccurrenceList] == 0} { set wordOccurrenceList [GetWordOccurrenceList \ $currentRep $maximumNumberOfWords \ $env(IP_ADDR):$env(SERVER_PORT)] } # wordListLength set wordListLength [llength $wordOccurrenceList] # regsub -all {_} $wordOccurrenceList { } wordOccurrenceList set wordList {} foreach item $wordOccurrenceList { lappend wordList [join $item] } set wordOccurrenceList [join $wordList
] GetConversionTable $languageRep2 $language global field::conversionTable # statisticsDate global "${languageRep2}::statisticsDate" global "${languageRep2}::Jan" global "${languageRep2}::Feb" global "${languageRep2}::Mar" global "${languageRep2}::Apr" global "${languageRep2}::May" global "${languageRep2}::Jun" global "${languageRep2}::Jul" global "${languageRep2}::Aug" global "${languageRep2}::Sep" global "${languageRep2}::Oct" global "${languageRep2}::Nov" global "${languageRep2}::Dec" set statisticsDate [subst [GetStatisticsDate $statisticsDate]] set output [SetFont [subst [set ${languageRep2}::body]]] # set output [set ${languageRep2}::body] } ^Recent$ { set maximumNumberOfEntries $env(MAX_NUMBER_OF_ENTRIES) set query [list list GetMostRecentMetadataRep $currentRep $maximumNumberOfEntries] # set query2String {from=recent} ;# no used anymore in MirrorGet set query2String {} ;# needed because it an argument of CreateOutput global cgi set cgi(choice) brief ;# used in LoopOverEntries set maximumNumberOfReferences 10 CreateOutput $language $languageRep1 $languageRep2 $query $query2String Recent \ ../ 0 $maximumNumberOfReferences brief return } ^Submit$ { # puts $currentRep foreach {language languageRep2} [FindLanguageForSubmissionForm $language $submissionFormLanguage $firstLanguageRep $languageRep2] {break} source ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}$frameName.tcl # puts ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}ReferenceTypeName.tcl source ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}ReferenceTypeName.tcl ;# set translationTable global "${languageRep2}::currentVariableFileName" ;# for reverse engineering GetConversionTable $languageRep2 $language global field::conversionTable # to select thesis as reference type the URL must be Submit/Thesis # to submit just a reference the URL must be Submit/Thesis?attachment=no global "${languageRep2}::submission header" global "${languageRep2}::update header" global "${languageRep2}::footer" global "${languageRep2}::submissionMetadataTable" ;# used in mirror/xxSubmit.tcl global "${languageRep2}::updateMetadataTable" global "${languageRep2}::updatingMetadataTable" ;# Migration 10/10/04 - not used global "${languageRep2}::Please wait for the submission completion." global "${languageRep2}::Please wait for the update completion." global "${languageRep2}::File Name" # global "${languageRep2}::User Name" global "${languageRep2}::Password" global "${languageRep2}::Submit" global "${languageRep2}::Update" global "${languageRep2}::Update Submission Agreement" global "${languageRep2}::Save/Check" global "${languageRep2}::Save/Exit" global "${languageRep2}::Remove before Update" global "${languageRep2}::Remove before Update and don't Copy to Source" # global "${languageRep2}::Remove before Update - d&s" global "${languageRep2}::Add" global "${languageRep2}::Add and Copy" global "${languageRep2}::Run" global "${languageRep2}::Finish" global "${languageRep2}::Close" global "${languageRep2}::Clear" # global "${languageRep2}::Return" global "${languageRep2}::Cancel" global "${languageRep2}::Code" global "${languageRep2}::Folder Name" global "${languageRep2}::forbidden submission" global "${languageRep2}::forbidden update" global "${languageRep2}::disabled submission" global "${languageRep2}::no user name for update" global "${languageRep2}::out-of-date search" global "${languageRep2}::Document" global "${languageRep2}::Review" global "${languageRep2}::Reference" global "${languageRep2}::Abstract" global "${languageRep2}::a document" global "${languageRep2}::a review" global "${languageRep2}::a reference" global "${languageRep2}::an abstract" global "${languageRep2}::search option for submit" global "${languageRep2}::search option for update" global "${languageRep2}::Don't Get URL" global "${languageRep2}::Get URL and Don't Transfer Copyright" global "${languageRep2}::Get URL and Transfer Copyright" global "${languageRep2}::popup warning" global "${languageRep2}::closed session" global "${languageRep2}::Add one more author field" global "${languageRep2}::Remove this author field" global "${languageRep2}::Move this author field up" global "${languageRep2}::Move this author field down" global "${languageRep2}::Try to fill out this field" global "${languageRep2}::User" ;# used in access to Restricted Area global "${languageRep2}::turn the attached file, the target file" global "${languageRep2}::capture the URL content" global "${languageRep2}::Have Forgotten it?" # global "${languageRep2}::translationTable" ;# set in xxFillingInstructions.tcl # administratorUserName # used by CreateReturnButton regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName # update and submissionType set update 0 set submissionType submit if [info exists env(QUERY_STRING)] { # puts $env(QUERY_STRING) if $updateStageOfSubmit { # update set update 1 set submissionType update # metadatarepository value is defined in Update (see cgi/update.tcl) set metadataList [Execute $serverAddressWithIP [list GetMetadata $metadataRep-*]] # puts $metadataList array set localMetadataArray $metadataList # repName == rep set repName $localMetadataArray($metadataRep-0,repository) # repositoryContentType ConditionalSet repositoryContentType localMetadataArray($metadataRep-0,contenttype) {} ## archivingPolicy - used in displayControl.tcl only # ConditionalSet archivingPolicy localMetadataArray($metadataRep-0,archivingpolicy) {} # metadataLastUpdate set metadataLastUpdate $localMetadataArray($metadataRep-0,metadatalastupdate) regsub -all { } $metadataLastUpdate {+} metadataLastUpdate append returnInfo "&lastupdate=$metadataLastUpdate" # documentStage - used in displayControl.tcl only if [info exists localMetadataArray($metadataRep-0,documentstage)] { set documentStage $localMetadataArray($metadataRep-0,documentstage) } # nextEdition - used in displayControl.tcl only if [info exists localMetadataArray($metadataRep-0,nextedition)] { set nextEdition $localMetadataArray($metadataRep-0,nextedition) } # userGroup - used in displayControl.tcl and in this procedure if [info exists localMetadataArray($metadataRep-0,usergroup)] { set userGroup $localMetadataArray($metadataRep-0,usergroup) } else { # for old metadata set userGroup {} ;# could be any thing (existence is tested in displayControl.tcl and allow the setting of optionTable2) } # advancedUser - used in displayControl.tcl and in this procedure set advancedUser $localMetadataArray($metadataRep-0,username) # secondaryType - used in displayControl.tcl if [info exists localMetadataArray($metadataRep-0,secondarytype)] { set secondaryType $localMetadataArray($metadataRep-0,secondarytype) } # window regsub -all {/} ${currentRep}___$metadataRep {__} window regsub -all {\.|@|-} $window {_} window set window ${window}___0 } else { # submit set userGroup {} ;# could be anything (existence is tested in displayControl.tcl and allow the setting of optionTable2) } # puts 2==$returnInfo # puts $update # puts [array names cgi] # some fields are: # deposit (used to force submission/update when a new reference has the same authors, title and reference type as an existing reference) # internal use # values are: yes or no, default is no; yes means to force submission # updateoption (set in CreateBriefEntry - ePrint) # has priority over the value defined in displayControl.tcl # values are: all, update, {remove before update}, add, {add and copy} and finish, default is given by updateOptionTable in displayControl.tcl if [regexp {(returnaddress)=(.*)$} $env(QUERY_STRING) m name value] { regsub {&metadatarepository=.*$} $value {} value ;# metadatarepository field comes from env(REQUEST_URI) (see CreateBriefEntry) it was needed for Submit (update option) but is not used in the returnaddress set cgi($name) $value } regsub {&?returnaddress=.*$} $env(QUERY_STRING) {} queryString foreach {name value} [split $queryString &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } # puts $update # puts [array get cgi] # puts $cgi(returnaddress) if ![info exists cgi(deposit)] {set cgi(deposit) no} if ![info exists cgi(updateoption)] {set cgi(updateoption) {}} if ![info exists cgi(returnaddress)] {set cgi(returnaddress) {}} if ![info exists cgi(returnbutton)] {set cgi(returnbutton) {no}} ;# needed in xxEnterPassword.html if ![info exists cgi(mirror)] {set cgi(mirror) {}} ;# is not empty when submitting or updating an ePrint (electronic source) if ![info exists cgi(frameinuse)] {set cgi(frameinuse) no} ;# when using search option (see displayControl.tcl) frameinuse is set to yes - frameinuse is not a user variable, is for internal use only if ![info exists cgi(registereduser)] {set cgi(registereduser) yes} ;# used when checking session array set cgi $extraCGIList ;# set in Submit - needed with multiple creator fields if ![info exists cgi(ingestactor)] {set cgi(ingestactor) {}} ;# used in xxSubmit.html and xxUpdateSubmission.html - needed with multiple creator fields if ![info exists cgi(hidesimilarbutton)] {set cgi(hidesimilarbutton) {no}} if ![info exists cgi(reviewprocess)] {set cgi(reviewprocess) {}} ;# used in xxSubmit.html and xxUpdateSubmission.html - needed with multiple creator fields 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 xxEnterLogin.html if {$updateStageOfSubmit || ![info exists pathInfo]} { # may not exist when coming form Submit set frameName Submit } # puts [array get cgi] # referenceType - used in displayControl.tcl # referenceType2 if !$updateStageOfSubmit { if [info exists pathInfo] { set referenceType2 [lindex $pathInfo 6] # Netscape doesn't work with regsub {(.)([A-Z])} $referenceType2 {\1 \2} referenceType ;# ConferenceProceedings -> Conference Proceedings regsub {(.)(or )} $referenceType {\1 \2} referenceType ;# Filmor Broadcast -> Film or Broadcast } else { # may not exist when coming from Submit set referenceType $cgi(%0 referencetype) set referenceType [join $referenceType] ;# {Conference Proceedings} -> Conference Proceedings regsub -all { } $referenceType {} referenceType2 ;# Conference Proceedings -> ConferenceProceedings } } else { if [info exists {cgi(%0 referencetype)}] { set referenceType $cgi(%0 referencetype) set referenceType [join $referenceType] ;# {Conference Proceedings} -> Conference Proceedings regsub -all { } $referenceType {} referenceType2 ;# Conference Proceedings -> ConferenceProceedings } } # referenceType3 regsub -all { } $referenceType {+} referenceType3 append returnInfo &%0+referencetype=\{$referenceType3\} if $update { # update (used in displayControl.tcl) LoadService $repName userName userName 1 1 ;# must be before source displayControl.tcl for dynamic forms set cgi(login) $userName ;# used in xxEnterPassword.html # if {[info exists cgi(username)] && [info exists cgi(session)]} # # append returnInfo "&username=$cgi(username)" ;# to maintain username # append returnInfo "&session=$cgi(session)" ;# to maintain session # # # publishingYear - used in displayControl.tcl ConditionalSet publishingYear localMetadataArray($metadataRep-0,year) {} # puts --$publishingYear-- # size - used in displayControl.tcl ConditionalSet size localMetadataArray($metadataRep-0,size) {} } # submissionStage - used in displayControl.tcl set submissionStage invoke # Source displayControl.tcl and xxFillingInstructions.tcl set enableOutput 0 eval $sourceDisplayControl # doc/xxFillingInstructions.tcl # OBS: Include has priority over the doc/xxFillingInstructions.tcl file # source ../$col/$languageRep2/doc/${language}FillingInstructions.tcl # puts [list $languageRep2 $submissionFormLanguageRep] source ../$col/$languageRep2/doc/${submissionFormLanguage}FillingInstructions.tcl source ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl # Source displayControl.tcl and xxFillingInstructions.tcl - end set cellFont {} # puts $displayTable(Audiovisual Material,%C) # puts $optionTable2(Report,%9) # puts $optionTable(Report,%9) if $updateStageOfSubmit { if {[string equal {Misc} $referenceType] && [regexp {review} $keywords]} { # review set displayTable(Misc,%A) [list 1.1 {(*)[Help Name]} {} {Reviewer(s)}] set displayTable(Misc,%T) [list 4 {} {} {}] set displayTable(Misc,%D) [list 0 {} {} {}] set displayTable(Misc,%9) [list 0 {} {} {}] set displayTable(Misc,%3) [list 0 {} {} {}] set displayTable(Misc,%K) [list 0 {} {} {}] set displayTable(Misc,%X) [list 0 {} {} {}] set displayTable(Misc,%O) [list 4 {} {} {Presentation Format}] set displayTable(Misc,%U) [list 0 {} {} {}] set displayTable(Misc,%@parentrepositories) [list 4 {click ->} {} {Work to be Reviewed}] set displayTable(Misc,%@language) [list 0 {} {} {}] set displayTable(Misc,%@copyholder) [list 0 {} {} {}] set displayTable(Misc,%@area) [list 4 {} {} {}] set displayTable(Misc,%@e-mailaddress) [list 0 {} {} {}] set displayTable(Misc,%@project) [list 0 {} {} {}] set displayTable(Misc,%@accessdate) [list 0 {} {} {}] set displayTable(Misc,%@readpermission) [list 0 {} {} {}] # set displayTable(Misc,%@documentstage) [list 3 {To Save
keep your login
and press Update
----
To Send
select 'Send Review'
and press Update
----
(*)[Help NextReview]} {} {Action to be Performed at Update}] set displayTable(Misc,%@documentstage) [list 3 {(*)[Help NextReview]} {} {Action to be Performed at Update}] set displayTable(Misc,filename) [list 0 {} {} {x}] set updateOptionTable(Misc) {update} set searchBaseTable(Misc) {writeUserArray} } } # if ![info exists cgi(targetframe)] {set cgi(targetframe) $display} if {[info exists searchOptionTable($referenceType)] && \ [string equal {yes} $searchOptionTable($referenceType)] && \ [string equal {yes} $cgi(frameinuse)]} { if ![info exists cgi(targetframe)] {set cgi(targetframe) _parent} } else { if ![info exists cgi(targetframe)] {set cgi(targetframe) _self} } if {[info exists submissionMaintenanceTable($referenceType)] && \ $submissionMaintenanceTable($referenceType)} { # submission maintenance if [file exists ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}SubmissionMaintenance.html] { # use include puts [subst [Include ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}SubmissionMaintenance.html]] } else { if [info exists submissionMaintenanceArray($referenceType)] { # use xxFillingInstructions.tcl puts [subst $submissionMaintenanceArray($referenceType)] } } return } # Closed submission/update if $update { # update if $updateStageOfSubmit { # Change write user name if [info exists updatePolicyTable($referenceType)] { if $updatePolicyTable($referenceType) { # force update by the alternate user - gives control to the alternate user ConditionalSet userName2 alternateUserTable($referenceType) {administrator} } else { # force update by the author - give control to the author ConditionalSet alternateUser alternateUserTable($referenceType) {administrator} regsub $alternateUser $userGroup {} userList ;# drop the alternate user if {[info exists userNameList($referenceType)] && \ [regexp {update by the author} $userNameList($referenceType)]} { # update by the author # Drop from user group the names which are in userNameList array set userNameTable [subst $userNameList($referenceType)] ;# may use userGroup set userList2 [GetArrayRange userNameTable] set userList [ListSubtraction userList userList2] ;# userList - userList2 # Drop from user group the names which are in userNameList - end } set userName2 [lindex $userList 0] ;# take the first } if ![string equal $userName2 $userName] { # change userName set userName $userName2 } } # Change write user name - end # Check session if {[info exists checkingSessionDataTable($referenceType)] && \ $checkingSessionDataTable($referenceType)} { # restricted access # CHECK SESSION if [info exists localMetadataArray($metadataRep-0,readergroup)] { set readerGroup $localMetadataArray($metadataRep-0,readergroup) } else { set readerGroup {} } if {(![info exists cgi(username)] || \ ![info exists cgi(session)] || \ [CheckSession $cgi(session) $cgi(username)]) && \ ![string equal {} $readerGroup]} { set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel] # puts [subst [subst ${closed session}]] # return # action set action ${Please wait for the submission completion.} # seconds set seconds "" set cgi(usertype) {} ;# could be removed ... set cgi(delayedreturnbutton) {} ;# could be removed ... set cgi(targetframe) {} ;# could be removed ... set cgi(useraction) {} ;# could be removed ... set cgi(username) $userName set cgi(wrongpassword) {no} set currentPassword 1 set currentFileName [FindCurrentHTMLFileName EnterPassword] set updateForRegister 0 set formAction http://$localSite/update$env(PATH_INFO)?$env(QUERY_STRING) if {[llength $readerGroup] == 1} { # just one read user set loginRow " ${cellFont}$User (Login)
$readerGroup " } else { # more than one read user set loginRow " ${cellFont}$User (Login) " } Load $currentFileName body # set output [subst $body] set output [subst [subst [subst [subst $body]]]] ;# more subtitutions are needed to resolve the content of $action puts $output return } } # Check session - end } if {(([info exists closedUpdateTable($referenceType)] && \ $closedUpdateTable($referenceType)) || \ ([info exists localMetadataArray($metadataRep-0,childrepositories)] && \ [info exists forceAssignedPaperUpdateTable($referenceType)] && \ !$forceAssignedPaperUpdateTable($referenceType))) && \ ![string equal {administrator} $userName] && \ (![string equal {Misc} $referenceType] || [regexp {review} $keywords])} { # closed update if [file exists ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedUpdate.html] { # use include puts [subst [Include ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedUpdate.html]] } else { # use default include puts [subst [Include ../$col/$languageRep2/doc/include/${language}${referenceType2}ClosedUpdate.html]] } return } } else { # submit if {[info exists closedSubmissionTable($referenceType)] && \ $closedSubmissionTable($referenceType)} { # closed submit if [file exists ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedSubmission.html] { # use include puts [subst [Include ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedSubmission.html]] } else { # use default include puts [subst [Include ../$col/$languageRep2/doc/include/${language}${referenceType2}ClosedSubmission.html]] } return } } # Closed submission/update - end # requiredFieldSymbol and requiredFieldAtCloseSymbol set requiredFieldSymbol $requiredFieldFootnoteTable($referenceType) ;# e.g., (*) regsub -all {(\*|\+)} $requiredFieldSymbol {\\\1} requiredFieldSymbol ;# requiredFieldSymbol is used in regular expression if [info exists requiredFieldAtCloseFootnoteTable($referenceType)] { set requiredFieldAtCloseSymbol $requiredFieldAtCloseFootnoteTable($referenceType) ;# e.g., (*) regsub -all {(\*|\+)} $requiredFieldAtCloseSymbol {\\\1} requiredFieldAtCloseSymbol ;# requiredFieldAtCloseSymbol is used in regular expression } # Create cgi array # usefull to recover the filled fields after a submit error CreateCGIArray ;# updates returnInfo # Create cgi array - end # puts [array names cgi] # puts [array get cgi] if {[info exists cgi(returnaddress)] && ![string equal {} $cgi(returnaddress)]} { if $update { if [info exists cgi(lastupdate)] { set metadataLastUpdate $localMetadataArray($metadataRep-0,metadatalastupdate) regsub -all {\+} $cgi(lastupdate) { } metadataLastUpdate2 ;# as in Submit # puts [list $metadataLastUpdate $metadataLastUpdate2] if ![regexp "$metadataLastUpdate" $metadataLastUpdate2] { # out-of-date search puts [subst [subst ${out-of-date search}]] return } } } } # puts $cgi(frameinuse) # puts [info exists cgi(returntype)] # Search option if {[info exists searchOptionTable($referenceType)] && \ [string equal {yes} $searchOptionTable($referenceType)] && \ [string equal {no} $cgi(frameinuse)] && \ ![info exists cgi(returntype)]} { # SEARCH OPTION - create frame set set frameHeight 32 if $update { # update set metadataList [Execute $serverAddressWithIP [list GetMetadata $metadataRep-*]] array set localMetadataArray $metadataList set repName $localMetadataArray($metadataRep-0,repository) if ![file exists $homePath/col/$repName/service/userName] { set header ${update header} set returnButton [CreateReturnButton
../../../../col/$languageRep2/doc/mirror ../../../../col/$currentRep/doc/mirror.cgi/About $display $Cancel] puts [subst [subst ${no user name for update}]] return } set {search option} ${search option for update} } else { # submit set {search option} ${search option for submit} } set queryString frameinuse=yes&$env(QUERY_STRING) set output [subst ${search option}] # puts OK ;# to see the frame set puts $output exit } # Search option - end # changing return button default # must be after the above CreateReturnButton if ![info exists cgi(returnbutton)] {set cgi(returnbutton) {no}} # attachment # puts [info exists cgi(attachment)] # puts [lindex $displayTable($referenceType,filename) 0] if [regexp {0} [lindex $displayTable($referenceType,filename) 0]] { if ![info exists cgi(attachment)] {set cgi(attachment) no} } if ![info exists cgi(attachment)] {set cgi(attachment) yes} # puts $cgi(attachment) # puts 3==$returnInfo if ![regexp {.\?} $returnInfo] { # doesn't contain return address append returnInfo "&attachment=$cgi(attachment)" append returnInfo "&returnbutton=$cgi(returnbutton)" # returnaddress must be the last field in the returnInfo string because of the second ? if {[info exists cgi(returnaddress)] && [string compare {} $cgi(returnaddress)] != 0} { append returnInfo "&returnaddress=$cgi(returnaddress)" if 0 { if {[info exists cgi(username)] && [info exists cgi(session)]} { append returnInfo "&username=$cgi(username)" ;# to maintain username append returnInfo "&session=$cgi(session)" ;# to maintain session } } } } # puts 4==$returnInfo # puts [array get cgi] # puts [info exists cgi(returnbutton)] # if {[info exists cgi(returnbutton)] && \ # [string compare {no} $cgi(returnbutton)] == 0} { ### changing return button default ## if {[string compare {no} $cgi(returnbutton)] == 0} # set cgi(targetframe) {""} # } # returnButton # puts [info exists cgi(returnaddress)] # puts
# puts [info exists cgi(returnbutton)] # puts
# puts $display # puts [array get cgi] # if {([info exists cgi(returnaddress)] || !$update) && \ # (![info exists cgi(returnbutton)] || [string compare {no} $cgi(returnbutton)] != 0)} # returnButton if [string equal {yes} $cgi(returnbutton)] { # add cancel button set cgi(returnaddress) $cgi(returnaddress)&hidesimilarbutton=$cgi(hidesimilarbutton) # puts $cgi(returnaddress) set returnButton [CreateReturnButton
http://$localSite/col/$languageRep2/doc/mirror {} $cgi(targetframe) $Cancel] # set returnButton [CreateReturnButton
http://$localSite/col/$languageRep2/doc/mirror {} $cgi(targetframe) $Cancel {} {} {} {} 1] ;# doesn't work, the browser returns a "page has expired" canceling update after a password error } else { set returnButton {} } # updateOption (is used at submit and update) if ![string equal {} $cgi(updateoption)] { set updateOption $cgi(updateoption) } else { ConditionalSet updateOption updateOptionTable($referenceType) {all} } if $update { # update if [info exists cgi(_(_previousedition)] { # ignore targetfile, documentstage and notes of the previous edition if [info exists localMetadataArray($metadataRep-0,targetfile)] {unset localMetadataArray($metadataRep-0,targetfile)} if [info exists localMetadataArray($metadataRep-0,documentstage)] {unset localMetadataArray($metadataRep-0,documentstage)} if [info exists localMetadataArray($metadataRep-0,notes)] {unset localMetadataArray($metadataRep-0,notes)} if [info exists documentStage] {unset documentStage} } # targetFile # targetFileExtension if [info exists localMetadataArray($metadataRep-0,targetfile)] { set targetFile $localMetadataArray($metadataRep-0,targetfile) set targetFileExtension [string trimleft [file extension $targetFile] .] } # ifConditionForRemoveBeforeUpdate if [string equal {all} $updateOption] { # all ConditionalSet updateType cgi(updatetype) {update} ;# default is update if [info exists depositOptionTable($referenceType)] { array set depositOptionArray $depositOptionTable($referenceType) } ConditionalSet copyToSource depositOptionArray(copytosource) 0 # updateOptionList set updateOptionList {Update} lappend updateOptionList {Update Submission Agreement} ;# added by GJFB in 2010-12-05 if [string equal {Electronic Source} $referenceType] { set ifConditionForRemoveBeforeUpdate 0 } else { if $copyToSource { lappend updateOptionList {Remove before Update and don't Copy to Source} {Remove before Update} Add {Add and Copy} set ifConditionForRemoveBeforeUpdate {document.update.userfile.value != "" && (document.update.updatetype\\\\\\\[2\\\\\\\].selected || document.update.updatetype\\\\\\\[3\\\\\\\].selected)} } else { lappend updateOptionList {Remove before Update} Add {Add and Copy} set ifConditionForRemoveBeforeUpdate {document.update.userfile.value != "" && document.update.updatetype\\\\\\\[2\\\\\\\].selected} } } # if [TestContentType $repName {^Tcl Page$} $homePath] # if {[info exists targetFile] && (([info exists targetFileExtension] && \ [regexp -nocase {tex} $targetFileExtension]) || \ [TestContentType $repName {^Tcl Page$|^Index$|^CGI Script$} $homePath])} { # .tex target file or Tcl Page, Index, CGI Script lappend updateOptionList {Run} } lappend updateOptionList {Finish} set updateMenu {} append updateMenu " " append updateMenu "   
(?)  " # set buttonName OK ;# for old customized pages (xxFillingInstruction.tcl) # set buttonName1 ${Save/Check} # set buttonName2 ${Save/Exit} } else { # not all set ifConditionForRemoveBeforeUpdate 0 set updateMenu " " # set buttonName ${Update} } set buttonName ${Update} set buttonName1 ${Save/Check} set buttonName2 ${Save/Exit} } else { # submit if [string equal {all} $updateOption] { # all set buttonName ${Submit} ;# for old customized pages (xxFillingInstruction.tcl) # set buttonName1 ${Accept/Save/Check} # set buttonName2 ${Accept/Save/Exit} set buttonName1 ${Save/Check} set buttonName2 ${Save/Exit} } else { # not all set buttonName ${Submit} } set buttonName ${Submit} set buttonName1 ${Save/Check} set buttonName2 ${Save/Exit} } # onClickExit if {$restrictedSubmission || \ ([info exists submissionPolicyTable($referenceType)] && $submissionPolicyTable($referenceType) == 1)} { set restrictedSubmission2 1 } else { set restrictedSubmission2 0 } set onClickCheck2 "ONCLICK='ProcessSubmit(0, 0, 0, 0, 0, 0, 0, 1)'" ;# check set onClickExit2 "ONCLICK='ProcessSubmit(0, 0, 0, 0, 0, 0, 0, 0)'" ;# exit if {[info exists displayTable($referenceType,username)] && \ [lindex $displayTable($referenceType,username) 0] || \ $update} { set onClickCheck "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission, 0, 1)'" ;# check # set onClickExit "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission, 0, 0)'" ;# exit set onClickExit "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission2, 0, 0)'" ;# exit } else { # submission without login (e.g., SBSR) set onClickExit $onClickExit2 } if [string equal {all} $updateOption] { set documentWriteToProcessKey "document.write (\"    \")" set documentWrite "document.write (\"    \")" } else { # ID name must not be Submit - Submit is a reserved word for IE7/8 set documentWriteToProcessKey "document.write (\"  \")" set documentWrite "document.write (\"  \")" } if [string equal {} $referenceType] {set referenceType Misc} # fieldList # {%@doi doi} {%F label} {%L callnumber} set fieldList [Execute $serverAddressWithIP [list ReturnReferModel $referenceType]] # puts $referenceType # puts $fieldList # puts $language # Migration 25/1/04 # fileTypeWarning if {[info exists contentTypeTable($referenceType)] && \ [info exists fileTypeWarningArray($referenceType)] && \ ![string equal {} $contentTypeTable($referenceType)]} { set contentTypeList [join $contentTypeTable($referenceType)
] set fileTypeWarning $fileTypeWarningArray($referenceType) } else { set fileTypeWarning {} } # Migration 25/1/04 - end # Security issue if ![info exists permissionList] {set permissionList {}} lappend permissionList $env(IP_ADDR) set found [AllowedRemoteAddress $permissionList] if {!$found && \ [lsearch -exact $permissionList {All Sites}] == -1 && \ [lsearch -exact $permissionList {All IPs}] == -1} { # not found if [info exists returnAddress] {set cgi(returnaddress) $returnAddress} ;# returnAddress may be defined in displayControl.tcl if $update { set header ${update header} puts [subst [subst ${forbidden update}]] } else { set header ${submission header} puts [subst [subst ${forbidden submission}]] } return } if [Execute $serverAddressWithIP Check-htpasswd] { puts {htpasswd program not found} return } if {!$update && [string equal {127.0.0.1} $env(REMOTE_ADDR)]} { set header ${submission header} puts [subst [subst ${disabled submission}]] return } # Security issue - end # Migration 25/1/04 # footnoteNumber if [info exists initialFootnoteNumberTable($referenceType)] { set footnoteNumber $initialFootnoteNumberTable($referenceType) incr footnoteNumber -1 } # Migration 25/1/04 - end # Process review data # append review fields to fieldList if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)]} { if $update { # update if [file exists ../$col/$repName/doc/.reviewArray.tcl] { # source ../$col/$repName/doc/.reviewArray.tcl # array set reviewArray {iconet.com.br/banon/2004/06.13.00.36,avaliacao 1 iconet.com.br/banon/2004/06.13.00.36,clareza 3 iconet.com.br/banon/2004/06.13.00.36,relevancia 1 iconet.com.br/banon/2004/06.13.00.36,conclusiva 1 iconet.com.br/banon/2004/06.13.00.36,consistencia 1 iconet.com.br/banon/2004/06.13.00.36,qualidadegrafica 1 iconet.com.br/banon/2004/06.13.00.36,comentarioeditor {} iconet.com.br/banon/2004/06.13.00.36,comentarioautor {} iconet.com.br/banon/2004/06.13.00.36,aprovacao {} iconet.com.br/banon/2004/06.13.00.36,adequacao 1} # array set reviewArray {iconet.com.br/banon/2006/11.01.23.55,commentsfortheauthors {} iconet.com.br/banon/2006/11.01.23.55,summaryofthepaper {} iconet.com.br/banon/2006/11.01.23.55,presentation {} iconet.com.br/banon/2006/11.01.23.55,recommendation {} iconet.com.br/banon/2006/11.01.23.55,technicalsoundness {} iconet.com.br/banon/2006/11.01.23.55,confidenceintheevaluation {} iconet.com.br/banon/2006/11.01.23.55,overallrating {} iconet.com.br/banon/2006/11.01.23.55,commentsfortheprogramcommitteeonly {} iconet.com.br/banon/2006/11.01.23.55,originality {} iconet.com.br/banon/2006/11.01.23.55,significance {}} if [catch {source ../$col/$repName/doc/.reviewArray.tcl} error] { puts "error in sourcing file <\;$env(DOCUMENT_ROOT)/col/$repName/doc/.reviewArray.tcl>\;:" puts
puts $error } foreach index [lsort -command FieldCompare [array names reviewArray]] { regsub {.*,} $index {} fieldName lappend fieldList [list $fieldName $fieldName] } } } } # Process review data - end if $update { # submissionDestination # used when closing an ePrint # current destination set submissionDestination $env(SERVER_NAME):$env(SERVER_PORT)/col/$currentRep if {[string equal {add} $updateOption] && [info exists cgi(_(_previousedition)]} { # ePrint update like # insert sourcesite - needed to return to the source form after an update error (e.g, unknown username) regsub { +} $serverAddress {+} serverAddress2 regsub {\?} $returnInfo "?sourcesite=$serverAddress2\\&" returnInfo set index [lindex [array names submissionDestinationTable $referenceType,*] 0] if {[string compare {} $index] != 0} { regsub "$referenceType," $index {} referFieldName ;# @area set referFieldIndex [lsearch -regexp $fieldList $referFieldName] set label [lindex [lindex $fieldList $referFieldIndex] 1] ;# area array set submissionDestinationArray $submissionDestinationTable($index) if [info exists localMetadataArray($metadataRep-0,$label)] { set value $localMetadataArray($metadataRep-0,$label) if [info exists submissionDestinationArray($value)] { # new destination set submissionDestination $submissionDestinationArray($value) if [info exists cgi(_(_previousedition)] { regsub {\?} $returnInfo {?testoutofdateform=no\&} returnInfo } } } } } } set hiddenInputList {} set requiredFieldList {} # set requiredFieldAtCloseList {} # puts [array names cgi] # puts [array get cgi] # puts
# puts $fieldList ## Put documentstage at the end # set documentStageIndex [lsearch $fieldList {%@documentstage documentstage}] # set fieldList [lreplace $fieldList $documentStageIndex $documentStageIndex] # lappend fieldList {%@documentstage documentstage} ## Put documentstage at the end - end # lappend fieldList {%@readpermission readpermission} # Create orderingFieldArray if [info exists orderingFieldTable($referenceType)] { set i 0 foreach fieldName $orderingFieldTable($referenceType) { incr i array set orderingFieldArray [list $fieldName $i] } } # Create orderingFieldArray - end set fillOutFieldCode {} ;# updated in CreateSelect set numberOfCreatorFields 0 ;# could be any integer (the right value is computed later when needed) # sourceFieldNameArray (needed in FindFieldValue) if [info exists cgi(sourcereferencetype)] { array set sourceFieldNameArray [join [Execute $serverAddressWithIP [list ReturnReferModel $cgi(sourcereferencetype)]]] if [info exists excludedSourceFieldNameTable($referenceType)] { foreach index $excludedSourceFieldNameTable($referenceType) { if [info exists sourceFieldNameArray($index)] {unset sourceFieldNameArray($index)} } } } set electronicMailAddressLineList {} set ifEMailAddressCondition {document.update.__e_mailaddress_e_mailaddress.value.match(eMailPattern) == null} set onLoad { onLoad="Disable()"} # ifListCreation (part of a JavaScript) set lineList {} # FOREACH # fieldList is based on the refer model foreach field [lsort -command CompareFieldName $fieldList] { # puts $field # field => %A author set fieldName [lindex $field 0] ;# %A set label [lindex $field 1] ;# author regsub {e-mail} $label {e_mail} label2 if [info exists cgi(sourcereferencetype)] { if [string equal {Electronic Source} $cgi(sourcereferencetype)] { # Electronic Source # closing ePrint # Migration 2009-09-04 # documentstage is not used anymore for ePrint # if below could be dropped in the future if [regexp {^%@documentstage$} $fieldName] { # drop the documentstage field continue } # Migration 2009-09-04 - end if [regexp {^%1$} $fieldName] { # turn the %1 (stageofalternatepublication) field empty if [info exists localMetadataArray($metadataRep-0,stageofalternatepublication)] { unset localMetadataArray($metadataRep-0,stageofalternatepublication) } } if [regexp {^%8$} $fieldName] { # turn the %8 (lastupdatedate) field empty if [info exists localMetadataArray($metadataRep-0,lastupdatedate)] { unset localMetadataArray($metadataRep-0,lastupdatedate) } } } if [string equal {Conference Proceedings} $cgi(sourcereferencetype)] { if [regexp {^%3$} $fieldName] { # turn the %3 (targetfile) field empty if [info exists localMetadataArray($metadataRep-0,targetfile)] { unset localMetadataArray($metadataRep-0,targetfile) } } } } # reshape field regsub -all {%|@| |-} $field {_} field ;# for JavaScript compatibility if [string equal {%A} $fieldName] { # multiple creator fields set creatorFieldName $field lappend hiddenInputList "" lappend hiddenInputList "" lappend hiddenInputList "" lappend hiddenInputList "" lappend hiddenInputList "" lappend hiddenInputList "" lappend hiddenInputList "" } # value set value [FindFieldValue $field $fieldName $label $referenceType $update] if [info exists displayTable($referenceType,$fieldName)] { foreach {translatedCustomizedFieldName translatedFootnoteReference} [Translate $fieldName $label $referenceType] {break} set fillInstruction [lindex $displayTable($referenceType,$fieldName) 1] regsub {\[Help .*\]} $fillInstruction {} fillInstruction set fillInstruction [subst $fillInstruction] ;# subst is to resolve: [expr $update?{}:{(*)}] (see administrator page script) if {[regexp "$requiredFieldSymbol" $fillInstruction] || \ ([info exists requiredFieldAtCloseSymbol] && \ [regexp "$requiredFieldAtCloseSymbol" $fillInstruction])} { # required field regsub {abstract} $label2 {abstract2} label2 ;# abstract is a reserved word for Netscape # puts $label2 # puts $translatedCustomizedFieldName if [regexp -nocase {(.*)} $translatedCustomizedFieldName m translatedCustomizedFieldName2] { lappend rowList "" } else { lappend rowList "" } lappend requiredFieldList $field } } ## fieldTypeNumber # if [info exists displayTable($referenceType,$fieldName)] # # set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] # # if [info exists displayTable($referenceType,$fieldName)] { # fieldTypeNumber set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] if {[regexp {%@readpermission} $fieldName] && [info exists archivingPolicy] && ![string equal {} $archivingPolicy]} { # read permission field and archiving policy is not empty # hide the read permission field (read permission will be set automatically at the document next access, see Get- and Get) set fieldTypeNumber 0 ;# force to 0 } if {$update && ![string equal {External Contribution} $repositoryContentType]} { if [regexp {%@versiontype|%@archivingpolicy} $fieldName] { # version type or archiving policy field and not External Contribution # hide the version and archiving policy type field set fieldTypeNumber 0 ;# force to 0 } } if {$fieldTypeNumber == 0} { # 0 # puts [list $fieldName = $value] # Add the current mirror repository value at submission if {!$update && [string equal {} $value] && [string equal {__mirrorrepository_mirrorrepository} $field]} { lappend hiddenInputList "" } # Add the current mirror repository value at submission - end if {![string equal {} $value] || [string equal {__e_mailaddress_e_mailaddress} $field]} { # if {[string equal {%3} $fieldName] || [string equal {%O} $fieldName]} # # target file (e.g., caoticas[1].pdf) - the two substitutions below are needed to avoid e.g., an invalid command name "1" when opening the form # notes [CD-ROM] # regsub -all {\[} $value {\\\\\\\[} value ;# commented by GJFB in 2011-02-09 - doesn't work with a field value like [CD-ROM] # regsub -all {\]} $value {\\\\\\\]} value ;# commented by GJFB in 2011-02-09 - doesn't work with a field value like [CD-ROM] regsub -all {\[} $value {\\\\\\\\\\\\\[} value ;# added by GJFB in 2011-02-09 regsub -all {\]} $value {\\\\\\\\\\\\\]} value ;# added by GJFB in 2011-02-09 # # lappend hiddenInputList "" } # Migration 2006-05-14 # old collection may contain multiple e-mail addresses in the e-mail address field if {[string equal {%@e-mailaddress} $fieldName] && $update} { # %@e-mailaddress set ifEMailAddressCondition {0} ;# don't check the e-mail address } # Migration 2006-05-14 - end } elseif {[regexp {1.1} $fieldTypeNumber]} { # 1.1 if ![string equal {} $value] { set value [string trim $value] set value \n$value\n ;# the browsers don't display the first blank line, the trailing blank line is for easily filling one more author } set onBlur {} ;# disable onblur effect lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference $value  " } elseif {$fieldTypeNumber == 1.2} { # 1.2 if [string equal {%X} $fieldName] { set numberOfRows 8 } else { set numberOfRows 4 } # puts $value set valueArray($fieldName) $value lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference  " } elseif {$fieldTypeNumber == 1.3} { # 1.3 lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference  " } elseif {[regexp {2.1} $fieldTypeNumber]} { # 2.1 if [string equal {%A} $fieldName] { # %A # multiple creator fields if 0 { lappend rowList " ${cellFont}         " } else { if ![info exists multipleCreatorWarning] {set multipleCreatorWarning { }} lappend rowList " ${cellFont}$multipleCreatorWarning" } if [regexp {^2.1$|^3$} [lindex $displayTable($referenceType,%@group) 0]] { # group foreach {translatedCustomizedFieldNameForGroup translatedFootnoteReferenceForGroup} [Translate %@group group $referenceType] {break} set groupValueList [FindFieldValue {__group_group} %@group group $referenceType $update] # puts $groupValueList } if {[info exists displayTable($referenceType,%@affiliation)] && [regexp {2.1} [lindex $displayTable($referenceType,%@affiliation) 0]]} { # affiliation foreach {translatedCustomizedFieldNameForAffiliation translatedFootnoteReferenceForAffiliation} [Translate %@affiliation affiliation $referenceType] {break} set affiliationValueList [FindFieldValue {__affiliation_affiliation} %@affiliation affiliation $referenceType $update] } if {[info exists displayTable($referenceType,%@electronicmailaddress)] && [regexp {2.1} [lindex $displayTable($referenceType,%@electronicmailaddress) 0]]} { # electronicmailaddress foreach {translatedCustomizedFieldNameForelectronicmailaddress translatedFootnoteReferenceForelectronicmailaddress} [Translate %@electronicmailaddress electronicmailaddress $referenceType] {break} set electronicmailaddressValueList [FindFieldValue {__electronicmailaddress_electronicmailaddress} %@electronicmailaddress electronicmailaddress $referenceType $update] # lappend rowList "" ;# for JavaScript alert } set numberOfCreatorFields [llength $value] set i 0 # puts --$value-- foreach value2 $value { incr i set cellBackgroundColor [lindex {#DDDDFF #FFDDDD} [expr $i%2]] lappend rowList " ${cellFont}[CreateOrdinalNumber $language $i] $translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference [expr $i > 1?{}:{ \;}] [expr $numberOfCreatorFields != 1?{}:{ \;}] [expr $i < $numberOfCreatorFields?{\" class=multipleCreatorButton ONCLICK=\"SetDownIndex($i)\" STYLE=\"font-size: 8pt\; font-family: Verdana\" TITLE=\"${Move this author field down}\">}:{ \;}]" lappend rowList "" ;# for JavaScript alert if [regexp {^2.1$|^3$} [lindex $displayTable($referenceType,%@group) 0]] { # group set groupValue [lindex $groupValueList [expr $i - 1]] if {[info exists fillingButtonTable($referenceType)] && \ $fillingButtonTable($referenceType)} { set fillingButton "" } else { set fillingButton " " } if [regexp {^2.1$} [lindex $displayTable($referenceType,%@group) 0]] { lappend rowList " ${cellFont}[subst $translatedCustomizedFieldNameForGroup] ${cellFont}$translatedFootnoteReferenceForGroup  $fillingButton  " lappend rowList "" ;# for JavaScript alert } elseif [regexp {^3$} [lindex $displayTable($referenceType,%@group) 0]] { set row append row "${cellFont}[subst $translatedCustomizedFieldNameForGroup] ${cellFont}$translatedFootnoteReferenceForGroup" append row "" CreateSelect %@group __group_group$i $groupValue row $i append row " $fillingButton  " lappend rowList $row lappend rowList "" ;# for JavaScript alert } } if {[info exists displayTable($referenceType,%@affiliation)] && [regexp {2.1} [lindex $displayTable($referenceType,%@affiliation) 0]]} { # affiliation set affiliationValue [lindex $affiliationValueList [expr $i - 1]] if {[info exists fillingButtonTable($referenceType)] && \ $fillingButtonTable($referenceType)} { set fillingButton "" } else { set fillingButton " " } lappend rowList " ${cellFont}$translatedCustomizedFieldNameForAffiliation ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName) ${cellFont}$translatedFootnoteReferenceForAffiliation  $fillingButton  " lappend rowList "" ;# for JavaScript alert } if {[info exists displayTable($referenceType,%@electronicmailaddress)] && [regexp {2.1} [lindex $displayTable($referenceType,%@electronicmailaddress) 0]]} { # electronicmailaddress set electronicmailaddressValue [lindex $electronicmailaddressValueList [expr $i - 1]] if {[info exists fillingButtonTable($referenceType)] && \ $fillingButtonTable($referenceType)} { set fillingButton "" } else { set fillingButton " " } lappend rowList " ${cellFont}$translatedCustomizedFieldNameForelectronicmailaddress ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName) ${cellFont}$translatedFootnoteReferenceForelectronicmailaddress  $fillingButton  " lappend rowList "" ;# for JavaScript alert lappend electronicMailAddressLineList "if (document.$submissionType.__electronicmailaddress_electronicmailaddress$i.value.match(eMailPattern) == null) {j++}" } } # lappend rowList " #x" } elseif [regexp {%@group|%@affiliation|%@electronicmailaddress} $fieldName] { # nothing to append } else { if {!$update && [regexp {%T} $fieldName] && \ [regexp {2.1} [lindex $displayTable($referenceType,%A) 0]]} { # title set onFocus { onFocus="MultipleCreatorAlert()"} } else { set onFocus {} } # Migration 2006-05-14 # old collection may contain multiple e-mail addresses in the e-mail address field if {[string equal {%@e-mailaddress} $fieldName] && $update} { # %@e-mailaddress if [regexp {\s} $value] { # multiple e-mail addresses set ifEMailAddressCondition {0} ;# don't check the e-mail address } } # Migration 2006-05-14 - end if {[string equal {%U} $fieldName] && [regexp {2.1d} $fieldTypeNumber]} { # %U # URL if 0 { # display the download radio buttons set downloadRadioButtons "
 ${Don't Get URL}
 ${Get URL and Don't Transfer Copyright}
 ${Get URL and Transfer Copyright} " if [info exists cgi(download)] { if {[string compare {geturldonttransfercopyright} $cgi(download)] == 0} { set downloadRadioButtons "
 ${Don't Get URL}
 ${Get URL and Don't Transfer Copyright}
 ${Get URL and Transfer Copyright} " } elseif {[string compare {geturltransfercopyright} $cgi(download)] == 0} { set downloadRadioButtons "
 ${Don't Get URL}
 ${Get URL and Don't Transfer Copyright}
 ${Get URL and Transfer Copyright} " } } lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference " lappend rowList $downloadRadioButtons } else { # display the check box for the URL field set chekBoxCode " " lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference $chekBoxCode" } } else { set valueArray($fieldName) $value ;# added by GJFB in 2010-11-26 - solves square bracket in the target file field (e.g., cartaz Prof[1]. Gerald Banon 19.6.ppt) regsub {\)} $fieldName {\\\)} fieldName2 ;# added by GJFB in 2010-11-07 - solves field name %) (nextedition) lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference " } lappend rowList " " } } elseif {$fieldTypeNumber == 2.2} { # 2.2 # display check box for the Content Type field if {$update && [regexp {%@contenttype} $fieldName] && ![regexp {^$|^External Contribution$} $repositoryContentType]} { # don't display the repository content type check box if the repository content type value is not empty neither External Contribution # this is done to preserve the current repository content type value if it is not empty neither External Contribution # just the External Contribution value may be set on-line, the other values must be set using the URLibService interface lappend rowList "" continue } elseif {[info exists cgi(templaterepository)]} { # don't display the repository content type check box if duplicating a respository from a template continue } set row append row "${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference" CreateCheckBox $fieldName $field $value row append row " " lappend rowList $row } elseif {$fieldTypeNumber == 2.3} { # 2.3 # radio input lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference " set radioOption {} foreach item $optionTable2($referenceType,$fieldName) { foreach {customizedOption option} $item {break} if [info exists translationTable($customizedOption,$referenceType,$fieldName)] { set translatedCustomizedOption $translationTable($customizedOption,$referenceType,$fieldName) } else { # don't translate set translatedCustomizedOption $customizedOption } if [string equal $option $value] { set checked { CHECKED} } else { set checked {} } lappend radioOption " $translatedCustomizedOption" } lappend rowList "[join $radioOption
] " } elseif {$fieldTypeNumber == 3} { # 3 if {[regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && \ [regexp {%@group} $fieldName]} { # multiple creator fields (group field) # nothing to append } else { set row append row "${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference" append row "" CreateSelect $fieldName $field $value row ;# updates fillOutFieldCode if [info exists optionTable2($referenceType,$fieldName)] { if [regexp {=>} $optionTable2($referenceType,$fieldName)] { if {[regexp {^%@documentstage$} $fieldName] && \ [string equal {another advanced user} $value]} { set onLoad {} } lappend lineList "if (document.update.anotheradvanceduser.value == \"\" && document.update.__documentstage_documentstage.value == \"another advanced user\") {fieldNameList += document.update.anotheradvanceduserfieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}" lappend fillOutFieldCode {if (document.update.__documentstage_documentstage.value == "another advanced user") { document.getElementById('anotherAdvancedUser').disabled=false } else { document.getElementById('anotherAdvancedUser').disabled=true document.update.anotheradvanceduser.value = "" }\ } ConditionalSet anotherAdvancedUser cgi(anotheradvanceduser) {} append row "    e-Mail (login)" append row "\n" append row "" } } append row " " lappend rowList $row } } elseif {[regexp {4|5} $fieldTypeNumber]} { # 4 or 5 set preservedValue $value ;# used in hidden type input only if [string equal {%@parentrepositories} $fieldName] { # used for review if {$fieldTypeNumber == 4} { # display the parent document link set value "$value" } if {$fieldTypeNumber == 5} { # display the parent document link and the parent reference link set metadataParentRep [Execute $serverAddressWithIP [list FindMetadataRep $value]] set value "$Document | $Reference" } } if {$update && [string equal {%@archivingpolicy} $fieldName]} { # Update archiving policy set archivingPolicy [Execute $serverAddressWithIP [list UpdateArchivingPolicy $rep $metadataRep administrator $codedPassword] 0] ;# archivingPolicy value is used to decide hiding or not the read permission field set value $archivingPolicy if [regexp {^<(.*)>$} $value m errorMessage] { puts
[join $errorMessage \n]
return } # Update archiving policy - end set preservedValue $value ;# used in hidden type input only set {archivingPolicyArray(allowpublisher allowfinaldraft)} { => publisher} set {archivingPolicyArray(denypublisher allowfinaldraft)} { => finaldraft or publisher} set {archivingPolicyArray(denypublisher* allowfinaldraft)} { => finaldraft or publisher} set {archivingPolicyArray(allowpublisher denyfinaldraft)} { => publisher} set {archivingPolicyArray(allowpublisher denyfinaldraft*)} { => publisher} set {archivingPolicyArray(denypublisher denyfinaldraft)} { => publisher or finaldraft} set {archivingPolicyArray(denypublisher* denyfinaldraft)} { => publisher} set {archivingPolicyArray(denypublisher denyfinaldraft*)} { => finaldraft or publisher} set {archivingPolicyArray(denypublisher* denyfinaldraft*)} { => publisher} regsub -all {\d+} $preservedValue {*} arrayEntry if [info exists archivingPolicyArray($arrayEntry)] { set value $value$archivingPolicyArray($arrayEntry) } } lappend rowList " ${cellFont}$translatedCustomizedFieldName ${cellFont}$translatedFootnoteReference  \;$value  " lappend hiddenInputList "" } } else { # Preserve value when the field doesn't appear in displayTable in displayControl.tcl # puts [list $fieldName = $value] if ![string equal {} $value] { # notes [CD-ROM] regsub -all {\[} $value {\\\\\\\\\\\\\[} value ;# added by GJFB in 2011-02-09 regsub -all {\]} $value {\\\\\\\\\\\\\]} value ;# added by GJFB in 2011-02-09 lappend hiddenInputList "" } # Preserve value when the field doesn't appear in displayTable in displayControl.tcl - end } } # FOREACH - end # Add Code field if $update { # update if {[info exists targetFile] && (([info exists targetFileExtension] && \ [regexp -nocase {tex} $targetFileExtension]) || \ [TestContentType $repName {^Tcl Page$|^Index$|^CGI Script$} $homePath])} { # .tex target file or Tcl Page, Index, CGI Script Load $homePath/col/$repName/doc/$targetFile codeValue lappend rowList " ${cellFont}\$Code ${cellFont}  " } } # Add Code field - end set fillOutFieldCode [join $fillOutFieldCode \n] ;# updated in CreateSelect # puts $requiredFieldList ;# => _A_author _T_title _B_journal _D_year _V_volume foreach requiredField $requiredFieldList { regsub {^_} $requiredField {%} field2 regsub {%_} $field2 {%@} field2 regsub -all {e_mail} $field2 {e-mail} field2 regsub {_} $field2 { } field2 set fieldName [lindex $field2 0] ;# %A set label [lindex $field2 1] ;# author regsub {e-mail} $label {e_mail} label2 # another advanced user if [string equal {%@documentstage} $fieldName] { lappend lineList "if (document.$submissionType.__documentstage_documentstage.value == \"another advanced user\" && document.$submissionType.anotheradvanceduser.value == \"\") {fieldNameList += document.$submissionType.documentstage.value + \"\\\\\\\\\\\\\\\\n\"; i++}" } # another advanced user - end # fieldTypeNumber set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] if {$fieldTypeNumber == 2.2} { # checkbox set i 0 set conditionList {} foreach xxx $boxTable($referenceType,$fieldName) { lappend conditionList "!(document.$submissionType.$requiredField\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\].checked)" incr i } AppendLineList [join $conditionList { && }] $label2 } elseif {$fieldTypeNumber == 2.3} { # radio set i 0 set conditionList {} foreach xxx $optionTable2($referenceType,$fieldName) { lappend conditionList "!(document.$submissionType.$requiredField\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\].checked)" incr i } AppendLineList [join $conditionList { && }] $label2 } else { regsub {abstract} $label2 {abstract2} label2 ;# abstract is a reserved word for Netscape if {[regexp {%A|%@group|%@affiliation|%@electronicmailaddress} $fieldName] && \ [regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && \ ([regexp {%A} $fieldName] || \ ([regexp {%@group} $fieldName] && [regexp {^2.1$|^3$} $fieldTypeNumber]) || \ ([regexp {%@affiliation} $fieldName] && [regexp {2.1} $fieldTypeNumber]) || \ ([regexp {%@electronicmailaddress} $fieldName] && [regexp {2.1} $fieldTypeNumber]))} { # multiple creator fields for {set i 1} {$i <= $numberOfCreatorFields} {incr i} { AppendLineList "document.$submissionType.$requiredField$i.value == \"\"" $label2 $i } } else { AppendLineList "document.$submissionType.$requiredField.value == \"\"" $label2 } } } # seconds lappend rowList "" # Add File Name field if [info exists cgi(filename)] { set fileName $cgi(filename) } else { set fileName {} } regsub -all {//} $fileName {\\} fileName ;# // -> \ # Store fileName C:/tmp/aaa binary 0 a # puts $cgi(attachment) if {[info exists cgi(templaterepository)] && \ [file isdirectory $homePath/col/$cgi(templaterepository)/doc] && \ [TestContentType $cgi(templaterepository) {Template} $homePath]} { # duplicate template set Object $Document set object ${a document} lappend hiddenInputList "" } else { # > if [string equal yes $cgi(attachment)] { # NAME=foldername if {[info exists displayTable($referenceType,foldername)] && \ [regexp {1} [lindex $displayTable($referenceType,foldername) 0]]} { # foreach {translatedCustomizedFieldNameForFolderName translatedFootnoteReferenceForGroup} [Translate %@group group $referenceType] {break} lappend rowList " ${cellFont}\${Folder Name} ${cellFont}[lindex $displayTable($referenceType,foldername) 1]  " } # NAME=userfile # set alternativeFieldNameForFileName [lindex $displayTable($referenceType,filename) 3] set alternativeFieldNameForFileName [lindex $displayTable($referenceType,filename) 3] if [info exists translationTable($alternativeFieldNameForFileName,$referenceType,filename)] { set alternativeFieldNameForFileName $translationTable($alternativeFieldNameForFileName,$referenceType,filename) } # Migration 5/2/06 if {[string compare {x} $alternativeFieldNameForFileName] == 0 || \ [string compare {} $alternativeFieldNameForFileName] == 0} { set alternativeFieldNameForFileName ${File Name} } # Migration 5/2/06 - end if [regexp {4|5} [lindex $displayTable($referenceType,filename) 0]] { lappend rowList " ${cellFont}$alternativeFieldNameForFileName ${cellFont}[lindex $displayTable($referenceType,filename) 1] <$repName>  " } else { set fillInstruction [subst [lindex $displayTable($referenceType,filename) 1]] ;# subst is to resolve: [expr $update?{}:{(*)}] (see administrator page script) if {[regexp "$requiredFieldSymbol" $fillInstruction] || \ ([info exists requiredFieldAtCloseSymbol] && \ [regexp "$requiredFieldAtCloseSymbol" $fillInstruction])} { # required field lappend rowList "" set fieldName filename ;# used in AppendLineList AppendLineList "document.$submissionType.userfile.value == \"\"" userfilefieldname } if 1 { # display check box for the File Name field if {![string equal {Electronic Source} $referenceType] && $update} { set chekBoxCode " " } else { set chekBoxCode {} } if $update { set onChange onChange="EnableDisableTargetFileCheckBox()" } else { set onChange {} } lappend rowList " ${cellFont}$alternativeFieldNameForFileName ${cellFont}[lindex $displayTable($referenceType,filename) 1] $chekBoxCode  " } else { # testing safari # with NAME=\"userfile\" safari doesn't work (the next hidden inputs are not sent to the server) lappend rowList " ${cellFont}$alternativeFieldNameForFileName ${cellFont}[lindex $displayTable($referenceType,filename) 1]  " } } if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)] && \ [info exists keywords] && [regexp {review} $keywords]} { set Object $Review set object ${a review} } else { set Object $Document set object ${a document} } } else { if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)] && \ [info exists keywords] && [regexp {review} $keywords]} { set Object $Review set object ${a review} } else { if [info exists depositOptionTable($referenceType)] { array set depositOptionArray $depositOptionTable($referenceType) } ConditionalSet copyAbstractToDoc depositOptionArray(copyabstracttodoc) 0 if $copyAbstractToDoc { set Object $Abstract set object ${an abstract} } else { set Object $Reference set object ${a reference} } } } # < } # Add File Name field - end # Migration 25/1/04 if {[info exists maximumSize] && [info exists fileSizeWarningArray($referenceType)]} { set fileSizeWarning $fileSizeWarningArray($referenceType) } else { set fileSizeWarning {} } # Migration 25/1/04 - end if $update { # update if {[string equal {all} $updateOption] && \ (![info exists userListWithPermissionToFinish($referenceType)] || \ [lsearch $userListWithPermissionToFinish($referenceType) $advancedUser] != -1)} { set finishOptionIndex [expr [llength $updateOptionList] - 1] set ifLine "if (document.update.updatetype\\\\\\\\\\\\\\\[$finishOptionIndex\\\\\\\\\\\\\\\].selected) {" ;# } testing the finish option set ifLine2 "if (false) {" ;# } don't ask } elseif {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)] && \ [regexp {review} $keywords]} { # is a review # set ifLine "if ((document.update.__documentstage_documentstage.value != document.update.username.value) && !(document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form # set ifLine2 "if ((document.update.__documentstage_documentstage.value == document.update.username.value) || (document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form set ifLine "if ((document.update.__documentstage_documentstage.value != \"not transfered\") && !(document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form set ifLine2 "if ((document.update.__documentstage_documentstage.value == \"not transfered\") || (document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form } else { set ifLine "if (false) {" ;# } don't ask set ifLine2 "if (false) {" ;# } don't ask } # action set action ${Please wait for the update completion.} } else { # submit # action set action ${Please wait for the submission completion.} } # Add username and password fields if $update { # update # insert username and password # NAME=username lappend rowList "" if [info exists cgi(session)] { lappend rowList "" ;# to maintain session } lappend rowList " ${cellFont}$conversionTable(username)  \;  \;$userName  " # NAME=password1 set additionalRowList {} set column2Value [lindex $displayTable($referenceType,password1) 1] lappend additionalRowList " [expr [string equal {empty} $env(DOMAIN_NAME)] || ![regexp {^([^<\s@]+)@([^@\s>]+)$} $userName]?{${cellFont}${Password}}:{${cellFont}${Password} - ${Have Forgotten it?}}] ${cellFont}$column2Value  " # an additional hidden input is needed because some browsers are not able to update the password field value with the coded password # (see ProcessKey JavaScript procedure) lappend additionalRowList "" lappend additionalRowList "" lappend lineList "if (document.update.password1.value == \"\") {fieldNameList += document.update.password1fieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}" if [string equal {add} $updateOption] { # add option set index [lindex [array names submissionDestinationTable $referenceType,*] 0] if ![string equal {} $index] { # a submission destination is defined (used when closing some ePrint environments) set helpExpression [Help Password2] regsub -all {"} $helpExpression {\\"} helpExpression # NAME=password2 lappend additionalRowList " ${cellFont}${Password} ${cellFont}$helpExpression  " lappend additionalRowList "" } } } else { # submit if {[info exists displayTable($referenceType,username)] && \ [lindex $displayTable($referenceType,username) 0] != 0} { # insert username and password # userName if [info exists cgi(username)] { set userName $cgi(username) } else { set userName {} } lappend rowList " ${cellFont}$conversionTable(username) ${cellFont}[lindex $displayTable($referenceType,username) 1]  " lappend rowList "" lappend lineList "if (document.submit.username.value == \"\") {fieldNameList += document.submit.usernamefieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}" lappend rowList " [expr [string equal {empty} $env(DOMAIN_NAME)] || !$restrictedSubmission?{${cellFont}${Password}}:{${cellFont}${Password} - ${Have Forgotten it?}}] ${cellFont}[lindex $displayTable($referenceType,password1) 1]  " # an additional hidden input is needed because some browsers are not able to update the password field value with the coded password # (see ProcessKey JavaScript procedure) lappend rowList "" lappend rowList "" lappend lineList "if (document.submit.password1.value == \"\") {fieldNameList += document.submit.password1fieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}" if {$restrictedSubmission || \ ([info exists submissionPolicyTable($referenceType)] && $submissionPolicyTable($referenceType) == 1)} { ## Migration 25/1/04 # set password2Warning {} ## Migration 25/1/04 - end } else { # lappend rowList "" # lappend lineList "if (document.submit.password2.value == \"\") {fieldNameList += document.submit.password2fieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}" lappend rowList " ${cellFont}${Password} ${cellFont}[lindex $displayTable($referenceType,password2) 1]  " lappend rowList "" ## Migration 25/1/04 # if ![info exists submissionPassword2WarningArray($referenceType)] { # set submissionPassword2WarningArray($referenceType) {} # } # set password2Warning [subst $submissionPassword2WarningArray($referenceType)] ## Migration 25/1/04 - end } # Migration 25/1/04 if [info exists submissionPasswordWarningArray($referenceType)] { set passwordWarning [subst $submissionPasswordWarningArray($referenceType)] } # Migration 25/1/04 - end set wrongPassword {} } else { # don't insert set passwordWarning {} ## Migration 25/1/04 # set password2Warning {} ## Migration 25/1/04 - end set wrongPassword {} if {[string compare {} [lindex $displayTable($referenceType,username) 2]] != 0} { lappend rowList "" } } } # Add username and password fields - end # Load htmlContent if $update { # update if [file exists ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}UpdateSubmission.html] { set filePath $submissionFormLanguageRep/doc/${submissionFormLanguage}UpdateSubmission.html } else { if [file exists ../$col/$languageRep1/doc/${language}UpdateSubmission.html] { set filePath $languageRep1/doc/${language}UpdateSubmission.html } else { set filePath $languageRep2/doc/${language}UpdateSubmission.html } } # puts $filePath Load ../$col/$filePath htmlContent if [info exists updatePasswordWarningArray($referenceType)] { set passwordWarning [subst $updatePasswordWarningArray($referenceType)] } ## Migration 25/1/04 # set password2Warning {} ## Migration 25/1/04 - end # displayControl.tcl after 31/1/04 doesn't use the variable below set requiredFileName {} # displayControl.tcl after 31/1/04 doesn't use the variable below - end set additionalRowList [join $additionalRowList \n] set additionalRowList2 {} foreach line [split $additionalRowList \n] { regsub -all {"} $line {\\\\\\\\"} line lappend additionalRowList2 \"$line\" } set additionalRowList [join $additionalRowList2 ,\n] # Used by JavaScript # if ![info exists cgi(wrongpassword)] {set cgi(wrongpassword) {no}} set cgi(wrongpassword) {no} # Used by JavaScript - end # requiredFieldSymbol set requiredFieldSymbol $requiredFieldFootnoteTable($referenceType) ;# e.g., (*) regsub -all {(\*|\+)} $requiredFieldSymbol {\\\1} requiredFieldSymbol ;# requiredFieldSymbol is used in regular expression if [regexp "$requiredFieldSymbol" [lindex $displayTable($referenceType,filename) 1]] { # required field - drop warning set fileNameWarning {} } } else { # submit if [file exists ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}Submit.html] { set filePath $submissionFormLanguageRep/doc/${submissionFormLanguage}Submit.html } else { if [file exists ../$col/$languageRep1/doc/${language}Submit.html] { set filePath $languageRep1/doc/${language}Submit.html } else { set filePath $languageRep2/doc/${language}Submit.html } } # puts $filePath Load ../$col/$filePath htmlContent # Migration 25/1/04 set fileNameWarningArray($referenceType) {} # Migration 25/1/04 - end # displayControl.tcl after 31/1/04 doesn't use the variable below set requiredFileName $requiredFieldFootnoteTable($referenceType) set requiredUserName $requiredFieldFootnoteTable($referenceType) # displayControl.tcl after 31/1/04 doesn't use the variable below - end set fileNameWarning {} } # Load htmlContent - end # Site warning if [info exists cgi(showformsite)] { # cgi(showformsite) value may be anything global "${languageRep2}::to the site <\$localSite>" set siteWarning "\${to the site <\$localSite>}" } else { Load ../$col/$currentRep/doc/@siteList.txt fileContent set fileContent [string trim $fileContent " \n"] regsub -all "\n+" $fileContent "\n" fileContent set siteList [split $fileContent \n] set numberOfSites2 [llength $siteList] if {$numberOfSites2 == 0} { set siteWarning "" } else { global "${languageRep2}::to the site <\$localSite>" set siteWarning "\${to the site <\$localSite>}" } } # Site warning - end # Additional instructions # set in xxFillingInstructions.tcl ConditionalSet additionalInstructions additionalInstructionsArray($referenceType) {} # Additional instructions - end # ifListCreation set ifListCreation [join $lineList \n] # ifElectronicMailAddressListCreation set ifElectronicMailAddressListCreation [join $electronicMailAddressLineList \n] # displayControl.tcl after 31/1/04 doesn't use the variable below set requiredPassword $requiredFieldFootnoteTable($referenceType) # displayControl.tcl after 31/1/04 doesn't use the variable below - end if ![info exists copyrightArray($referenceType)] {set copyrightArray($referenceType) {}} ConditionalSet submissionPeriod submissionPeriodArray($referenceType) {} if ![info exists submitHeaderArray($referenceType)] {set submitHeaderArray($referenceType) {}} if ![info exists submitFooterArray($referenceType)] {set submitFooterArray($referenceType) {}} # if [info exists documentStage] { # lappend hiddenInputList "" # } set hiddenInput [join $hiddenInputList \n] set rowList [join $rowList \n] # puts $rowList # regsub -all {\\} $rowList {\\\\\\\\} rowList ;# \ -> \\ # puts $htmlContent set htmlContent [ProcessBrackets $htmlContent] if [string equal {yes} $cgi(frameinuse)] { set popupWarning ${popup warning} } else { set popupWarning {} } # catch {subst [subst $htmlContent]} output # catch {subst [subst [subst $htmlContent]]} output # catch {SetFont [subst [subst [subst [subst $htmlContent]]]]} output # set output $htmlContent # set output [subst $htmlContent] # set output [subst [subst $htmlContent]] # set output [subst [subst [subst $htmlContent]]] # set output [subst [subst [subst [subst $htmlContent]]]] if 1 { set output [SetFont [subst [subst [subst [subst $htmlContent]]]]] set output [UnProcessBrackets $output] } # puts [array get cgi] # puts [pwd] } ^FillingInstructions$ { # cgi inputs used by FillingInstructions # repository (used by instructions/xxUpdateInstructions.html) # foreach {language languageRep2} [FindLanguageForSubmissionForm $language $submissionFormLanguage $firstLanguageRep $languageRep2] {break} source ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}Submit.tcl global "${languageRep2}::headerWarning" global "${languageRep2}::zipFileWarning" global "${languageRep2}::fileNameWarning" # referenceType ConditionalSet referenceType cgi(referencetype) {Misc} # instructionType set instructionType $cgi(instructiontype) # advancedUser ConditionalSet advancedUser cgi(advanceduser) {} ;# advanceduser is used only with the instructions for choosing the update type # repPath if {![string equal $languageRep1 $submissionFormLanguageRep] && \ [file exists ../$col/$submissionFormLanguageRep/doc/instructions/$language${instructionType}Instructions.html]} { # puts {use the submission form language repository} set repPath ../$col/$submissionFormLanguageRep } elseif [file exists ../$col/$languageRep1/doc/instructions/$language${instructionType}Instructions.html] { # puts {use the default or customized (if any) language repository} set repPath ../$col/$languageRep1 } else { # puts {use the default language repository} set repPath ../$col/$languageRep2 } if [info exists repPath] { set filePath $repPath/doc/instructions/$language${instructionType}Instructions.html # puts $filePath # puts [file exists $filePath] Load $filePath fileContent if ![string equal {Search} $instructionType] { # Source displayControl.tcl set enableOutput 0 eval $sourceDisplayControl # Source displayControl.tc - end # maximumFileSize set maximumFileSize $maximumFileSizeTable($referenceType) # contentTypeList set contentTypeList [join $contentTypeTable($referenceType)
] if ![regexp {application/x-zip-compressed|application/zip} $contentTypeTable($referenceType)] { # drop the zip file warning set zipFileWarning {} } if ![string equal {Electronic Source} $referenceType] { # not an ePrint # drop the header warning (saying: The submitted file must have the center part of the header empty.) set headerWarning {} } } # SUBST # fieldName # targetFile if [string equal {Update} $instructionType] { LoadService $cgi(repository) targetFile targetFile 0 1 ;# 0 is for uncrypted - 1 is for level 1 } ConditionalSet fieldName cgi(fieldname) {} set output [subst $fileContent] } else { set output {there are no instructions} } } ^NewPassword$ { source ../$col/$languageRep2/doc/mirror/${language}Register.tcl ;# needed for Cancel global "${languageRep2}::Cancel" global "${languageRep2}::site" if [file exists ../$col/$languageRep1/doc/${language}NewPassword.html] { set languageRep $languageRep1 } else { set languageRep $languageRep2 } # Source displayControl.tcl set enableOutput 0 eval $sourceDisplayControl # Source displayControl.tc - end if [info exists archiveAcronym] { set archiveName $archiveAcronym } else { set archiveName "$site $localSite" } if [info exists conferenceAcronym] { set archiveName $conferenceAcronym } if {[info exists cgi(returnbutton)] && [string equal {yes} $cgi(returnbutton)]} { set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel] } else { set returnButton [CreateReturnButton
../$col/$languageRep2/doc/mirror About {} $Cancel] } # repSite if 0 { # not used if [catch {FindSite2 iconet.com.br/banon/2009/05.17.20.29} siteRep] { puts $siteRep global errorInfo; puts $errorInfo } foreach repServerAddress $siteRep {break} set repSite [ReturnHTTPHost $repServerAddress] } if 0 { # for a test in banon-pc3 set repSite banon-pc3 } else { set repSite urlib.net } ConditionalSet targetFrame cgi(targetframe) {} Load ../$col/$languageRep/doc/${language}NewPassword.html body set output [subst $body] } ^About$ { set path $homePath/col/$mirrorHomePageRep/doc/${language}About.html set alternatePath [CreateAlternatePath $path 1] set timePeriod [TestForTclPageUpdate $path $alternatePath] ConditionalSet forceAboutUpdating cgi(forceaboutupdating) 0 ;# default is 0 if {$timePeriod || $forceAboutUpdating} { # global numberOfItems global numberOfReferencesList ;# used in MultipleSubmit global "${languageRep2}:: was distributed over \$numberOfActiveSites within a total of \$numberOfSites2 collections and it " global "${languageRep2}::
Last Version: <\$lastVersion>." global "${languageRep2}:: Download it." global "${languageRep2}::welcome1" global "${languageRep2}::welcome2" global "${languageRep2}::You also can access all the full texts of the current local collection through the URLib Local Collection Index." # package require http ;# needed here as well # set urlibServerAddress [Execute $serverAddressWithIP GetURLibServerAddress] ;# 150.163.x.xx:80 set urlibServerAddress [GetURLibServerAddress] ;# 150.163.x.xx:80 foreach {urlibServerName urlibPort} [ReturnCommunicationAddress $urlibServerAddress] {break} if {"$env(IP_ADDR) $env(URLIB_PORT)" == "$urlibServerName $urlibPort"} { # Main Site set welcome $welcome2 } else { set welcome $welcome1 } # numberOfReferencesList # set query {list GetNumberOfItems} set query {list GetNumberOfReferences} # MULTIPLE SUBMIT set numberOfReferencesList {} if 0 { # testing update this page without GetNumberOfReferences set numberOfSatisfiedQueries 0 set listOfSites 0 set listOfActiveSites 0 set numberOfSites 0 } else { MultipleSubmit {} $query numberOfReferencesList 0 } # one or more elements in numberOfReferencesList might contain an error message # through listOfInactiveSites one can identify the sites that have produced # the error messages puts --$numberOfReferencesList-- # siteList - used by ReturnSiteInformation in xxAbout.html set numberOfReferencesList2 {} set siteList {} foreach siteResult $numberOfReferencesList { if [string equal {0 0} $siteResult] {continue} ;# see GetNumberOfReferences lappend numberOfReferencesList2 $siteResult lappend siteList [lindex $siteResult 0] } # puts $siteList # siteInformationList set siteInformationList [join $numberOfReferencesList2] # puts $siteInformationList array set siteInformationArray $siteInformationList # puts [array names siteInformationArray] set numberOfItemsList {} foreach site [array names siteInformationArray] { # $siteInformationArray($site) # numberofreferences 300 numberofvisiblereferences 270 numberofvisiblereferenceswithfulltext 150 # puts [list $site --$siteInformationArray($site)--] array set informationArray $siteInformationArray($site) lappend numberOfItemsList [list $informationArray(numberofvisiblereferences) $informationArray(numberofvisiblereferenceswithfulltext)] } set numberOfItemsList [join $numberOfItemsList] set numberOfActiveSites $numberOfSatisfiedQueries set listOfInactiveSites {} foreach item $listOfSites { if {[lsearch $listOfActiveSites $item] == -1} { lappend listOfInactiveSites $item } } # nOR and nOFT set nOR 0 set nOFT 0 foreach {numberOfVisibleReferences numberofvisiblereferenceswithfulltext} $numberOfItemsList { set nOR [expr $nOR + $numberOfVisibleReferences] set nOFT [expr $nOFT + $numberofvisiblereferenceswithfulltext] } # loBiMiRep set loBiMiRep $env(LOBIMIREP) ;# needed with MultipleExecute # MULTIPLE SUBMIT set command [list list GetSiteInformation] # GETSITEINFORMATION set siteInformationList [MultipleExecute {} $command] set siteInformationList [join $siteInformationList] # puts $siteInformationList ;# may contain an error message (when time-out for GetSiteInformation is large) array set siteInformationArray2 $siteInformationList foreach site [array names siteInformationArray] { if [info exists siteInformationArray2($site)] { set siteInformationArray($site) [concat $siteInformationArray($site) $siteInformationArray2($site)] } } set siteInformationList [array get siteInformationArray] ;# used by ReturnSiteInformation in xxAbout.html # puts --$siteInformationList-- # URLibReferenceRep set URLibReferenceRep iconet.com.br/banon/2001/02.10.22.55 if {$numberOfSites == 1} { set siteWarning " " } else { set siteWarning "\${ was distributed over \$numberOfActiveSites within a total of \$numberOfSites2 collections and it }" } if 0 { if {"$env(IP_ADDR) $env(URLIB_PORT)" == "$urlibServerName $urlibPort"} { # Main site set lastVersionWarning "" set downloadWarning "" } else { # lastVersion set query {list GetURLibServiceLastVersion} # MULTIPLE SUBMIT set lastVersion {} # MultipleSubmit {} $query lastVersion 0 [list $urlibServerAddress2] MultipleSubmit {} $query lastVersion 1 [list $urlibServerAddress2] if [string equal {} $lastVersion] { set lastVersionWarning "" } else { set lastVersionWarning "\${
Last Version: <\$lastVersion>.}" } if [string equal $env(SERVICE_VERSION) $lastVersion] { set downloadWarning "" } else { set downloadWarning "\${ Download it.}" } } } else { set lastVersionWarning "" set downloadWarning "" } # Get number of visits # set numberOfVisits [Execute $serverAddressWithIP [list GetNumberOfVisits $env(LOBIMIREP)]] set numberOfVisits [Execute $serverAddressWithIP [list GetNumberOfVisits $currentRep]] # Get number of visits - end # Link to index1.html if [file exists ../$col/$env(LOCOINREP)/doc/index1.html] { set indexHTML "\${You also can access all the full texts of the current local collection through the URLib Local Collection Index.}" } else { set indexHTML "" } # Link to index1.html - end # translationTable source ../$col/$languageRep2/doc/mirror/${language}ReferenceTypeName.tcl ;# set translationTable # global referencetype::translationTable if [file exists ../$col/$languageRep1/doc/${language}About.html] { Load ../$col/$languageRep1/doc/${language}About.html body } else { Load ../$col/$languageRep2/doc/${language}About.html body } set body [ProcessBrackets $body] set numberOfSites2 $numberOfSites ;# numberOfSites is recomputed during a substitution below (executing ReturnTitleList) # puts $body # puts $currentRep # catch {subst $body} output set output [subst $body] set output [UnProcessBrackets $output] set output [ProcessBrackets $output] set output [SetFont [subst [subst $output]]] set output [UnProcessBrackets $output] set dirName [file dirname $alternatePath] file mkdir $dirName ;# create the auxdoc directory in the mirrorHomePage.html repository Store output $alternatePath } else { Load $alternatePath output } } .+ { if [file exists ../$col/$languageRep1/doc/${language}$frameName.html] { Load ../$col/$languageRep1/doc/${language}$frameName.html fileContent set fileContent2 [ProcessBrackets $fileContent] if [catch {subst $fileContent2} fileContent] { return -code error "CreateMirror: $fileContent " } else { set output [UnProcessBrackets $fileContent] } } else { return -code error "CreateMirror: file $homePath/col/$languageRep1/doc/${language}$frameName.html doesn't exist" } } default { # empty frameName # puts OK if $usePHP { puts "Location: http://$localSite/col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile" puts {} return } # targetFrame set targetFrame _top if [info exists env(QUERY_STRING)] { regexp {targetframe=([^&]*)} $env(QUERY_STRING) m targetFrame } # Capture URL (same code in createpage.tcl) set q_u_e_r_y {} if {[info exists env(QUERY_STRING)] && [string compare {} $env(QUERY_STRING)] != 0} { # GET style lappend q_u_e_r_y $env(QUERY_STRING) } if [info exists env(CONTENT_LENGTH)] { # POST style lappend q_u_e_r_y [string trim [read stdin $env(CONTENT_LENGTH)] \n] } set q_u_e_r_y [join $q_u_e_r_y &] foreach {name value} [split $q_u_e_r_y &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } # Capture URL - end set serverAddress $localSite ;# old usage of serverAddress # Load ../$col/$mirrorHomePageRep/service/targetFile mirrorHomePageTargetFile # puts ../$col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile Load ../$col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile mirrorPage source ../$col/$languageRep2/doc/mirror/${language}Home.tcl global "${languageRep2}::Bibliographic Mirror at <\;\$serverAddress>\;" set thisRepository $mirrorHomePageRep set urlibServerAddress [GetURLibServerAddress] ;# 150.163.x.xx:80 foreach {urlibServerName urlibPort} [ReturnCommunicationAddress $urlibServerAddress] {break} ;# used in mirrorPage # set output [subst $mirrorPage] set output [subst [subst $mirrorPage]] } } puts $output # < } m] {puts $m; if 0 {global errorInfo; puts $errorInfo}} } # CreateMirror - end # ---------------------------------------------------------------------- # CreateSelect # used with Register and Submit # example of fieldName: %A # example of field: _A_author # creatorNumber is empty or is 1, 2, 3 ... proc CreateSelect {fieldName field value varName {creatorNumber {}}} { global cgi # upvar translationTable translationTable upvar referenceType referenceType upvar optionTable optionTable upvar optionTable2 optionTable2 upvar defaultOptionTable defaultOptionTable upvar $varName row upvar userName userName upvar fillOutFieldCode fillOutFieldCode ;# used in submit.html upvar fieldList fieldList ;# {%A author} {%T title} upvar fillOutFieldTable fillOutFieldTable ;# set in displayControl.tcl upvar actionTable actionTable ;# set in displayControl.tcl upvar submissionType submissionType upvar referenceType3 referenceType3 upvar language language upvar http http # Create fillOutFieldCode # for function FillOutField(fieldName, optionNumber, creatorNumber) if [info exists actionTable($referenceType,$fieldName)] { # Dynamic action lappend fillOutFieldCode " if (fieldName == \"$fieldName\") \{" set i 0 lappend fillOutFieldCode " itemsAction = new Array([llength $actionTable($referenceType,$fieldName)])" foreach item $actionTable($referenceType,$fieldName) { lappend fillOutFieldCode " itemsAction\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\] = \"$http://[lindex [lindex $item 1] 0]/col/[lindex [lindex $item 1] 1]/doc/submit.cgi\"" incr i } lappend fillOutFieldCode " document.$submissionType.action = itemsAction\\\\\\\\\\\\\\\[optionNumber\\\\\\\\\\\\\\\] + '?%0+referencetype=\{$referenceType3\}&languagebutton=$language&returnbutton=$cgi(returnbutton)&targetframe=$cgi(targetframe)&attachment=$cgi(attachment)'" lappend fillOutFieldCode " \}" # Dynamic action - end } set fillOutFieldCode2 {} foreach name [array names fillOutFieldTable $referenceType,$fieldName,*] { regsub "^$referenceType,$fieldName," $name {} destinationFieldName ;# %@affiliation if {[set i [lsearch -regexp $fieldList ^$destinationFieldName]] != -1} { set destinationField [lindex $fieldList $i] regsub -all {%|@| |-} $destinationField {_} destinationField ;# for JavaScript compatibility - __group_group if [regexp {^$|^1$} $creatorNumber] { lappend fillOutFieldCode2 " items$destinationField = new Array([expr [llength $fillOutFieldTable($name)] / 2])" set i 0 foreach {x y} $fillOutFieldTable($name) { lappend fillOutFieldCode2 " items$destinationField\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\] = \"$y\"" incr i } } lappend fillOutFieldCode2 " if (creatorNumber == \"$creatorNumber\") \{" lappend fillOutFieldCode2 " document.$submissionType.$destinationField$creatorNumber.value = items$destinationField\\\\\\\\\\\\\\\[optionNumber\\\\\\\\\\\\\\\]" lappend fillOutFieldCode2 " \}" } } if {[string compare {} $fillOutFieldCode2] != 0} { lappend fillOutFieldCode "if (fieldName == \"$fieldName\") \{" set fillOutFieldCode [concat $fillOutFieldCode $fillOutFieldCode2] lappend fillOutFieldCode " \}" } # Create fillOutFieldCode - end append row " } # CreateSelect - end # ---------------------------------------------------------------------- # CreateOptionForSelect proc CreateOptionForSelect {fieldName fieldValue optionName optionValue} { upvar row row upvar 2 translationTable translationTable upvar 2 referenceType referenceType if [info exists translationTable($optionName,$referenceType,$fieldName)] { set translatedOption $translationTable($optionName,$referenceType,$fieldName) } else { # don't translate set translatedOption $optionName } # puts [list $fieldValue $optionValue] # if [string equal $fieldValue $optionValue] # ;# not used because we may have fieldValue == DPI (or DPI-OBT-INPE-BR) and optionValue == DPI-OBT-INPE-MCT-BR # 2008-01: later on, one should return to use the above if instead of the one below regexp {[^-]*} $fieldValue fieldValue2 if {([string equal {%@group} $fieldName] && ![string equal {} $fieldValue] && [regexp ^$fieldValue2 $optionValue]) || \ (![string equal {%@group} $fieldName] && [string equal $fieldValue $optionValue])} { # append row "" } else { append row "" } } # CreateOptionForSelect - end # ---------------------------------------------------------------------- # CreateCheckBox # used with Register and Submit # example of fieldName: %A # example of field: _A_author proc CreateCheckBox {fieldName field value varName} { upvar referenceType referenceType upvar boxTable boxTable upvar $varName row upvar userName userName set boxValues $boxTable($referenceType,$fieldName) if {[llength [lindex [lindex $boxValues 0] 1]] <= 1} { # without subitem foreach box $boxValues { if [string equal {} [lindex $box 0]] {continue} CreateBoxForCheckBox $fieldName $value $field $box ;# appends row } } else { # with subitems (the first item has at least two subitems) foreach box $boxValues { append row [lindex $box 0]
foreach box2 [lindex $box 1] { CreateBoxForCheckBox $fieldName $value $field $box2 ;# appends row } append row
} } } # CreateCheckBox - end # ---------------------------------------------------------------------- # CreateBoxForCheckBox proc CreateBoxForCheckBox {fieldName fieldValue field box} { upvar row row upvar 2 translationTable translationTable upvar 2 referenceType referenceType upvar 2 update update set name [lindex $box 0] if [info exists translationTable($name,$referenceType,$fieldName)] { set translatedName $translationTable($name,$referenceType,$fieldName) } else { # don't translate set translatedName $name } set checked {} if [string equal {} $fieldValue] { if {(![info exists update] || !$update) && [lindex $box 1]} {set checked CHECKED} ;# use default value at submit only } else { # puts [list $fieldValue $name] if {[lsearch $fieldValue $name] != -1} {set checked CHECKED} } # append row "   \;$translatedName
" append row " \;$translatedName
" } # CreateBoxForCheckBox - end # ---------------------------------------------------------------------- # AppendLineList proc AppendLineList {condition label2 {i {}}} { upvar requiredFieldSymbol requiredFieldSymbol upvar displayTable displayTable upvar referenceType referenceType upvar fieldName fieldName upvar conditionList conditionList upvar lineList lineList upvar optionTable2 optionTable2 upvar submissionType submissionType upvar update update ;# used in subst (see fillInstruction) upvar updateOption updateOption ;# used in subst (see fillInstruction) set fillInstruction [lindex $displayTable($referenceType,$fieldName) 1] regsub {\[Help .*\]} $fillInstruction {} fillInstruction set fillInstruction [subst $fillInstruction] ;# subst is to resolve: [expr $update?{}:{(*)}] (see administrator page script) if [regexp "$requiredFieldSymbol" $fillInstruction] { lappend lineList "if ($condition) {fieldNameList += document.$submissionType.$label2$i.value + \"\\\\\\\\\\\\\\\\n\"; i++}" } else { if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)]} { lappend lineList "if (document.$submissionType.__documentstage_documentstage.value == \"Closed Review\" && $condition) {fieldNameList += document.$submissionType.$label2.value + \"\\\\\\\\\\\\\\\\n\"; i++}" } } } # AppendLineList - end # ---------------------------------------------------------------------- # CompareFieldName proc CompareFieldName {a b} { global orderingFieldArray set a1 [lindex $a 0] ;# %A set b1 [lindex $b 0] if {[info exists orderingFieldArray($a1)] && \ [info exists orderingFieldArray($b1)]} { set a2 $orderingFieldArray($a1) set b2 $orderingFieldArray($b1) return [expr $a2<=$b2?-1:1] } elseif {[info exists orderingFieldArray($a1)] && \ ![info exists orderingFieldArray($b1)]} { return -1 } elseif {![info exists orderingFieldArray($a1)] && \ [info exists orderingFieldArray($b1)]} { return 1 } else { return 0 } } # CompareFieldName - end # ---------------------------------------------------------------------- # FindFieldValue # example: # FindFieldValue {__group_group} %@group group $referenceType $update proc FindFieldValue {field fieldName label referenceType update} { global cgi global multipleLineReferFieldNamePattern global multipleLineReferFieldNamePatternForCreator upvar displayTable displayTable upvar localMetadataArray localMetadataArray upvar reviewArray reviewArray upvar metadataRep metadataRep upvar repName repName upvar sourceFieldNameArray sourceFieldNameArray if [info exists cgi(sourcereferencetype)] { if [info exists sourceFieldNameArray($fieldName)] { set label2 $sourceFieldNameArray($fieldName) } else { set label2 {} } } else { set label2 $label } # fieldTypeNumber if [info exists displayTable($referenceType,$fieldName)] { set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] } if [info exists cgi($field)] { if {[regexp {%A|%@group|%@affiliation|%@electronicmailaddress} $fieldName] && \ [info exists displayTable($referenceType,$fieldName)] && \ [regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && \ ([regexp {%A} $fieldName] || \ ([regexp {%@group} $fieldName] && [regexp {^2.1$|^3$} $fieldTypeNumber]) || \ ([regexp {%@affiliation} $fieldName] && [regexp {2.1} $fieldTypeNumber]) || \ ([regexp {%@electronicmailaddress} $fieldName] && [regexp {2.1} $fieldTypeNumber]))} { # multiple creator fields # change into a list if {[info exists cgi(passworderror)] && $cgi(passworderror)} { regsub -all {\s\n} $cgi($field) "\n" value ;# drop extra blank lines (needed when returning after a wrong password) } else { set value $cgi($field) } set value [split $value \n] if ![llength $value] {set value {{}}} ;# to avoid zero creator field # puts --$value-- } else { set value $cgi($field) # regsub -all {"} $value {\"} value ;# " -> " - " leads to problem in INPUT VALUE } # Store value C:/tmp/aaa binary 0 a # puts $field--$value-- # regsub -all "\n" $value {} value ;# preserve lines ! (otherwise we get double lines) - doesn't work with multiple creator fields regsub -all {\s\n} $value "\n" value ;# TEXTAREA adds one blank line between each line } elseif {$update && [info exists localMetadataArray($metadataRep-0,$label2)]} { set value $localMetadataArray($metadataRep-0,$label2) # if [regexp {^%A|^%E|^%Y|^%\?|^%@group|^%@affiliation|^%@electronicmailaddress} $fieldName] if [regexp $multipleLineReferFieldNamePattern $fieldName] { # multiple line fields # if [regexp {^%@group|^%@affiliation|^%@electronicmailaddress} $fieldName] # if ![regexp $multipleLineReferFieldNamePatternForCreator $fieldName] { set value [MultipleRegsub {,*$} $value {}] ;# drop trailing commas } else { set value [MultipleRegsub {(,.+),$|^([^ ]+),$} $value {\1\2}] ;# drop trailing comma } if {[regexp {%A|%@group|%@affiliation|%@electronicmailaddress} $fieldName] && \ [info exists displayTable($referenceType,$fieldName)] && \ [regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && \ ([regexp {%A} $fieldName] || \ ([regexp {%@group} $fieldName] && [regexp {^2.1$|^3$} $fieldTypeNumber]) || \ ([regexp {%@affiliation} $fieldName] && [regexp {2.1} $fieldTypeNumber]) || \ ([regexp {%@electronicmailaddress} $fieldName] && [regexp {2.1} $fieldTypeNumber]))} { # multiple creator fields # leave as a list } else { set value [join $value \n] } } else { # puts $value ## set value [join $value] ;# doesn't work - lost quotes (") # regsub -all {"} $value {\"} value ;# " -> " - " leads to problem in INPUT VALUE # puts $value } # if [regexp {^%T} $fieldName] { ## hide $ in title, ex: cr$30 # regsub -all {\$} $value {\\\\\\\$} value ;# cr$30 -> cr\$30 # } } elseif {$update && [info exists reviewArray($repName,$fieldName)]} { set value $reviewArray($repName,$fieldName) } else { if {[regexp {%A|%@group|%@affiliation|%@electronicmailaddress} $fieldName] && \ [info exists displayTable($referenceType,$fieldName)] && \ [regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && \ ([regexp {%A} $fieldName] || \ ([regexp {%@group} $fieldName] && [regexp {^2.1$|^3$} $fieldTypeNumber]) || \ ([regexp {%@affiliation} $fieldName] && [regexp {2.1} $fieldTypeNumber]) || \ ([regexp {%@electronicmailaddress} $fieldName] && [regexp {2.1} $fieldTypeNumber]))} { # multiple creator fields set value {{}} } else { set value {} } } # puts --$value-- regsub -all {"} $value {\"} value ;# " -> " - " leads to problem in INPUT VALUE # regsub -all {\$} $value {\\\\\\$} value ;# $ -> \\\\\\$ ($w$-operator) # puts $referenceType,$fieldName # puts [info exists displayTable($referenceType,$fieldName)] if [info exists displayTable($referenceType,$fieldName)] { # Process check box type entry if {$fieldTypeNumber == 2.2} { # 2.2 # checkbox set value [TurnIntoList $value] } # Process check box type entry - end # puts "$field = $value" if [string equal {} $value] { # set default value (from displayTable) set value [lindex $displayTable($referenceType,$fieldName) 2] # puts "$field = $value" } else { # puts 1-$value ## use fifteen \ before square brackets (1 + 2 + 4 + 8 = 15 (there are four substitutions) ## in regsub we must double the number of \, that is we need thirty \. # regsub -all {\[} $value {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[} value # regsub -all {\]} $value {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\]} value # use three \ before square brackets (1 + 2 = 3 (there are two substitutions) # in regsub we must double the number of \, that is we need six \. # regsub -all {\[} $value {\\\\\\[} value ;# removed by GJFB in 2010-11-26 - doesn't work when using square bracket in the abstract field (e.g., [1]) # regsub -all {\]} $value {\\\\\\]} value ;# removed by GJFB in 2010-11-26 - doesn't work when using square bracket in the abstract field (e.g., [1]) # puts 2-$value } if [string equal {readpermission} $label] { set value [ReturnAllowedIPList $value] } } # puts --$value--
return $value } # FindFieldValue - end # ---------------------------------------------------------------------- # Translate proc Translate {fieldName label referenceType} { upvar displayTable displayTable upvar conversionTable conversionTable upvar translationTable translationTable upvar update update ;# used in subst (see fieldTypeNumber) # translatedCustomizedFieldName set customizedFieldName [lindex $displayTable($referenceType,$fieldName) 3] set translatedCustomizedFieldName {} ;# could be anything # fieldTypeNumber set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] if {[string compare {} $customizedFieldName] == 0} { if {$fieldTypeNumber != 0} { set translatedCustomizedFieldName $conversionTable($label) } } else { if [info exists translationTable($customizedFieldName,$referenceType,$fieldName)] { set translatedCustomizedFieldName $translationTable($customizedFieldName,$referenceType,$fieldName) } else { # don't translate set translatedCustomizedFieldName $customizedFieldName } } # translatedFootnoteReference set footnoteReference [lindex $displayTable($referenceType,$fieldName) 1] set translatedFootnoteReference {} ;# could be anything if [info exists translationTable($footnoteReference,$referenceType,$fieldName)] { set translatedFootnoteReference $translationTable($footnoteReference,$referenceType,$fieldName) } else { # don't translate set translatedFootnoteReference $footnoteReference } if {[string compare {} $translatedFootnoteReference] == 0} {set translatedFootnoteReference  \;} ;# empty cell for netscape return [list $translatedCustomizedFieldName $translatedFootnoteReference] } # Translate - end # ---------------------------------------------------------------------- # CreateOrdinalNumber proc CreateOrdinalNumber {language number} { switch $language { en { switch $number { 1 {return {1st}} 2 {return {2nd}} 3 {return {3rd}} default {return "$numberth"} } } pt-BR {return "$number°"} default {return $number} } } # CreateOrdinalNumber - end # ----------------------------------------------------------------------