Index: openacs-4/packages/cms/tcl/form-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-oracle.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/tcl/form-procs-oracle.xql 4 Jul 2001 17:20:54 -0000 1.1
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+ select
+ attributes.attribute_id, attribute_name,
+ attributes.table_name,
+ attribute_label, type_label, object_type as subtype, datatype,
+ params.is_html, params.is_required,
+ widget, param,
+ nvl( (select param_type from cm_attribute_widget_params
+ where attribute_id = attributes.attribute_id
+ and param_id = params.param_id), 'literal' ) param_type,
+ nvl( (select param_source from cm_attribute_widget_params
+ where attribute_id = attributes.attribute_id
+ and param_id = params.param_id),
+ 'onevalue' ) param_source,
+ nvl( (select value from cm_attribute_widget_params
+ where attribute_id = attributes.attribute_id
+ and param_id = params.param_id),
+ params.default_value ) value
+ from
+ (
+ select
+ aw.attribute_id, fwp.param,
+ aw.widget, decode(aw.is_required,'t','t',fwp.is_required) is_required,
+ fwp.param_id, fwp.default_value, fwp.is_html
+ from
+ cm_form_widget_params fwp, cm_attribute_widgets aw
+ where
+ fwp.widget = aw.widget
+ ) params,
+ (
+ select
+ attr.attribute_id, attribute_name, sort_order,
+ attr.pretty_name as attribute_label, attr.datatype,
+ types.object_type, types.pretty_name as type_label,
+ tree_level, types.table_name
+ from
+ acs_attributes attr,
+ (
+ select
+ object_type, pretty_name, level as tree_level,
+ table_name
+ from
+ acs_object_types
+ where
+ object_type ^= 'acs_object'
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = :content_type
+ ) types
+ where
+ attr.object_type = types.object_type
+ ) attributes
+ where
+ attributes.attribute_id = params.attribute_id
+
+
+
+
+
+
+
+ and $extra_where
+
+
+
+
+
+
+ select content_item.get_latest_revision(:item_id) from dual
+
+
+
+
+
+ select nvl(pretty_name,enum_value), enum_value
+ from acs_enum_values
+ where attribute_id = :attribute_id
+ order by sort_order
+
+
+
+
+
+ begin
+ :revision_id := content_revision.new(
+ title => :title,
+ description => :description,
+ mime_type => :mime_type,
+ text => ' ',
+ item_id => content_symlink.resolve(:item_id),
+ creation_ip => '[ns_conn peeraddr]',
+ creation_user => [User::getID]
+ );
+ end;
+
+
+
+
+
+
+ select
+ types.table_name, types.id_column, attr.attribute_name,
+ attr.datatype
+ from
+ acs_attributes attr,
+ ( select
+ object_type, table_name, id_column, level as inherit_level
+ from
+ acs_object_types
+ where
+ object_type <> 'acs_object'
+ and
+ object_type <> 'content_revision'
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = :content_type) types
+ where
+ attr.object_type (+) = types.object_type
+ order by
+ types.inherit_level desc
+
+
+
+
+
+
+
+ select
+ types.table_name, types.id_column, attr.attribute_name,
+ attr.datatype
+ from
+ acs_attributes attr,
+ ( select
+ object_type, table_name, id_column, level as inherit_level
+ from
+ acs_object_types
+ where
+ object_type not in ($sql_exclusion)
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = :content_type) types
+ where
+ attr.object_type (+) = types.object_type
+
+
+
+
+
+
+
+ and $extra_where
+
+
+
+
+
+
+
+ order by
+ types.inherit_level desc
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/cms/tcl/form-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-postgresql.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/tcl/form-procs-postgresql.xql 4 Jul 2001 17:20:54 -0000 1.1
@@ -0,0 +1,165 @@
+
+
+postgresql7.1
+
+
+
+
+ select
+ attributes.attribute_id, attribute_name,
+ attributes.table_name,
+ attribute_label, type_label, object_type as subtype, datatype,
+ params.is_html, params.is_required,
+ widget, param,
+ nvl( (select param_type from cm_attribute_widget_params
+ where attribute_id = attributes.attribute_id
+ and param_id = params.param_id), 'literal' ) param_type,
+ nvl( (select param_source from cm_attribute_widget_params
+ where attribute_id = attributes.attribute_id
+ and param_id = params.param_id),
+ 'onevalue' ) param_source,
+ nvl( (select value from cm_attribute_widget_params
+ where attribute_id = attributes.attribute_id
+ and param_id = params.param_id),
+ params.default_value ) value
+ from
+ (
+ select
+ aw.attribute_id, fwp.param,
+ aw.widget, decode(aw.is_required,'t','t',fwp.is_required) is_required,
+ fwp.param_id, fwp.default_value, fwp.is_html
+ from
+ cm_form_widget_params fwp, cm_attribute_widgets aw
+ where
+ fwp.widget = aw.widget
+ ) params,
+ (
+ select
+ attr.attribute_id, attribute_name, sort_order,
+ attr.pretty_name as attribute_label, attr.datatype,
+ types.object_type, types.pretty_name as type_label,
+ tree_level, types.table_name
+ from
+ acs_attributes attr,
+ (
+ select
+ object_type, pretty_name, level as tree_level,
+ table_name
+ from
+ acs_object_types
+ where
+ object_type ^= 'acs_object'
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = :content_type
+ ) types
+ where
+ attr.object_type = types.object_type
+ ) attributes
+ where
+ attributes.attribute_id = params.attribute_id
+
+
+
+
+
+ select content_item__get_latest_revision(:item_id)
+
+
+
+
+
+ select nvl(pretty_name,enum_value), enum_value
+ from acs_enum_values
+ where attribute_id = :attribute_id
+ order by sort_order
+
+
+
+
+
+ :revision_id := select content_revision__new(:title,:description,:mime_type,' ',content_symlink__resolve(:item_id),'[ns_conn peeraddr]',[User::getID]
+
+
+
+
+
+
+ select
+ types.table_name, types.id_column, attr.attribute_name,
+ attr.datatype
+ from
+ acs_attributes attr PIGHT OUTER JOIN
+ ( select
+ o2.object_type, o2.table_name, o2.id_column,
+ tree_level(o2.tree_sortkey) as inherit_level
+ from
+ ( SELECT *
+ FROM acs_object_types
+ WHERE object_type = :content_type
+ ) o1,
+ acs_object_types o2
+ where
+ o2.object_type <> 'acs_object'
+ AND
+ o2.object_type <> 'content_revision'
+ AND
+ o2.tree_sortkey <= o1.tree_sortkey
+ AND
+ o1.tree_sortkey like (o2.tree_sortkey || '%')
+
+ ) types USING (object_type)
+ order by
+ types.inherit_level desc
+
+
+
+
+
+
+
+ select
+ types.table_name, types.id_column, attr.attribute_name,
+ attr.datatype
+ from
+ acs_attributes attr,
+ ( select
+ o2.object_type, o2.table_name, o2.id_column,
+ tree_level(o2.tree_sortkey) as inherit_level
+ from
+ ( SELECT *
+ FROM acs_object_types
+ WHERE object_type = :content_type
+ ) o1,
+ acs_object_types o2
+ where
+ object_type not in ($sql_exclusion)
+ and
+ o2.tree_sortkey <= o1.tree_sortkey
+ and
+ o1.tree_sortkey like (o2.tree_sortkey || '%')
+
+ ) types USING (object_type)
+
+
+
+
+
+
+
+ and $extra_where
+
+
+
+
+
+
+
+ order by
+ types.inherit_level desc
+
+
+
+
+
Index: openacs-4/packages/cms/tcl/form-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/tcl/form-procs.xql 4 Jul 2001 17:20:54 -0000 1.1
@@ -0,0 +1,39 @@
+
+
+
+
+
+ select content_type from cr_items i, cr_revisions r
+ where r.item_id = i.item_id
+ and r.revision_id = :revision_id
+
+
+
+
+
+
+ select $what from ${table_name}x where revision_id = :revision_id
+
+
+
+
+
+ insert into $last_table (
+ [join $columns ", "]
+ ) values (
+ [join $values ", "]
+ )"
+
+
+
+
+
+ insert into $last_table (
+ [join $columns ", "]
+ ) values (
+ [join $values ", "]
+ )"
+
+
+
+
\ No newline at end of file