content-extlink-procs.tcl

Procedures for content_extlink

Location:
packages/acs-content-repository/tcl/content-extlink-procs.tcl
Created:
2004-06-09
Author:
Dave Bauer <dave@thedesignexperience.org>
CVS Identification:
$Id: content-extlink-procs.tcl,v 1.12.2.1 2020/08/26 15:17:29 antoniop Exp $

Procedures in this file

Detailed information

content::extlink::copy (public)

 content::extlink::copy -extlink_id extlink_id \
    -target_folder_id target_folder_id -creation_user creation_user \
    [ -creation_ip creation_ip ]
Switches:
-extlink_id (required)
extlink to copy
-target_folder_id (required)
folder to copy extlink into
-creation_user (required)
-creation_ip (optional)
Returns:
0

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_extlink content_extlink (test acs-content-repository) content::extlink::copy content::extlink::copy test_content_extlink->content::extlink::copy package_exec_plsql package_exec_plsql (public) content::extlink::copy->package_exec_plsql

Testcases:
content_extlink

content::extlink::delete (public)

 content::extlink::delete -extlink_id extlink_id
Switches:
-extlink_id (required)
item_id of extlink to delete
Returns:
0

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_extlink content_extlink (test acs-content-repository) content::extlink::delete content::extlink::delete test_content_extlink->content::extlink::delete content::item::delete content::item::delete (public) content::extlink::delete->content::item::delete

Testcases:
content_extlink

content::extlink::edit (public)

 content::extlink::edit -extlink_id extlink_id -url url -label label \
    -description description

Edit an existing external link. The parameters are required because it is assumed that the caller will be pulling the existing values out of the database before editing them.

Switches:
-extlink_id (required)
Optional pre-assigned object_id for the link
-url (required)
The URL of the external resource
-label (required)
Label for the extlink (defaults to the URL)
-description (required)
An extended description of the link (defaults to NULL)

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_extlink content_extlink (test acs-content-repository) content::extlink::edit content::extlink::edit test_content_extlink->content::extlink::edit ad_conn ad_conn (public) content::extlink::edit->ad_conn db_dml db_dml (public) content::extlink::edit->db_dml db_transaction db_transaction (public) content::extlink::edit->db_transaction packages/file-storage/www/simple-edit.tcl packages/file-storage/ www/simple-edit.tcl packages/file-storage/www/simple-edit.tcl->content::extlink::edit

Testcases:
content_extlink

content::extlink::is_extlink (public)

 content::extlink::is_extlink -item_id item_id
Switches:
-item_id (required)
item_id to check
Returns:
1 if extlink, otherwise 0

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_name_api attachments_name_api (test attachments) content::extlink::is_extlink content::extlink::is_extlink test_attachments_name_api->content::extlink::is_extlink test_content_extlink content_extlink (test acs-content-repository) test_content_extlink->content::extlink::is_extlink package_exec_plsql package_exec_plsql (public) content::extlink::is_extlink->package_exec_plsql attachments::get_title attachments::get_title (public) attachments::get_title->content::extlink::is_extlink packages/attachments/www/go-to-attachment.tcl packages/attachments/ www/go-to-attachment.tcl packages/attachments/www/go-to-attachment.tcl->content::extlink::is_extlink packages/forums/lib/message/attachment-list.tcl packages/forums/ lib/message/attachment-list.tcl packages/forums/lib/message/attachment-list.tcl->content::extlink::is_extlink

Testcases:
content_extlink, attachments_name_api

content::extlink::name (public)

 content::extlink::name -item_id item_id

Returns the name of an extlink

Switches:
-item_id (required)
The object id of the item to check.

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_name_api attachments_name_api (test attachments) content::extlink::name content::extlink::name test_attachments_name_api->content::extlink::name test_content_extlink content_extlink (test acs-content-repository) test_content_extlink->content::extlink::name db_string db_string (public) content::extlink::name->db_string attachments::get_title attachments::get_title (public) attachments::get_title->content::extlink::name packages/file-storage/www/simple-delete.tcl packages/file-storage/ www/simple-delete.tcl packages/file-storage/www/simple-delete.tcl->content::extlink::name

Testcases:
content_extlink, attachments_name_api

content::extlink::new (public)

 content::extlink::new [ -extlink_id extlink_id ] -url url \
    -parent_id parent_id [ -name name ] [ -label label ] \
    [ -description description ] [ -package_id package_id ]

Create a new external link.

Switches:
-extlink_id (optional)
-url (required)
-parent_id (required)
-name (optional)
-label (optional)
-description (optional)
-package_id (optional)
Returns:
0

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_extlink content_extlink (test acs-content-repository) content::extlink::new content::extlink::new test_content_extlink->content::extlink::new package_exec_plsql package_exec_plsql (public) content::extlink::new->package_exec_plsql packages/attachments/www/simple-add-2.tcl packages/attachments/ www/simple-add-2.tcl packages/attachments/www/simple-add-2.tcl->content::extlink::new packages/file-storage/www/simple-add-2.tcl packages/file-storage/ www/simple-add-2.tcl packages/file-storage/www/simple-add-2.tcl->content::extlink::new packages/file-storage/www/simple-add.tcl packages/file-storage/ www/simple-add.tcl packages/file-storage/www/simple-add.tcl->content::extlink::new

Testcases:
content_extlink
[ hide source ] | [ make this the default ]

Content File Source

ad_library {

    Procedures for content_extlink

    @author Dave Bauer (dave@thedesignexperience.org)
    @creation-date 2004-06-09
    @cvs-id $Id: content-extlink-procs.tcl,v 1.12.2.1 2020/08/26 15:17:29 antoniop Exp $
}

namespace eval ::content::extlink {}

d_proc -public content::extlink::copy {
    -extlink_id:required
    -target_folder_id:required
    -creation_user:required
    {-creation_ip ""}
} {
    @param extlink_id extlink to copy
    @param target_folder_id folder to copy extlink into
    @param creation_user
    @param creation_ip
    @return 0
} {
    return [package_exec_plsql -var_list [list \
        [list extlink_id $extlink_id ] \
        [list target_folder_id $target_folder_id ] \
        [list creation_user $creation_user ] \
        [list creation_ip $creation_ip ] \
    ] content_extlink copy]
}

d_proc -public content::extlink::new {
    {-extlink_id ""}
    -url:required
    -parent_id:required
    {-name ""}
    {-label ""}
    {-description ""}
    {-package_id ""}
} {
    Create a new external link.

    @return 0
} {
    return [package_exec_plsql -var_list [list \
        [list extlink_id $extlink_id ] \
        [list url $url ] \
        [list parent_id $parent_id ] \
        [list name $name ] \
        [list label $label ] \
        [list description $description ] \
        [list package_id $package_id ] \
    ] content_extlink new]
}


d_proc -public content::extlink::edit {
    -extlink_id:required
    -url:required
    -label:required
    -description:required
} {

    Edit an existing external link.  The parameters are required because it
    is assumed that the caller will be pulling the existing values out of
    the database before editing them.

    @param extlink_id Optional pre-assigned object_id for the link
    @param url The URL of the external resource
    @param label Label for the extlink (defaults to the URL)
    @param description An extended description of the link (defaults to NULL)
} {

    set modifying_user [ad_conn user_id]
    set modifying_ip [ad_conn peeraddr]

    db_transaction {
        db_dml extlink_update_object {}
        db_dml extlink_update_extlink {}
    }
}



d_proc -public content::extlink::delete {
    -extlink_id:required
} {
    @param extlink_id item_id of extlink to delete
    @return 0
} {
    content::item::delete -item_id $extlink_id
}


d_proc -public content::extlink::is_extlink {
    -item_id:required
} {
    @param item_id item_id to check

    @return 1 if extlink, otherwise 0
} {
    return [package_exec_plsql -var_list [list \
        [list item_id $item_id ] \
    ] content_extlink is_extlink]
}

d_proc -public content::extlink::name {
    -item_id:required
} {
    Returns the name of an extlink

    @param item_id  The object id of the item to check.
} {
    return [db_string get {}]
}

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