• Publicity: Public Only All

content-type-procs.tcl

Procedures for content types

Location:
packages/acs-content-repository/tcl/content-type-procs.tcl
Created:
2004-06-09
Author:
Dave Bauer <dave@thedesignexperience.org>
CVS Identification:
$Id: content-type-procs.tcl,v 1.17.2.1 2019/04/12 21:19:13 gustafn Exp $

Procedures in this file

Detailed information

content::type::attribute::delete (public)

 content::type::attribute::delete -content_type content_type \
    -attribute_name attribute_name [ -drop_column drop_column ]
Switches:
-content_type (required)
-attribute_name (required)
-drop_column (optional)

Testcases:
No testcase defined.

content::type::attribute::new (public)

 content::type::attribute::new -content_type content_type \
    -attribute_name attribute_name -datatype datatype \
    -pretty_name pretty_name [ -pretty_plural pretty_plural ] \
    [ -sort_order sort_order ] [ -default_value default_value ] \
    [ -column_spec column_spec ]
Switches:
-content_type (required)
-attribute_name (required)
-datatype (required)
-pretty_name (required)
-pretty_plural (optional)
-sort_order (optional)
-default_value (optional)
-column_spec (optional)
Specification for column to pass to the database. Not optional if the column does not already exist in the table.
Returns:
attribute_id for created attribute

Testcases:
content_item

content::type::content_type_p (public)

 content::type::content_type_p -content_type content_type \
    -mime_type mime_type

Checks if the mime_type is of the content_type, e.g. if application/pdf is of content_type "image" (which it should not...) Cached

Switches:
-content_type (required)
content type to check against
-mime_type (required)
mime type to check for

Testcases:
No testcase defined.

content::type::delete (public)

 content::type::delete -content_type content_type \
    [ -drop_children_p drop_children_p ] \
    [ -drop_table_p drop_table_p ] [ -drop_objects_p drop_objects_p ]
Switches:
-content_type (required)
-drop_children_p (optional)
-drop_table_p (optional)
-drop_objects_p (optional, defaults to "f")
Drop the objects of this content type along with all entries in cr_items and cr_revisions. Will not be done by default.

Testcases:
content_item

content::type::get_template (public)

 content::type::get_template -content_type content_type \
    [ -use_context use_context ]
Switches:
-content_type (required)
-use_context (optional, defaults to "public")
Returns:
template_id

Testcases:
No testcase defined.

content::type::is_content_type (public)

 content::type::is_content_type -object_type object_type
Switches:
-object_type (required)
Returns:
t or f

Testcases:
No testcase defined.

content::type::new (public)

 content::type::new -content_type content_type [ -supertype supertype ] \
    -pretty_name pretty_name -pretty_plural pretty_plural \
    -table_name table_name -id_column id_column \
    [ -name_method name_method ]
Switches:
-content_type (required)
-supertype (optional, defaults to "content_revision")
-pretty_name (required)
-pretty_plural (required)
-table_name (required)
-id_column (required)
-name_method (optional)
Returns:
type_id

Testcases:
content_item

content::type::refresh_view (public)

 content::type::refresh_view -content_type content_type
Switches:
-content_type (required)
Creates or replaces the view associated with the supplied content type. By convention, this view is called TYPEx .

Testcases:
No testcase defined.

content::type::register_child_type (public)

 content::type::register_child_type -parent_type parent_type \
    -child_type child_type [ -relation_tag relation_tag ] \
    [ -min_n min_n ] [ -max_n max_n ]
Switches:
-parent_type (required)
-child_type (required)
-relation_tag (optional)
-min_n (optional)
-max_n (optional)
Returns:
0

Testcases:
No testcase defined.

content::type::register_mime_type (public)

 content::type::register_mime_type -content_type content_type \
    -mime_type mime_type

Associate a content_type with a mime_type (both params are strings, e.g. folder , application/pdf )

Switches:
-content_type (required)
-mime_type (required)
Returns:
0

Testcases:
No testcase defined.

content::type::register_relation_type (public)

 content::type::register_relation_type -content_type content_type \
    -target_type target_type [ -relation_tag relation_tag ] \
    [ -min_n min_n ] [ -max_n max_n ]
Switches:
-content_type (required)
-target_type (required)
-relation_tag (optional)
-min_n (optional)
-max_n (optional)
Returns:
0

Testcases:
No testcase defined.

content::type::register_template (public)

 content::type::register_template -content_type content_type \
    -template_id template_id [ -use_context use_context ] \
    [ -is_default is_default ]
Switches:
-content_type (required)
-template_id (required)
-use_context (optional, defaults to "public")
-is_default (optional)

Testcases:
No testcase defined.

content::type::rotate_template (public)

 content::type::rotate_template -template_id template_id \
    -content_type content_type [ -use_context use_context ]

Force all items of content_type to use a new template. This will also cause items of this content type with no template assigned to use the new template. Finally, sets new template as default for this type. (IS THIS RIGHT ???? ----------------- ??????? )

Switches:
-template_id (required)
-content_type (required)
-use_context (optional, defaults to "public")

Testcases:
No testcase defined.

content::type::set_default_template (public)

 content::type::set_default_template -content_type content_type \
    -template_id template_id [ use_context ]
Switches:
-content_type (required)
-template_id (required)
Parameters:
use_context (optional, defaults to "public")
Returns:
0

Testcases:
No testcase defined.

content::type::unregister_child_type (public)

 content::type::unregister_child_type -parent_type parent_type \
    -child_type child_type [ -relation_tag relation_tag ]
Switches:
-parent_type (required)
-child_type (required)
-relation_tag (optional)
Returns:
0
See Also:

Testcases:
No testcase defined.

content::type::unregister_mime_type (public)

 content::type::unregister_mime_type -content_type content_type \
    -mime_type mime_type
Switches:
-content_type (required)
-mime_type (required)
Returns:
0
See Also:

Testcases:
No testcase defined.

content::type::unregister_relation_type (public)

 content::type::unregister_relation_type -content_type content_type \
    -target_type target_type [ -relation_tag relation_tag ]
Switches:
-content_type (required)
-target_type (required)
-relation_tag (optional)
Returns:
0
See Also:

Testcases:
No testcase defined.

content::type::unregister_template (public)

 content::type::unregister_template [ -content_type content_type ] \
    -template_id template_id [ -use_context use_context ]
Switches:
-content_type (optional)
-template_id (required)
-use_context (optional)
Returns:
0
See Also:

Testcases:
No testcase defined.
[ show source ]