acs_object_type_hierarchy (public)

 acs_object_type_hierarchy [ -object_type object_type ] \
    [ -indent_string indent_string ] [ -indent_width indent_width ] \
    [ -join_string join_string ] [ -additional_html additional_html ]

Defined in packages/acs-tcl/tcl/object-type-procs.tcl

Returns an HTML snippet representing a hierarchy of ACS Object Types

Switches:
-object_type
(optional)
the object type for which to show a hierarchy for.
-indent_string
(defaults to " ") (optional)
string with which to lpad
-indent_width
(defaults to "4") (optional)
number of times to insert indent_string into indentation
-join_string
(defaults to "<br>") (optional)
string with which to join each row returned by the query
-additional_html
(optional)
any additional html you might want to print per line
Author:
Yonatan Feldman <yon@arsdigita.com>
Created:
August 13, 2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_object_type_hierarchy object_type_hierarchy (test acs-tcl) acs_object_type_hierarchy acs_object_type_hierarchy test_object_type_hierarchy->acs_object_type_hierarchy db_foreach db_foreach (public) acs_object_type_hierarchy->db_foreach db_map db_map (public) acs_object_type_hierarchy->db_map export_vars export_vars (public) acs_object_type_hierarchy->export_vars lang::util::localize lang::util::localize (public) acs_object_type_hierarchy->lang::util::localize packages/acs-subsite/www/admin/object-types/index.tcl packages/acs-subsite/ www/admin/object-types/index.tcl packages/acs-subsite/www/admin/object-types/index.tcl->acs_object_type_hierarchy packages/acs-subsite/www/admin/object-types/one.tcl packages/acs-subsite/ www/admin/object-types/one.tcl packages/acs-subsite/www/admin/object-types/one.tcl->acs_object_type_hierarchy

Testcases:
object_type_hierarchy
Source code:

    set result ""

    if { $object_type ne "" } {
        set sql [db_map object_type_not_null]
        set join_string "&nbsp;&gt;&nbsp;"
    } else {
        set sql [db_map object_type_is_null]
    }

    set i 0
    db_foreach object_types "$sql" {

        if { $i > 0 } {
            append result $join_string
        }
        incr i
        set href [export_vars -base ./one {object_type}]
        append result [subst {\n    $indent<a href="[ns_quotehtml $href]">[lang::util::localize $pretty_name]</a>}]
        append result $additional_html
    }

    return $result
XQL Not present:
Generic
PostgreSQL XQL file:
<fullquery name="acs_object_type_hierarchy.object_type_not_null">
    <querytext>

	select o2.object_type,
	       o2.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 between o2.tree_sortkey and tree_right(o2.tree_sortkey)
         order by level desc

      </querytext>
</fullquery>

<fullquery name="acs_object_type_hierarchy.object_type_is_null">
    <querytext>

	select object_type,
	       pretty_name,
               repeat('$indent_string',(tree_level(tree_sortkey) - 1) * $indent_width) as indent
	  from acs_object_types
	 order by tree_sortkey

      </querytext>
</fullquery>
packages/acs-tcl/tcl/object-type-procs-postgresql.xql

Oracle XQL file:
<fullquery name="acs_object_type_hierarchy.object_type_not_null">
    <querytext>

	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

      </querytext>
</fullquery>

<fullquery name="acs_object_type_hierarchy.object_type_is_null">
    <querytext>

	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

      </querytext>
</fullquery>
packages/acs-tcl/tcl/object-type-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: