xo::db::sql::content_item proc new (public)

 xo::db::sql::content_item[i] new [ -dbn dbn ] -name name  \
    [ -parent_id parent_id ] [ -item_id item_id ] [ -locale locale ] \
    [ -creation_date creation_date ] [ -creation_user creation_user ] \
    [ -context_id context_id ] [ -creation_ip creation_ip ] \
    [ -item_subtype item_subtype ] [ -content_type content_type ] \
    [ -title title ] [ -description description ] \
    [ -mime_type mime_type ] [ -nls_language nls_language ] \
    [ -text text ] [ -data data ] [ -relation_tag relation_tag ] \
    [ -is_live is_live ] [ -storage_type storage_type ] \
    [ -package_id package_id ] [ -with_child_rels with_child_rels ] \
    [ -childof childof ]

Defined in packages/xotcl-core/tcl/05-db-procs.tcl

Automatically generated method

Switches:
-dbn
(optional)
-name
(required)
-parent_id
(optional)
-item_id
(optional)
-locale
(optional)
-creation_date
(defaults to "now") (optional)
-creation_user
(optional)
-context_id
(optional)
-creation_ip
(optional)
-item_subtype
(defaults to "content_item") (optional)
-content_type
(defaults to "content_revision") (optional)
-title
(optional)
-description
(optional)
-mime_type
(defaults to "text/plain") (optional)
-nls_language
(optional)
-text
(optional)
-data
(optional)
-relation_tag
(optional)
-is_live
(defaults to "f") (optional)
-storage_type
(optional)
-package_id
(optional)
-with_child_rels
(defaults to "t") (optional)
-childof
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::sql::content_item proc new xo::db::sql::content_item proc new test_xotcl_core_tutorial_4->xo::db::sql::content_item proc new db_with_handle db_with_handle (public) xo::db::sql::content_item proc new->db_with_handle

Testcases:
xotcl_core_tutorial_4
Source code:
#function_args: {NAME {}} {PARENT_ID null} {ITEM_ID null} {LOCALE null} {CREATION_DATE now} {CREATION_USER null} {CONTEXT_ID null} {CREATION_IP null} {ITEM_SUBTYPE content_item} {CONTENT_TYPE content_revision} {TITLE null} {DESCRIPTION null} {MIME_TYPE text/plain} {NLS_LANGUAGE null} {TEXT null} {DATA null} {RELATION_TAG null} {IS_LIVE f} {STORAGE_TYPE null} {PACKAGE_ID null} {WITH_CHILD_RELS t}
foreach var [list NAME PARENT_ID ITEM_ID LOCALE CREATION_DATE CREATION_USER CONTEXT_ID CREATION_IP ITEM_SUBTYPE CONTENT_TYPE TITLE DESCRIPTION MIME_TYPE NLS_LANGUAGE TEXT DATA RELATION_TAG IS_LIVE STORAGE_TYPE PACKAGE_ID WITH_CHILD_RELS]  {
  set varname [string tolower $var]
  if {[info exists $varname]} {
    set $var [set $varname]
    set _$var :$var
  } else {
    set _$var null
  }
}
set sql "
select content_item__new($_NAME$_PARENT_ID$_ITEM_ID$_LOCALE$_CREATION_DATE$_CREATION_USER$_CONTEXT_ID$_CREATION_IP$_ITEM_SUBTYPE$_CONTENT_TYPE$_TITLE$_DESCRIPTION$_MIME_TYPE$_NLS_LANGUAGE$_TEXT$_DATA$_RELATION_TAG$_IS_LIVE$_STORAGE_TYPE$_PACKAGE_ID$_WITH_CHILD_RELS) FOR UPDATE
    "
db_with_handle -dbn $dbn db {
  #ns_log notice "--sql=$sql"
  return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: