rel_types::create_role (public)
rel_types::create_role -pretty_name pretty_name \ -pretty_plural pretty_plural [ -role role ]
Defined in packages/acs-subsite/tcl/rel-types-procs.tcl
Create a new Relationship Role
- Switches:
- -pretty_name (required)
- -pretty_plural (required)
- -role (optional)
- Returns:
- 1 if successful
- Author:
- Malte Sussdorff <sussdorff@sussdorff.de>
- Created:
- 2005-06-04
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_subsite_rel_type_roles
Source code: if {![info exists role] || $role eq ""} { set role [util_text_to_url -text $pretty_name -replacement "_" -existing_urls [db_list get_roles {}]] } set return_code 1 db_transaction { # Force internationalization of Roles # Internationalising of Attributes. This is done by storing the # attribute with its acs-lang key set message_key "role_${role}" # Register the language keys lang::message::register en_US acs-translations $message_key $pretty_name lang::message::register en_US acs-translations "${message_key}_plural" $pretty_plural # Replace the pretty_name and pretty_plural with the message key, so # it is inserted correctly in the database set pretty_name "#acs-translations.${message_key}#" set pretty_plural "#acs-translations.${message_key}_plural#" db_exec_plsql create_role {} } on_error { set return_code 0 } return $return_codeGeneric XQL file: <fullquery name="rel_types::create_role.get_roles"> <querytext> select role from acs_rel_roles </querytext> </fullquery>packages/acs-subsite/tcl/rel-types-procs.xql
PostgreSQL XQL file: <fullquery name="rel_types::create_role.create_role"> <querytext> select acs_rel_type__create_role(:role, :pretty_name, :pretty_plural) </querytext> </fullquery>packages/acs-subsite/tcl/rel-types-procs-postgresql.xql
Oracle XQL file: <fullquery name="rel_types::create_role.create_role"> <querytext> begin acs_rel_type.create_role(:role, :pretty_name, :pretty_plural); end; </querytext> </fullquery>packages/acs-subsite/tcl/rel-types-procs-oracle.xql