Index: openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl,v
diff -u -N -r1.13 -r1.14
--- openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 12 May 2001 05:17:28 -0000 1.13
+++ openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 12 May 2001 18:17:39 -0000 1.14
@@ -330,7 +330,9 @@
proc db_map {snippet_name} {
set fullname [db_qd_get_fullname $snippet_name]
set fullquery [db_qd_fetch $fullname]
- return [db_fullquery_get_querytext $fullquery]
+ set sql [db_fullquery_get_querytext $fullquery]
+
+ return [uplevel 1 [list subst -nobackslashes $sql]]
}
# Check compatibility of a FullQuery against an RDBMS
Index: openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql 24 Apr 2001 23:59:24 -0000 1.1
+++ openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql 12 May 2001 18:17:17 -0000 1.2
@@ -1,11 +1,36 @@
+ postgresql7.1
+
+
-
+ select object_type,
+ pretty_name,
+ '' as indent,
+ tree_level(o2.tree_sortkey) as level
+ from (select *
+ from acs_object_types
+ where object_type = :object_type) o1,
+ acs_object_types o2
+ where o2.tree_sortkey <= o1.tree_sortkey
+ and o1.tree_sortkey like (o2.tree_sortkey || '%')
+ order by level desc
+
+
+
+
+
-[acs_object_type_hierarchy_pg_sql $object_type $indent_string $indent_width]
+
+ select object_type,
+ pretty_name,
+ repeat('$indent_string',(tree_level(tree_sortkey) - 1) * $indent_width) as indent
+ from acs_object_types
+ where tree_sortkey like (select tree_sortkey || '%'
+ from acs_object_types
+ where supertype is null)
+
-
+
-
Index: openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl 24 Apr 2001 23:59:24 -0000 1.2
+++ openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl 12 May 2001 18:17:17 -0000 1.3
@@ -33,30 +33,10 @@
set result ""
if { [exists_and_not_null object_type] } {
-
- set sql "
- select object_type,
- pretty_name,
- '' as indent
- from acs_object_types
- start with object_type = :object_type
- connect by prior supertype = object_type
- order by level desc
- "
-
+ set sql [db_map object_type_not_null]
set join_string " > "
-
} else {
-
- set sql "
- select object_type,
- pretty_name,
- replace(lpad(' ', (level - 1) * $indent_width), ' ', '$indent_string') as indent
- from acs_object_types
- start with supertype is null
- connect by supertype = prior object_type
- "
-
+ set sql [db_map object_type_is_null]
}
set i 0
@@ -75,53 +55,3 @@
}
-
-ad_proc -public acs_object_type_hierarchy_pg_sql {
-
- -object_type
- -indent_string
- -indent_width
-
-} {
-
- Returns pg version of sql for acs_object_type_hierarchy routine. This
- routine is called by the query dispatcher.
-
- @author Dan Wickstrom (dcwickstrom@earthlink.net)
- @creation-date April 24, 2001
- @param object_type the object type for which to show a hierarchy for.
- @param indent_string string with which to lpad
- @param indent_width number of times to insert indent_string
into indentation
-
-} {
-
- if { [exists_and_not_null object_type] } {
-
- set sql "
- select ot2.object_type,
- ot2.pretty_name,
- '' as indent,
- tree_level(ot2.tree_sortkey) as level
- from acs_object_types ot1, acs_object_types ot2
- where ot1.object_type = :object_type
- and ot2.tree_sortkey <= ot1.tree_sortkey
- and ot1.tree_sortkey like (ot2.tree_sortkey || '%')
- order by level desc
- "
-
- } else {
- #FIXME: what is the equivalent of oracle's replace function?
- set sql "
- select object_type,
- pretty_name,
- replace(lpad(' ', (tree_level(tree_sortkey) - 1) * $indent_width), ' ', '$indent_string') as indent
- from acs_object_types
- where tree_sortkey like (select tree_sortkey || '%'
- from acs_object_types
- where supertype is null)
- "
-
- }
-
- return $sql
-}