Forum OpenACS Q&A: Using the API for shell scripts
This is my first post to the list.
Thanks to the builders of OpenACS.
It is a great piece of software!
My organization is testing OpenACS (with dotLrn)
and I have to load many users and courses from one
external DB (more than 10000 users). Is there any way
to make a shell script from command line (not Web)
to insert the users and courses in OpenACS?
I am reading the API and doing some testing without any
If that is possible, please, send me one example
Welcome to the community!
Have you looked at the batch synchronization?
If you have the possibility of fitting the users into a big XML document following the IMS Enterprise 1.1 specification for user information, we can load it into .LRN automatically.
The documentation is still a bit short of perfect:
Visit /acs-admin/auth/ on your server to work it.
If you need anything explained, just post here.
Thanks for the reply.
That is a nice tool!
But I need some thing more flexible, for
calling from command line (linux bash).
I am looking the code for call tcl procs that
I need but I have found that several tcl used code is
embebed in aolserver (like nsv_array structure)
and I do not know how could I use that
from my program (it is programed in C).
All the way, I think of OpenACS would need full
independence from aolserver code. In that way we
could build tools for administrate since command
I think the following is not useful for Jose's application, but just in case:
If on the other hand you're writing an AOLserver module in C, you may have noticed that AOLserver provides no C API to nsv, only a Tcl API. However, it is fortunately not too difficult to add an efficient C NSV API. I have done so and use it myself, although I never packaged it up for release. (Which means if someone actually needs it, let me know.)
If you are writing a non-AOLserver multi-threaded program and miss the AOLserver Nsv API, you are in luck, just use the Tcl Threads Extension with tclsh. It's tsv api is just like nsv only better. Last time I looked tsv also has only a Tcl API no C; I never tried to add a C API to it but presumably it should also be feasible.
I've been working on a project to do this, and running arbitrary API code works pretty well. This is an old version of the code, but should do what you want.
If you have trouble getting it working, I'll try to package up something more current.
I am in the process of transfering a slightly smaller amount of data from a legacy system to a dotLRN1.0 postgres system. I am working from a excel export of the data so I am useing CSV. I created almost 5000 users from a CSV and the web interface in a couple hours. The trick for me was running Jeff's object__new performance improvements.
For Sloan we transfered data from a legacy ACES database on the same box Tracy wrote scripts that connected to both databases, extracting the data from the old database then running the tcl APIs to import the data into dotLRN. AISEC expanded and refined these scripts.
If you want to connect up to two running databases see this thread: http://openacs.org/forums/message-view?message_id=32476
If you want to extract your old data as CSV and upload it contact me, I'm doing that this week.