mcidasv/mcidasv — pull request #21 by mhiley (2013-02-18 21:35:49+00:00)
Title: Fixes for ADDE bundle resave problem [925]

Hey Jon.. I've been poking around occasionally at this problem with re-saving ADDE-image-containing bundles, and I think I've finally come up with a decent looking fix for it. When you get a chance can you take a look and let me know what you think? The 2 changes are:

(1) If the DataCategory from the DataChoice is null, then just set it to DataCategory.CATEGORY_IMAGE. This avoids an NPE in Hashtable and as far as I can tell only matters for the little tab label that pops up as you are selecting which data to save.

(2) Only mess with the ADDE URL parameters if we are actually dealing with an ADDE URL (as opposed to local file). The problem was that when re-saving bundles, we are working with local area files instead of ADDE URLs, and "replaceKey" was adding ADDE parameters on to the end of the filepaths, leading to an invalid URL that would cause "writeTo" to fail later on.

I've mostly tested with local ADDE sources and zipped bundles, but just tried remote/zipped and remote/unzipped and had good luck with those combos also. I can't even get a local/unzipped bundle to load in the first place, but have the same problem in 1.2- so either I'm doing something dumb there or it's a different issue.

Thanks!
Mike