Forum OpenACS Development: Re: relational segments: how do you use them

Posted by Tom Jackson on

Hmm, well I went about translating my pl code to tcl code, but quickly discovered I couldn't.

First, I started to create the new rel_types I need. The corresponding tcl proc is rel_types::new. Unfortunately, this procedure does much more than wrap acs_rel_type__create_type, and at the same time it does less. First off, you can't pass in any old extension table name or primary key name, it autogenerates these for you. Second, it autogenerates the table for you.

Second, there doesn't seem to be anything corresponding to acs_object_type__create_type.

Third, there doesn't seem to be any proc to achieve the following for allowing additional rel_types to be applied to a group:

insert into group_type_rels 
 (group_rel_type_id, rel_type, group_type)
  select nextval('t_acs_object_id_seq'), r.rel_type, 'unicycle_club'
  from group_type_rels r
  where r.group_type = 'group';

Although I'm not sure these are even used, they may be solely for the subside admin UI.

rel_segments_new looks like it will work.