The Blog

I had the need to set Business Data and other column values in the ItemAdding event handler. I had to use ItemAdding, because I needed the changes committed so that the values I set would be visible on the Edit Properties screen immediately after uploading a document. Using the synchronous handler guaranteed that the values would be set.

I ran into the following issues with ItemAdding/ItemAdded event handlers:

  • Setting AfterProperties for some columns was not working using the InternalName of the field.
  • For Microsoft Office document file types, any data that I set in ItemAdding event via AfterProperties was lost after the first time the item was edited.

According to other people’s experience, when using the AfterProperties in ItemAdding event, you must use the Internal Name of the field, not the display name.

properties.AfterProperties[list.Fields[“Display Name”].InternalName] = somevalue;

When I did this, however, my experience was exactly the opposite. It was only by using the Display Name of the field that I could actually get any of the data to stick. I’m not sure if it was my particular mix of SP1, Site Content types, 64bit server, and the use of a Business Data column on the document library that was making it not work, but I simply had to use the display name, or else none of the data I set would stick (my column names had a mix of spaces and no spaces, and interestingly the column names with no spaces worked either way).

This whole architecture of hashtables of properties and trying to match up values seems to me to be pretty fragile, and I’m not sure why Microsoft went this way. It also seemed to create my second problem, where data I did set disappeared.

Once I got things working with the Display Name of the field, I then noticed that I had a problem with the data disappearing after I would edit the properties of the document. But this was only for Microsoft Office document types, things were fine for image files, text files, xml files. In debugging, I checked the values at ItemAdding, ItemAdded, ItemUpdating, and ItemUpdated. Everything looked as it should through ItemUpdating, but somewhere in between ItemUpdating and ItemUpdated, the data was lost, and my values were set to empty strings. It seems there is something strange with the parser for Office file types.

To get around this, I had to set the values again in the ItemAdded event and Update the ListItem.

I would have simply switched to using ItemAdded exclusively, since that seemed to retain the data in all cases, but my code was executing a call to the Business Data Catalog, and so was a little slow. This would cause errors from SharePoint when a user would change data in the Edit Properties screen after upload, because it would complain that the file was recently updated. Generally a problem I would expect from an asynchronous handler.

To solve this, I do the heavy lifting code in ItemAdding, and then simply do a resetting of the value in ItemAdded to ensure that it sticks.

properties.ListItem[“DisplayName”] = properties.AfterProperties[“DisplayName”];properties.ListItem.SystemUpdate();

I still don’t feel comfortable using ItemAdded for this, but it seems to be fast enough that I don’t have any problems.

I recently had the need to create a custom SharePoint application page (living in_layouts directory) that needed to display the BDC entity picker control, so that a user filling out this form could select a BDC entity instance, exactly like a user would in a business data column defined on a list. It took a while to figure it out, here are the steps to get it working: Continue Reading →

I got this recipe for a solution to cleaning moldy walls, like my concrete block garage walls currently are.

  • 1 5 gallon bucket
  • 4 gallons hot water
  • 1 cup TSP
  • 1 cup bleach
  • 1 cup pinesol

Mix and then scrub the walls. Then they’ll be ready for paint.

Permalink

Shanna and I just saw Indiana Jones and the Kingdom of the Crystal Skull. There was plenty of that Indiana Jones charm, and Harrison Ford seemed to pick up right where he left off with the last film.

Originally, I was worried that it would be all computer graphics driven, and that it would lose the feel of reality, but barring a scene of swinging on vines in the jungle, it wasn’t too heavy on the CG.

What I always liked about the other movies was that even though some of the actions scenes were hairy and crazy, they were still plausible. Could someone hang on to a rope bridge after it had been cut? Maybe. Could someone avoid a rolling boulder and then escape from natives with poison darts? Maybe. Could someone survive a tank going off a cliff? Maybe.

This fourth movie however was full of too many ridiculous, over the top stunts that were not believable at all. This left very little suspense, as you knew that no matter what, the entire team of heroes was going to come out unscathed (the refrigerator scene in particular).

The story was interesting, but rushed. I felt that there was just too much action to pack in, that there was not enough time left to develop the characters and the story. My biggest beef with the film was that there was very little down-time. The moments of dialog with Sean Connery, the gross dinner scene at the Temple of Doom, the bar in Nepal. There was plenty of slow time to develop things in the other movies, but not in this one.

Overall, it was entertaining and met my expectations, but predictably not better than any of the other films.

Permalink

We’ve implemented Ontolica search (for MOSS 2007) for several of our customers. The product fits our service offerings very well, and provides a great value add for minimal cost and effort (compared with other search replacement products).

The sales team has been very helpful and responsive. They’ve provided trial licenses quickly and without hassle, have provided training and demos/overviews of the product, and have even been excellent interfaces to help escalate support incidents. I can’t really say enough about the sales team.

I can’t say that about their support however. So far, they have had just about the worst level of support I have experienced with a third party SharePoint product. If you file a support incident through their web site or via email, you are guaranteed to not get a response.

I filed one particular support incident, never heard back from anyone, until 2 months later, when I received an automated email asking me if my incident had been resolved. Another incident received no response until I involved the sales persons, who managed to look into the issue themselves. A co-worker filed another incident, and never heard a response. I’m not even convinced they have a support team.

Outside of the support, if you are interested in their product, keep in mind that they have very little extensibility. This can be important if you ever need to write any customized search code, and would like to take advantage of the Ontolica features in your custom search solution.

One client of ours had a need to run searches using impersonation, so we wrote code to leverage the MOSS search web service, passing in the credentials of the impersonating account. We would have liked to have been able to pass our returned results into the Ontolica web parts (or simply have been able to use Ontolica with impersonation), but the web parts all use internal hidden search objects that are obfuscated and cannot be interacted with (unless you like deciphering obfuscated code). This made it so that we had rich search tabs with all the Ontolica features, and then our customized search tab with stripped down functionality. To be fair, my beef also lies with Microsoft for closing up their own search with the SearchResultHiddenObject, which cannot be used easily without reflection and a big level of effort. I would have thought that a product that provides such a good experience with installation and configuration would have put more thought into extensibility (and support).

Overall I would give Ontolica 3 out of 5 stars.