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 -r1.6.2.5 -r1.6.2.6 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 19 Jul 2005 21:28:33 -0000 1.6.2.5 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 30 Jan 2006 16:55:47 -0000 1.6.2.6 @@ -652,3 +652,27 @@ set url [export_vars -base ${base_url}lorsm {man_id item_id}] return $url } + +ad_proc -public lorms::imscp::register_xml_object_id { + {-xml_file: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::imscp::import_imscp $xml_file] + + # Restore the package_id + ad_conn -set package_id $current_package_id + + return $object_id +} +