Forum OpenACS Development: Re: TCL API for acs_object_types

Collapse
Posted by Don Baccus on
This is excellent ...

I was planning to TIP a slightly different approach, however ... which would be to have acs_object.create_type create the table if need be and for acs_object.create_attribute to create the attribute if necessary.  create_type would also create the id column with the proper foreign key as well.

In essence this means "migrate the above from content_type.create_type() etc to base objects", make them both consistent.

This would simplify the create object Tcl API and would make things consistent regardless if one choose to create object types that way or directly in SQL.

BTW this is why the sketched-out Tcl API for creating content types from an APM callback works - the underlying content_type SQL package does all the table and column definitions if they don't already exist.

As far as creating any object goes, you can use package_instantiate_object to do that - check out the latest version of notes/www/add-edit.tcl I committed a couple of days ago.  I've been planning to add a package_update_object proc as well (I've already added a package_exex_plsql proc so one can call del() and similar procs directly from Tcl).

Some of the things on your TODO list a fairly ambitious, i.e. composite object types ...