Forum OpenACS Improvement Proposals (TIPs): Re: TIP #67: (Proposed) Tcl API for Content Repository

Collapse
Posted by Dave Bauer on
I committed the preliminary APIs to CVS HEAD under
packages/acs-content-repostory/tcl

content-item-procs.tcl
content-revision-procs.tcl
content-folder-procs.tcl
content-type-procs.tcl
content-extlink-procs.tcl
content-symlink-procs.tcl
content-template-procs.tcl

in addition there are

content-permission-procs.tcl
content-keyword-procs.tcl

Most of the API calls package_exec_plsql so there are very few queries. I did change content::revision::new to use the cr_revisionsi view so that has to build a query from the attributes.

which I don't think we really need. I think permissions can be handled with the permission:: tcl api and keywords should be replaces with the categories package.

Comments welcome!

Collapse
Posted by Malte Sussdorff on
I think permissions can be handled with the permission:: tcl api and keywords should be replaces with the categories package.

I utterly agree.

Collapse
Posted by Randy O'Meara on
Dave,

Some of the CR plsql procs that you made TCL-accessible with package_exec_plsql cannot be accessed in this manner because they are not defined as accessible procs via plsql define_function_args(). See the actual error message below. The first set I encountered were:

content::type::register_relation_type, and
content::type::unregister_relation_type
For these two, I simply added the appropriate define_function_args() calls:
select define_function_args('content_type__register_relation_type','content_type,target_type,relation_tag,min_n,max_n');
select define_function_args('content_type__unregister_relation_type','content_type,target_type,relation_tag');
to content-type.sql. These changes solved this particular set of problems. There are probably additional instances of this problem.

BTW, I am using your CR TCL API (successfully) under 5.1 by simply including the TCL files you provided. I'm forced to develop on 5.1 due to an error recently introduced on HEAD (here) that breaks the role system I've devised which utilizes rel_types::new. I don't know who introduced the breakage, but I cannot develop on HEAD until the breakage is repaired.

/R

Error generated before I added define_function_args:

ERROR:  Function content_type__register_relation_type() does not exist
    Unable to identify a function that satisfies the given argument types
    You may need to add explicit typecasts
SQL: 
    select content_type__register_relation_type()