Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql 27 Nov 2003 15:25:18 -0000 1.18
+++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql 13 Mar 2007 09:09:04 -0000 1.19
@@ -20,7 +20,8 @@
p.package_key,
p.package_id,
p.instance_name,
- t.package_type
+ t.package_type,
+ (select count(*) from site_nodes where parent_id = n.node_id) as num_children
from site_nodes n left join
apm_packages p on n.object_id = p.package_id left join
apm_package_types t using (package_key)
@@ -30,6 +31,27 @@
+
+
+ select n.node_id,
+ n.parent_id,
+ n.name,
+ n.directory_p,
+ n.pattern_p,
+ n.object_id,
+ p.package_key,
+ p.package_id,
+ p.instance_name,
+ t.package_type,
+ (select count(*) from site_nodes where parent_id = n.node_id) as num_children
+ from site_nodes n left join
+ apm_packages p on n.object_id = p.package_id left join
+ apm_package_types t using (package_key)
+ where n.node_id = :node_id or n.parent_id = :node_id
+ order by n.tree_sortkey
+
+
+
select n.node_id,
@@ -41,7 +63,8 @@
p.package_key,
p.package_id,
p.instance_name,
- t.package_type
+ t.package_type,
+ (select count(*) from site_nodes where parent_id = n.node_id) as num_children
from site_nodes n left join
apm_packages p on n.object_id = p.package_id left join
apm_package_types t using (package_key)