Index: openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 10 Dec 2001 20:26:08 -0000 1.1
@@ -0,0 +1,100 @@
+
+
+
+oracle8.1.6
+
+
+
+
+ begin
+
+ :1 := portal.new (
+ name => :name,
+ layout_id => :layout_id,
+ template_id => :template_id,
+ portal_template_p => :portal_template_p,
+ context_id => :context_id
+ );
+
+ acs_permission.grant_permission (
+ object_id => :1,
+ grantee_id => :user_id,
+ privilege => 'portal_read_portal'
+ );
+
+ acs_permission.grant_permission (
+ object_id => :1,
+ grantee_id => :user_id,
+ privilege => 'portal_edit_portal'
+ );
+
+ if :portal_template_p = 't' then
+ acs_permission.grant_permission (
+ object_id => :1,
+ grantee_id => :user_id,
+ privilege => 'portal_admin_portal'
+ );
+ end if;
+
+ end;
+
+
+
+
+
+
+ begin
+ portal.delete (portal_id => :portal_id);
+ end;
+
+
+
+
+
+ update portal_element_map
+ set region = :region,
+ sort_key = (select nvl((select max(sort_key) + 1
+ from portal_element_map
+ where portal_id = :portal_id
+ and region = :region),
+ 1)
+ from dual)
+ where element_id = :element_id
+
+
+
+
+
+ insert into portal_element_map
+ (element_id, name, pretty_name, portal_id, datasource_id, region, sort_key)
+ values
+ (:new_element_id, :ds_name, :ds_name, :portal_id, :ds_id, :region,
+ nvl((select max(sort_key) + 1
+ from portal_element_map
+ where region = :region), 1))
+
+
+
+
+
+ update portal_element_map
+ set region = :target_region,
+ sort_key = (select nvl((select max(sort_key) + 1
+ from portal_element_map
+ where portal_id = :portal_id
+ and region = :target_region),
+ 1)
+ from dual)
+ where element_id = :element_id
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/new-portal/tcl/portal-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/new-portal/tcl/portal-procs.xql 10 Dec 2001 20:26:08 -0000 1.1
@@ -0,0 +1,314 @@
+
+
+
+
+
+ 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
+
+
+
+
+
+ select layout_id from
+ portal_layouts where
+ name = $layout_name
+
+
+
+
+
+ delete from acs_permissions where object_id= :portal_id
+
+
+
+
+
+ select name from portals where portal_id = :portal_id
+
+
+
+
+
+ select portal_id, portals.name, theme_id, filename as layout_template
+ from portals, portal_layouts
+ where portals.layout_id = portal_layouts.layout_id
+ and portal_id = :portal_id
+
+
+
+
+
+ select element_id, region, sort_key
+ from portal_element_map
+ where portal_id = :portal_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.portal_id, p.name, t.filename as template, t.layout_id
+ from portals p, portal_layouts t
+ where p.layout_id = t.layout_id
+ and p.portal_id = :portal_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
+ where portal_id = :portal_id
+ and element_id = :element_id
+
+
+
+
+
+ update portal_element_map
+ set state = 'locked'
+ where portal_id = :portal_id
+ and element_id = :element_id
+
+
+
+
+
+ update portal_element_map
+ set state = 'full'
+ where portal_id = :portal_id
+ and 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 region
+ from portal_supported_regions
+ where layout_id = :layout_id
+
+
+
+
+
+ select count(*) as count
+ from portal_element_map
+ where portal_id = :portal_id
+ and region = :region
+
+
+
+
+
+ delete from portal_element_map
+ where element_id= :element_id
+
+
+
+
+
+ select template_id
+ from portals p, portal_element_map pem
+ where p.portal_id = :portal_id
+ and p.template_id = pem.portal_id
+ and pem.datasource_id = :ds_id
+
+
+
+
+
+ insert into portal_element_map
+ (element_id, name, pretty_name, portal_id, datasource_id, region, sort_key, state)
+ select :new_element_id, name, pretty_name, :portal_id, :ds_id, region, sort_key, state
+ from portal_element_map
+ where portal_id = :template_id
+ and 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
+ where portal_id = :template_id
+ and 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 sort_key, element_id
+ from portal_element_map
+ where portal_id = :portal_id
+ and region = :region
+ and sort_key < :sort_key
+ and state != 'locked'
+ order by sort_key desc) where rownum = 1
+
+
+
+
+
+ select sort_key as other_sort_key, element_id as other_element_id
+ from (select sort_key, element_id
+ from portal_element_map
+ where portal_id = :portal_id
+ and region = :region
+ and sort_key > :sort_key
+ and state != 'locked'
+ order by 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+