Index: openacs-4/packages/assessment/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/apm-callback-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/apm-callback-procs.tcl 9 Jun 2005 19:19:47 -0000 1.3 +++ openacs-4/packages/assessment/tcl/apm-callback-procs.tcl 9 Jan 2006 12:23:39 -0000 1.4 @@ -22,6 +22,8 @@ # Enable the delivery intervals and delivery methods for a specific INTER_ITEM_CHECK enable_intervals_and_methods $type_id + # Service contract implementations - fts + as::sc::register_implementations } } @@ -38,6 +40,8 @@ # Delete the implementation for the notification of one specific INTER_ITEM_CHECK delete_inter_item_check_impl + # Delete service contract implementation + as::sc::unregister_implementations } } Index: openacs-4/packages/assessment/tcl/as-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-sc-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/tcl/as-sc-procs.tcl 9 Jan 2006 12:23:39 -0000 1.1 @@ -0,0 +1,57 @@ +ad_library { + + Assessment Library - Service Contracts + + @creation-date jan 2006 + @author jopez@inv.it.uc3m.es + @cvs-id $Id: as-sc-procs.tcl,v 1.1 2006/01/09 12:23:39 josee Exp $ +} + +namespace eval as {} +namespace eval as::sc {} + +ad_proc -private as::datasource { assessment_id } { + @param assessment_id +} { + # noop +} + +ad_proc -private as::url { assessment_id } { + @param assessment_id + + returns the url for the assessment + +} { + set package_id [db_string package_id { + select package_id from cr_folders where folder_id=(select context_id from acs_objects where object_id=:assessment_id) + }] + set url [apm_package_url_from_id $package_id] + return "${url}assessment?assessment_id=$assessment_id" +} + +ad_proc -private as::sc::register_implementations {} { + Register the as_assessments content type fts contract +} { + as::sc::register_fts_impl +} + +ad_proc -private as::sc::unregister_implementations {} { + acs_sc::impl::delete -contract_name FtsContentProvider -impl_name as_assessments +} + +ad_proc -private as::sc::register_fts_impl {} { + set spec { + name "as_assessments" + aliases { + datasource as::datasource + url as::url + } + contract_name FtsContentProvider + owner assessment + } + + acs_sc::impl::new_from_spec -spec $spec +} + + +