Index: openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql 14 Sep 2002 12:45:39 -0000 1.5 +++ openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql 21 Sep 2002 17:09:09 -0000 1.6 @@ -678,7 +678,7 @@ null, null ); - + return 0; end;' language 'plpgsql'; select inline_10 (); @@ -910,14 +910,14 @@ ) returns integer as' declare - audience_item_id alias $1; + audience_item_id alias for $1; begin delete from cr_wp_presentations_aud where exists (select 1 from cr_revisions where revision_id = cr_wp_presentations_aud.id and item_id = audience_item_id); delete from cr_item_publish_audit where item_id = audience_item_id; - content_item__delete(audience_item_id); + PERFORM content_item__delete(audience_item_id); return 0; end;' language 'plpgsql'; @@ -926,14 +926,14 @@ ) returns integer as' declare - background_item_id alias $1; + background_item_id alias for $1; begin delete from cr_wp_presentations_back where exists (select 1 from cr_revisions where revision_id = cr_wp_presentations_back.id and item_id = background_item_id); delete from cr_item_publish_audit where item_id = background_item_id; - content_item__delete(background_item_id); + PERFORM content_item__delete(background_item_id); return 0; end;' language 'plpgsql'; @@ -942,7 +942,7 @@ ) returns integer as' declare - pres_item_id alias $1; + pres_item_id alias for $1; v_audience_item_id cr_items.item_id%TYPE; v_background_item_id cr_items.item_id%TYPE; del_rec record; @@ -952,27 +952,27 @@ where content_type = ''cr_wp_slide'' and parent_id = pres_item_id loop - wp_slide__delete(del_rec.slide_item_id); + PERFORM wp_slide__delete(del_rec.slide_item_id); end loop; select item_id into v_audience_item_id from cr_items where content_type = ''cr_wp_presentation_aud'' and parent_id = pres_item_id; - delete_aud(v_audience_item_id); + PERFORM wp_presentation__delete_audience(v_audience_item_id); select item_id into v_background_item_id from cr_items where content_type = ''cr_wp_presentation_back'' and parent_id = pres_item_id; - delete_back(v_background_item_id); + PERFORM wp_presentation__delete_background(v_background_item_id); delete from acs_permissions where object_id = pres_item_id; - update acs_objects set context_id=null where context_id = pres_item_id; - delete from cr_wp_presentations where exists (select 1 from cr_revisions where cr_revisions__revision_id = cr_wp_presentations__presentation_id and cr_revisions.item_id = pres_item_id); - content_item__delete(pres_item_id); + -- update acs_objects set context_id=null where context_id = pres_item_id; + delete from cr_wp_presentations where exists (select 1 from cr_revisions where cr_revisions.revision_id = cr_wp_presentations.presentation_id and cr_revisions.item_id = pres_item_id); + PERFORM content_item__delete(pres_item_id); return 0; end;' language 'plpgsql'; @@ -1243,7 +1243,7 @@ PERFORM content_item__set_live_revision(v_revision_id); update cr_wp_slides - set sort_key = p_sort_key + 1 + set sort_key = sort_key + 1 where sort_key >= p_sort_key and exists (select 1 from cr_items, cr_revisions where parent_id = p_pres_item_id and cr_items.item_id = cr_revisions.item_id @@ -1411,8 +1411,9 @@ delete_preamble__preamble_item_id alias for $1; begin delete from cr_wp_slides_preamble - where exists (select 1 from cr_revisions where revision_id = cr_wp_slides_preamble.id - and item_id = delete_preamble__preamble_item_id); + where exists (select 1 from cr_revisions where revision_id = + cr_wp_slides_preamble.id + and item_id = delete_preamble__preamble_item_id); delete from cr_item_publish_audit where item_id = delete_preamble__preamble_item_id; @@ -1429,7 +1430,7 @@ begin delete from cr_wp_slides_postamble where exists (select 1 from cr_revisions where revision_id = - cr_wp_slides_postamble.id + cr_wp_slides_postamble.id and item_id = delete_postamble__postamble_item_id); delete from cr_item_publish_audit @@ -1447,7 +1448,7 @@ begin delete from cr_wp_slides_bullet_items where exists (select 1 from cr_revisions where revision_id = - cr_wp_slides_bullet_items.id + cr_wp_slides_bullet_items.id and item_id = delete_bullet_items__bullet_items_item_id); delete from cr_item_publish_audit @@ -1462,7 +1463,7 @@ ) returns integer as' declare del_rec record; - delete__slide_item_id alias for $1; + slide_item_id alias for $1; v_sort_key cr_wp_slides.sort_key%TYPE; v_pres_item_id cr_items.item_id%TYPE; v_preamble_item_id cr_items.item_id%TYPE; @@ -1472,57 +1473,56 @@ for del_rec in select item_id as attach_item_id from cr_items where content_type in (''cr_wp_image_attachment'', ''cr_wp_file_attachment'') - and parent_id = delete__slide_item_id + and parent_id = slide_item_id loop wp_attachment__delete(del_rec.attach_item_id); end loop; select item_id into v_preamble_item_id from cr_items where content_type = ''cr_wp_slide_preamble'' - and parent_id = delete__slide_item_id; + and parent_id = slide_item_id; PERFORM wp_slide__delete_preamble(v_preamble_item_id); select item_id into v_postamble_item_id from cr_items where content_type = ''cr_wp_slide_postamble'' - and parent_id = delete__slide_item_id; + and parent_id = slide_item_id; PERFORM wp_slide__delete_postamble(v_postamble_item_id); select item_id into v_bullet_items_item_id from cr_items where content_type = ''cr_wp_slide_bullet_items'' - and parent_id = delete__slide_item_id; + and parent_id = slide_item_id; PERFORM wp_slide__delete_bullet_items(v_bullet_items_item_id); - -- sort_key of all revisions should be the same +-- sort_key of all revisions should be the same select max(s.sort_key), max(i.parent_id) into v_sort_key, v_pres_item_id from cr_wp_slides s, cr_revisions r, cr_items i - where r.item_id = delete__slide_item_id + where r.item_id = slide_item_id and r.revision_id = s.slide_id and i.item_id = r.item_id; delete from cr_wp_slides where exists (select 1 from cr_revisions - where cr_revisions.revision_id = cr_wp_slides.slide_id - and cr_revisions.item_id = delete__slide_item_id); + where cr_revisions.revision_id = cr_wp_slides.slide_id + and cr_revisions.item_id = slide_item_id); update cr_wp_slides set sort_key = sort_key - 1 where sort_key > v_sort_key and exists (select 1 from cr_revisions r, cr_items i where i.parent_id = v_pres_item_id and i.item_id = r.item_id and r.revision_id = cr_wp_slides.slide_id); - update acs_objects set context_id = '''' - where context_id = delete__slide_item_id; +-- update acs_objects set context_id=null +-- where context_id = slide_item_id; - delete from cr_item_publish_audit where item_id = delete__slide_item_id; + delete from cr_item_publish_audit where item_id = slide_item_id; - PERFORM content_item__delete(delete__slide_item_id); - + PERFORM content_item__delete(slide_item_id); return 0; end;' language 'plpgsql'; @@ -1797,6 +1797,9 @@ return 0; end; 'language 'plpgsql'; + + + create function wp_presentation__set_live_revision(integer) returns integer as ' declare p_revision_id alias for $1; @@ -1819,3 +1822,4 @@ end;' language 'plpgsql'; + Index: openacs-4/packages/wp-slim/www/presentation-print-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-print-view.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-print-view.adp 21 Sep 2002 17:09:10 -0000 1.1 @@ -0,0 +1,96 @@ + +@pres_title@ + +

@pres_title@

+a Wimpy Point Presentation owned by @owner_name@ +@copyright_notice@ + + +
+

@slides.title@

+ + <% get_attach_list @slides.slide_id@ %> + + + + @attach_list.file_name@ + + + + + + + + +
+

@slides.preamble@ +

+ + + @attach_list.file_name@ + + +
+ + + + @attach_list.file_name@ + + + + + + + + + + + +
+ <% + set rownum @slides.rownum@ + set bullet_list [ multirow get slides $rownum bullet_list ] + %> + +
    +
  • @bullet_list:item@
  • +
+
+
+ + + @attach_list.file_name@ + + +
+ + + + @attach_list.file_name@ + + + + + + + + + + +
+

@slides.postamble@ +

+ + + @attach_list.file_name@ + + +
+ + + @attach_list.file_name@ + + +
+
+@page_signature@ Index: openacs-4/packages/wp-slim/www/presentation-print-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-print-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-print-view.tcl 21 Sep 2002 17:09:10 -0000 1.1 @@ -0,0 +1,50 @@ +# /packages/wimpy-point/www/presentation-print-view.tcl +ad_page_contract { +This generates a printer friendly view of a presentation, suitable for print-out thru' a browser. + @author Samir Joshi(samir@symphinity.com) + @creation-date Thu 8 Aug 2002 + +} { + item_id:naturalnum,notnull +} -properties { + pres_title:onevalue + page_signature:onevalue + copyright_notice:onevalue + public_p:onevalue + show_modified_p :onevalue + audience:onevalue + background:onevalue + slides:multirow + owner_name:onevalue + owner_id : onevalue +} +set user_id [ad_verify_and_get_user_id] + +set subsite_name [ad_conn package_url] +regexp {^(.+)/$} $subsite_name match subsite_name + +set package_id [ad_conn package_id] +set pres_item_id $item_id +set url [ad_conn url] + +db_1row get_owner_name { +} + +db_1row get_presentation_data { +} + +db_1row get_aud_data { +} + +db_1row get_back_data { +} + +db_multirow slides get_slide_info { +} + +ad_return_template + + + + + Index: openacs-4/packages/wp-slim/www/presentation-print-view.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-print-view.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-print-view.xql 21 Sep 2002 17:09:10 -0000 1.1 @@ -0,0 +1,68 @@ + + + + + + + select item_id as first_slide_item_id + from cr_items + where content_type = 'cr_wp_slide' + and parent_id = :pres_item_id + and exists (select 1 from cr_wp_slides s where s.slide_id=cr_items.live_revision and s.sort_key=1) + + + + + + + select first_names || ' ' || last_name as owner_name, person_id as owner_id + from persons, acs_objects + where persons.person_id = acs_objects.creation_user + and acs_objects.object_id = :pres_item_id + + + + + + select p.pres_title, p.page_signature, p.style, p.copyright_notice, p.public_p, p.show_modified_p + from cr_wp_presentations p, cr_items i + where i.item_id = :pres_item_id + and i.live_revision = p.presentation_id + + + + + + select name as audience + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_presentation_aud' + and cr_items.parent_id = :pres_item_id + and cr_revisions.revision_id = cr_items.live_revision + + + + + + select name as background + from cr_revisions r, cr_items i + where i.content_type = 'cr_wp_presentation_back' + and i.parent_id = :pres_item_id + and r.revision_id = i.live_revision + + + + + + select s.slide_title as title , + i.item_id as slide_id , + s.sort_key,wp_slide__get_preamble(i.item_id) as preamble, + wp_slide__get_postamble(i.item_id) as postamble, + wp_slide__get_bullet_items(i.item_id) as bullet_list + from cr_wp_slides s, cr_items i + where i.parent_id = :pres_item_id + and i.live_revision = s.slide_id + order by s.sort_key + + + + Index: openacs-4/packages/wp-slim/www/serve-presentation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/serve-presentation.adp 6 Sep 2002 21:51:10 -0000 1.4 +++ openacs-4/packages/wp-slim/www/serve-presentation.adp 21 Sep 2002 17:09:10 -0000 1.5 @@ -22,4 +22,6 @@ +

Here is a printer-friendly version of the presentation. +
@page_signature@ Index: openacs-4/packages/wp-slim/www/serve-presentation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/serve-presentation.tcl 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/serve-presentation.tcl 21 Sep 2002 17:09:10 -0000 1.3 @@ -14,6 +14,7 @@ owner_name owner_id slides:multirow + subsite_name:onevalue } set url [ad_conn url]