Forum OpenACS Development: Re: Objects data model

Collapse
2: Re: Objects data model (response to 1)
Posted by Malte Sussdorff on
With OpenACS 5.3, acs-objects.package_id should contain the package_id of the object, if all your applications have been rewriten to actually store it (or if they are using the content repository TCL API).

You could then write a quick function to check the package_id in acs-objects and see to which community the package_id belongs to.

There is no direct connection between context_id and package_id or community_id.

Collapse
3: Re: Objects data model (response to 2)
Posted by Eduardo Santos on
Well, I tried to do so, but it seems like the package_id for the objects is not the same package_id for a community. What I did to solve this issue is a little bit different: I am "walking up" the table. I got the context_id and put it in the object_id. Then I got the context_id for the new object and put it in the object_id. It's like climbing up the stairs, until I find the object_type like dotlrn_community.

The problem here is about the performance. I'm doing recursive searchs in a huge table like acs_objects, and this is not a nice thing to do. What I could find out is that I can improve the performance of my query using the tree_sortkey. However, I found another problem here: it just doesn't work for some objects. For forums it works, but for other objects, like file-storage folders it does not work. It seems like the tree_sortkey of the file-storage object is related to its parent folder, but it never gets to the community. So, I'm out of ideas to improve the performance. Any idea?