Index: openacs-4/packages/contacts/contacts.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/contacts.info,v
diff -u -r1.71 -r1.72
--- openacs-4/packages/contacts/contacts.info 1 Apr 2006 07:13:26 -0000 1.71
+++ openacs-4/packages/contacts/contacts.info 3 May 2006 05:48:10 -0000 1.72
@@ -7,14 +7,14 @@
f
f
-
+
Matthew Geddert
This application lets you collaboratively view, edit and categorize contacts.
2006-03-31
Contacts is an application for managing all those people and or organization you need to keep track of. It has a complete UI for storing and categorizing contacts. Each contact can have an arbitrary number of custom attributes associated with it, including other contacts (i.e. a certain contact "belongs" to a certain organization). It also functions as a service contract provider for attributes related to users in your system
0
-
+
@@ -70,6 +70,7 @@
+
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.2 -r1.3
--- openacs-4/packages/contacts/tcl/oo-procs.tcl 25 Apr 2006 08:50:13 -0000 1.2
+++ openacs-4/packages/contacts/tcl/oo-procs.tcl 3 May 2006 05:48:11 -0000 1.3
@@ -183,6 +183,79 @@
}
}
+ad_proc -public contact::oo::join_pdf {
+ -filenames:required
+ {-title ""}
+ {-item_id ""}
+ {-parent_id ""}
+ {-no_import:boolean}
+ {-return_pdf:boolean}
+} {
+ Joins given pdf files and inserts the resulting 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.
+
+ @param filenames The full path to the pdf-files to be joined.
+ @param title Title which will be used for the resulting content item and file name if none was given in the item
+ @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.
+} {
+ # This exec command is missing all the good things about openacs
+ # Add the parameter to whatever package you put this procedure in.
+ set pdfjoin_bin [parameter::get -parameter "PdfJoinBin" -default "/usr/bin/pdfjoin"]
+ set pdf_filename "[ns_tmpnam].pdf"
+
+ catch {eval exec $pdfjoin_bin --outfile $pdf_filename [join $filenames " "]} result
+ set mime_type "application/pdf"
+
+ if {![file exists $pdf_filename]} {
+ error "$result - couldn't join pdfs"
+ return
+ }
+
+ if {$no_import_p} {
+ return [list $mime_type $pdf_filename]
+ }
+
+ set pdf_filesize [file size $pdf_filename]
+
+ set file_name [file tail $pdf_filename]
+ if {$title eq ""} {
+ set title $file_name
+ }
+
+ if {[exists_and_not_null $item_id]} {
+ set parent_id [get_parent -item_id $item_id]
+
+ set revision_id [cr_import_content \
+ -title $title \
+ -item_id $item_id \
+ $parent_id \
+ $pdf_filename \
+ $pdf_filesize \
+ $mime_type \
+ $file_name ]
+ } else {
+ set revision_id [cr_import_content \
+ -title $title \
+ $parent_id \
+ $pdf_filename \
+ $pdf_filesize \
+ $mime_type \
+ $file_name ]
+ }
+
+ content::item::set_live_revision -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 {
-path:required
-document_filename:required