select impl_name
from acs_sc_impls, acs_sc_bindings, acs_sc_contracts
where acs_sc_impls.impl_id = acs_sc_bindings.impl_id
and acs_sc_contracts.contract_id= acs_sc_bindings.contract_id
and acs_sc_contracts.contract_name='portal_datasource'
select datasource_id
from portal_datasource_avail_map
where portal_id = :portal_id
delete from acs_permissions where object_id= :portal_id
select name from portals where portal_id = :portal_id
select p.name, pcp.portal_id, pl.filename as layout_template,
p.theme_id as theme_id, pp.layout_id as layout_id
from portals p, portal_current_page pcp, portal_layouts pl, portal_pages pp
where pcp.page_id = :page_id
and pcp.portal_id = :portal_id
and p.portal_id = pcp.portal_id
and pp.page_id = pcp.page_id
and pl.layout_id = pp.layout_id
select element_id, region, pem.sort_key
from portal_element_map pem, portal_current_page pcp
where pcp.portal_id = :portal_id
and pcp.page_id = pem.page_id
and state != 'hidden'
order by region, sort_key
update portals
set name = :new_name
where portal_id = :portal_id
select theme_id as cur_theme_id
from portals
where portal_id = :portal_id
select theme_id, name, description
from portal_element_themes
order by name
select p.name, p.portal_id, pl.filename as template, pp.pretty_name as page_name
from portals p, portal_layouts pl, portal_pages pp
where pp.portal_id = :portal_id
and pp.page_id = :page_id
and pp.portal_id = p.portal_id
and pl.layout_id = pp.layout_id
select region
from portal_supported_regions
where layout_id = :layout_id
update portal_element_map
set state = 'full'
where element_id = :element_id
update portal_element_map
set state = 'hidden'
where element_id = :element_id
update portals
set theme_id = :theme_id
where portal_id = :portal_id
select state
from portal_element_map pem, portal_current_page pcp
where pcp.portal_id = :portal_id
and pem.page_id = pcp.page_id
and element_id = :element_id
update portal_element_map
set state = 'pinned'
where element_id = :element_id
update portal_element_map
set state = 'full'
where element_id = :element_id
select 1
from portals
where portal_template_p = 't'
and portal_id = :portal_id
select template_id
from portals
where portal_id = :portal_id
and template_id is not null
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
update portal_current_page
set page_id = :page_id
where portal_id = :portal_id
select page_id
from portal_current_page
where portal_id = :portal_id
select pretty_name
from portal_pages
where page_id = :page_id
select page_id
from portal_pages
where portal_id = :portal_id
order by sort_key
select region
from portal_supported_regions
where layout_id = :layout_id
select count(*) as count
from portal_element_map pem, portal_pages pp
where pp.portal_id = :portal_id
and pem.region = :region
and pp.page_id = pem.page_id
delete from portal_element_map
where element_id= :element_id
select 1
from portals p, portal_element_map pem, portal_pages pp
where p.portal_id = :portal_id
and p.template_id = pp.portal_id
and pp.portal_id = pem.page_id
and pem.datasource_id = :ds_id
insert into portal_pages
(element_id, name, pretty_name, page_id, datasource_id, region, sort_key, state)
select :new_element_id, name, pretty_name, :page_id, :ds_id, region, sort_key, state
from portals p, portal_element_map pem, portal_pages pp
where pem.page_id = pp.page_id
and pp.portal_id = :template_id
and pem.datasource_id = :ds_id
insert into portal_element_map
(element_id, name, pretty_name, page_id, datasource_id, region, sort_key, state)
select :new_element_id, name, pretty_name, :page_id, :ds_id, region, sort_key, state
from portals p, portal_element_map pem, portal_pages pp
where pem.page_id = pp.page_id
and pp.portal_id = :template_id
and pem.datasource_id = :ds_id
insert into portal_element_parameters
(parameter_id, element_id, config_required_p, configured_p, key, value)
select acs_object_id_seq.nextval, :new_element_id, config_required_p, configured_p, key, value
from portal_element_parameters
where element_id = (select element_id
from portal_element_map pem, portal_pages pp
where pem.page_id = pp.page_id
and pp.portal_id = :template_id
and pem.datasource_id = :ds_id)
insert into portal_element_parameters
(parameter_id, element_id, config_required_p, configured_p, key, value)
select acs_object_id_seq.nextval, :new_element_id, config_required_p, configured_p, key, value
from portal_datasource_def_params where datasource_id= :ds_id
select sort_key as other_sort_key, element_id as other_element_id
from (select pem.sort_key, element_id
from portal_element_map pem, portal_pages pp
where pp.portal_id = :portal_id
and pp.page_id = pem.page_id
and region = :region
and pem.sort_key < :sort_key
and state != 'pinned'
order by pem.sort_key desc) where rownum = 1
select sort_key as other_sort_key, element_id as other_element_id
from (select pem.sort_key, element_id
from portal_element_map pem, portal_pages pp
where pp.portal_id = :portal_id
and pem.page_id = pp.page_id
and region = :region
and pem.sort_key > :sort_key
and state != 'pinned'
order by pem.sort_key) where rownum = 1
update portal_element_map set sort_key = :dummy_sort_key
where element_id = :element_id
update portal_element_map set sort_key = :sort_key
where element_id = :other_element_id
update portal_element_map set sort_key = :other_sort_key
where element_id = :element_id
update portal_element_parameters set value = :value
where element_id = :element_id and
key = :key
select value
from portal_element_parameters
where element_id= :element_id
and key= :key
insert into portal_element_parameters
(parameter_id, element_id, configured_p, key, value) values
(acs_object_id_seq.nextval, :element_id, 't', :key, :value)
delete from portal_element_parameters where
element_id= :element_id and
key= :key and
value= :value
delete from portal_element_parameters where
element_id= :element_id and
key= :key
select value
from portal_element_parameters
where element_id = :element_id and
key = :key
select pem.element_id,
pem.datasource_id,
pem.state,
pet.filename as filename,
pet.resource_dir as resource_dir
from portal_element_map pem, portal_element_themes pet
where pet.theme_id = :theme_id
and pem.element_id = :element_id
select key, value
from portal_element_parameters
where element_id = :element_id
select pem.element_id,
pem.datasource_id,
pem.state
from portal_element_map pem
where pem.element_id = :element_id
select key, value
from portal_element_parameters
where element_id = :element_id
select portal_id, datasource_id
from portal_element_map pem, portal_pages pp
where element_id = :element_id
and pem.page_id = pp.page_id
update portal_element_map
set state = 'hidden'
where element_id = :element_id
select name from portal_datasources where datasource_id = :ds_id
select datasource_id from portal_datasources where name = :ds_name
insert into portal_datasource_avail_map
(portal_datasource_id, portal_id, datasource_id)
values
(:new_p_ds_id, :portal_id, :ds_id)
delete from portal_datasource_avail_map
where portal_id = :portal_id
and datasource_id = :ds_id
select 1
from portal_datasource_avail_map
where portal_id = :portal_id and
datasource_id = :ds_id
select element_id from portal_element_map pem, portal_pages pp
where pp.portal_id= :portal_id
and datasource_id= :ds_id
and pem.page_id = pp.page_id
select layout_id from portal_pages where portal_id = :portal_id and sort_key = :page_num
select layout_id from portal_pages where page_id = :page_id
select layout_id from portal_layouts where name = :layout_name
select 1 from portals where portal_id = :portal_id
select theme_id from portal_element_themes where name = :theme_name