group::new (public)

 group::new [ -form_id form_id ] [ -variable_prefix variable_prefix ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ] \
    [ -group_id group_id ] [ -context_id context_id ] \
    [ -group_name group_name ] [ -pretty_name pretty_name ] \
    [ group_type ]

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

Creates a group of this type by calling the .new function for the package associated with the given group_type. This function will fail if there is no package.

There are now several ways to create a group of a given type. You can use this Tcl API with or without a form from the form system, or you can directly use the PL/SQL API for the group type.

Examples:


    # OPTION 1: Create the group using the Tcl Procedure. Useful if the
    # only attribute you need to specify is the group name

    db_transaction {
        set group_id [group::new -group_name "Author" $group_type]
    }


    # OPTION 2: Create the group using the Tcl API with a templating
    # form. Useful when there are multiple attributes to specify for the
    # group

    template::form create add_group
    template::element create add_group group_name -value "Publisher"

    db_transaction {
        set group_id [group::new -form_id add_group $group_type ]
    }

    # OPTION 3: Create the group using the PL/SQL package automatically
    # created for it

    # creating the new group
    set group_id [db_exec_plsql add_group "
      begin
        :1 := ${group_type}.new (group_name => 'Editor');
      end;
    "]

    

Switches:
-form_id (optional)
The form id from templating form system (see example above)
-variable_prefix (optional)
-creation_user (optional)
-creation_ip (optional)
-group_id (optional)
-context_id (optional)
-group_name (optional)
The name of this group. This is a required variable, though it may be specified either explicitly or through form_id
-pretty_name (optional)
Parameters:
group_type (optional, defaults to "group")
The type of group we are creating. Defaults to group which is what you want in most cases.
Returns:
group_id of the newly created group
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
10/2000

Testcases:
group_localization, acs_subsite_expose_bug_775, acs_subsite_check_composite_group, acs_subsite_group_type, acs_subsite_rel_segment_new
[ show source ]
Show another procedure: