Index: openacs-4/packages/news/tcl/news-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-callback-procs.tcl,v diff -u -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/news/tcl/news-callback-procs.tcl 18 Nov 2005 09:43:11 -0000 1.1.2.8 +++ openacs-4/packages/news/tcl/news-callback-procs.tcl 3 Mar 2006 13:12:04 -0000 1.1.2.9 @@ -41,101 +41,6 @@ return $result } -ad_proc -public -callback datamanager::move_new -impl datamanager { - -object_id:required - -selected_community:required -} { - Move a new to another class or community -} { - set new_package_id [news_get_package_id -community_id $selected_community] - -db_dml update_news {} -db_dml update_news_acs_objects_1 {} -db_dml update_news_acs_objects_2 {} -} - -ad_proc -public -callback datamanager::copy_new -impl datamanager { - -object_id:required - -selected_community:required -} { - Copy a new to another class or community -} { -#get environment data - set package_id [news_get_package_id -community_id $selected_community] - -#get the revision's data - - set news_revisions_list [db_list_of_lists get_news_revisions_data {}] - set news_revisions_number [llength $news_revisions_list] - -#do the first revision - set present_object_id [lindex [lindex $news_revisions_list 1] 0] - db_1row get_news_data {} - set publish_date_ansi [lindex [lindex $news_revisions_list 1] 1] - set publish_body [lindex [lindex $news_revisions_list 1] 2] - set mime_type [lindex [lindex $news_revisions_list 1] 3] - set publish_title [lindex [lindex $news_revisions_list 1] 4] - - - set live_revision_p "t" - -#create the new - set news_id [news_create_new -publish_body $publish_body \ - -publish_title $publish_title \ - -publish_date_ansi $publish_date_ansi \ - -mime_type $mime_type \ - -package_id $package_id \ - -archive_date_ansi $archive_date_ansi \ - -approval_user $approval_user \ - -approval_date $approval_date \ - -approval_ip $approval_ip \ - -creation_ip $creation_ip \ - -user_id $user_id \ - -live_revision_p $live_revision_p \ - -publish_lead $publish_lead ] - - -#if there are revisions, they are included here - for {set i 2} {$i < $news_revisions_number} {incr i} { - - set present_object_id [lindex [lindex $news_revisions_list $i] 0] - db_1row get_news_data {} - db_1row get_present_new_item {} - - set publish_date_ansi [lindex [lindex $news_revisions_list $i] 1] - set publish_body [lindex [lindex $news_revisions_list $i] 2] - set mime_type [lindex [lindex $news_revisions_list $i] 3] - set publish_title [lindex [lindex $news_revisions_list $i] 4] - set revision_log [lindex [lindex $news_revisions_list $i] 5] -# db_1row get_live_revision {} -# if {$live_revision == $present_object_id} { -# set active_revision_p "t" -# } else { -# set active_revision_p "f" -# } -set active_revision_p "t" - - db_exec_plsql create_news_item_revision {} - } -#does the new includes images? - - -return $news_id -} - - -ad_proc -public -callback datamanager::delete_new -impl datamanager { - -object_id:required -} { - Move a new to the trash -} { - set trash_package_id [datamanager::get_trash_package_id] - -db_dml del_update_news {} -db_dml del_update_news_acs_objects_1 {} -db_dml del_update_news_acs_objects_2 {} -} - #Callbacks for application-track ad_proc -callback application-track::getApplicationName -impl news {} { Index: openacs-4/packages/news/tcl/news-callback-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-callback-procs.xql,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/news/tcl/news-callback-procs.xql 10 Oct 2005 12:59:35 -0000 1.1.2.4 +++ openacs-4/packages/news/tcl/news-callback-procs.xql 3 Mar 2006 13:12:04 -0000 1.1.2.5 @@ -18,159 +18,4 @@ - - - update cr_news - set package_id = :new_package_id - where news_id in (select revision_id from cr_revisions where item_id = (select item_id from cr_items where live_revision=:object_id)); - - - - - - - - update acs_objects - set package_id = :new_package_id, - context_id = :new_package_id - where object_id=(select item_id from cr_revisions where revision_id=:object_id); - - - - - - update acs_objects - set package_id = :new_package_id - where object_id in (select revision_id from cr_revisions where item_id = (select item_id from cr_revisions where revision_id=:object_id)); - - - - - - - SELECT a.archive_date as archive_date_ansi, - a.approval_user, - a.approval_date, - a.approval_ip, - a.lead as publish_lead, - b.creation_user as user_id, - b.creation_ip, - b.creation_date - FROM cr_news as a, acs_objects as b - WHERE a.news_id=:present_object_id and b.object_id=:present_object_id - - - - - -SELECT context_id as new_item_id -FROM acs_objects -WHERE object_id=:news_id - - - - - -SELECT a.live_revision -FROM cr_items as a, - acs_objects as b -WHERE b.object_id=:present_object_id and a.item_id=b.context_id - - - - - - -SELECT a.revision_id, - a.publish_date, - a.content as publish_body, - a.mime_type, - a.title as publish_title, - a.description as revision_log -FROM cr_revisions as a,cr_revisions as b -WHERE b.revision_id=:object_id and b.item_id=a.item_id -ORDER BY a.revision_id - - - - - - - select news__new( - null, -- p_item_id - null, -- p_locale - :publish_date_ansi, -- p_publish_date - :publish_body, -- p_text - null, -- p_nls_language - :publish_title, -- p_title - :mime_type, -- p_mime_type - :package_id, -- p_package_id - :archive_date_ansi, -- p_archive_date - :approval_user, -- p_approval_user - :approval_date, -- p_approval_date - :approval_ip, -- p_approval_ip - null, -- p_relation_tag - :creation_ip, -- p_creation_ip - :user_id, -- p_creation_user - :live_revision_p, -- p_is_live_p - :publish_lead -- p_lead - ); - - - - - - - select news__revision_new( - :new_item_id, -- p_item_id - :publish_date_ansi, -- p_publish_date - :publish_body, -- p_text - :publish_title, -- p_title - :revision_log, -- p_description - :mime_type, -- p_mime_type - :package_id, -- p_package_id - :archive_date_ansi, -- p_archive_date - :approval_user, -- p_approval_user - :approval_date, -- p_approval_date - :approval_ip, -- p_approval_ip - current_timestamp, -- p_creation_date - :creation_ip, -- p_creation_ip - :user_id, -- p_creation_user - :active_revision_p, -- p_make_active_revision_p - :publish_lead -- p_lead - ); - - - - - - - - - update cr_news - set package_id = :trash_package_id - where news_id in (select revision_id from cr_revisions where item_id = (select item_id from cr_items where live_revision=:object_id)); - - - - - - - - update acs_objects - set package_id = :trash_package_id, - context_id = :trash_package_id - where object_id=(select item_id from cr_revisions where revision_id=:object_id); - - - - - - update acs_objects - set package_id = :trash_package_id - where object_id in (select revision_id from cr_revisions where item_id = (select item_id from cr_revisions where revision_id=:object_id)); - - - - Index: openacs-4/packages/news/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.tcl,v diff -u -r1.20.2.8 -r1.20.2.9 --- openacs-4/packages/news/tcl/news-procs.tcl 18 Nov 2005 09:43:11 -0000 1.20.2.8 +++ openacs-4/packages/news/tcl/news-procs.tcl 3 Mar 2006 13:12:04 -0000 1.20.2.9 @@ -8,76 +8,7 @@ } # News specific db-API wrapper functions and interpreters -ad_proc news_get_package_id { - -community_id -} { - Get the news package in the selected community - @param community_id -} { - - if {[info exist community_id] == 0} { - set community_id [dotlrn_community::get_community_id] - } -ns_log Notice "community_id: $community_id" - db_1row get_news_package_id {} - - return $package_id -} - -ad_proc news_create_new { - - {-item_id "null"} - {-locale "null"} - -publish_date_ansi - {-publish_body "null"} - {-nsl_language "null"} - {-publish_title "null"} - {-mime_type "text/plain"} - -package_id:required - -archive_date_ansi - -approval_user - -approval_date - -approval_ip - {-relation_tag "null"} - -creation_ip - -user_id - {-live_revision_p "t"} - {-publish_lead "null"} -} { - Create a New -} { - - if {[info exist user_id] == 0} { - set user_id [ad_conn user_id] - } - if {[info exist approval_user] == 0} { - set approval_user [ad_conn user_id] - } - - if {[info exist creation_ip] == 0} { - set creation_ip [ad_conn host] - } - if {[info exist approval_ip] == 0} { - set approval_ip [ad_conn host] - } - if {[info exist publish_date_ansi] == 0} { - set publish_date_ansi [dt_systime] - } - if {[info exist archive_date_ansi] == 0} { - set archive_date_ansi [dt_systime] - } - if {[info exist approval_date] == 0} { - set approval_date [dt_systime] - } - - set news_id [db_exec_plsql create_news_item {}] - - return $news_id -} - - - ad_proc news_items_archive { id_list when } { immediately gives all news items in list id_list @@ -438,10 +369,8 @@ -impl_name "news" \ -owner "news"] rss_gen_report $subscr_id - } - # add news notification ad_proc -public news_notification_get_url { news_package_id @@ -473,4 +402,3 @@ -notif_text $new_content } - Index: openacs-4/packages/news/tcl/news-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.xql,v diff -u -r1.8.2.5 -r1.8.2.6 --- openacs-4/packages/news/tcl/news-procs.xql 16 Nov 2005 12:14:56 -0000 1.8.2.5 +++ openacs-4/packages/news/tcl/news-procs.xql 3 Mar 2006 13:12:04 -0000 1.8.2.6 @@ -28,38 +28,4 @@ - - - SELECT b.object_id as package_id - FROM acs_objects as a,acs_objects as b - WHERE a.context_id=:community_id and a.object_type='apm_package' and a.object_id=b.context_id and b.title='News'; - - - - - - - select news__new( - null, -- p_item_id - null, -- p_locale - :publish_date_ansi, -- p_publish_date - :publish_body, -- p_text - null, -- p_nls_language - :publish_title, -- p_title - :mime_type, -- p_mime_type - :package_id, -- p_package_id - :archive_date_ansi, -- p_archive_date - :approval_user, -- p_approval_user - :approval_date, -- p_approval_date - :approval_ip, -- p_approval_ip - null, -- p_relation_tag - :creation_ip, -- p_creation_ip - :user_id, -- p_creation_user - :live_revision_p, -- p_is_live_p - :publish_lead -- p_lead - ); - - - - Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `openacs-4/packages/news/tcl/test/news-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff?