category-synonyms-procs.tcl

category-synonyms procs for the site-wide categorization package.

Location:
packages/categories/tcl/category-synonyms-procs.tcl
Created:
8 January 2004
Authors:
Bernd Schmeil <bernd@thebernd.de>
Timo Hentschel <timo@timohentschel.de>
CVS Identification:
$Id: category-synonyms-procs.tcl,v 1.4 2017/08/07 23:48:05 gustafn Exp $

Procedures in this file

Detailed information

category_synonym::add (public)

 category_synonym::add -name name [ -locale locale ] \
    -category_id category_id [ -synonym_id synonym_id ]

Inserts a new synonym.

Switches:
-name (required)
-locale (optional)
-category_id (required)
-synonym_id (optional)
Options:
-name
synonym name.
-locale
locale of the language. [ad_conn locale] used by default.
-category_id
id of the category of the synonym to be inserted.
-synonym_id
synonym_id of the synonym to be inserted.
Authors:
Bernd Schmeil <bernd@thebernd.de>
Timo Hentschel <timo@timohentschel.de>

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_synonyms category_synonyms (test categories) category_synonym::add category_synonym::add test_category_synonyms->category_synonym::add ad_conn ad_conn (public) category_synonym::add->ad_conn db_exec_plsql db_exec_plsql (public) category_synonym::add->db_exec_plsql db_transaction db_transaction (public) category_synonym::add->db_transaction packages/categories/www/cadmin/synonym-form.tcl packages/categories/ www/cadmin/synonym-form.tcl packages/categories/www/cadmin/synonym-form.tcl->category_synonym::add

Testcases:
category_synonyms

category_synonym::delete (public)

 category_synonym::delete synonym_id

Deletes a synonym.

Parameters:
synonym_id (required)
Options:
-synonym_id
synonym_id of the synonym to be deleted.
Authors:
Bernd Schmeil <bernd@thebernd.de>
Timo Hentschel <timo@timohentschel.de>

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_synonyms category_synonyms (test categories) category_synonym::delete category_synonym::delete test_category_synonyms->category_synonym::delete db_exec_plsql db_exec_plsql (public) category_synonym::delete->db_exec_plsql db_transaction db_transaction (public) category_synonym::delete->db_transaction packages/categories/www/cadmin/synonym-delete-2.tcl packages/categories/ www/cadmin/synonym-delete-2.tcl packages/categories/www/cadmin/synonym-delete-2.tcl->category_synonym::delete

Testcases:
category_synonyms

category_synonym::edit (public)

 category_synonym::edit -synonym_id synonym_id -name name \
    [ -locale locale ]

Updates a synonym.

Switches:
-synonym_id (required)
-name (required)
-locale (optional)
Options:
-synonym_id
synonym_id of the synonym to be updated.
-name
synonym name.
-locale
locale of the language. [ad_conn locale] used by default.
Authors:
Bernd Schmeil <bernd@thebernd.de>
Timo Hentschel <timo@timohentschel.de>

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_synonyms category_synonyms (test categories) category_synonym::edit category_synonym::edit test_category_synonyms->category_synonym::edit ad_conn ad_conn (public) category_synonym::edit->ad_conn db_exec_plsql db_exec_plsql (public) category_synonym::edit->db_exec_plsql db_transaction db_transaction (public) category_synonym::edit->db_transaction packages/categories/www/cadmin/synonym-form.tcl packages/categories/ www/cadmin/synonym-form.tcl packages/categories/www/cadmin/synonym-form.tcl->category_synonym::edit

Testcases:
category_synonyms

category_synonym::search (public)

 category_synonym::search -search_text search_text [ -locale locale ]

Gets all matching synonyms for search text in result table.

Switches:
-search_text (required)
-locale (optional)
Options:
-search_text
string to be matched against.
-locale
locale of the language. [ad_conn locale] used by default.
Authors:
Bernd Schmeil <bernd@thebernd.de>
Timo Hentschel <timo@timohentschel.de>

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_synonyms category_synonyms (test categories) category_synonym::search category_synonym::search test_category_synonyms->category_synonym::search ad_conn ad_conn (public) category_synonym::search->ad_conn db_exec_plsql db_exec_plsql (public) category_synonym::search->db_exec_plsql db_transaction db_transaction (public) category_synonym::search->db_transaction packages/categories/www/index.tcl packages/categories/ www/index.tcl packages/categories/www/index.tcl->category_synonym::search

Testcases:
category_synonyms

category_synonym::search_sweeper (private)

 category_synonym::search_sweeper

Deletes results of old searches

Partial Call Graph (max 5 caller/called nodes):
%3 db_dml db_dml (public) category_synonym::search_sweeper category_synonym::search_sweeper category_synonym::search_sweeper->db_dml

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

Content File Source

ad_library {
    category-synonyms procs for the site-wide categorization package.

    @author Bernd Schmeil (bernd@thebernd.de)
    @author Timo Hentschel (timo@timohentschel.de)

    @creation-date 8 January 2004
    @cvs-id $Id: category-synonyms-procs.tcl,v 1.4 2017/08/07 23:48:05 gustafn Exp $
}


namespace eval category_synonym {}

d_proc -public category_synonym::add {
    -name:required
    {-locale ""}
    -category_id:required
    {-synonym_id ""}
} {
    Inserts a new synonym.

    @option name synonym name.
    @option locale locale of the language. [ad_conn locale] used by default.
    @option category_id id of the category of the synonym to be inserted.
    @option synonym_id synonym_id of the synonym to be inserted.
    @author Bernd Schmeil (bernd@thebernd.de)
    @author Timo Hentschel (timo@timohentschel.de)
} {
    if {$locale eq ""} {
    set locale [ad_conn locale]
    }

    db_transaction {
    set synonym_id [db_exec_plsql insert_synonym ""]
    }
    
    return $synonym_id
}

d_proc -public category_synonym::edit {
    -synonym_id:required
    -name:required
    {-locale ""}
} {
    Updates a synonym.

    @option synonym_id synonym_id of the synonym to be updated.
    @option name synonym name.
    @option locale locale of the language. [ad_conn locale] used by default.
    @author Bernd Schmeil (bernd@thebernd.de)
    @author Timo Hentschel (timo@timohentschel.de)
} {
    if {$locale eq ""} {
    set locale [ad_conn locale]
    }

    db_transaction {
    set synonym_id [db_exec_plsql update_synonym ""]
    }

    return $synonym_id
}

ad_proc -public category_synonym::delete { synonym_id } {
    Deletes a synonym.

    @option synonym_id synonym_id of the synonym to be deleted.
    @author Bernd Schmeil (bernd@thebernd.de)
    @author Timo Hentschel (timo@timohentschel.de)
} {
    db_transaction {
    db_exec_plsql delete_synonym ""
    }
}

d_proc -public category_synonym::search {
    -search_text:required
    {-locale ""}
} {
    Gets all matching synonyms for search text in result table.

    @option search_text string to be matched against.
    @option locale locale of the language. [ad_conn locale] used by default.
    @author Bernd Schmeil (bernd@thebernd.de)
    @author Timo Hentschel (timo@timohentschel.de)
} {
    if {$locale eq ""} {
    set locale [ad_conn locale]
    }

    db_transaction {
    set query_id [db_exec_plsql new_search ""]
    }

    return $query_id
}

d_proc -private category_synonym::search_sweeper {
} {
    Deletes results of old searches
} {
    db_dml delete_old_searches ""
}

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