Forum OpenACS Development: ::content::item::* vs ::item::* cleanup

After being trapped by the redundancy of SQL queries in acs-content-repository/tcl/item-procs.tcl and acs-content-repository/tcl/content-item-procs.tcl) i decided to do something against it, as other people might have the same problem. So I did a major cleanup of item-procs.tcl, item-procs.xql, item-procs-postgres.xql, and item-procs-oracle.xql, and redirected all calls in the deprecated interface (::item::*) to the appropriate ::content::item::* and ::content::revision::* calls. I have also changed the deprecated calls in acs-content-repository to the newer interface where possible.

I made the full cleanup in 18 of the 24 procs in item-procs.tcl, left out 6, for which i found no direct replacement in content::*. Not sure, what to do with these.

In the same step, i have commented the uncommented API calls in ::content::item::*, which had in some places rather crude comments (e.g. return type NUMBER(38), ...)

If one uses still ::item::* in her/his packages, i would recommend to upgrade to the newer interface as well. The old interfaces are still in the code, but will eventually be removed in the future.

I also noticed, that we have in ::content::item::* both


content::item::content_type,

and

content::item::get_content_type

both calling the stored procedure

content_item__get_content_type

Most likely, one of those should be set deprecated and removed at some later time. This requires most probably a TIP.

The code seems to continue to work, the regression tests pass like before (not sure, if this means much).

Btw, all these changes are in CVS HEAD.

-gustaf neumann

remaining item-procs:

item::get_content
item::content_is_null
item::get_revision_content
item::content_methods_by_type
item::get_mime_info
item::get_extended_url

no direct equivalent in content::item::* but use no direct sql calls anymore (tcl api only)

item::get_element
item::publish
item::unpublish

deprecated and do not have direct sql calls anymore (tcl api only)

item::get_title
item::get_publish_status (made a copy in ::content::item::procs)
item::is_publishable
item::get_content_type
item::get_item_from_revision
item::get_id
item::get_template_id
item::get_template_url
item::get_url
item::get_best_revision
item::get_latest_revision
item::get_live_revision
item::get_type
item::copy
item::get
item::delete