group::delete (public)

 group::delete group_id

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

Deletes the group specified by group_id, including all relational segments specified for the group and any relational constraint that depends on this group in any way.

Parameters:
group_id (required)
The group to delete
Returns:
object_type of the deleted group, if it was actually deleted. Returns the empty string if the object didn't exist to begin with
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
10/2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_expose_bug_775 acs_subsite_expose_bug_775 (test acs-subsite) group::delete group::delete test_acs_subsite_expose_bug_775->group::delete test_group_localization group_localization (test acs-subsite) test_group_localization->group::delete db_0or1row db_0or1row (public) group::delete->db_0or1row db_exec_plsql db_exec_plsql (public) group::delete->db_exec_plsql lang::message::unregister lang::message::unregister (public) group::delete->lang::message::unregister group_type::delete group_type::delete (public) group_type::delete->group::delete packages/acs-subsite/www/admin/groups/delete-2.tcl packages/acs-subsite/ www/admin/groups/delete-2.tcl packages/acs-subsite/www/admin/groups/delete-2.tcl->group::delete

Testcases:
group_localization, acs_subsite_expose_bug_775
Source code:
    if { ![db_0or1row package_select {
        select t.package_name, t.object_type
        from acs_object_types t
        where t.object_type = (select o.object_type
                                 from acs_objects o
                                where o.object_id = :group_id)
    }] } {
        # No package means the object doesn't exist. We're done :)
        return
    }

    # Maybe the relational constraint deletion should be moved to
    # the acs_group package...

    db_exec_plsql delete_group {}

    # Remove the automatically generated message key localizing the
    # group name
    lang::message::unregister acs-translations "group_title_${group_id}"

    return $object_type
XQL Not present:
Generic
PostgreSQL XQL file:
<fullquery name="group::delete.delete_group">
    <querytext>
	  DECLARE
	    row record;
	  BEGIN 
            -- the acs_group package takes care of segments referred
  	    -- to by rel_constraints.rel_segment. We delete the ones
	    -- references by rel_constraints.required_rel_segment here.

	    for row in select cons.constraint_id
                          from rel_constraints cons, rel_segments segs
                         where segs.segment_id = cons.required_rel_segment
                           and segs.group_id = :group_id loop

                perform rel_segment__delete(row.constraint_id);

            end loop;

	    -- delete the actual group
	    perform ${package_name}__delete(:group_id);

	    return 1;
	  END;
        
      </querytext>
</fullquery>
packages/acs-subsite/tcl/group-procs-postgresql.xql

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

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