Changeset 213
- Timestamp:
- Feb 23, 2006, 9:06:49 AM (18 years ago)
- Location:
- trunk/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/filexfer/monitor.java
r171 r213 19 19 20 20 public class monitor extends Thread { 21 private String protocol = "1.0"; 22 21 23 private filexfer parent; 22 24 private String hostName; … … 136 138 137 139 try { 138 ostream.println("REGISTER "+user+" "+ipAddr+" "+cookie+" RAPPTURE ");140 ostream.println("REGISTER "+user+" "+ipAddr+" "+cookie+" RAPPTURE/"+protocol); 139 141 ostream.println("ACTIVATE RAPPTURE"); 140 142 parent.status.append("Connected\n"); -
trunk/gui/scripts/analyzer.tcl
r210 r213 619 619 Rappture::Tooltip::cue $widget "Can't download this result. Looks like you might be having trouble with the version of Java installed for your browser." 620 620 } 621 } elseif {"old client" == $result} { 622 if {"" != $widget} { 623 Rappture::Tooltip::cue $widget "For this to work properly, you must first restart your Web browser. You don't need to close down this session. Simply shut down all windows for your Web browser, then restart the browser and navigate back to this page. You'll find it on \"my nanoHUB\" listed under \"my sessions\". Once the browser is restarted, the download should work properly." 624 } 625 } elseif {"old clients" == $result} { 626 if {"" != $widget} { 627 Rappture::Tooltip::cue $widget "There are multiple browser pages connected to this session, and one of them has browser that needs to be restarted.\n\nWhoever didn't get the download should restart their Web browser. You don't need to close down this session. Simply shut down all windows for the Web browser, then restart the browser and navigate back to this page. You'll find it on \"my nanoHUB\" listed under \"my sessions\". Once the browser is restarted, the download should work properly." 628 } 621 629 } else { 622 630 error $result " (while spooling result \"$title\")" -
trunk/gui/scripts/filexfer.tcl
r210 r213 45 45 } 46 46 47 # maps client socket => socket protocol 48 # if it doesn't match, we warn user to restart the browser 49 variable protocol 50 set protocol(current) "1.0" 51 47 52 # 48 53 # Translates mime type => file extension … … 182 187 variable enabled 183 188 variable clients 189 variable protocol 184 190 variable access 185 191 … … 214 220 215 221 set sent 0 222 set protoproblems 0 216 223 set access($filename) [bakeCookie] 217 224 foreach cid $clients(order) { 218 225 if {[info exists clients($cid)] && $clients($cid)} { 226 if {![string equal $protocol($cid) $protocol(current)]} { 227 incr protoproblems 228 } 219 229 catch { 220 230 puts $cid [format "url /spool/%s/%s?access=%s" \ … … 226 236 if {!$sent} { 227 237 error "no clients" 238 } 239 if {$protoproblems == 1} { 240 error "old client" 241 } elseif {$protoproblems > 1} { 242 error "old clients" 228 243 } 229 244 } … … 351 366 } 352 367 # blank line -- process below... 353 } elseif {[regexp { +RAPPTURE $} $line]} {368 } elseif {[regexp { +RAPPTURE(/[0-9\.]+)?$} $line]} { 354 369 set buffer($cid) $line 355 370 # special Rappture request -- process below... … … 373 388 set lines [lrange $lines 1 end] 374 389 if {![regexp {^ *([A-Z]+) +([^ ]+) +(HTTP/1\.[01])$} $line \ 375 match type url proto col]376 && ![regexp { +(RAPPTURE )$} $line match protocol]} {390 match type url proto] 391 && ![regexp { +(RAPPTURE(/[0-9\.]+)?)$} $line match proto]} { 377 392 set errmsg "Malformed request: $line" 378 393 } 379 394 380 if {[string match HTTP/* $proto col]} {395 if {[string match HTTP/* $proto]} { 381 396 # 382 397 # HANDLE HTTP/1.x REQUESTS... … … 425 440 shutdown $cid 426 441 } 427 } elseif { $protocol == "RAPPTURE"} {442 } elseif {[string match RAPPTURE* $proto]} { 428 443 # 429 444 # HANDLE SPECIAL RAPPTURE REQUESTS... 430 445 # 431 if {[regexp {^ *(REGISTER) +([^ ]+) +([^ ]+) +([^ ]+) +RAPPTURE$} \ 432 $line match type user addr cookie]} { 433 request_REGISTER $cid $user $addr $cookie 446 set vers "0.0" 447 if {[regexp {^ *(REGISTER) +([^ ]+) +([^ ]+) +([^ ]+) +RAPPTURE(/[0-9\.]+)?$} \ 448 $line match type user addr cookie vers]} { 449 set vers [string trimleft $vers /] 450 request_REGISTER $cid $user $addr $cookie $vers 434 451 } elseif {[regexp {^ *UNREGISTER +RAPPTURE$} $line]} { 435 452 request_UNREGISTER $cid … … 684 701 && [info exists uploadcmds($post(callback))]} { 685 702 # get the data -- either text or file 686 set data $post($post(which)) 703 set dlist [list which $post(which)] 704 lappend dlist data $post($post(which)) 687 705 688 706 # get the upload callback command 689 707 set cmd $uploadcmds($post(callback)) 690 if {[catch "$cmd [list $data]" result]} {708 if {[catch "$cmd $dlist" result]} { 691 709 bgerror $result 692 710 } … … 732 750 733 751 # ---------------------------------------------------------------------- 734 # USAGE: request_REGISTER <clientId> <user> <address> <cookie> 752 # USAGE: request_REGISTER <clientId> <user> <address> <cookie> <protocol> 735 753 # 736 754 # Used internally to handle REGISTER requests on this server. A client 737 755 # sends REGISTER requests when it wants to be notified of file transfer 738 756 # operations. The <cookie> must match the one for this server, so 739 # we know we can trust the client. 740 # ---------------------------------------------------------------------- 741 proc Rappture::filexfer::request_REGISTER {cid user addr clientCookie} { 757 # we know we can trust the client. The <protocol> tells us what version 758 # of filexfer client we're talking to. If the protocol doesn't match 759 # the current version, we warn the user to restart his browser. 760 # ---------------------------------------------------------------------- 761 proc Rappture::filexfer::request_REGISTER {cid user addr clientCookie proto} { 742 762 variable clients 743 763 variable cookie 764 variable protocol 744 765 745 766 if {![string equal $cookie $clientCookie]} { … … 749 770 # add this client to the known listeners 750 771 set clients($cid) 0 772 set protocol($cid) $proto 751 773 } 752 774 } -
trunk/gui/scripts/loader.tcl
r210 r213 286 286 if {$status == 0} { 287 287 Rappture::Tooltip::cue $itk_component(combo) \ 288 "Upload starting...\nA web browser page should pop up on your desktop. Use that form to handle the upload operation. "288 "Upload starting...\nA web browser page should pop up on your desktop. Use that form to handle the upload operation.\n\nIf the upload form doesn't pop up, make sure that you're allowing pop ups from this site. If it still doesn't pop up, you may be having trouble with the version of Java installed for your browser. See our Support area for details.\n\nClick anywhere to dismiss this message." 289 289 } else { 290 290 if {$result == "no clients"} { 291 291 Rappture::Tooltip::cue $itk_component(combo) \ 292 292 "Can't upload files. Looks like you might be having trouble with the version of Java installed for your browser." 293 } elseif {"old client" == $result} { 294 Rappture::Tooltip::cue $itk_component(combo) "For this to work properly, you must first restart your Web browser. You don't need to close down this session. Simply shut down all windows for your Web browser, then restart the browser and navigate back to this page. You'll find it on \"my nanoHUB\" listed under \"my sessions\". Once the browser is restarted, the upload should work properly." 295 } elseif {"old clients" == $result} { 296 Rappture::Tooltip::cue $itk_component(combo) "There are multiple browser pages connected to this session, and one of them has browser that needs to be restarted.\n\nWhoever didn't get the upload form should restart their Web browser. You don't need to close down this session. Simply shut down all windows for the Web browser, then restart the browser and navigate back to this page. You'll find it on \"my nanoHUB\" listed under \"my sessions\". Once the browser is restarted, the upload should work properly." 293 297 } else { 294 298 bgerror $result … … 314 318 Rappture::Tooltip::cue $itk_component(combo) \ 315 319 "Can't download data. Looks like you might be having trouble with the version of Java installed for your browser." 320 } elseif {"old client" == $result} { 321 Rappture::Tooltip::cue $itk_component(combo) "For this to work properly, you must first restart your Web browser. You don't need to close down this session. Simply shut down all windows for your Web browser, then restart the browser and navigate back to this page. You'll find it on \"my nanoHUB\" listed under \"my sessions\". Once the browser is restarted, the download should work properly." 322 } elseif {"old clients" == $result} { 323 Rappture::Tooltip::cue $itk_component(combo) "There are multiple browser pages connected to this session, and one of them has browser that needs to be restarted.\n\nWhoever didn't get the download should restart their Web browser. You don't need to close down this session. Simply shut down all windows for the Web browser, then restart the browser and navigate back to this page. You'll find it on \"my nanoHUB\" listed under \"my sessions\". Once the browser is restarted, the download should work properly." 316 324 } else { 317 325 bgerror $result … … 380 388 381 389 # ---------------------------------------------------------------------- 382 # USAGE: _uploadValue 390 # USAGE: _uploadValue ?<key> <value> <key> <value> ...? 383 391 # 384 392 # Invoked automatically whenever the user has uploaded data from … … 386 394 # argument) and loads into the destination widget. 387 395 # ---------------------------------------------------------------------- 388 itcl::body Rappture::Loader::_uploadValue { string} {396 itcl::body Rappture::Loader::_uploadValue {args} { 389 397 Rappture::Tooltip::cue hide ;# take down the note about the popup window 398 399 array set data $args 400 401 if {[string length [string trim $data(data)]] == 0} { 402 switch -- $data(which) { 403 file { 404 set mesg "You indicated that you were uploading a file, but y" 405 } 406 text { 407 set mesg "You indicated that you were uploading text, but y" 408 } 409 default { 410 set mesg "Y" 411 } 412 } 413 Rappture::Tooltip::cue $itk_component(combo) \ 414 "${mesg}ou didn't fill in any data on the upload form." 415 return 416 } 417 390 418 # 391 419 # BE CAREFUL: This string may have binary characters that … … 394 422 # done with it. 395 423 # 424 set string $data(data) 396 425 regsub -all {[\000-\010\013\014\016-\037\177-\377]} $string {} string 397 426 regsub -all "\r" $string "\n" string -
trunk/gui/scripts/tooltip.tcl
r115 r213 145 145 } 146 146 set pos 0 147 ::for {set i 0} {$pos >= 0 && $i < 5} {incr i} {147 ::for {set i 0} {$pos >= 0 && $i < 20} {incr i} { 148 148 incr pos 149 149 set pos [string first \n $mesg $pos]
Note: See TracChangeset
for help on using the changeset viewer.