application_group::new (public)

 application_group::new [ -group_id group_id ] \
    [ -group_type group_type ] [ -package_id package_id ] \
    [ -group_name group_name ] [ -creation_user creation_user ] \
    [ -creation_ip creation_ip ] [ -email email ] [ -url url ]

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

Creates an application group (i.e., group of "users/parties of this application") Returns the group_id of the new application group.

Switches:
-group_id (optional)
-group_type (optional, defaults to "application_group")
-package_id (optional)
-group_name (optional)
-creation_user (optional)
-creation_ip (optional)
-email (optional)
-url (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_application_group_new acs_subsite_application_group_new (test acs-subsite) application_group::new application_group::new test_acs_subsite_application_group_new->application_group::new ad_conn ad_conn (public) application_group::new->ad_conn db_exec_plsql db_exec_plsql (public) application_group::new->db_exec_plsql db_string db_string (public) application_group::new->db_string db_transaction db_transaction (public) application_group::new->db_transaction subsite::default::create_app_group subsite::default::create_app_group (public) subsite::default::create_app_group->application_group::new

Testcases:
acs_subsite_application_group_new
Source code:

    if { [ns_conn isconnected] } {
        # Since we have a connection, default user_id / peeraddr
        # if they're not specified
        if { $creation_user eq "" } {
            set creation_user [ad_conn user_id]
        }
        if { $creation_ip eq "" } {
            set creation_ip [ad_conn peeraddr]
        }
        if { $package_id eq "" } {
            set package_id [ad_conn package_id]
        }
    }

    if {$package_id eq ""} {
        error "application_group::new - package_id not specified"
    }

    if {$group_name eq ""} {
        set group_name [db_string group_name_query {
            select substr(instance_name, 1, 90)
            from apm_packages
            where package_id = :package_id
        }]
        append group_name " Parties"
    }

    db_transaction {
        # creating the new group
        set group_id [db_exec_plsql add_group {}]
    }

    return $group_id
XQL Not present:
Generic
PostgreSQL XQL file:
<fullquery name="application_group::new.add_group">
    <querytext>

		select application_group__new (
	            :group_id,
	            :group_type,
		    now(),
	            :creation_user,
	            :creation_ip,
		    :email,
		    :url,
	            :group_name,
                    :package_id,
                    null,
	            :package_id
		)
	    
      </querytext>
</fullquery>
packages/acs-subsite/tcl/application-group-procs-postgresql.xql

Oracle XQL file:
<fullquery name="application_group::new.add_group">
    <querytext>
      
		begin
		:1 := application_group.new (
	            group_id      => :group_id,
	            object_type    => :group_type,
	            group_name    => :group_name,
                    package_id    => :package_id,
	            context_id    => :package_id,
	            creation_user => :creation_user,
	            creation_ip   => :creation_ip,
		    email         => :email,
		    url           => :url,
                    join_policy   => null
		);
		end;
	    
      </querytext>
</fullquery>
packages/acs-subsite/tcl/application-group-procs-oracle.xql

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