• Publicity: Public Only All

rel-segments-procs.tcl

Helpers for relational segments

Location:
packages/acs-subsite/tcl/rel-segments-procs.tcl
Created:
Tue Dec 12 16:37:45 2000
Author:
mbryzek@arsdigita.com
CVS Identification:
$Id: rel-segments-procs.tcl,v 1.7.2.3 2020/07/21 13:58:55 gustafn Exp $

Procedures in this file

Detailed information

rel_segment::delete (public)

 rel_segment::delete segment_id

Deletes the specified relational segment including all relational constraints that depend on it.

Parameters:
segment_id (required)
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
1/12/2001

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_rel_segment_new acs_subsite_rel_segment_new (test acs-subsite) rel_segment::delete rel_segment::delete test_acs_subsite_rel_segment_new->rel_segment::delete db_exec_plsql db_exec_plsql (public) rel_segment::delete->db_exec_plsql db_foreach db_foreach (public) rel_segment::delete->db_foreach packages/acs-subsite/www/admin/groups/rel-type-remove-2.tcl packages/acs-subsite/ www/admin/groups/rel-type-remove-2.tcl packages/acs-subsite/www/admin/groups/rel-type-remove-2.tcl->rel_segment::delete packages/acs-subsite/www/admin/rel-segments/delete-2.tcl packages/acs-subsite/ www/admin/rel-segments/delete-2.tcl packages/acs-subsite/www/admin/rel-segments/delete-2.tcl->rel_segment::delete packages/acs-subsite/www/admin/rel-types/delete-2.tcl packages/acs-subsite/ www/admin/rel-types/delete-2.tcl packages/acs-subsite/www/admin/rel-types/delete-2.tcl->rel_segment::delete rel_segments_delete rel_segments_delete (public, deprecated) rel_segments_delete->rel_segment::delete

Testcases:
acs_subsite_rel_segment_new

rel_segment::new (public)

 rel_segment::new [ -context_id context_id ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ] \
    group_id rel_type segment_name

Creates a new relational segment

Switches:
-context_id (optional)
-creation_user (optional)
-creation_ip (optional)
Parameters:
group_id (required)
rel_type (required)
segment_name (required)
Returns:
The segment_id of the new segment
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_expose_bug_775 acs_subsite_expose_bug_775 (test acs-subsite) rel_segment::new rel_segment::new test_acs_subsite_expose_bug_775->rel_segment::new test_acs_subsite_rel_segment_new acs_subsite_rel_segment_new (test acs-subsite) test_acs_subsite_rel_segment_new->rel_segment::new ad_conn ad_conn (public) rel_segment::new->ad_conn db_exec_plsql db_exec_plsql (public) rel_segment::new->db_exec_plsql packages/acs-subsite/www/admin/rel-segments/new-3.tcl packages/acs-subsite/ www/admin/rel-segments/new-3.tcl packages/acs-subsite/www/admin/rel-segments/new-3.tcl->rel_segment::new rel_segments_new rel_segments_new (public, deprecated) rel_segments_new->rel_segment::new subsite::default::create_app_group subsite::default::create_app_group (public) subsite::default::create_app_group->rel_segment::new

Testcases:
acs_subsite_expose_bug_775, acs_subsite_rel_segment_new

rel_segments_delete (public, deprecated)

 rel_segments_delete segment_id
Deprecated. Invoking this procedure generates a warning.

Deletes the specified relational segment including all relational constraints that depend on it.

Parameters:
segment_id (required)
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
1/12/2001 DEPRECATED: does not comply with OpenACS naming convention
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) rel_segment::delete rel_segment::delete (public) rel_segments_delete rel_segments_delete rel_segments_delete->ad_log_deprecated rel_segments_delete->rel_segment::delete

Testcases:
No testcase defined.

rel_segments_new (public, deprecated)

 rel_segments_new [ args... ]
Deprecated. Invoking this procedure generates a warning.

