Posts tagged ‘Software’

OpenOffice Batch Export

I’m currently using Ubuntu Jaunty 9.04 as my primary operating system. I’ve been working with a set of presentation files that were originally in Microsoft PowerPoint format (PPT), but that I converted to OpenOffice Impress format (ODP) when it appeared that OpenOffice had an issue with retaining content formatting when exporting to PPT.

Multiple people have to handle these presentation files, though, and PPT is the most universal format supported by presentation programs like OpenOffice Impress and Keynote. Additionally, when the presentations are actually used, PDF is the required final format.

To alleviate myself of the need to export the ODP version to PDF and PPT manually each time I made changes to a presentation, I did some digging and came across the wonderful unoconv utility, which uses the OpenOffice UNO bindings to allow for conversion of documents between OpenOffice-supported formats.

If you have Ubuntu, installing the unoconv package via synaptic is all it takes to make this utility available to you. The only issue I ran into with that package is that the –list flag to return a list of supported formats returns the error "unable to get gail version number" without any output. Actual document conversion seems to work without issue.

If you don’t have Ubuntu, the unoconv web site makes Red Hat and Debian packages available as well as a tarball of the source code.

Below is the bash script I used.

#!/bin/bash
for file in `ls -1 *.odp`; do
    unoconv -d presentation -f pdf --stdout $file > PDF/${file/%odp/pdf};
    unoconv -d presentation -f ppt --stdout $file > .PPT/${file/%odp/ppt};
done

Getting Google Calendars into Thunderbird on Ubuntu

As work-related events recently started piling up, we gained a need to keep them organized. So we got a Google Calendar, shared it between us, and all was dandy. I wanted to be able to pull that into my local e-mail client, though. I’m running Ubuntu Ibex and its Thunderbird package.

My friend and colleague Keith Casey pointed out to me that Thunderbird has a Provider for Google Calendar add-on that works with Lightning, which I already had installed. So I install the GCal add-on and restarted Thunderbird. No visible change. I checked the Add-ons area only to find that the entry for the GCal add-on was displaying the message "Requires additional items" with no way to see what said items were. A search prompted me to check the version of the Lightning add-on, which I found to be 0.8 because I’d already installed the Ubuntu package for it and that was the latest version available.

As it turns out, the Ubuntu wiki has instructions for what I figured out on my own the first time around: version 0.9 of the Lightning extension has to be downloaded and installed manually for 64bit builds. After that, the GCal add-on was right as rain. Adding a calendar was as simply as accessing Google Calendar via the web, going to Calendar Settings for an individual calendar, and using the XML link for that calendar when adding the calendar to Lightning using new new Google Calendar option added by the GCal add-on.

Acadiana Open Source Group

While the Acadiana Macromedia Multimedia User Group has been around for a number of years and the recently formed Acadiana .NET User Group (requires Silverlight) has added to the number of user groups in the Acadiana area, there was still a void left by the long since defunct Linux user group of the area that needed to be filled. To that end, I decided to spearhead an effort to start a local user group for the open source software community.

The Acadiana Open Source Group now has a web site, a Facebook group, and a first meeting scheduled for the end of April. So, if you’re in the Acadiana area or know someone who is, tell them about AOS! I’ve sent out press releases to various media sources, sent Facebook invites to friends, and will likely end up posting flyers in various places around nearby UL campus before the meeting date. I want to pack the conference room we have reserved and have a large number of return visitors for the next meeting, so bring it!

IE6 Compatibility Testing via Virtualization

In my last entry, I noted that I was testing my use of SWFUpload in both IE6 and IE7. You may wonder how I managed this. Google has plenty of information on “hack” methods to get both versions of IE to coexist on a single XP installation.

If you have the machine power for it, though, there is a method that is actually supported by Microsoft to accomplish this. It employs virtualization which is becoming increasingly popular in the computing world. It is useful for two particular applications: to make server environment installations independent of the host operating system and hardware and to allow multiple operating systems to coexist on the same hardware without the need for partitioning storage devices.

In 2003, Microsoft bought out a company called Connectix which specialized in virtualization software, one of their main products being Virtual PC. Microsoft subsequently released a rebranded version of VPC as a free download.

Once the need to test applications on IE6 and IE7 for cross-compatibility was realized, Microsoft also began sporadically releasing a freely downloadable series of up-to-date Windows XP images with IE6 pre-installed and expiration dates after which the images would no longer function. The latest image is set to expire in early June 2008.

With Microsoft pushing adoption of Windows Vista and IE7, it’s uncertain as to whether or not Microsoft will continue releasing these VPC images. However, it does appear that Microsoft plans to continue developing Virtual PC. Therefore, if you have an extra Windows XP license to spare, this arrangement is a nice and relatively lightweight solution to making IE6 and IE7 available for testing on the same machine.

More SWFUpload

So I ran into a little issue with SWFUpload. The user reporting the issue was using the latest version of IE6 on Windows XP. When they clicked a button set to call selectFiles on the SWFUpload instance in use, IE would display a JavaScript error stating something to the effect of, “Exception thrown and not caught.” When I actually checked the contents of the exception instance, the actual problem was reported as “Invalid function name.”

