update content_activities set activity_id = :activity_id where item_id = :page_item_id insert into content_activities (item_id,activity_id) values (:item_id,:activity_id) select count(p.page_id) from cr_items ci, xowiki_page p where ci.parent_id = :folder_id and ci.content_type = '::xowiki::PageInstance' and p.page_id = ci.live_revision select p.page_order from cr_items ci, cr_revisions r, xowiki_page p where ci.parent_id = :folder_id and ci.content_type not in ('::xowiki::PageTemplate') and r.revision_id = ci.live_revision and p.page_id = r.revision_id and p.page_order is not null order by p.page_order desc select 1 from cr_items where name = :page_name and parent_id = :folder_id