Forum .LRN Q&A: How to relate community_id with package_id

Hi, I tried to look for this in the forums but I get an error when I click on "search". I will try to explain myself as clear as possible:

1. I created a package and integrated it with dotlrn
2. The way I chose to differentiate the information between different instances is by getting the package_id [ad_conn package_id], and store the package_id in my tables.
3. I want to let a professor add a "file" to multiple classes (from the same page). I already know how to get all the classes (community_ids) that the professor is teaching, BUT, the problem is that I don't know how to relate the community_id with the package_id that I stored in my tables. The table dotlrn_communities_all has a column named "package_id", but that package_id is not the same that the one I get by doing [ad_conn package_id] inside my package instance.

I need a way to relate the community_id with the package_id that I get calling [ad_conn package_id] from my package pages.

I hope I made myself clear, thanks for your help!

Collapse
Posted by Carl Robert Blesius on
1. You might want to try the OpenACS developer forums Jose (more technically oriented eyes over there)

2. You can use google to search the OpenACS site using the site:openacs.org syntax:

http://www.google.com/search?q=site:openacs.org+community_id+package_id

Collapse
3: google site search (response to 2)
Posted by Rocael Hernández Rizzardini on
interesting, I was wondering this morning how to make google to search a given site ....  site:openacs.org  good!
Hi, thanks for your help Don, Carl, Roc.

I finally could do what I was trying, this is (for the record) the way I did it (thanks to roc@ help)

-Get the url with the community_id:
      ... dotlrn_community__url(community_id) as url ...
-Get the community info using the community url:
      array set array_with_info [site_node::get -url "${url}[apm_package_key_from_id [ad_conn package_id]]"]

This last command returns an array with all the information about the istance of [ad_conn package_id] mounted in that community.

I hope this help someone else in the future!

the thing was that Jose needed to know the package_id of a given package instance for a given community_id, so with having the community_id you can get the url of it, and then joining url + the package-key to form the full url for the specific application instance, and then, with that full url using site_node::get to get the package_id.

i.e.

../classA/  (we know the community_id)
../classA/evaluation  (we want to know the package_id for the evaluation instance)

solution:  site_node::get -url "../classA/evaluation" will return among other things, the package_id

=)