Index: openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl,v diff -u -N -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl 19 Jul 2005 21:28:33 -0000 1.1.2.1 +++ openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl 30 Jan 2006 16:55:47 -0000 1.1.2.2 @@ -45,3 +45,15 @@ set result "lors merge is done" return $result } + + +ad_proc -public -callback imsld::import -impl lors {} { + this is the imsld lors importer +} { + if {$res_type == "imscp_xmlv1p0"} { + return [lorsm::imscp::register_xml_object_id \ + -xml_file $tmp_dir/$res_href \ + -community_id $community_id] + } +} + 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.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 +} +