package_object_attribute_list (public)

 package_object_attribute_list [ -start_with start_with ] \
    [ -include_storage_types include_storage_types ] object_type

Defined in packages/acs-subsite/tcl/package-procs.tcl

Returns a list of lists all the attributes (column name or attribute_name) to be used for this object type. Each list elements contains: (attribute_id, table_name, attribute_name, pretty_name, datatype, required_p, default_value)

Switches:
-start_with
(defaults to "acs_object") (optional)
The highest parent object type for which to include attributes
-include_storage_types
(defaults to "type_specific") (optional)
Parameters:
object_type - The object type for which to include attributes
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/29/2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_item content_item (test acs-content-repository) package_object_attribute_list package_object_attribute_list test_content_item->package_object_attribute_list test_image_new image_new (test acs-content-repository) test_image_new->package_object_attribute_list db_list_of_lists db_list_of_lists (public) package_object_attribute_list->db_list_of_lists attribute::add_form_elements attribute::add_form_elements (public) attribute::add_form_elements->package_object_attribute_list content::revision::new content::revision::new (public) content::revision::new->package_object_attribute_list package_instantiate_object package_instantiate_object (public) package_instantiate_object->package_object_attribute_list package_object_view_helper package_object_view_helper (private) package_object_view_helper->package_object_attribute_list

Testcases:
image_new, content_item
Source code:

    set storage_clause ""

    if {$include_storage_types ne ""} {
        set storage_clause "
          and a.storage in ([ns_dbquotelist $include_storage_types])"
    }

    return [db_list_of_lists attributes_select {}]
Generic XQL file:
packages/acs-subsite/tcl/package-procs.xql

PostgreSQL XQL file:
<fullquery name="package_object_attribute_list.attributes_select">
    <querytext>

        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, acs_object_types t2
                where t.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
                  and t2.object_type = :start_with) t
         where a.object_type = :object_type
           and t.object_type = a.ancestor_type $storage_clause
         order by type_level, sort_order, attribute_id
      </querytext>
</fullquery>
packages/acs-subsite/tcl/package-procs-postgresql.xql

Oracle XQL file:
<fullquery name="package_object_attribute_list.attributes_select">
    <querytext>
      
	select a.attribute_id, 
	       nvl(a.table_name, t.table_name) as table_name,
	       nvl(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, level as type_level
                  from acs_object_types t
                 start with t.object_type=:start_with
               connect by prior t.object_type = t.supertype) t 
         where a.object_type = :object_type
           and t.object_type = a.ancestor_type $storage_clause
         order by type_level
      </querytext>
</fullquery>
packages/acs-subsite/tcl/package-procs-oracle.xql

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