Fruddled Gruntbugglies

Enthralling readers since 2005

Author: lpaulriddle

  • The ongoing Oracle Calendar saga

    Well, my initial efforts to use the Oracle Calendar SDK have been a resounding failure. I got everything installed, and was able to compile a “hello world” type program. However it appears that our calendar server is too old and crusty to work with the newer set of API functions, all of which have the prefix CSDK_. Apparently I need to use the old CorporateTime API, with functions that begin with CAPI_. Now, when I run nm * in the SDK library directory, it turns up a bunch of these functions, but I’m not sure they’re actually what I want, and I don’t have any documentation or sample code. I’ll search around, and give this one more shot, but I’m beginning to resign myself to the fact that this is going to have to be a partially-manual process, at least until we upgrade our calendar server.

    On the same front, I started looking at what it would take to create my own .ics file which I could subscribe to with iCal. I started by creating a dummy calendar in iCal, publishing it, copying the published .ics file into /tmp on my linux box, and then unpublishing the file in iCal (which deletes it off the WebDAV server). I then edited the .ics file in /tmp, changed the name, copied it file back to the web server, and successfully subscribed to it with iCal. Apple sticks a GUID field, among other things, into its published .ics files, and I’m not sure how I’d generate one from scratch, so I’ll just use this file as a template and I’ll be able to build a .ics file that iCal will be happy with. So, making progress here.

  • Oracle Calendar API Revisited

    Well.. I’ve managed to track down the Oracle Calendar SDK libraries for Linux. They’re included with the Oracle Collaboration Suite distribution, which I had originally thought only included libraries for the Mac. I did a little more digging and found this post on Oracle’s Calendar SDK message board. It turns out I need to run the installer and let it do an “official” install of the stuff. A bit convoluted given that all I need is a couple libraries and include files, but if it works…

    Here’s what I did:

    1. Downloaded the Oracle Collaboration Suite distribution (version 10g) from Oracle’s web site. It came as a 3.8-gig multipart compressed tar archive (thank God for Internet2)! After running the script to assemble the parts, I ended up with a file called OCS_101200.tar.gz.
    2. I’m not interested in everything in the tar file, just the calendar stuff. This is all in a directory called calendar_standalone. So, I untarred just that directory: tar xzvf OCS_101200.tar.gz calendar_standalone.
    3. I ran the installation script, runInstaller -ignoreSysPrereqs. The option tells the installer to keep running even though I’m not running one of Oracle’s pre-approved flavors of Linux.
    4. Walk through the menus, select the SDK, and follow the directions.

    After doing this, I ended up with the SDK (along with 300 megs of other kruft) installed in my home directory under a directory called product.

    Haven’t played around with it yet, but hopefully I can write something to do a simple event extract. If that works, I can write an automated script that extracts the data, massages it, and posts it as an iCal subscription. Stick it in cron to run nightly, and I’ve got my ultimate solution for Oracle Calendar integration. Wish me luck!

  • Missing Sync

    Well, as promised, I sprung $40 for The Missing Sync for Palm OS. I’ve installed it, set up sync with iCal and Address Book, and tried out the internet connection sharing feature. My initial impressions are good. Setup was painless. The iCal sync seems to work very well. The initial sync resulted in some duplicate calendar entries, but I think that’s because it was also pulling in my data from Palm Desktop. Once I deleted the duplicate data and got rid of the old Palm Desktop conduits, it worked great. As for the internet connection sharing, I doubt I’ll get much use out of it, but it works without a hitch.

    Missing Sync also includes an app that allows you to mount the SD card on the Mac desktop as an external volume. As I don’t yet have an SD card, I haven’t been able to try this out. I’m curious as to how it works. The documentation does not reveal many details. I’m hoping it emulates the USB storage standard, which would let me mount it on my Linux boxes as well. I’d like to be able to use the Palm as sort of a “poor man’s jump drive.” Again, I may not end up using it much, but I can try it out and see if it’s useful to me, or if I’d be better served with a “dedicated” USB jump drive.

    If it turns out that it doesn’t emulate USB storage, I can try out a product called Card Export II which advertises this functionality. It’s only $15 and I can download a fully functional trial version. But I’m hoping Missing Sync will do it for me.

    Next up.. I think I’m going to rework my Oracle Calendar intergration a bit. I’m going to write a Perl script to take the exported Oracle Calendar data (in vCal format), tweak it a bit for all-day events and holidays, and write it out in iCalendar format. Then I can just post the resulting iCalendar file on my web site, and subscribe to it with iCal. That way I don’t have to import it into iCal, which is a cumbersome process. We’ll see how it goes.

  • Phase One Calendar Plan

    It turns out, from my readings on the net, that iCal is a little limited with regards to publishing remote calendars and subscribing to them. You can either publish, or subscribe, but not both. That knocks iCal down a few pegs in my book, but it still seems to be the best option going for Palm synchronization, so I’m still going to build my initial calendaring solution around it. I won’t have all the functionality that I want, but it will be a good start.

    Incidentally, after my initial experimentation with Sunbird, I went back and read more about it. It turns out the version I was using, version 0.3alpha, is based on a total code rewrite and is actually less stable than its predecessor, version 0.2. I tried 0.2 out, and it doesn’t seem to suffer from the crashing problems I had with 0.3alpha. In fact, I can subscribe to and edit a remote WebDAV calendar just fine. iCal cannot do this (presumably because Apple wants to sell me a .mac membership to get this functionality). This, coupled with the fact that Sunbird works on Mac, Windows and Linux, makes me lean towards Sunbird as my ultimate Calendaring solution. However, as Sunbird does not have Palm sync support yet, I’m still stuck with iCal for the time being. So here’s what I’m going to do:

    1. Shell out the $40 for the Missing Sync product, to get tightly integrated Palm sync support for iCal. Hope the product works as well as advertised.
    2. Load all of my calendar data into iCal (export data out of Oracle Calendar and merge any local changes that I put into Palm Desktop)
    3. Publish all of my iCal calendars to my WebDAV server so I can view them with PHP iCalendar. Set up autopublish so they stay up to date.
    4. Try out the Oracle Calendar SDK. It would be nice to have a command line tool to export the data out of Oracle Calendar and automatically generate a .ics file that I can subscribe to with iCal.

    This will give me most of the functionality I’m after. I’ll be able to view, but not edit, the published calendars with PHP iCalendar or Sunbird. To edit them I’ll either need to use iCal on my laptop, or my Palm. Not perfect, but livable.

  • Fun with the National Student Clearinghouse

    Can I just say that I hate configuring passthrough authentication to outsourced sites on remote web servers?

    Rule 1: The company’s step-by-step setup instructions will not apply to your particular system configuration.
    Rule 2: It never works the first time.
    Rule 3: See rule 2.
    Rule 4: Debugging is impossible, because the error logs are on the remote site.

    It’s kind of like playing pin-the-tail-on-the-donkey: Put on blindfold, spin around a few times, try some stuff, and maybe you can get it to work. If not, call the rep. The rep is invariably non-technical and will have to pass the request on to a developer. The developer may or may not get back to you with useful info. Or maybe an error log. Or something. Then, you try again.

    Oh, and I forgot….
    Rule 5: Once you eventually do get it working, it will work for awhile, then break at the most inconvenient time possible, when the vendor decides to make some change to the remote site without telling anyone. Thus, it becomes a perpetual maintenance-hassle-waiting-to-happen that hangs over your head for, well, forever.

    I just, finally, got the passthrough authentication to work with the National Student Clearinghouse. Basically, their stuff works like this: Post several magic variables to their web server. Server sends back a form that includes an encrypted token. Form uses javascript to auto-post itself back to NSC web server, which brings up the student’s clearinghouse view.

    To make a long story short: It’s very picky about the HTTP_REFERER. We gave them the URL of our development server ahead of time. In the initial request, the referrer string that the script sends must begin with the URL we provided to them. Fine, I can use LWP::UserAgent to post the initial request, and set the referrer to whatever I want. I was still missing one piece though: In the second request (the auto-post form which is sent to the browser), the referrer must exactly match the referrer that I sent in the first request. Of course, NSC’s documentation conveniently doesn’t mention this.

    Example: If I give them ‘http://devel.umbc.edu’ as the development URL, then my initial referrer must begin with that. I can send ‘http://devel.umbc.edu/cgi-bin/blah.pl’ and it will accept that. On the second request, I have to send it exact the same referrer string as I did in the first request, or it won’t accept it, even if it matches the development URL. Got that?

    I probably made this harder on myself than it needed to be, by trying to get cute and fudge the referrer header from a URL other than the development URL I gave them. But it’s a bit annoying to have to jump through these hoops to make the thing happy about the referrer, given that it’s a really bad idea to rely on the referrer for any kind of security purposes in the first place.

    Oh well, let’s hope I don’t have to do this again for awhile.

  • Initial Impressions of Sunbird

    Just spent a bit of time playing around with Sunbird. I would call it “not quite ready for prime time.” It’s got a nice interface. I was able to subscribe to my iCal-published calendar without a hitch. It can auto-reload remote calendars on startup. I can also create local calendars and publish them successfully. However, the publishing support seems to be kind of a work-in-progress. When I publish a new calendar, it doesn’t remember its URL. I have to re-type it every time I publish. When I try to modify a remote calendar that I subscribed to, it crashes. There appears to be no support for auto-publishing as entries are made.

    I’ll keep an eye on Sunbird, but it looks like it’s not quite ready for day-in day-out use. I expect it’ll get there eventually though.

  • More on publishing and sharing calendars

    I did some more research on calendar sharing over the long weekend. The first thing I tried was using iCal to publish a calendar to my new WebDAV server. It worked without a hitch. However, all this does is upload the .ics file to the web directory. I can then subscribe to the calendar with another iCalendar-capable client, but there’s no built-in facility to view the calendar with a web browser, as I had originally thought (apparently this is a feature of Apple’s .mac subscription service).

    A little bit more searching turned up a nifty app called PHP iCalendar. This does exactly what I was looking for: install it, point it at a directory with iCalendar files, and it displays everything on my web browser. Installation was as easy as putting mod_php4 on my web server, untarring the distribution, and editing the config file. It works great and the interface is nice. So, with that I now have read-only access to my calendar from anywhere on the net.

    I also wondered if there was a full-featured iCalendar-compatible calendar app out there for Linux. I found the Mozilla Calendar and Sunbird Project. Mozilla Calendar is a plugin for Firefox or Thunderbird, while Sunbird is a standalone app. Both share the same codebase, features and bugs. This is alpha pre-release software, but it’s being actively developed and appears to be the most promising solution. It works with Windows, Mac and Linux, meaning I could hypothetically use it on all three platforms (although on the Mac, I currently need iCal for Palm synchronization). I’ve downloaded this and verified that it seems to work, but I haven’t played with it extensively.

    All this gives rise to the question: Could I keep the “official” version of my calendar on my web server, access it with Sunbird, iCal and/or PHP iCalendar, and have all my changes automatically sync up with the web copy? That is definitely the question, and if it’s doable, I think it’s the optimum solution. If I can track down a working version of the Oracle Calendar SDK for Linux, I could even automate the integration with Oracle Calendar.

    I know I can configure iCal to automatically publish to the web whenever I make a change to it (although I’ve never tried it so I’m not sure how it works in practice). I think Sunbird has a similar capability. Again, it remains to be seen how well this will actually work. I don’t have the Mac with me today, so I’ll play around with Sunbird on my Linux box, and see what it can do.

  • Can’t forget the Palm

    The final piece of the puzzle is the Palm. I need to get the Palm syncing up with iCal. Apple provides an app called iSync which can do this. However, I tried it and was not impressed. iSync is an intriguing application, but it seems mainly geared towards cell phone type devices. Its support for the Palm seems to be kind of an afterthought. It works, but it doesn’t support a lot of the features on the Palm, particularly with the address book

    A more promising looking solution is a commercial product called The Missing Sync. This is a total replacement for Palm Desktop/HotSync that is specifically geared to the Mac. It reportedly integrates very well with iCal and the Mac’s address book. It also includes a lot of nifty extras (internet connection sharing, expansion card mounting, etc).

    Missing Sync costs $40, but based on what I read, it’s worth the price. There are two things about it that I would consider negatives:

    1. No trial/demo version available I’m willing to look beyond this because of the overwhelmingly positive reviews I’ve read about the product. A lot of people, myself included, like try-before-you-buy, particularly with software. They could probably sell more copies of this if they had a demo version. Let people try it, wonder how they got along without it, and they’ll buy it.
    2. Can only be installed on 2 macs Not an issue for me now, as I have only 1 mac, but who knows how many I’ll accumulate over the years? I really hate it when companies cripple their products like this. Still, I’ll live with this despite my philosophical problem with it. If it ever becomes an issue for me, I’ll complain loudly.

    Issues aside, it looks like a high quality product, and unless I change my mind about using iCal, I’ll probably give this a go.

  • WebDAV Server

    No secret now that I’m looking to iCal as my calendaring app of choice, so I’m continuing to put it through its paces. Next up is to try out its publishing feature. Supposedly, I can publish the calendar to any WebDAV server and then access it using a web browser (or subscribe to it using another iCal client).

    I didn’t have a WebDAV server sitting around anywhere, so I went ahead and set one up using Apache 2.0.54 with mod_dav/mod_dav_fs. It was pretty easy, basically just load the DAV modules and enable DAV in the appropriate directory (with authentication of course). I can access it with a command-line tool called cadaver, which provides FTP-like access to the WebDAV space. So it looks like everything is good to go on the server side.

    I don’t have my Mac with me today, so I’ll try uploading a calendar tonight after I get home.

  • More on exporting and importing

    Playing around some more with Oracle Calendar’s export feature, and the resulting data file, to try to get my all-day events to show up properly in iCal. First off, Oracle Calendar can actually export into two different formats, vCal and iCalendar. iCalendar is actually a newer spec that grew out of vCal. Apple’s iCal can import either format. This is significant, because when I export in iCalendar format, the all-day events get imported into iCal properly. When I use vCal, they show up as one-minute meetings starting at midnight.

    So… let’s just use iCalendar instead of vCal, right? Wrong. First off, I have no problem exporting a small date range (say, a month) in iCalendar format. When I try to export a 3-year date range, Oracle Calendar goes off into la-la land and never comes back. OK, well maybe it eventually comes back, but I gave up after about 20 minutes and killed it. This happened with multiple clients on multiple machines, so it’s not just the Mac. It’s either having a problem with one of my entries (which would be a bug), or it just plain takes forever. Either way, this makes it unusable for my purposes.

    Not only that, when I managed to successfully export an iCalendar file, iCal wouldn’t import it. It imports the first entry and then seems to quit. Not sure which app is at fault here, but don’t really care.

    That leaves me with vCal. Oracle Calendar will export three years of data in vCal format in about a minute or so. Not exactly lightning fast, but usable. Now, how to get iCal to treat my events as events and not 1-minute meetings?

    Here’s the deal: the vCal spec uses the DTSTART and DTEND fields to identify meeting start and end times, respectively. If you leave out DTEND, it treats the entry as an untimed event. And it works. If I edit the vCal file and remove DTEND from an untimed event, iCal imports it properly. Here’s a Perl script to do it:

    #!/usr/bin/perl
    #
    while (<>) {
        print;
        if (/^BEGIN:VEVENT/) {
            printEvent();
        }
    }
    exit 0;


    sub printEvent() {
        my @evData = ();
        my $miscFlag = undef;
        while (<>) {
            push(@evData, $_);
            if (/^CATEGORIES:MISCELLANEOUS/) {
               nbsp;$miscFlag = 1;
            }
            elsif (/^END:VEVENT/) {
                foreach (@evData) {
                    print unless (/^DTEND:/ && $miscFlag);
                }
                last;
            }
        }
      }