Index: openacs-4/packages/contacts/tcl/oo-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/oo-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/tcl/oo-procs.tcl 9 Apr 2006 16:40:51 -0000 1.1 +++ openacs-4/packages/contacts/tcl/oo-procs.tcl 25 Apr 2006 08:50:13 -0000 1.2 @@ -50,6 +50,7 @@ {-item_id ""} {-parent_id ""} {-no_import:boolean} + {-return_pdf:boolean} } { Imports an OpenOffice file (.sxw / .odt) as a PDF file into the content repository. If item_id is specified a new revision of that item is created, else a new item is created. @@ -59,6 +60,7 @@ @param item_id The item_id of the content item to which the content should be associated. @param parent_id Needed to set the parent of this object @param no_import If this flag is specified the location of the generated PDF will be returned, but the pdf will not be stored in the content repository + @param return_pdf If this flag is specified the location of the generated PDF will be returned and the PDF will be stored in the content repository (in contrast to "no_import" @return item_id of the revision that contains the file @return file location of the file if "no_import" has been specified. } { @@ -135,7 +137,7 @@ set pdf_filename $oo_file set mime_type "application/odt" } else { -# ns_unlink $oo_file + ns_unlink $oo_file } if {$no_import_p} { @@ -170,10 +172,15 @@ $file_name ] } - ns_unlink $pdf_filename + content::item::set_live_revision -revision_id $revision_id - return [content::revision::item_id -revision_id $revision_id] + if {$return_pdf_p} { + return [list $mime_type $pdf_filename] + } else { + ns_unlink $pdf_filename + return [content::revision::item_id -revision_id $revision_id] + } } ad_proc -public contact::oo::change_content {