Programmatically adding appointments to Oracle Calendar 10
I'm trying to integrate a Web开发者_开发百科 scheduling appliance with my organization's calendar system, Oracle Calendar 10. Getting meetings out is just a matter of parsing the UNICPOUTR output, and I thought I had a handle on getting meetings in with UNICPINR, but I'm getting a couple of odd errors.
Basically I grab the room description from UNICPOUTR, append the data for the new meeting, write out to /usr/tmp, and try to import the resulting file. I created a test resource to try things out, but something's gone odd. Here's the resource description from UNICPOUTR:
{
F Unison Export File
V A.02.53
E FALSE
X
R a Test Resource
R b
R c 10
R d
R e
R f
R g
I
P 4 480 1080 1 30 190 2 1 60 0 0 10
N 0
}
But trying to use this as a basis for an import file results in the rather odd error:
"R=Test Resource/N=Test Resou/CA=10/LOC=10/PHONE=10/EXT=10/FAX=10/PSW=g"
does not exist
Trying to get a handle on the resource with the -ls flag on UNICPINR, as
unicpinr -ls /usr/tmp/meeting.test
just spits out
unicpinr: file pattern not found - First
after a message on how to use the utility.
Is anybody out there familiar enough with the system that they can tell me what's going wrong here, or better yet suggest an alternate way to get new meetings in?
Okay, so after spending a day chewing on it, I've come up with this solution. There were a couple problems at work here (notwithstanding the -ls which I haven't investigated).
First: while UNICPOUTR will produce blank lines for acceptable nulls in the resource description, UNICPINR will for some reason assume that a blank line means to use the value from the previous line of input.
Second: UNICPINR doesn't seem to be able to search on anything other than the resource name.
Solution: take the resource description block and filter out the lines that start with X (room administrator), I (room password), and "R b" through "R g" (various resource identifiers). UNICPINR can run a search with "R a" just fine.
The resulting import, however, leaves all the meetings thinking they were created (M) and owned (W) by the room itself, but the original creator/owner are in the comments section prefaced by "Event creator: " and "Event owner: ", so I can work with that.
This may be a problem that only I will ever face, but it's responsible to leave the solution, however kludgy, in case someone else is out there groping about blindly. So here it is.
精彩评论