# Copyright for the Uniform Repository Service (c) 1995 - 2019, # by Gerald Banon. All rights reserved. # Version 2.1 # processreview.tcl # this script is the main part of the review system # to run this script enter the following web address in your browser: if 0 { # incomplete URL http://banon-pc2.dpi.inpe.br/col/iconet.com.br/banon/2007/01.10.09.37/doc/processreview.cgi # assign http://banon-pc2.dpi.inpe.br/col/iconet.com.br/banon/2007/01.10.09.37/doc/processreview.cgi/hyperspectral?reviewrepository=iconet.com.br/banon/2006/09.17.17.49 # select http://banon-pc2.dpi.inpe.br/col/iconet.com.br/banon/2007/01.10.09.37/doc/processreview.cgi/hyperspectral?reviewrepository=iconet.com.br/banon/2006/09.17.17.49&typeofwork=Artigos # http://banon-pc2.dpi.inpe.br/processreview.cgi/iconet.com.br/banon/2006/09.17.17.49?mirror=iconet.com.br/banon/2007/01.10.09.37&theme=all&languagebutton=en&typeofwork=all } if 0 { # to register o reviewer and to begin a review http://banon-pc.dpi.inpe.br:1905/col/iconet.com.br/banon/2004/06.12.14.52/doc/mirror.cgi } # ---------------------------------------------------------------------- # ProcessReview proc ProcessReview {} { if [catch { set currentProcedureName ProcessReview global env global col global cgi ;# used by FindLanguage global homePath ;# used by SynchronizeRepository (sourceDisplayControl), LoadService, FindLanguage and FindCurrentHTMLFileName global language languageRep1 languageRep2 ;# used by FindCurrentHTMLFileName global submissionFormLanguage submissionFormLanguageRep ;# used by Help and FindCurrentHTMLFileName global multipleLineReferFieldNamePattern ;# used by GetReferField and PutReferField global serverAddress ;# used by SetFieldValue global localSite ;# used by Help global serverAddressWithIP ;# used by SynchronizeRepository (sourceDisplayControl) global loCoInRep ;# used by SynchronizeRepository (sourceDisplayControl) global loBiMiRep ;# used while executing SynchronizeRepository (sourceDisplayControl) global URLibServiceRepository ;# used while executing SynchronizeRepository (sourceDisplayControl) upvar 0 currentRep mirrorRep ;# alias if 0 { puts {Content-Type: text/html} puts {} } set col ../../../../.. # URLibServiceRepository set URLibServiceRepository $env(URLIB_SERVICE_REP) set multipleLineReferFieldNamePattern $env(MULI_PATTERN) source ../$col/$URLibServiceRepository/doc/utilities1.tcl source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl # homePath set homePath $env(DOCUMENT_ROOT) # serverAddress set serverAddress [list $env(SERVER_NAME) $env(URLIB_PORT)] ;# used in SetFieldValue # serverAddressWithIP set serverAddressWithIP [list $env(IP_ADDR) $env(URLIB_PORT)] ;# used in this pocedure and in CheckUsernamePasswordForm # serverAddress2 regsub { +} $serverAddressWithIP {+} serverAddress2 # localSite set localSite $env(SERVER_NAME):$env(SERVER_PORT) ;# $env(HTTP_HOST) not used because can be shorter like sputnik:1909 # loCoInRep set loCoInRep $env(LOCOINREP) # loBiMiRep set loBiMiRep $env(LOBIMIREP) # mirrorHomePageRepository # used in sourceDisplayControl set mirrorHomePageRepository dpi.inpe.br/banon/2000/01.23.20.24 if {[info exists env(QUERY_STRING)] && [string compare {} $env(QUERY_STRING)] != 0} { # GET style set query $env(QUERY_STRING) foreach {name value} [split $query &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } elseif [info exists env(CONTENT_LENGTH)] { # POST style # set query [string trim [read stdin $env(CONTENT_LENGTH)] \n] } else { set query {} } # Create cgi array # usefull to recover the filled fields after a submit error CreateCGIArray # Create cgi array - end # puts [array get cgi] if 1 { set pathInfo [file split $env(PATH_INFO)] # currentRep (local mirror repository - contains @siteList.txt) regsub -all { } [lrange $pathInfo 1 4] {/} currentRep } else { if ![info exists cgi(requiredmirror)] { puts {no mirror repository defined} puts

