content::item::content_methods_by_type (public)

 content::item::content_methods_by_type [ -get_labels ] content_type

Defined in packages/acs-content-repository/tcl/content-item-procs.tcl

Determines all the valid content methods for instantiating a content type. Possible choices are text_entry, file_upload, no_content and xml_import. Currently, this proc merely removes the text_entry method if the item does not have a text mime type registered to it. In the future, a more sophisticated mechanism will be implemented.

Switches:
-get_labels
(boolean) (optional)
Return not just a list of types, but a list of name-value pairs, as in the -options ATS switch for form widgets
Parameters:
content_type - The content type
Returns:
A Tcl list of all possible content methods

Partial Call Graph (max 5 caller/called nodes):
%3 db_list db_list (public) content::item::content_methods_by_type content::item::content_methods_by_type content::item::content_methods_by_type->db_list

Testcases:
No testcase defined.
Source code:

    set types [db_list cmbt_get_content_mime_types {
        select mime_type from cr_content_mime_type_map
        where content_type = :content_type
        and lower(mime_type) like 'text/%'
    }]

    set need_text [expr {[llength $types] > 0}]

    if { [info exists $get_label)] } {
        set methods [list  [list "No Content" no_content]  [list "File Upload" file_upload]]

        if { $need_text } {
            lappend methods [list "Text Entry" text_entry]
        }

        lappend methods [list "XML Import" xml_import]
    } else {
        set methods [list no_content file_upload]
        if { $need_text } {
            lappend methods text_entry
        }
        lappend methods xml_import
  }

  return $methods
Generic XQL file:
packages/acs-content-repository/tcl/content-item-procs.xql

PostgreSQL XQL file:
packages/acs-content-repository/tcl/content-item-procs-postgresql.xql

Oracle XQL file:
packages/acs-content-repository/tcl/content-item-procs-oracle.xql

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