Creates a new relational segment

Returns:
The segment_id of the new segment DEPRECATED: does not comply with OpenACS naming convention
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/2000
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) rel_segment::new rel_segment::new (public) rel_segments_new rel_segments_new rel_segments_new->ad_log_deprecated rel_segments_new->rel_segment::new

Testcases:
No testcase defined.

rel_segments_permission_p (public, deprecated)

 rel_segments_permission_p [ -user_id user_id ] \
    [ -privilege privilege ] segment_id
Deprecated. Invoking this procedure generates a warning.

Wrapper for ad_permission to allow us to bypass having to specify the read privilege Deprecated: just another wrapper for permission::permission_p

Switches:
-user_id (optional)
-privilege (optional, defaults to "read")
Parameters:
segment_id (required)
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/2000
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) permission::permission_p permission::permission_p (public) rel_segments_permission_p rel_segments_permission_p rel_segments_permission_p->ad_log_deprecated rel_segments_permission_p->permission::permission_p

Testcases:
No testcase defined.
[ hide source ] | [ make this the default ]

Content File Source

ad_library {

    Helpers for relational segments

    @author mbryzek@arsdigita.com
    @creation-date Tue Dec 12 16:37:45 2000
    @cvs-id $Id: rel-segments-procs.tcl,v 1.7.2.3 2020/07/21 13:58:55 gustafn Exp $

}

namespace eval rel_segment {}

ad_proc -deprecated rel_segments_new args {
    Creates a new relational segment

    @author Michael Bryzek (mbryzek@arsdigita.com)
    @creation-date 12/2000

    @return The <code>segment_id</code> of the new segment

    DEPRECATED: does not comply with OpenACS naming convention

    @see rel_segment::new

} {
    return [rel_segment::new {*}$args]
}

d_proc -public rel_segment::new {
    { -context_id "" }
    { -creation_user "" }
    { -creation_ip "" }
    group_id
    rel_type
    segment_name
} {
    Creates a new relational segment

    @author Michael Bryzek (mbryzek@arsdigita.com)
    @creation-date 12/2000

    @return The <code>segment_id</code> of the new segment

} {
    if { [ns_conn isconnected] } {
        if { $creation_user eq "" } {
            set creation_user [ad_conn user_id]
        }
        if { $creation_ip eq "" } {
            set creation_ip [ad_conn peeraddr]
        }
    }
    return [db_exec_plsql create_rel_segment {}]

}

d_proc -deprecated rel_segments_delete {
    segment_id
} {
    Deletes the specified relational segment including all relational
    constraints that depend on it.

    @author Michael Bryzek (mbryzek@arsdigita.com)
    @creation-date 1/12/2001

    DEPRECATED: does not comply with OpenACS naming convention

    @see rel_segment::delete
} {
    return [rel_segment::delete $segment_id]
}

d_proc -public rel_segment::delete {
    segment_id
} {
    Deletes the specified relational segment including all relational
    constraints that depend on it.

    @author Michael Bryzek (mbryzek@arsdigita.com)
    @creation-date 1/12/2001

} {
    # First delete dependent constraints.
    db_foreach select_dependent_constraints {
        select c.constraint_id
          from rel_constraints c
         where c.required_rel_segment = :segment_id
    } {
        db_exec_plsql constraint_delete {}
    }

    db_exec_plsql rel_segment_delete {}

}

d_proc -deprecated -public rel_segments_permission_p {
    { -user_id "" }
    { -privilege "read" }
    segment_id
} {

    Wrapper for ad_permission to allow us to bypass having to
    specify the read privilege

    Deprecated: just another wrapper for permission::permission_p

    @author Michael Bryzek (mbryzek@arsdigita.com)
    @creation-date 12/2000

    @see permission::permission_p

} {
    return [permission::permission_p -party_id $user_id -object_id $segment_id -privilege $privilege]
}


# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: