Index: openacs-4/packages/lorsm/tcl/lorsm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.tcl,v diff -u -N -r1.6.2.11 -r1.6.2.12 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 23 May 2006 15:01:59 -0000 1.6.2.11 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 24 May 2006 11:26:19 -0000 1.6.2.12 @@ -654,7 +654,30 @@ return $url } +ad_proc -public lorsm::register_xml_object_id { + {-xml_file:required} + {-tmp_dir:required} + {-community_id:required} +} { + Relation with lorsm of IMSCP files returning the object_id +} { + # Save the current package_id to restore when the object is + # imported + set current_package_id [ad_conn package_id] + # Get the package_id associated with the current community + # FIXME this is a hack until I figure out how to get the + # package_id of the current community + ad_conn -set package_id [db_string get_package_id {select dotlrn_community_applets.package_id from dotlrn_community_applets join apm_packages on (dotlrn_community_applets.package_id=apm_packages.package_id) where community_id = :community_id and package_key='lorsm'}] + + set object_id [lorsm::import_imscp -upload_file $xml_file -tmp_dir $tmp_dir] + + # Restore the package_id + ad_conn -set package_id $current_package_id + + return $object_id +} + # namespace eval lorsm::merge { # ad_proc -callback MergeShowUserInfo -impl lorsm {