Working my way backward through the chain of execution, I could see that IE recognized selectFiles. At this point, I thought to check the Adobe Flash Player version to ensure that it matched the version of the SWFUpload Flash component that I was running. Sure enough, it was outdated. Once I installed version 9 and restarted IE, everything worked as expected.

I haven’t tried this on IE7 under a pre-9 Flash Player version (and in fact I’m not entirely certain you can get an older version of Flash Player that will run under IE7), so this may or may not also be possible under IE7 as well as IE6. If you want to test for the issue, simply catch any exception thrown when called selectFiles and alert the user accordingly.

SWFUpload

One of the tasks I was recently given at my job involved examining issues with a browser-based batch file upload component. The component that was being used, iBULC, required a separate installation of proprietary software on the client-side, had a rather clunky browser interface, and proved difficult to troubleshot. Rather than expending effort to get iBULC to work properly, I went in search of a new solution. That new solution is SWFUpload.

SWFUpload is a small file upload solution that supports selection and uploading of multiple files, all while exposing a flexible event-driven API to allow you to handle events on the client-side in whatever manner suits your needs. It has two components, a Flash file (supports Flash 8 and 9) and a JavaScript include. A little HTML and JavaScript allows you to include these two components in your application and define handler functions to intercepts whatever events might be relevant to your interface. I was amazed at how quickly I was able to get a solution working. The examples and bundled documentation are quite good.

I only experienced two issues with SWFUpload in the process of completing my task. The first was that ampersands were being HTML encoded in the POST request being sent by the SWFUpload Flash component to my PHP script on the server side for intercepting uploaded files. This caused PHP to be unable to parse the POST parameters correctly. Luckily, the issue had already been reported and a quick fix in the JavaScript component resolved the problem.

The other issue was in the Flash component not properly sending cookie values to the PHP script, even with the JavaScript plugin for handling cookies enabled. Apparently this issue is most likely due to a known bug in the Flash player for Firefox. The only method I was able to use to circumvent the issue required including cookie data as POST parameters and checking for them there in the server-side script. Obviously this is a quick-and-dirty solution and I hope I eventually get to apply a more proper solution.

One outside issue unrelated to SWFUpload that I also ran into in the process of completing this task was an odd error in Internet Explorer. Even though the page using SWFUpload ran fine in Firefox, IE consistently returned the error “Internet Explorer cannot open the Internet site, Operation aborted.” For whatever reason, IE apparently doesn’t like it when you try to run JavaScript within <script> tags inside a table if the JavaScript isn’t contained within a function. An obscure bug, but an annoying one nonetheless. Moving the offending JavaScript to its own function appeared to fix the problem.

Outside of those issues, I was quite happy with the results. I was able to put the new solution together within an afternoon, it uses the native OS interface for multiple file selection, and it allows me to respond to the events that occur in the file upload process however might be necessary. I’d definitely recommend that you check SWFUpload out if you’re in need of a similar solution.

Goodbye WordPress, Hello Habari

So after eventually getting fed up with WordPress, especially after the WYSIWYG editor disappered in the 2.3.3 update, I finally decided to bite the bullet and migrate my blog over to Habari. Once I’d been through the process, I thought I’d write a short blog entry about the experience.

First, there was the matter of content. Though it wasn’t as easy or intuitive as it could have been to track down how to migrate content from WordPress, once I knew how, it was a snap. Simply go to Admin > Plugins, activate the WordPress Importer plugin (which comes bundled with the release), then go to Admin > Import and you’ll have a WordPress Database option. From that point, it’s just a matter of putting in the authentication credentials to point Habari at the WordPress database and it seamlessly imports all your data into the Habari database.

Next came making Habari support my existing URL scheme from WordPress. It turns out that Habari has a database table for rewrite rules, but currently no section of the admin area to manage it. Ergo, the only way to add to or change these is to do it manually. Luckily, there was a blog entry from Michael Harris that detailed all this and even provided the exact INSERT statement needed.

After that came my blog theme. If the Habari developers are ex-WordPress developers as I’ve heard, they must not have liked the WordPress API much, because the two sure are different. This made theme migration look cumbersome enough that I decided to simply retire my old blog theme in favor of a slightly tweaked version of one of the stock themes available for Habari, namely Whitespace.

Finally, there were plugins. I wanted to continue using Akismet to manage content spam, as that had tended to serve me well while I was using WordPress. Luckily, Chris Davis has created an Akismet plugin. I downloaded the archive into /user/plugins, decompressed it, and then had to dig around in the plugin’s PHP file and add in my WordPress API key and blog URL. It would be nice if this was updated to use the configuration API that Habari offers for plugins. I tried the Blogroll plugin and didn’t really care for its interface. In that particular area, I actually liked how WordPress did things.

I experienced two particularly strange things during the process of migrating my blog. One occurred when I tried to swap out directories to make the new Habari-based version of my blog live. When I did that, all plugins mysteriously deactivated. I had to go back into Admin > Plugins and reactive them individually. They all seemed to retain their settings, at least.

The other oddity happened after I activated the TinyMCE plugin so that I could use a browser-based WYSIWYG interface to edit content. The dashboard screen in the admin area (and only that screen, from what I can tell) started throwing an “exception without a stack frame” error. I’ve e-mailed the author on that one, so we’ll see what happens.

Overall, though, I’m very satisfied with Habari and look forward to using it to catch up on the backlog of post ideas I’ve managed to build up over the past few weeks.