Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.31 -r1.32 --- openacs-4/packages/dotlrn/dotlrn.info 21 Jan 2002 07:50:17 -0000 1.31 +++ openacs-4/packages/dotlrn/dotlrn.info 21 Jan 2002 19:07:55 -0000 1.32 @@ -206,9 +206,6 @@ - - - @@ -230,6 +227,8 @@ + + Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 21 Jan 2002 06:30:11 -0000 1.13 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 21 Jan 2002 19:07:55 -0000 1.14 @@ -49,19 +49,20 @@ db_transaction { if {$rel_type == "dotlrn_full_user_rel"} { # Create a portal page for this user - set portal_id [portal::create -name "Your dotLRN Workspace" $user_id] + set portal_id [portal::create -name "Your dotLRN Workspace" -default_page_name [ad_parameter user_wsp_first_page_name] $user_id] + # create the default pages from the ad_param + foreach name [split [ad_parameter user_wsp_page_names] ","] { - # XXX AKS - portals having problems with the following - # two lines - if the next line is taken out of the - # transaction, it full acc user add works, but lim acc - # user add dosent. weird!!!! - # Add the basic dotLRN class listing portlet - # XXXX - - dotlrn_main_portlet::add_self_to_page $portal_id {} + portal::page_create -portal_id $portal_id -pretty_name $name + } - # end XXXX + # manually switch back to the first page + portal::set_current_page -portal_id $portal_id \ + -page_id [portal::get_page_id -portal_id $portal_id \ + -sort_key 0] + dotlrn_main_portlet::add_self_to_page $portal_id {} + # Update the user and set the portal page correctly ns_set put $extra_vars portal_id $portal_id } Index: openacs-4/packages/dotlrn/www/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/master.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/master.adp 21 Jan 2002 06:30:11 -0000 1.6 +++ openacs-4/packages/dotlrn/www/master.adp 21 Jan 2002 19:07:55 -0000 1.7 @@ -46,5 +46,4 @@


-
MIT Sloan School of Management | MIT Index: openacs-4/packages/new-portal/sql/oracle/api-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/api-create.sql,v diff -u -r1.28 -r1.29 --- openacs-4/packages/new-portal/sql/oracle/api-create.sql 21 Jan 2002 06:52:26 -0000 1.28 +++ openacs-4/packages/new-portal/sql/oracle/api-create.sql 21 Jan 2002 19:08:41 -0000 1.29 @@ -53,6 +53,7 @@ v_page_id portal_pages.page_id%TYPE; v_layout_id portal_pages.layout_id%TYPE; v_sort_key portal_pages.sort_key%TYPE; + v_current_page_count integer; begin v_page_id := acs_object.new ( object_type => object_type, @@ -83,6 +84,21 @@ (page_id, pretty_name, portal_id, layout_id, sort_key) values (v_page_id, pretty_name, portal_id, v_layout_id, v_sort_key); + select count(*) into v_current_page_count + from portal_current_page + where portal_id = portal_page.new.portal_id; + + if v_current_page_count = 0 then + insert into portal_current_page + (portal_id, page_id) values (portal_id, v_page_id); + else + update portal_current_page + set page_id = v_page_id + where portal_id = portal_id; + +-- raise_application_error(-20000, 'aks1 just UPDATED portal_current_page with page_id ' || v_page_id || ' portal_id ' || portal_id || ' page count ' || v_current_page_count); + end if; + return v_page_id; end new; @@ -101,21 +117,22 @@ create or replace package portal as - function new ( - portal_id in portals.portal_id%TYPE default null, - name in portals.name%TYPE default 'Untitled', - theme_id in portals.theme_id%TYPE default null, - layout_id in portal_layouts.layout_id%TYPE default null, - portal_template_p in portals.portal_template_p%TYPE default 'f', - template_id in portals.template_id%TYPE default null, - object_type in acs_object_types.object_type%TYPE default 'portal', - creation_date in acs_objects.creation_date%TYPE - default sysdate, - creation_user in acs_objects.creation_user%TYPE - default null, - creation_ip in acs_objects.creation_ip%TYPE default null, - context_id in acs_objects.context_id%TYPE default null - ) return portals.portal_id%TYPE; + function new ( + portal_id in portals.portal_id%TYPE default null, + name in portals.name%TYPE default 'Untitled', + theme_id in portals.theme_id%TYPE default null, + layout_id in portal_layouts.layout_id%TYPE default null, + portal_template_p in portals.portal_template_p%TYPE default 'f', + template_id in portals.template_id%TYPE default null, + default_page_name in portal_pages.pretty_name%TYPE default 'Main Page', + object_type in acs_object_types.object_type%TYPE default 'portal', + creation_date in acs_objects.creation_date%TYPE + default sysdate, + creation_user in acs_objects.creation_user%TYPE + default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portals.portal_id%TYPE; procedure delete ( portal_id in portals.portal_id%TYPE @@ -133,6 +150,7 @@ layout_id in portal_layouts.layout_id%TYPE default null, portal_template_p in portals.portal_template_p%TYPE default 'f', template_id in portals.template_id%TYPE default null, + default_page_name in portal_pages.pretty_name%TYPE default 'Main Page', object_type in acs_object_types.object_type%TYPE default 'portal', creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -146,7 +164,6 @@ v_theme_id portals.theme_id%TYPE; v_layout_id portal_layouts.layout_id%TYPE; v_page_id portal_pages.page_id%TYPE; - v_current_page_id portal_pages.page_id%TYPE; begin -- we must create at least one page for this portal @@ -175,21 +192,16 @@ -- now insert the default page v_page_id := portal_page.new ( portal_id => v_portal_id, - pretty_name => 'Default Page', + pretty_name => default_page_name, layout_id => v_layout_id, creation_date => creation_date, creation_user => creation_user, creation_ip => creation_ip, context_id => context_id ); - - -- set the current page to the page we just made --- insert into portal_current_page --- (portal_id, page_id) values (v_portal_id, v_page_id); - else - -- we have to copy things like the template, theme form the template - -- portal_template_p is false. no chained templates yet + -- we have to copy things like the template, theme form the + -- templateportal_template_p is false. no chained templates select theme_id into v_theme_id from portals where portal_id = portal.new.template_id; @@ -208,15 +220,6 @@ sort_key => page.sort_key ); end loop; - - -- set the current page to page with sk 0 - select page_id into v_current_page_id - from portal_pages - where portal_id = v_portal_id - and sort_key = 0; - - insert into portal_current_page - (portal_id, page_id) values (v_portal_id, v_current_page_id); end if; 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 -r1.3 -r1.4 --- openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 21 Jan 2002 09:37:41 -0000 1.3 +++ openacs-4/packages/new-portal/tcl/portal-procs-oracle.xql 21 Jan 2002 19:08:41 -0000 1.4 @@ -13,6 +13,7 @@ layout_id => :layout_id, template_id => :template_id, portal_template_p => :portal_template_p, + default_page_name => :default_page_name, context_id => :context_id ); Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -r1.94 -r1.95 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 21 Jan 2002 15:42:32 -0000 1.94 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 21 Jan 2002 19:08:41 -0000 1.95 @@ -97,6 +97,7 @@ {-template_id ""} {-portal_template_p "f"} {-layout_name "Simple 2-Column"} + {-default_page_name ""} {-context_id ""} user_id } {