Index: openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl 3 Jan 2004 01:42:57 -0000 1.2 +++ openacs-4/contrib/packages/portal/tcl/datasource-procs.tcl 22 Jan 2004 02:50:12 -0000 1.3 @@ -43,11 +43,16 @@ The specification is a list of name-value pairs. Possible names are - name The name of the new datasource - owner The package that owns this portlet (defaults to name) - description A human-readable description (defaults to name) - params A list of param key/attributes and their values - aliases Service contract aliases clause for acs_sc::impl::new_from_spec + name The name of the new datasource + pretty_name The pretty name (or message key) of the datasource + owner The package that owns this portlet + application The package the portlet works with + template The template the displays the portlet content + shadeable_p If true the user can shade (i.e. close) the portlet + hideable_p If true, the user can hide the portlet entirely + description A human-readable description (defaults to name) + params A list of portlet-specific param key/attributes and their values + aliases Service contract aliases clause for acs_sc::impl::new_from_spec Each parameter key can be followed by a comma-separated list of attributes in the familiar style of ad_page_contract or ad_form. Do not include spaces @@ -65,15 +70,20 @@ set datasource(description) $datasource(name) } - # Default datasource owner to its name - if { ![info exists datasource(owner)] } { - set datasource(owner) $datasource(name) - } - db_transaction { - set datasource_id [new -name $datasource(name) -description $datasource(description)] + set var_list [list \ + [list name $datasource(name)] \ + [list pretty_name $datasource(pretty_name)] \ + [list owner $datasource(owner)] \ + [list application $datasource(application)] \ + [list template $datasource(template)] \ + [list shadeable_p $datasource(shadeable_p)] \ + [list hideable_p $datasource(hideable_p)] \ + [list description $datasource(description)]] + set datasource_id [package_exec_plsql -var_list $var_list portal_datasource new] + foreach {param value} $datasource(params) { if { ![regexp {^([^ \t:]+)(?::([a-zA-Z0-9_,(|)]*))} \ @@ -112,22 +122,6 @@ } } - ad_proc -private new { - {-name:required} - {-description:required} - } { - - @author Simon Carstensen (simon@bcuni.net) - - } { - - set var_list [list \ - [list name $name] \ - [list description $description]] - - return [package_exec_plsql -var_list $var_list portal_datasource new] - } - ad_proc -private set_def_param { {-datasource_id:required} {-config_required_p:required}