Forum OpenACS Q&A: How to use ACS Objects and CR TCL API

Dear all,

I have read the notes tutorial [1,2] on how to define an acs object. Also there seems to me an older fashion way to define objects and attributes [3]. The mentioned link to rubick.com on CR [4] didn't work. Seems the server is down.
I was not able to find anything but the TIP on the new CR TCL API [5] which doesn't explain the API or give a clear overview - seems to be work in progress anyway.

So here is my question: Where can I get more info on how and when to make use of acs objects for my package and how to make use of the new CR API.

Once I have a clear understanding of what this is all about I will write a "... for dummies" guide on that.

Any help is appreciated.

Greetings,
Nima

[1] https://openacs.org/doc/current/tutorial-database.html
[2] packages/acs-core-docs/www/files/note-procs.tcl
[3] https://openacs.org/doc/current/objects.html
[4] http://rubick.com:8002/openacs/content_repository
[5] https://openacs.org/forums/message-view?message%5fid=189046

Collapse
Posted by Nima Mazloumi on
Something else related to the above. While the TCL API Browser is very sophisticated I found the PL/SQL Browser very weak:
- only a list
- also the list didn't seem to be complete
For instance: content_type__create_type is not listed. I was only able to display it calling directly:

api-doc/plsql-subprogram-one?type=FUNCTION&name=content_type__create_type

- there is only the source code available but no documentation on what the function is all about and what the parameters mean

Is there a tcl api like documentation available for functions or a search?

Greetings,
NIma

Collapse
Posted by Nick Carroll on
Nima,

Check out the Wiki package, as it makes use of the CR TCL API.

My rule of thumb for when to use acs_objects, is to use acs_objects when I need to use the permissions API for accessing info in a particular table.

I don't use acs_objects for tables that simply map one ID with another ID.

In most cases I tend to use acs_objects.

Collapse
Posted by Jade Rubick on
By the way, the rubick.com link will work as soon as I get around to fixing it.
Collapse
Posted by Nick Carroll on
It is also interesting to note that with the TCL CR api, there may not be a need for a datamodel for an application. The wiki package demonstrates this. Also the notes package could be rewritten to use the TCL CR api, so you can blow away notes-create.sql.

I guess you'll just be using acs_objects that exist in CR, as oppose to defining your own object types. This could very well simplify the application datamodel.