puts " The query string part of the URL must contain a field named 'requiredmirror'." return } else { # currentRep set currentRep $cgi(requiredmirror) } set pathInfo [file split $env(PATH_INFO)] # currentRep (local mirror repository - contains @siteList.txt) regsub -all { } [lrange $pathInfo 1 4] {/} reviewRepository } # Find the language and the language repository # needed for sourcing $submissionFormRep/doc/displayControl.tcl # needed for the button images foreach {language languageRep1 languageRep2 firstLanguageRep \ submissionFormRep submissionFormLanguage submissionFormLanguageRep} \ [FindLanguage $mirrorRep] {break} # Find the language and the language repository - end # foreach {bgColor background bgProperties fontTag fontTag2} [GetBg $languageRep1 $language] {break} # set background [subst $background] # submissionType set submissionType update ;# used in {wrong password} only # puts $languageRep2 source ../$col/$loCoInRep/auxdoc/.userArray.tcl # Source displayControl.tcl and xxFillingInstructions.tcl set enableOutput 0 eval $sourceDisplayControl # OBS: Include has priority over the doc/xxFillingInstructions.tcl file source ../$col/$languageRep2/doc/${language}FillingInstructions.tcl source ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl # Source displayControl.tcl and xxFillingInstructions.tcl - end set cellFont {} # numberOfReviewersPerWork set numberOfReviewersPerWork $numberOfReviewersPerWorkTable(Conference Proceedings) # typesOfWorkList # puts $optionTable2(Conference Proceedings,%@tertiarytype) set tertiaryTypeFieldValue $optionTable2(Conference Proceedings,%@tertiarytype) if {[llength $tertiaryTypeFieldValue] == 1} { set typesOfWorkList $tertiaryTypeFieldValue ;# {Full Paper} } else { set typesOfWorkList {} foreach item [lrange $tertiaryTypeFieldValue 1 end] { # if {[string compare {} [lindex $item 0]] == 0} {continue} foreach {name value} $item {break} lappend typesOfWorkList $value } } set typesOfWork [join $typesOfWorkList { + }] # puts $typesOfWork # Parse the URL # set pathInfoLength [llength $pathInfo] # if {$pathInfoLength == 5} if ![info exists cgi(theme)] { puts {no theme specified} puts

if [info exists {optionTable(Conference Proceedings,%@subject)}] { puts " The themes are: $optionTable(Conference Proceedings,%@subject) " } else { puts {optionTable(Conference Proceedings,%@subject) not found} puts

puts " the theme list must be stored in optionTable(Conference Proceedings,%@subject) in $homePath/col/$submissionFormRep/doc/displayControl.tcl" } return } else { if ![info exists {optionTable(Conference Proceedings,%@subject)}] { puts {optionTable(Conference Proceedings,%@subject) not found} puts

puts " the theme list must be stored in optionTable(Conference Proceedings,%@subject) in $homePath/col/$submissionFormRep/doc/displayControl.tcl or you must add/change the mirror field value in the query part of the URL" return } # themeLabel set themeLabel $cgi(theme) } if 1 { if ![info exists cgi(reviewrepository)] { puts {no review repository defined} puts

puts " The query information part of the URL must contain a field named 'reviewrepository' and which value is the name of a repository containing a tcl page for the creation of a theme list. See repository iconet.com.br/banon/2006/09.17.17.49 as an example." return } else { # reviewRepository set reviewRepository $cgi(reviewrepository) # puts $reviewRepository } } # Parse the URL - end source ../$col/$languageRep2/doc/mirror/${language}Submit.tcl global "${languageRep2}::Please wait for the submission completion." global "${languageRep2}::Password" global "${languageRep2}::empty password" global "${languageRep2}::wrong password" global "${languageRep2}::unknown username" global "${languageRep2}::Continue" global "${languageRep2}::Cancel" if [info exists cgi(typeofwork)] { # paper selection # typeOfWork regsub -all {_} $cgi(typeofwork) { } typeOfWork # Load ../$col/$reviewRepository/doc/paperSelection.html fileContent set currentFileName [FindCurrentHTMLFileName PaperSelection] } else { # reviewer assignment # Load ../$col/$reviewRepository/doc/reviewerAssignment.html fileContent set currentFileName [FindCurrentHTMLFileName ReviewerAssignment] } Load $currentFileName fileContent source ../$col/$languageRep2/doc/mirror/${language}ReviewerAssignment.tcl ;# must be after the above source (because of header and footer) global "${languageRep2}::header" global "${languageRep2}::footer" global "${languageRep2}::nothing selected" global "${languageRep2}::no work selected" global "${languageRep2}::no reviewer selected" global "${languageRep2}::user - password" global "${languageRep2}::Reviewers" global "${languageRep2}::Works" global "${languageRep2}::Assign" global "${languageRep2}::currentVariableFileName" ;# for reverse engineering # codedPassword2 Load $homePath/col/$loCoInRep/auxdoc/xxx data binary set data [UnShift $data] set codedPassword2 [lindex $data end] # Process selection if [info exists cgi(select)] { # set hiddenInput " # # # #" set hiddenInput " " # Similar to Submit if ![info exists cgi(wrongpassword)] {set cgi(wrongpassword) {no}} set message [subst [subst [CheckUsernamePasswordForm]]] if {[string compare {} $message] != 0} { # regsub is useful for unknown username and wrong password regsub {NAME="wrongpassword" VALUE="no"} $message {NAME="wrongpassword" VALUE="yes"} message puts $message return } # Similar to Submit - end } # Process selection - end # Process assignment (assign/undo) if [info exists cgi(assign)] { # assign/undo a reviewer to a work # Similar to Submit set hiddenInput "" if [info exists cgi(work)] { lappend hiddenInput " " } if [info exists cgi(reviewer)] { lappend hiddenInput " " } set hiddenInput [join $hiddenInput \n] set message [subst [subst [CheckUsernamePasswordForm]]] if {[string compare {} $message] != 0} { # regsub is useful for unknown username and wrong password regsub {NAME="wrongpassword" VALUE="no"} $message {NAME="wrongpassword" VALUE="yes"} message puts $message return } # Similar to Submit - end # if {![info exists cgi(work)] && ![info exists cgi(reviewer)]} { # set hiddenInput "" # puts [subst [subst ${nothing selected}]] # return # } if {(![info exists cgi(work)] && [info exists cgi(reviewer)]) || \ ([info exists cgi(work)] && ![info exists cgi(reviewer)])} { if ![info exists cgi(work)] { set hiddenInput " " puts [subst [subst ${no work selected}]] return } if ![info exists cgi(reviewer)] { set hiddenInput " " puts [subst [subst ${no reviewer selected}]] return } } # OK (assignment/undo) while {[EnterQueue [pid]]} { set x2 0; after 100 {set x2 1}; vwait x2 } if [file exists ../$col/$reviewRepository/doc/assignmentArray.tcl] { source ../$col/$reviewRepository/doc/assignmentArray.tcl } # assignmentArray.tcl is updated in submit.tcl when a reviewer chooses another reviewer set userName $cgi(username) set codedPassword $password1 if {[info exists cgi(work)] && [info exists cgi(reviewer)]} { # OK (assignment) set hiddenInput " " set nextUser $cgi(reviewer) # loop ... # set index [array names assignmentArray $cgi(work),*] foreach checkedWork [TurnIntoList $cgi(work)] { set index [array names assignmentArray $checkedWork,*] # regexp -- {(.*)-([^,]*),} $cgi(work) m workRepName reviewNumber regexp -- {(.*)-([^,]*),} $checkedWork m workRepName reviewNumber if {[llength $index] != 0} { # puts {the reviewer has declined the review} # Add the new reviewer to the existing reader group for the work Load ../$col/$workRepName/service/authenticatedUsers authenticatedUsers set readUserListForParentRepositories $authenticatedUsers lappend readUserListForParentRepositories $nextUser set readUserListForParentRepositories [lsort -unique $readUserListForParentRepositories] # Add the new reviewer to the existing reader group for the work - end set reviewRepName $assignmentArray($index) unset assignmentArray($index) set reviewMetadataRepName [Execute $serverAddressWithIP [list FindMetadataRep $reviewRepName]] # Update @metadata.refer Load ../$col/$reviewMetadataRepName/doc/@metadata.refer referMetadata regsub "%@documentstage\[^%\n\]*" $referMetadata "%@documentstage $nextUser" referMetadata Store referMetadata ../$col/$reviewMetadataRepName/doc/@metadata.refer # Update @metadata.refer - end # UPDATE # puts [list $userName $codedPassword] # puts [list UpdateRepMetadataRep \ $reviewRepName $reviewMetadataRepName $userName $codedPassword \ preserve 0 1 {} 1 \ {} $nextUser $nextUser disable $readUserListForParentRepositories] # => UpdateRepMetadataRep iconet.com.br/banon/2005/11.19.23.37 iconet.com.br/banon/2005/11.19.23.38 banon 33 preserve 0 1 {} 1 {} banon banon disable {administrator banon bb lise@dpi.inpe.br} # must be administrator and not $userName because the reviewer may be the proper administrator # in UpdateRepMetadataRep userName and nextUser must be different to have a change in the advenced user name # language value is set to empty Load ../$col/$reviewRepName/service/language languageFieldValue LoadService $workRepository visibility booleanVisibility 1 1 set startApacheServer [Execute $serverAddressWithIP [list UpdateRepMetadataRep \ $reviewRepName $reviewMetadataRepName administrator $codedPassword preserve 0 \ 1 {} 1 {} $nextUser $nextUser \ disable $readUserListForParentRepositories \ {} {} 0 \ $languageFieldValue 1 0 \ {} 0 $booleanVisibility]] if {[string compare 0 $startApacheServer] != 0 && \ [string compare 1 $startApacheServer] != 0} { puts {ProcessReview: error while executing UpdateRepMetadataRep} puts
puts --$startApacheServer-- LeaveQueue [pid] return } } else { # puts {the reviewer has not declined the review} set workMetadataRepName [Execute $serverAddressWithIP [list FindMetadataRep $workRepName]] # SetFieldValue $serverAddressWithIP $workMetadataRepName-0 {title type tertiarytype usergroup} SetFieldValue $serverAddressWithIP $workMetadataRepName-0 {title subject tertiarytype usergroup} set item [array names userArray $cgi(reviewer),fullname] set fullName $userArray($item) set metadataEntryList [list [list %0 Misc]] lappend metadataEntryList "%A $fullName" # if [info exists {translationTable(Review $reviewNumber on the work: $title,Misc,%T)}] if [info exists {translationTable($reviewNumber: $title,Misc,%T)}] { # set reviewTitle $translationTable(Review \$reviewNumber on the work: \$title,Misc,%T) set reviewTitle $translationTable(\$reviewNumber: \$title,Misc,%T) } else { # set reviewTitle {Review $reviewNumber on the work: $title} set reviewTitle {$reviewNumber: $title} } set conferenceName [lindex $displayTable(Conference Proceedings,%B) 2] lappend metadataEntryList "%T [subst $reviewTitle]" lappend metadataEntryList "%K review." lappend metadataEntryList "%X Review of a work submitted to the $conferenceName." lappend metadataEntryList "%3 @reviewSheet.html" lappend metadataEntryList "%O $tertiarytype" ;# presentation format lappend metadataEntryList "%@parentrepositories $workRepName" # lappend metadataEntryList "%@area $type" lappend metadataEntryList "%@area $subject" # lappend metadataEntryList "%@usergroup $cgi(reviewer)" lappend metadataEntryList "%@documentstage $cgi(reviewer)" lappend metadataEntryList "%@mirrorrepository $currentRep" # Create readUserListForParentRepositories # ConditionalSet readUserListForParentRepositories readUserNameList($cgi(referencetype)) {} ConditionalSet readUserListForParentRepositories readUserNameList(Misc) {} # Add the current reader names Load ../$col/$workRepName/service/authenticatedUsers authenticatedUsers set readUserListForParentRepositories [concat $readUserListForParentRepositories $authenticatedUsers] # Add the current reader names - end ## Add user name # LoadService $workRepName userName authorName 1 1 # if {[string compare {} $authorName] != 0} {lappend readUserListForParentRepositories $authorName} ## Add user name - end # Add user group set readUserListForParentRepositories [concat $usergroup $readUserListForParentRepositories] # Add user group - end # Add administrator login # regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName # lappend readUserListForParentRepositories $administratorUserName lappend readUserListForParentRepositories {administrator} # Add administrator login - end # Add reviewer login lappend readUserListForParentRepositories $nextUser # Add reviewer login - end set readUserListForParentRepositories [lsort -unique $readUserListForParentRepositories] # Create readUserListForParentRepositories - end # CREATE # set startApacheServer 1 # the command below doesn't work because the child repository reviewRepository may # have so many parent repositories that the list of them may overcome the 4K of the # socket buffer size catch {Execute $serverAddressWithIP [list CreateRepMetadataRep \ empty {} \ {} 0 disable \ $metadataEntryList preserve 0 0 {} \ {} $nextUser {} {} \ 1 {} $nextUser 0 \ $nextUser {} 1 \ $readUserListForParentRepositories]} reviewRepName ;# calls DDRoutine twice # puts $reviewRepName ;# return error message in CreateRepMetadataRep # Create the .reviewArray.tcl file # set data "array set reviewArray {$reviewRepName,avaliacao {} $reviewRepName,clareza {} $reviewRepName,relevancia {} $reviewRepName,conclusiva {} $reviewRepName,consistencia {} $reviewRepName,qualidadegrafica {} $reviewRepName,comentarioeditor {} $reviewRepName,comentarioautor {} $reviewRepName,aprovacao {} $reviewRepName,adequacao {}}" set dataList {} foreach index [array names orderingTable Misc,*] { regsub {Misc,} $index {} fieldName lappend dataList "$reviewRepName,$fieldName {}" } set data "array set reviewArray [list [join $dataList]]" Store data ../$col/$reviewRepName/doc/.reviewArray.tcl # Create the .reviewArray.tcl file - end set reviewMetadataRepName [Execute $serverAddressWithIP [list FindMetadataRep $reviewRepName]] # regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName # set message [Execute $serverAddressWithIP [list UpdateRepository2 $reviewRepName $reviewMetadataRepName $administratorUserName $codedPassword directory $homePath/col/$reviewRepName/doc/]] ;# calls DDRoutine set message [Execute $serverAddressWithIP [list UpdateRepository2 $reviewRepName $reviewMetadataRepName administrator $codedPassword directory $homePath/col/$reviewRepName/doc/]] ;# calls DDRoutine if {[string compare {} $message] != 0} { puts $message } } # set assignmentArray($cgi(work),$cgi(reviewer)) $reviewRepName set assignmentArray($checkedWork,$cgi(reviewer)) $reviewRepName StoreArray assignmentArray $homePath/col/$reviewRepository/doc/assignmentArray.tcl w list array 1 } # end of loop ... if [info exists cgi(work)] {unset cgi(work)} if [info exists cgi(reviewer)] {unset cgi(reviewer)} } else { # OK (undo) if [info exists cgi(undo)] { # set index $cgi(undo) ;# iconet.com.br/banon/2005/06.05.22.46-1,Oral,nobre set repositoryList {} foreach checkedWork [TurnIntoList $cgi(undo)] { set index $checkedWork ;# iconet.com.br/banon/2005/06.05.22.46-1,Oral,nobre # reviewerLogin regsub {.*,} $index {} reviewerLogin # reviewRepName set reviewRepName $assignmentArray($index) unset assignmentArray($index) # Load $homePath/col/$reviewRepository/service/reference reference # set parentRepositoryList [split $reference \n] # if {[set i [lsearch -regexp $parentRepositoryList $reviewRepName]] != -1} { # set parentRepositoryList [lreplace $parentRepositoryList $i $i] # } # set reference [join $parentRepositoryList \n] # Store reference $homePath/col/$reviewRepository/service/reference # Execute $serverAddressWithIP [list UpdateReferenceTable $reviewRepository] # set reviewMetadataRepository [Execute $serverAddressWithIP [list FindMetadataRep $reviewRepository]] # reviewMetadataRepName set reviewMetadataRepName [Execute $serverAddressWithIP [list FindMetadataRep $reviewRepName]] set parentWorkRep [lindex [Execute $serverAddressWithIP [list GetMetadata $reviewMetadataRepName-0,parentrepositories]] 1] set parentWorkMetadataRep [Execute $serverAddressWithIP [list FindMetadataRep $parentWorkRep]] # remove ## Remove reviewRepName as a parent of reviewRepository # set metadata2List [Execute $serverAddressWithIP [list GetMetadata $reviewMetadataRepository-0,parentrepositories]] # set parentRepositories [lindex $metadata2List 1] # if {[set i [lsearch -exact $parentRepositories $reviewRepName]] != -1} { # set parentRepositories [lreplace $parentRepositories $i $i] # } ## Remove reviewRepName as a parent of reviewRepository - end # Remove reviewRepName as a child of parentWorkRep # set metadata2List2 [Execute $serverAddressWithIP [list GetMetadata $parentWorkMetadataRep-0,childrepositories]] # set metadata2List [concat $metadata2List $metadata2List2] set metadata2List [Execute $serverAddressWithIP [list GetMetadata $parentWorkMetadataRep-0,childrepositories]] # set childRepositories [lindex $metadata2List2 1] set childRepositories [lindex $metadata2List 1] if {[set i [lsearch -exact $childRepositories $reviewRepName]] != -1} { set childRepositories [lreplace $childRepositories $i $i] } # Remove reviewRepName as a child of parentWorkRep - end # add ## Update the parents of reviewRepository # set metadataList [list $reviewMetadataRepository-0,parentrepositories $parentRepositories] ## Update the parents of reviewRepository - end # Update the childs of parentWorkRep if {[string compare {} $childRepositories] != 0} { # set metadataList [concat $metadataList [list $parentWorkMetadataRep-0,childrepositories $childRepositories]] set metadataList [list $parentWorkMetadataRep-0,childrepositories $childRepositories] } else { set metadataList {} } # Update the childs of parentWorkRep - end # Update the readergroup of parentWorkRep set metadata2List2 [Execute $serverAddressWithIP [list GetMetadata $parentWorkMetadataRep-0,readergroup]] set metadata2List [concat $metadata2List $metadata2List2] set readerGroup [lindex $metadata2List2 1] set index2 [lsearch $readerGroup $reviewerLogin] set readerGroup [lreplace $readerGroup $index2 $index2] set metadataList [concat $metadataList [list $parentWorkMetadataRep-0,readergroup $readerGroup]] StoreService readerGroup $parentWorkRep authenticatedUsers 0 1 Execute $serverAddressWithIP [list UpdateRepositoryProperties $parentWorkRep authenticatedusers] # Update the readergroup of parentWorkRep - end if 0 { # commented by GJFB in 2020-08-18 Execute $serverAddressWithIP [list RemoveMetadata $metadata2List] Execute $serverAddressWithIP [list AddMetadata $metadataList] } else { Execute $serverAddressWithIP [list UpdateMetadata $metadata2List $metadataList] ;# added by GJFB in 2020-08-18 - uses metadata2List and metadataList } # Execute $serverAddressWithIP [list UpdateRepositoryListForPost $reviewRepository] # DELETE # set return [Execute $serverAddressWithIP [list RemoveRepository $reviewRepName $userName $password1]] set return [Execute $serverAddressWithIP [list RemoveRepository $reviewRepName $reviewMetadataRepName $userName $password1]] if {[string compare {} $return] != 0} { puts $return } lappend repositoryList $reviewRepName lappend repositoryList $reviewMetadataRepName # Update markList if [file exists ../$col/$reviewRepository/doc/markList.tcl] { # SOURCE markList.tcl source ../$col/$reviewRepository/doc/markList.tcl if ![info exists markList] {set markList {}} } else { set markList {} } # SetFieldValue $serverAddressWithIP $parentWorkMetadataRep-0 {type} SetFieldValue $serverAddressWithIP $parentWorkMetadataRep-0 {subject} # ComputeMark $parentWorkRep $type ComputeMark $parentWorkRep $subject ;# sets markList # STORE markList StoreArray markList $homePath/col/$reviewRepository/doc/markList.tcl w list list 1 # Update markList - end StoreArray assignmentArray $homePath/col/$reviewRepository/doc/assignmentArray.tcl w list array 1 } # set startApacheServer 1 ;# needed for the new reader group # Load ../$col/$URLibServiceRepository/auxdoc/pid pid # Execute $serverAddressWithIP "set $pid startApacheServer 1" ;# Set startApacheServer 1 Execute $serverAddressWithIP [list UpdateRepositoryListForPost $repositoryList] } else { # set startApacheServer 0 } } # StoreArray assignmentArray $homePath/col/$reviewRepository/doc/assignmentArray.tcl w list array 1 LeaveQueue [pid] } else { if ![info exists cgi(typeofwork)] { # reviewer assignment if [file exists ../$col/$reviewRepository/doc/assignmentArray.tcl] { source ../$col/$reviewRepository/doc/assignmentArray.tcl } } } # Process assignment (assign/undo) - end # example of assignmentArray.tcl content: # array set assignmentArray {iconet.com.br/banon/2003/05.05.09.20,Artigos,banon iconet.com.br/banon/2004/06.13.00.36} set cellBgColor {#BCBCBC} # set cellFont {} set cellFont {} set fontTag {} set ifListCreation {} regsub -all { and | and, } $themeLabel { } themeLabelForQuery ;# in case of the english language if [info exists cgi(typeofwork)] { # paper selection if {[info exists cgi(select)] || [info exists cgi(update)]} { while {[EnterQueue [pid]]} { set x2 0; after 100 {set x2 1}; vwait x2 } } # markList if [file exists ../$col/$reviewRepository/doc/markList.tcl] { # SOURCE markList.tcl source ../$col/$reviewRepository/doc/markList.tcl if ![info exists markList] {set markList {}} } else { set markList {} } if [info exists cgi(update)] { # Update markList set markList [lsort -unique $markList] if {[string compare {all} $themeLabel] == 0} {set themeLabelForQuery *} if {[string compare {all} $typeOfWork] == 0} { set tertiaryTypeLabelForQuery * } else { set tertiaryTypeLabelForQuery $typeOfWork } # set query "referencetype, conference and subject, $themeLabelForQuery" # set query "referencetype, conference and subject, $themeLabelForQuery and (tertiarytype, $tertiaryTypeLabelForQuery or not tertiarytype, *)" set query "mirrorrepository, $mirrorRep and referencetype, conference and subject, $themeLabelForQuery and (tertiarytype, $tertiaryTypeLabelForQuery or not tertiarytype, *)" # puts $query set rep-iList [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword2] set workRepList {} # puts --${rep-iList}-- foreach rep-i ${rep-iList} { SetFieldValue $serverAddressWithIP ${rep-i} {repository subject} # puts $subject ComputeMark $repository $subject lappend workRepList $repository } # Remove deleted work repositories set markIndex 0 foreach mark $markList { if {([string compare {all} $themeLabel] == 0 || \ [string compare $themeLabel [lindex $mark 3]] == 0) && \ ([string compare {all} $typeOfWork] == 0 || \ [string compare $typeOfWork [lindex $mark 6]] == 0)} { if {[lsearch -exact $workRepList [lindex $mark 0]] == -1} { set markList [lreplace $markList $markIndex $markIndex] continue ;# markIndex must not be incremented } } incr markIndex } # Remove deleted work repositories - end # Update markList - end } set rowList {} set i 1 ;# to alternate row color set markIndex 0 set numberOfAccepted 0 set numberOfRejected 0 set numberOfUndefined 0 set numberOfPosters 0 set numberOfOrals 0 set hiddenInput {} set ifConditionList {} # puts $typeOfWork # sort based on the average mark (averageMark) # set markList [lsort -index 7 -integer -decreasing $markList] set markList [lsort -command CompareMarkList $markList] set displaySessionColumn 0 set displayThemeColumn 0 set displayFormatColumn 0 foreach mark $markList { # set markList {{dpi.inpe.br/banon-pc2@80/2007/01.29.21.02 {} {Submission example} {Shape analysis} {Shape analysis} {Shape analysis} {Full Paper} 160 {} {} {} {} {} {}} {iconet.com.br/banon/2006/07.10.02.16 {} yyy {Level set methods} {Motion analysis and tracking} {Motion analysis and tracking} {Full Paper} 0 {} {} {} {} {} {}}} foreach {workRepository childrepositories title themeLabel2 session theme tertiarytype averageMark overallRating recommendation formatRecommendation confidence comments accepted} $mark {break} # puts --$mark-- # puts --$accepted-- # puts [list --$tertiarytype-- --$typeOfWork--] # puts [list --$themeLabel2-- --$themeLabel--] if {([string compare -nocase $tertiarytype $typeOfWork] == 0 || \ [string compare -nocase {all} $typeOfWork] == 0) && \ ([string compare $themeLabel2 $themeLabel] == 0 || \ [string compare {all} $themeLabel] == 0)} { # must be displayed set workMetadataRep [Execute $serverAddressWithIP [list FindMetadataRep $workRepository]] SetFieldValue $serverAddressWithIP $workMetadataRep-0 {author metadatarepository} set author2 {} foreach name $author { regsub {,$} $name {} name; lappend author2 $name } set author2 [join $author2 {; }] # window regsub -all {/} ${mirrorRep}___$metadatarepository {__} window regsub -all {\.|@|-} $window {_} window set window ${window}___0 regsub -all {/} $workRepository {__} workRepository2 regsub -all {\.|@|-} $workRepository2 {_} workRepository2 if [info exists cgi(select)] { # markList might be updated set flag 0 if [info exists cgi($workRepository2)] { if {[string compare $cgi($workRepository2) $accepted] != 0} { set accepted $cgi($workRepository2) set flag 1 } } else { set accepted {} } if [info exists cgi(currentsession___$workRepository2)] { if {[string compare $cgi(currentsession___$workRepository2) $session] != 0} { set session $cgi(currentsession___$workRepository2) set flag 1 } } if [info exists cgi(currenttheme___$workRepository2)] { if {[string compare $cgi(currenttheme___$workRepository2) $theme] != 0} { set theme $cgi(currenttheme___$workRepository2) set flag 1 } } if [info exists cgi(currentformat___$workRepository2)] { if {[string compare $cgi(currentformat___$workRepository2) $tertiarytype] != 0} { set tertiarytype $cgi(currentformat___$workRepository2) set flag 1 } } # Update @metadata.refer if $flag { # markList must be updated set flag 0 Load ../$col/$workMetadataRep/doc/@metadata.refer referMetadata set mark [GetReferField $referMetadata @mark] if {[string compare {} $accepted] != 0 && \ [string compare $mark $accepted] != 0} { # update must be done set referMetadata [PutReferField $referMetadata %@mark $accepted] set flag 1 } set session2 [GetReferField $referMetadata @session] if {[string compare $session2 $session] != 0} { # update must be done set referMetadata [PutReferField $referMetadata %@session $session] set flag 1 } set theme2 [GetReferField $referMetadata 9] if {[string compare $theme2 $theme] != 0} { # update must be done set referMetadata [PutReferField $referMetadata %9 $theme] set flag 1 } set tertiaryType [GetReferField $referMetadata @tertiarytype] if {[string compare $tertiaryType $tertiarytype] != 0} { # update must be done set referMetadata [PutReferField $referMetadata %@tertiarytype $tertiarytype] set flag 1 } if $flag { # Load ../$col/$workMetadataRep/service/language languageFieldValue Load ../$col/$workRepository/service/language languageFieldValue Store referMetadata ../$col/$workMetadataRep/doc/@metadata.refer LoadService $workRepository userName authorName 1 1 LoadService $workRepository visibility booleanVisibility 1 1 set startApacheServer [Execute $serverAddressWithIP [list UpdateRepMetadataRep \ $workRepository $workMetadataRep $cgi(username) $password1 preserve 0 \ 1 {} 1 {} $authorName {} \ disable {} \ {} {} 0 \ $languageFieldValue 1 0 \ {} 0 $booleanVisibility]] if {[string compare 0 $startApacheServer] != 0 && \ [string compare 1 $startApacheServer] != 0} { puts {ProcessReview: error while executing UpdateRepMetadataRep} puts
puts --$startApacheServer-- LeaveQueue [pid] return } } # Update @metadata.refer - end set markList [lreplace $markList $markIndex $markIndex \ [list $workRepository $childrepositories $title $themeLabel2 $session $theme $tertiarytype $averageMark $overallRating $recommendation $formatRecommendation $confidence $comments $accepted]] } } # puts --$formatRecommendation-- # puts --$accepted-- if {[string compare {} $averageMark] == 0} { } else { set averageMark [expr $averageMark / 10.] } set recommendation2 {} set formatRecommendation2 {} set j 0 foreach childRep $childrepositories { lappend recommendation2 "[lindex $recommendation $j]" lappend formatRecommendation2 "[lindex $formatRecommendation $j]" incr j } if $i {set color #EEEEEE; set i 0} else {set color #E3E3E3; set i 1} if {[string compare {} $accepted] == 0} { set accept {} set reject {} set acceptInputValue 0 set rejectInputValue 0 incr numberOfUndefined } else { if $accepted { set accept { CHECKED} set reject {} set acceptInputValue 1 set rejectInputValue 0 incr numberOfAccepted } else { set accept {} set reject { CHECKED} set acceptInputValue 0 set rejectInputValue 1 incr numberOfRejected } } # currentSession if {[string compare {all} $typeOfWork] == 0} { # set optionList "
" set acceptInputName accept___$workRepository2 set rejectInputName reject___$workRepository2 lappend hiddenInput "" lappend hiddenInput "" lappend ifConditionList "(document.check.$acceptInputName.value == document.update.$workRepository2\[0\].checked) && (document.check.$rejectInputName.value == document.update.$workRepository2\[1\].checked)" } incr markIndex if {[string compare {1} $accepted] == 0 && [regexp -nocase {Poster} $session]} {incr numberOfPosters} if {[string compare {1} $accepted] == 0 && [regexp -nocase {Oral} $session]} {incr numberOfOrals} } set numberOfItems [expr $numberOfUndefined + $numberOfAccepted + $numberOfRejected] if $numberOfItems { set percentageOfUndefined [expr ($numberOfUndefined. / $numberOfItems) * 100] regsub {(.*\..).*} $percentageOfUndefined {\1} percentageOfUndefined set percentageOfAccepted [expr ($numberOfAccepted. / $numberOfItems) * 100] regsub {(.*\..).*} $percentageOfAccepted {\1} percentageOfAccepted set percentageOfRejected [expr ($numberOfRejected. / $numberOfItems) * 100] regsub {(.*\..).*} $percentageOfRejected {\1} percentageOfRejected } set hiddenInput [join $hiddenInput \n] if {[string compare {} $ifConditionList] == 0} { set ifCondition 1 } else { set ifCondition ([join $ifConditionList { && }]) } if {[info exists cgi(select)] || [info exists cgi(update)]} { # STORE markList StoreArray markList $homePath/col/$reviewRepository/doc/markList.tcl w list list 1 LeaveQueue [pid] # puts "Location: http://$localSite/rep-/$reviewRepository" # puts "" # return } set selectionTable [join $rowList \n] } else { # reviewer assignment # Create closedReviewRepositoryList set closedReviewRepositoryList {} set query "ref misc and documentstage closed review and area $themeLabelForQuery" # puts $query foreach item [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword2] { SetFieldValue $serverAddressWithIP $item {repository} lappend closedReviewRepositoryList $repository } # Create closedReviewRepositoryList - end # Create workTable # set checkedWorkList if [info exists cgi(work)] { set checkedWorkList [TurnIntoList $cgi(work)] ;# used in ReturnReviewerList } # Create declinedReviewRepositoryList set declinedReviewRepositoryList {} set query "referencetype, misc and documentstage, declined review and area, $themeLabelForQuery" set rep-iList [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword2] foreach item ${rep-iList} { SetFieldValue $serverAddressWithIP $item {repository} lappend declinedReviewRepositoryList $repository } # Create declinedReviewRepositoryList - end set rowList {} # QUERY set j 0 set k 0 set conditionList {} set undoConditionList {} set query "referencetype, conference and subject, $themeLabelForQuery" # puts $query # set rep-iList [lsort [FindMetadataRepositories $query 0 [list $serverAddressWithIP]]] set rep-iList [FindMetadataRepositories $query 0 [list $serverAddressWithIP] $codedPassword2] if [info exists cgi(update)] { while {[EnterQueue [pid]]} { set x2 0; after 100 {set x2 1}; vwait x2 } } set numberOfWorks [llength ${rep-iList}] set repTitle {} foreach rep-i ${rep-iList} { SetFieldValue $serverAddressWithIP ${rep-i} {title} lappend repTitle [list ${rep-i} $title] } # Sorting by title foreach item [lsort -index 1 $repTitle] { if [info exists cgi(update)] { SetFieldValue $serverAddressWithIP [lindex $item 0] {title author repository metadatarepository tertiarytype childrepositories} # RESTORE assignmentArray # Remove foreach item2 [array names assignmentArray $repository-*,*] { unset assignmentArray($item2) } # Remove - end # Add foreach chilReviewdRep $childrepositories { set childReviewMetadataRep [Execute $serverAddressWithIP [list FindMetadataRep $chilReviewdRep]] SetFieldValue $serverAddressWithIP $childReviewMetadataRep-0 {title usergroup} # puts --$usergroup-- set usergroupIndex [lsearch -exact $usergroup {administrator}] set login [lindex [lreplace $usergroup $usergroupIndex $usergroupIndex] end] regexp {([0-9]+):.*} $title m reviewNumber # set assignmentArray(cptec.inpe.br/adm_conf/2005/10.10.04.13-1,Poster,carolina) dpi.inpe.br/Gemini@80/2005/11.17.14.20 set assignmentArray($repository-$reviewNumber,$tertiarytype,$login) $chilReviewdRep } # Add - end # LeaveQueue [pid] # exit } else { SetFieldValue $serverAddressWithIP [lindex $item 0] {title author repository metadatarepository tertiarytype} } set author2 {} foreach name $author { regsub {,$} $name {} name; lappend author2 $name } set author2 [join $author2 {; }] # window regsub -all {/} ${mirrorRep}___$metadatarepository {__} window regsub -all {\.|@|-} $window {_} window set window ${window}___0 set i 0 foreach row [ReturnReviewerList $repository $tertiarytype] { lappend rowList lappend rowList $row if !$i {lappend rowList "${fontTag} $tertiarytype
$title
$author2
"} lappend rowList incr i } } if [info exists cgi(update)] { StoreArray assignmentArray $homePath/col/$reviewRepository/doc/assignmentArray.tcl w list array 1 LeaveQueue [pid] } if {$j != 0} { if {$j == 1} { regsub {\.work\[0\]\.} $conditionList {.work.} conditionList ;# because JavaScript doesn't understand document.update.work[0].checked when there is only one radio button } # append ifListCreation "if ([join $conditionList { && }]) {fieldNameList += \"$Works\\n\"; i++}" append ifListCreation "\t\tnoWorkChecked=[join $conditionList { && }]" set thereIsAtLeastOneWorkToCheck 1 } else { append ifListCreation "\t\tnoWorkChecked=1" set thereIsAtLeastOneWorkToCheck 0 } if {$k != 0} { if {$k == 1} { regsub {\.undo\[0\]\.} $undoConditionList {.undo.} undoConditionList ;# because JavaScript doesn't understand document.update.undo[0].checked when there is only one check box } append ifListCreation "\n" append ifListCreation "\t\tif ([join $undoConditionList { || }]) {return ConfirmUndo()}" } set workTable [join $rowList \n] # Create workTable - end append ifListCreation "\n" # Create reviewerTable set rowList {} set j 0 set conditionList {} set itemList [array names userArray *,fullname] set userList {} ;# list of list of item name and item value foreach item $itemList { lappend userList [list $item $userArray($item)] } set numberOfReviewers 0 # -index 0 to sort by user name (login) # -index 1 to sort by fullname foreach user [lsort -index 1 $userList] { set item [lindex $user 0] regsub {,fullname} $item {} userName if ![info exists userArray($userName,subject)] {continue} ;# not a reviewer # Turn green if the reviewer has selected the current subject set userThemeList [TurnIntoList $userArray($userName,subject)] if {[lsearch -exact $userThemeList $themeLabel] == -1} { set bgColorTD #CCCCCC if {![info exists {displayAllReviewrsTable(Conference Proceedings)}] || \ !${displayAllReviewrsTable(Conference Proceedings)}} { continue } } else { set bgColorTD #CCFFCC } # Turn green if the reviewer has selected the current subject - end set fullName $userArray($item) set numberOfReviewsList {} # set numberOfReviewsList 0 # set numberOfReviews [llength [array names assignmentArray *,$userName]] if [string equal {} $typesOfWorkList] { set numberOfReviewsList [llength [array names assignmentArray *,,$userName]] } else { foreach type $typesOfWorkList { regsub -all { } $type {_} typeOfWork2 lappend numberOfReviewsList [llength [array names assignmentArray *,$typeOfWork2,$userName]] } } # puts --$typesOfWorkList-- # puts [llength $typesOfWorkList] set numberOfReviews [join $numberOfReviewsList { + }] lappend rowList lappend rowList "$cellFont[expr ([llength $typesOfWorkList] > 1)?{$numberOfReviews = [expr $numberOfReviews]}:{$numberOfReviews}]" if {[info exists cgi(reviewer)] && [string compare $cgi(reviewer) $userName] == 0} { # checked lappend rowList " ${fontTag}$fullName <$userName>
" } else { if $thereIsAtLeastOneWorkToCheck { lappend rowList " ${fontTag}$fullName <$userName>
" } else { lappend rowList " ${fontTag}$fullName <$userName>" } } lappend rowList lappend conditionList "!(document.update.reviewer\[$j\].checked)" incr j incr numberOfReviewers } if {$j != 0 && $thereIsAtLeastOneWorkToCheck} { if {$j == 1} { regsub {\.reviewer\[0\]\.} $conditionList {.reviewer.} conditionList ;# because JavaScript doesn't understand document.update.reviewer[0].checked when there is only one radio button } # append ifListCreation "if ([join $conditionList { && }]) {fieldNameList += \"$Reviewers\\n\"; i++}" append ifListCreation "\t\tnoReviewerChecked=[join $conditionList { && }]" } else { append ifListCreation "\t\tnoReviewerChecked=1" } set reviewerTable [join $rowList \n] # Create reviewerTable - end append ifListCreation "\n" append ifListCreation "\t\tif ((noWorkChecked && !noReviewerChecked) || (!noWorkChecked && noReviewerChecked)) {" append ifListCreation "\n" append ifListCreation "\t\t\tif (noWorkChecked) {fieldNameList += \"$Works\\n\"; i++}" append ifListCreation "\n" append ifListCreation "\t\t\tif (noReviewerChecked) {fieldNameList += \"$Reviewers\\n\"; i++}" append ifListCreation "\n" append ifListCreation "\t\t}" append ifListCreation "\n" } # if [info exists cgi(assign)] { ## puts $startApacheServer ## with UNIX, StartApacheServerAfterSubmission must be executed after the last communication with the URLib server # if $startApacheServer {Execute $serverAddressWithIP [list StartApacheServerAfterSubmission]} # } # action set action ${Please wait for the submission completion.} # seconds set seconds "" # insert password LoadService $reviewRepository userName userName 1 1 if {[string compare {administrator} $userName] == 0} { # administrator is alias for administrator user name regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName set userName $administratorUserName } # lappend additionalRowList "Usuário: $userName   $Password: " lappend additionalRowList [subst ${user - password}] lappend additionalRowList "" # 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 "" append ifListCreation "\t\tif (document.update.password1.value == \"\") {fieldNameList += document.update.password1fieldname.value + \"\\n\"; i++}" set additionalRowList [join $additionalRowList \n] 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}} # Used by JavaScript - end # puts [subst $fileContent] ;# doesn't restrict the access to authenticated reader # sessionTime # symmetricKey # regexp {(.*)-(.*)} [OpenSession $env(REMOTE_ADDR) symmetricKey] m sessionTime symmetricKey foreach {sessionTime symmetricKey} [OpenSession [list $env(REMOTE_ADDR) administrator] symmetricKey] {break} set fileContent [subst $fileContent] Store fileContent $homePath/col/$reviewRepository/doc/@output.html puts "Location: http://$localSite/col/$reviewRepository/doc/@output.html" puts {} } m] {puts $m; if 0 {global errorInfo; puts $errorInfo}} } # ProcessReview - end # ---------------------------------------------------------------------- # ReturnReviewerList # returns the list of reviewers assigned to a given work # workRepository is the name of the repository that contains the work proc ReturnReviewerList {workRepository typeOfWork} { upvar cgi cgi upvar assignmentArray assignmentArray upvar cellFont cellFont upvar cellBgColor cellBgColor upvar userArray userArray upvar numberOfReviewersPerWork numberOfReviewersPerWork upvar declinedReviewRepositoryList declinedReviewRepositoryList upvar closedReviewRepositoryList closedReviewRepositoryList upvar localSite localSite upvar j j upvar conditionList conditionList upvar k k upvar undoConditionList undoConditionList upvar checkedWorkList checkedWorkList # typeOfWork2 regsub -all { } $typeOfWork {_} typeOfWork2 set flag 1 for {set i 1} {$i <= $numberOfReviewersPerWork} {incr i} { set assignmentItem [array names assignmentArray $workRepository-$i,*] if {[string compare {} $assignmentItem] == 0} { # the ith line has no reviewer if $flag { if {[info exists checkedWorkList] && [lsearch $checkedWorkList ${workRepository}-$i,$typeOfWork2] != -1} { # checked lappend rowList " \; " } else { lappend rowList " \; " } lappend conditionList "!(document.update.work\[$j\].checked)" incr j set flag 0 } else { lappend rowList " \; \; " } } else { # the ith line has a reviewer regsub {.*,} $assignmentItem {} userName if {[lsearch -exact $declinedReviewRepositoryList $assignmentArray($assignmentItem)] != -1} { # the reviewer has declined the review if {[info exists cgi(work)] && [string compare $cgi(work) ${workRepository}-$i,$typeOfWork2] == 0} { lappend rowList "$cellFont$userArray($userName,fullname) " } else { lappend rowList "$cellFont$userArray($userName,fullname) " } lappend conditionList "!(document.update.work\[$j\].checked)" incr j } else { # the reviewer has not declined the review if {[lsearch -exact $closedReviewRepositoryList $assignmentArray($assignmentItem)] != -1} { # the reviewer has closed the review lappend rowList "$cellFont$userArray($userName,fullname) \; \; \; \;" } else { lappend rowList "$cellFont$userArray($userName,fullname) \;" } lappend undoConditionList "document.update.undo\[$k\].checked" incr k } } } return $rowList } # ReturnReviewerList - end # ---------------------------------------------------------------------- # CompareMarkList # sort is based on average mark first and then on title proc CompareMarkList {a b} { set a7 [lindex $a 7] set b7 [lindex $b 7] if {$a7 > $b7} {return -1} elseif {$b7 > $a7} {return 1} set a2 [lindex $a 2] set b2 [lindex $b 2] return [expr [string compare $a2 $b2]] } # CompareMarkList - end # ----------------------------------------------------------------------