Forum OpenACS Development: Re: Augmenting acs_objects - adding package_id, name, and clarifying other fields

subsite_id in acs_objects: Yes, because not only would I want to limit searches (or whatever service), I definitely want to add the subsite name in every output whatsoever:

* object <foo> in community <bar>

Be it an email notification or a search result. (OpenACS == Open Architecture Community System)

Calculating the subsite_id with the site_nodes table is NOT straight-forward in Oracle because of the limitations of connect by up until 9i. (See the rather klunky PL/SQL procs Harish and I posted here

So no opinions about archived_p, deleted_p or a state column? My gutfeel is that they are not too useful currently but may become so very quickly...then they could probably be added without much ado.

No, the package_id in acs_objects would model a 1:1 (or 1:0 in case package_id doesn't make sense which Tom seems to be hinting at) relationship. It should be the package_id of the "mother package", the one you would most closely associate with this particular object. Is there a possibility of 1:n or even n:m (package_id : object_id) in OpenACS? I doubt it.

Yun, your example is right: for a news object the respective mother package_id is that of the corresponding news package.

Name - exactly as in cr_items. Does it make sense to duplicate this? Probably not, especially as cr_items already has locale, content_type, publish_status etc.

So, is there any reason why we wouldn't stuff every named object's name et al. into cr_items? CR experts - clarify please.

How would a generic object map work? If you want to relate two objects, stick them in this table with a tag on the relationship. You can use the same idea for a package_id, or subsite_id, allowing objects to be associated with zero or more packages or subsites.

create table object_map (
 object_id_1,
 object_id_2,
 tag
);

select * from object_map where tag = 'site image';

select * from object_map where object_id_1 = :my_site_node
and tag = 'site image';

select * from object_map where object_id_2 = :my_image
and tag = 'site image';

How the generic object map would work - sure. But do we need it?!

From past project I would say: no, we don't need it.