Index: openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql 6 May 2001 21:40:21 -0000 1.1 +++ openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql 15 May 2001 16:59:00 -0000 1.2 @@ -17,6 +17,40 @@ + + + FIX ME CONNECT BY + + select upper(coalesce(attr.table_name,t.table_name)) as attr_table_name, + upper(coalesce(attr.column_name, attr.attribute_name)) as attr_column_name, + attr.ancestor_type, attr.min_n_values, attr.default_value + from acs_object_type_attributes attr, + (select t.object_type, t.table_name, level as type_level + from acs_object_types t + start with t.object_type = :object_type + connect by prior t.supertype = t.object_type) t + where attr.ancestor_type = t.object_type + and attr.object_type = :object_type + order by t.type_level + + + + + + + + FIX ME CONNECT BY + + select t.object_type + from acs_object_types t + where t.dynamic_p = 't' + start with t.object_type = :object_type + connect by prior t.object_type = t.supertype + + + + + @@ -32,11 +66,37 @@ + + + FIX ME CONNECT BY + + select t.object_type as ancestor_type + from acs_object_types t + start with t.object_type = :object_type + connect by prior t.supertype = t.object_type + + + + + + + + FIX ME CONNECT BY + + select t.object_type as sub_type + from acs_object_types t + start with t.object_type = :object_type + connect by prior t.object_type = t.supertype + + + + + - select acs_object.name(:user_id) as author, - current_time as creation_date + select acs_object__name(:user_id) as author, + current_timestamp as creation_date @@ -46,27 +106,74 @@ - select acs_object.name(:user_id) as author, - current_time as creation_date + select acs_object__name(:user_id) as author, + current_timestamp as creation_date + + + + select a.attribute_id, + coalesce(a.table_name, t.table_name) as table_name, + coalesce(a.column_name, a.attribute_name) as attribute_name, + a.pretty_name, + a.datatype, + case when a.min_n_values = 0 then 'f' else 't' end as required_p, + a.default_value, + t.table_name as object_type_table_name, + t.id_column as object_type_id_column + from acs_object_type_attributes a, + (select t.object_type, t.table_name, t.id_column, tree_level(t.tree_sortkey) as type_level + from acs_object_types t + where tree_sortkey like + (select tree_sortkey || '%' + from acs_object_types + where object_type = :start_with)) t + where a.object_type = :object_type + and t.object_type = a.ancestor_type $storage_clause + order by type_level + + + + + + + + select cols.table_name, cols.column_name + from user_tab_columns cols, + (select upper(t.table_name) as table_name + from acs_object_types t + where t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type = :object_type)) t + where cols.column_name in + (select args.argument_name + from user_arguments args + where args.position > 0 + and args.object_name = upper(:object_name) + and args.package_name = upper(:package_name)) + and cols.table_name = t.table_name + + + + + --- FIX ME PLSQL --- BEGIN - select ${package_name}__new([plsql_utility::generate_attribute_parameter_call \ + FIX ME PLSQL + + BEGIN + :1 := ${package_name}.new([plsql_utility::generate_attribute_parameter_call \ -prepend ":" \ -indent [expr [string length $package_name] + 29] \ $pieces] ); --- END; - + END; + - +