- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::db::CrAttribute
::xo::db::CrAttribute create ... \ORM class representing an acs_attribute for a content_type in the Content Repository.
[ -column_name column_name ] \
[ -constraint_values constraint_values ] \
[ -create_acs_attribute:substdefault (default "true") ] \
[ -create_table_attribute:substdefault (default "true") ] \
[ -datatype:substdefault (default "text") ] \
[ -help_text help_text ] \
[ -index index ] \
[ -max_n_values:substdefault (default "1") ] \
[ -min_n_values:substdefault (default "1") ] \
[ -multivalued multivalued ] \
[ -not_null not_null ] \
[ -pretty_name pretty_name ] \
[ -pretty_plural:substdefault (default "") ] \
[ -references:substdefault (default "") ] \
[ -required:substdefault (default "false") ] \
[ -spec spec ] \
[ -sqltype sqltype ] \
[ -substdefault substdefault ] \
[ -unique unique ] \
[ -validator validator ]
Defined in packages/xotcl-core/tcl/05-db-procs.tcl
Class Relations
::xotcl::MetaSlot create ::xo::db::CrAttribute \ -superclass ::xo::db::AttributeMethods (to be applied on instances)
create_attribute (scripted, public)
<instance of xo::db::CrAttribute> create_attributeCreate an OpenACS content repository attribute, if not already defined (or attribute creation is turned off for this xo::db::CrAttribute)
- Testcases:
- No testcase defined.
if {!${:create_acs_attribute}} return set object_type [${:domain} object_type] if {$object_type eq "content_folder"} { # content_folder does NOT allow one to use create_attribute etc. return } #:log "check attribute ${:column_name} object_type=$object_type, domain=${:domain}" if {![:db_attribute_defined -object_type $object_type -attribute_name ${:column_name}]} { #ns_log notice "GN: CrAttribute create_attribute flushes acs_attributes cache" nsv_unset -nocomplain acs_attributes acs_attributes if {![::xo::db::Class object_type_exists_in_db -object_type $object_type]} { ${:domain} create_object_type } ::acs::dc call content_type create_attribute -content_type $object_type -attribute_name ${:column_name} -datatype ${:datatype} -pretty_name ${:pretty_name} -column_spec [:column_spec] #if {[::acs::icanuse "nsv_dict"]} { # nsv_dict set acs_attributes $object_type ${:column_name} 1 #} }
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables