Index: openacs-4/packages/xowiki/tcl/xowiki-uploader-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-uploader-procs.tcl,v diff -u -r1.3.2.3 -r1.3.2.4 --- openacs-4/packages/xowiki/tcl/xowiki-uploader-procs.tcl 26 Aug 2020 18:35:00 -0000 1.3.2.3 +++ openacs-4/packages/xowiki/tcl/xowiki-uploader-procs.tcl 20 Aug 2022 15:44:00 -0000 1.3.2.4 @@ -35,7 +35,7 @@ :public method store_file {} { # # Store the file provided via instance variables by using the - # formfield::file implementation. + # formfield::file implementation (uses xowiki::File). # set f [::xowiki::formfield::file new -name upload -object ${:parent_object}] set file_object [$f store_file \ @@ -48,10 +48,25 @@ -publish_date_cmd {;} \ -save_flag ""] $f destroy - return {status_code 201 message created} + return [list status_code 201 message created file_object $file_object file_name ${:file_name}] } } + nx::Class create ::xowiki::UploadFileIconified -superclass ::xowiki::UploadFile { + # + # Refinement of ::xowiki::UploadFile but returning content rended + # by a special renderer. There is e.g. such a renderer defined in + # xowf for the online exam. + # + :public method store_file {} { + set d [next] + if {[dict get $d status_code] in {200 201}} { + return [list status_code 201 message [${:parent_object} render_iconified $d]] + } + return {status_code 500 message "something wrong"} + } + } + nx::Class create ::xowiki::UploadPhotoForm -superclass ::xowiki::Upload { # # Class for storing files as instances of photo.form.