delete
from acs_permissions
where object_id = :portal_id
select *
from portals
where portal_id = :portal_id
update portals
set name = :name,
theme_id = :theme_id,
template_id = :template_id
where portal_id = :portal_id
select portals.name,
portals.portal_id,
portals.theme_id,
portal_layouts.layout_id,
portal_layouts.filename as layout_filename,
portal_pages.page_id
from portals,
portal_pages,
portal_layouts
where portal_pages.sort_key = :page_num
and portal_pages.portal_id = :portal_id
and portal_pages.portal_id = portals.portal_id
and portal_pages.layout_id = portal_layouts.layout_id
select portal_elements.element_id,
portal_elements.region,
portal_elements.sort_key
from portal_elements,
portal_pages
where portal_pages.portal_id = :portal_id
and portal_elements.page_id = :page_id
and portal_elements.page_id = portal_pages.page_id
and portal_elements.state != 'hidden'
order by portal_elements.region,
portal_elements.sort_key
select portals.name,
portals.portal_id,
portal_layouts.filename as template,
portal_pages.name as page_name,
portal_pages.layout_id as layout_id
from portals,
portal_layouts,
portal_pages
where portal_pages.portal_id = :portal_id
and portal_pages.page_id = :page_id
and portal_pages.portal_id = portals.portal_id
and portal_pages.layout_id = portal_layouts.layout_id
update portal_elements
set state = 'full'
where element_id = :element_id
update portal_elements
set state = 'hidden'
where element_id = :element_id
select max(page_id)
from portal_pages
where portal_id = :portal_id
select min(page_id)
from portal_pages
where portal_id = :portal_id
select element_id
from portal_elements
where page_id = :max_page_id
select name,
layout_id,
sort_key
from portal_pages
where page_id = :source_page_id
select page_id
from portal_pages
where portal_id = :portal_id
and sort_key = :sort_key
update portal_pages
set name = :name,
layout_id = :layout_id
where page_id = :target_page_id
select portal_elements.region,
portal_elements.sort_key,
portal_elements.state,
portal_datasources.datasource_id,
portal_datasources.name,
portal_elements.name as pretty_name
from portal_elements,
portal_datasources
where portal_elements.page_id = :source_page_id
and portal_elements.datasource_id = portal_datasources.datasource_id
select portal_pages.element_id
from portal_elements,
portal_pages
where portal_pages.portal_id = :portal_id
and portal_elements.page_id = portal_pages.page_id
and portal_elements.datasource_id = :datasource_id
and portal_elements.name = :name
update portal_elements
set region = :region,
sort_key = :sort_key,
state = :state,
page_id = :target_page_id
where element_id = :target_element_id
select page_id
from portal_pages
where portal_id = :portal_id
and sort_key = :sort_key
select count(*)
from portal_pages
where portal_id = :portal_id
select page_id
from portal_pages
where portal_id = :portal_id
order by sort_key
select name,
sort_key as page_num
from portal_pages
where portal_id = :portal_id
order by sort_key
select theme_id
from portals
where portal_id = :portal_id
select page_id
from portal_pages
where portal_id = :portal_id
and name = :page_name