Forum OpenACS Q&A: Personal/Corporate Calendar in ACS
I have successfully installed the OpenACS without too
much trouble .
I am investigating the possibility for using ACS for
personal and corporate use. In this respect a very
important feature is the use of a personal/corporate
calendar for booking meeting rooms, making sure
everybody can attend, the secretary must easily be able
to book meetings for others, check where they are, etc. I
haven't been able to figure out (yet) if this is part of the
intranet part of ACS. Could someone please explain to
me how if it is, or does anyone have a module doing
kindly booked us a room using the aD web-based booking
module/corporate calendaring module.
Which is NOT part of the ACS at this point.
We were kinda going like "hey, why hasn't this been released, people
would love this" and the response was that no one had had time to do so.
You might ask your question over at web/db, though since several aD
folk (including Adam) monitor this forum we might get a response here.
If aD were to make the code available, but not neatly packaged up etc,
perhaps a volunteer could be found to port it and integrate it with
the existing OpenACS release?
(hint hint to all concerned)
it's designed for ACS 3.4, and is in APM format.
To use it, just gunzip the APM & take a look at the code that lies beneath.
public and user calendar categories in the datamodel. The admin UI
doesn't fully support the datamodel, however (wasn't quite there in
ACS Classic 3.2, I guess). However, it doesn't take much work to set
up a simple UI to set up the various kinds of calendar events.
There's also an easy-to-use calendar drawing widget that takes an
ns_set of julian date keys and HTML values, parameters for background
and foreground colors, day headers, etc etc etc.
With a little work you can set up a simple calendar which displays
shared and private calendar dates tailored to the individual user.
I assume that the room reservation system uses the calendar module to
store reservation dates, but haven't looked at the code so could be
wrong. The calendar module itself does no scheduling or similar work,
it is truly just a simple calendar tool.
If you look into the room reservation system, be warned that OpenACS
doesn't support the 3.4 APM tools. You'll have to unpackge it to port
it. This shouldn't be hard.
Of course, our 4.1 version will fully support the APM system.
I feel I am on deep water here. I have been trying to convert the ACS (personal) calendar .apm package to OpenACS-3.2.4. I think I got the .sql right and I am now trying to get the tcl's running. After some tweeking, I got the initial .tcl's to load into the server at start-up, but I constantly run into 'command not found' when trying to load the calendar's index.tcl. Is there anywhere documented the differencies (HowToPort...) between ACS and OpenACS-3.2.4 ? Or am I just doing something plain stupid ? .
When the tcl file is sourced at startup, does it load gracefully or are there any errors reported?
calendar package. Probably a 3.4, and absolutely a 3.4 if I
understand correctly just what you downloaded.
OpenACS 3.2 predates the arsDigita Package Manager (apm), so doesn't
have any of the package stuff in it. You have a couple of options,
rip out the package stuff, or wait until we get the ACS 4 core ported
and rewrite the package as an ACS 4 package.
I realize this isn't a very satisfactory answer, you've caught us at a
point where our initial port is obsolete and our future port only just
about to start (hey, it's Feb 3, and we said we'd start Feb 1, we
gotta get going here).
I just downloaded the .apm file and took a look. The major issue is that it's an ACS 3.4.x package and OpenACS is based on 3.2.x. Between those versions, ACS added the package management stuff as well as some new database-access stuff.
So, I don't think you've done anything wrong - you're on the right track. Basically you need to look at each command that is not found and decide if it's needed. If so, you need to figure out how to port it to 3.2.4. As far as I know, there isn't a HOWTO on this, but I'm happy to help here, where I can.
1) ad_library - it looks like this is a documentation routine. Since it's not present in any of the other files in the /web/$openacs-server/tcl directory, I would just delete this call.
2) ad_page_contract - this function specifies the form variables that the page should expect and sets them. It does some documentation stuff as well. You should be able to delete this call and replace it by the simple
set_the_usual_form_variables 0. Be aware that this call may do some error-checking as well, so you may need to validate the input yourself. Also, it's a good idea to document what variables you expect in the form.
3) db_1row - This is from the new database access api. Look at this document for some background info. You'll need to convert all the calls starting with db_ to the ns_db equivalent. Plus, you'll need to do your own handle management. So, I would do ...
set db [ns_db gethandle] # now you got a handle. send this to all your db calls in this file ... ns_db 1row $db $sql_query ... # done with db stuff - release your handle ns_db releasehandle $db
Hopefully, this will get you started. Good luck!
set item_id [db_exec_plsql cal_ins_item_on_id_table "
:1 := cal_ins_item_on_id_table(:on_which_table, :on_what_id,
:title, :user_id, :group_id, :description, :html_p,
:related_link_url, :related_link_text, :redirect_to_related_link_p,
Will this work in 3.2.x or do I have to implement some plsql function?
As far as the db_exec_plsql call, you are correct. You need to port "cal_ins_item_on_id_table" and then you can call it like this:
set item_id [database_to_tcl_string "select cal_ins_item_on_id_table(....)"]
You will also need to port the bind variables so that you use regular tcl variables instead.
Regarding ad_proc, I've not taken a close look at 3.4 so don't know what the private/public function flags do. I suggest you study the code - it may be taking advantage of namespaces (Tcl 8x) or the like to avoid name collisions. But I don't know. Does anyone else, offhand?
(I'm busy with a bunch of stuff at the moment, otherwise I'd be willing to dig into the details myself).
The "begin 1:=func_name(); end;" constructs refer to a PL/SQL function. You have to rewrite func_name() in PL/pgSQL. You might see Roberto's beta "PL/pgSQL for PL/SQL porters" manual, also referenced in the "4.0 design" forum.
After re-writing the function, you simply call it like this:
ns_db 1row $db "select func_name()"
Postgres doesn't require the "from" clause in such cases, i.e. no need to do a "from dual". Since you're not interested in the result of the function in this case, you don't need to call set_variables_after_query.
[20/Feb/2001:02:49:50][27955.10245][-conn3-] Error: dbinit: db handle limit exceeded: thread already
owns 1 handle from pool 'main'
[20/Feb/2001:02:49:50][27955.10245][-conn3-] Error: could not allocate 1 handle from pool "main"
It occurs because I have inserted [ns_db gethandle] ... ns_db release handle, in several places in the tcl functions. Of course these functions are nested, but in 3.4.x the db handles are controlled by the db_xxxx functions, whereas in 3.2.x they handled by the programmer, right? If I am right, to solve this problem you need quite a good idea of the structure the system (and the calendar package in particular). To get such an overview I would like some kind of tool to analyse tcl scripts. Does any of you have/know of such a tool or do you have any other idea of what to do in this situation. Has this occured in any of the other work of converting ACS -> OpenACS?
Did you ever succeed in porting the 3.4 calendar package to OpenACS 3x? If so (or even if you never quite got it working) can I get a copy of what you've done so far?
One of my upcoming tasks, for a client, will be to generalize the calendar package so it can track *any* object derived from acs_events, rather than just the calendar object type (the acs_event type has all the time and date information needed to display calendar events).
I also have a copy of the 3.4-based room reservation package mentioned above.
The cool thing to do would be to rewrite the room reservation package to use the standard acs_events data type and massage it in whatever other way is needed to make it work well within the OpenACS 4 framework (expose it to the search package, for instance). By basing it on the standard OpenACS 4 acs_events data type the reservation could then be easily added to the right calendar (AFTER I make the changes to the calendar package mentioned above, which will happen in the next two weeks).
A lot of people would love to have this. I've not looked at the code for the room reservation system so don't know how closely tied it is to the old intranet package. It should be generalized in any case if it is.
If you're interested in working on this, e-mail me privately and we'll talk things out...
Changes: I improved the interface so that the first screen you see is the table showing you which rooms are free and busy. You click on the time slot you want instead of filling out the form, and it gives you the form with the spot you wanted already filled in.
(e.g., Jade changing the UI on room reservations), it would be a
Really Good Idea for the 4.x module owners to look at those
improvements from a pageflow perspective. Much of 4.x is
actually a step backward in terms of usability.