attribute::multirow (public)

 attribute::multirow [ -start_with start_with ] \
    [ -include_storage_types include_storage_types ] \
    [ -datasource_name datasource_name ] [ -object_type object_type ] \
    [ -return_url return_url ] object_id

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

Sets up a multirow datasource containing the attribute values of object_id. We only support specific storage attributes. We include all attributes of the object's type, or any of its supertypes, up to $start_with.

Switches:
-start_with (optional, defaults to "acs_object")
-include_storage_types (optional, defaults to "type_specific")
-datasource_name (optional, defaults to "attributes")
-object_type (optional)
-return_url (optional)
Parameters:
object_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-subsite/www/admin/groups/one.tcl packages/acs-subsite/ www/admin/groups/one.tcl attribute::multirow attribute::multirow packages/acs-subsite/www/admin/groups/one.tcl->attribute::multirow packages/acs-subsite/www/admin/parties/one.tcl packages/acs-subsite/ www/admin/parties/one.tcl packages/acs-subsite/www/admin/parties/one.tcl->attribute::multirow packages/acs-subsite/www/admin/relations/one.tcl packages/acs-subsite/ www/admin/relations/one.tcl packages/acs-subsite/www/admin/relations/one.tcl->attribute::multirow ad_conn ad_conn (public) attribute::multirow->ad_conn attribute::array_for_type attribute::array_for_type (public) attribute::multirow->attribute::array_for_type db_foreach db_foreach (public) attribute::multirow->db_foreach db_string db_string (public) attribute::multirow->db_string export_vars export_vars (public) attribute::multirow->export_vars

Testcases:
No testcase defined.
Source code:

        upvar $datasource_name attributes

        if {$object_type eq ""} {
            set object_type [db_string object_type_query {
                select object_type from acs_objects where object_id = :object_id
            }]
        }

        if {$return_url eq ""} {
            set return_url "[ad_conn url]?[ad_conn query]"
        }

        # Build up the list of attributes for the type specific lookup
        set attr_list [attribute::array_for_type  -start_with $start_with  -include_storage_types $include_storage_types  attr_props enum_values $object_type]

        # Build up a multirow datasource to present these attributes to the user
        template::multirow create $datasource_name pretty_name value export_vars

        set package_object_view [package_object_view  -start_with "acs_object"  $object_type]

        if { [array size attr_props] > 0 } {
            db_foreach attribute_select [subst -nocommands {
                select *
                from ($package_object_view) dummy
                where object_id = :object_id
            }] {
                foreach key $attr_list {
                    set col_value [set $key]
                    set attribute_id $attr_props(id:$key)
                    if { $attr_props(datatype:$key) eq "enumeration" && [info exists enum_values($key:$col_value)] } {
                        # Replace the value stored in the column with the
                        # pretty name for that attribute
                        set col_value $enum_values($key:$col_value)
                    }
                    template::multirow append $datasource_name $attr_props(pretty_name:$key$col_value "id_column=$object_id&[export_vars {attribute_id return_url}]"
                }
            }
        }
Generic XQL file:
packages/acs-subsite/tcl/attribute-procs.xql

PostgreSQL XQL file:
packages/acs-subsite/tcl/attribute-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/attribute-procs-oracle.xql

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