Monday, May 3, 2010

The BDC, Required Metadata, and the Word2007 Properties Panel = FAIL

Word 2007 has some nice integration features with Sharepoint.  One of them is the implementation of a "Server Properties" panel from with the client.  Its intended purpose is to allow the user to edit both the document's content and metadat from within the same interface.  It works flawlessly with simple metadata.  However, when you introduce a metadata field that taps into the business data catalog (BDC), things go horribly, horribly wrong.

Ideally, your document has a field that exposes a connection to the BDC and then tries to autopopulate other fields based on that connection.  In the Sharepoint 'Properties' page, these autopoulated fields are editable.  However, in the Word2007 client, these fileds are grayed out, waiting for data from the BDC.  You cannot edit these fields.  This becomes problematice if the Primary Key field for the BDC metadata is required.  The Word2007 client interprets not only the main field as required, but all the fields that this connector autopopulates.  What if your database record for this primary key is not fully filled out?  What if its missing one piece of data?  That data cannot be autopoulated into the metadata field (which is implicitly required in Word2007).  As a result, when you try to save and check in the document, Word throws an error saying that the required meatdata is not filled out.  You are stuck!  You can't leave any field blank, but you also can't fill them out due to the fact that they're autopopulated. 

At this point you have one of 4 options:
  • Uncheck the 'Required' property for the Primary Key BDC metadata
  • Upload, but don't check in the document.  Then go into the Sharepoint GUI, fill out the required properties, and check in.
  • Check in the document using Word 2003 or earlier.
  • Fill out all the data for that BDC record in the source database.
None of these workarounds are good from a usability standpoint.  If anyone has a better workaround for this, let me know.

"Unknown user profile error..."

This was a particularly devilish problem that came to light last year.  Our team's information architect was updating his MySite in Sharepoint when he got this error.  He had no idea why it suddenly popped up.  He had been uploading a new picture to his profile when the error occured. 
Ok, it doesn't like the picture file for some reason, I'll just delete it.
Nope, it still gave him the error even after deleting the picture.  Now every save to the profile, no matter how small, threw the error. 
Something must have changed in the environment thats broken the MySite collections.

Wrong answer again.  No changes or updates had been applied to production in that week.  So what is going on here?  The short answer is that there is a bug i how Sharepoint handles some configurations of the Profile field properties.  That's a pretty general answer, but I'll break it down step-by-step.

If a property for a field is configured in the following manner:


'User can override security policy' (YES),
AND
'Do not allow user to make changes to this field'
AND
There is text in the field.

...the profile will not save correctly. What can mask this condition is if there is no content in a that field.  You may have those properties set on the profile that will cause the error, but until the user populates the field with content, no error will be thrown.  It took me several iterations of careful troubleshooting to figure this one out.  You can mitigate these errors by unchecking the 'User can override security policy' property.  Logically, you can see how the two properties in question can conflict with each other.  If the 'security policy' is a property of the field, but you don't allow users to make changes to the field, and you choose to let user's override it....well, you see the loop we're in now?

In our case, we have information importing from a Domino database that populates these fields.  So our information architect was filling out his information in his Lotus Notes address book, and 'causing' errors in Sharepoint.  Hope this helps anyone with similar problems.

Saturday, April 24, 2010

Perfect Recipes: Red Beans and Rice

Some time ago, when my wife started pursuing her college degree, I became the main cook in our house.  This is one of the first recipes that I started with and I've been refining it ever since.  Jared Wilson, a fellow at Boar's Head Tavern, originally shared this dish with me, and I liked it so much its been in my regular meal rotation.  I've been refining it ever since and am very pleased with the final result.

One of the best things about this recipe is how easy it is to make.  Its also relatively inexpensive, and serves a large family with leftovers.  Enjoy!

Prep Time: 30 minutes
Cook Time: 2 to 8 hours (depending on how you cook it)
Servings: 8-10
Cost: ~$15.00

My red beans and rice recipe

Ingredients:
1 pound dried red beans (I use rosadas), rinsed and sorted over
4-6 strips of bacon
1 1/2 cups chopped yellow onions
1 lb andoullie sausage (or polish sausage)
1 cup bell peppers, chopped
1 cup chopped celery
1/2 tsp pepper
2 Tbl Tony Cacherres Creole seasoning
1 tsp pimenton (smoked paprika)
1 bay leaf
3 cloves of garlic pressed
3 cups of water
4 cups chicken stock
1 cup beef stock
2 cups rice (to serve with)

Direction:
  • In a large soup pot cook bacon until most of the fat is rendered.
  • Remove bacon and saute vegetables in the bacon grease
  • After about 4 minutes add the garlic and cook for 1 minute.
  •  Add all other ingredients, water, stock, stir well, and bring to a boil. 
  • Reduce the heat medium-low and simmer, uncovered, stirring occasionally, until the beans are tender and starting to thicken, about 2 hours.
  • Alternately, you can transfer all of this to a crock pot and cook for 8 hours on low or 4 hours on high.
  • Serve with cooked rice

Thursday, February 11, 2010

The Limits of Evil

I just completed a wonderful book by Neil Gaiman called Stardust.  Its your typical fantasy book set in the world of Faerie: the boy gets the girl, a lost lineage is restored, simple people have nobility awakened within them.  It was thoroughly enjoyable even if it wasn't otherwise remarkable.  One particular thing that struck me, however, was the interaction of two of the main characters: the villian and the slave.

Without giving away too much of the story, there was a situation where a witch had held a woman in servitude for 30 years.  Her slavery ended when the hero arranged matters so that the conditions of breaking the spell that bound her were satisfied.  "These things have their own rules...", she said. 

That's the part that struck me.  In faerie stories, evil has rules that it must follow.  Their are limits imposed upon it by a power that is necessarily greater and better.  In the real world, it seems like evil has free reign.  We've just finished a century that arguably saw more war, ethnic cleansing, and genocide than any other time in history.  Evil is everywhere.  Even those who count themselves as the 'good', if they are honest, recognize that it is only the hairsbreadth of lawful government and privledge that seperate us from complicity with the atrocities we observe from afar.  There doesn't seem to be any limitations or rules that the roving militia needs to follow.  There's no deep magic that seems to govern the random ghoul of cancer. 

And yet, there is a wall.  There is a boundary that say's "this far and no farther".  Evil must play by the rules God sets in place for it.  It has no choice, though it would rage against it.  We are proctected and kept in the promise that some day all will finally be well...that "after my body has been destroyed, yet in my flesh I will see God.  That's why faerie stories resonate so strongly.  We know that his is the way the world should be, and the way it really is, though we can't see it yet.  The hero has arranged an end to our slavery, and all the years stolen from us will be restored, all the relationships torn from us will be reunited in joy, and our sometimes lonely walk through life will end with a homecoming to a house full of companions and one loving Father at last.

Wednesday, January 27, 2010

Perfect Beef Stroganoff

I'm a little obsessive when it comes to cooking. I have a small repertoire of recipes (about 20), but I keep refining them until they're as close to perfection as I can get them. Last night, I made my final tweeks to a beef stragnoff recipe that has come as close as I can get it. Remember, these recipes are to my taste, so you're version of nirvana will differ from mine. I'm of a school of thought that says complicated recipes are just a way to try to make all foods taste like bacon. In any case, here's the recipe:

Ingredients
1.5 pounds beef chuck roast or stew beef
1/2 teaspoon salt
1/2 teaspoon ground black pepper
4 ounces butter
4 green onions, sliced (white parts only)
1/2 onion chopped
1/2 tsp of rosemary
1/2 tsp thyme
4 tablespoons all-purpose flour
1 (14 ounce) can beef broth
1 teaspoon prepared mustard (I like brown)
6 ounce sliced mushrooms
2 cloves of garlic - pressed or minced
1/2 cup sour cream
1/3 cup white wine
salt to taste
ground black pepper to taste

Directions
1.Remove any fat and gristle from the roast and cut into strips 1/2 inch thick by 2 inches long.
1.5 In a large bowl, mix Rosmary, thyme, flour, salt and pepper. Add the beef cubes and toss until they are coated.
2.In a large skillet over medium heat, melt the butter and brown the beef strips quickly, then push the beef strips off to one side. Add the onions and mushrooms, cook slowly for 3 to 5 minutes, add garlic and saute for 1 minute.
3. Pour in beef broth and bring to a boil, stirring constantly. Lower the heat and stir in mustard. Cover and simmer for 1 hour or until the meat is tender.
4.Five minutes before serving, stir in the mushrooms, sour cream, and white wine. Heat briefly then salt and pepper to taste.

Monday, April 13, 2009

The work of our hands...

As I've started on this project, my hands have begun to remember things. Hands have a memory. They might not recall the arithmetic of numbers or anything quantitative, but they have long memories for the way a thing should 'feel'. I can put a shovel in my hand and remember a day long past when my father and I shoveled yards of gravel onto our dirt driveway. The swing of a wooden handled hammer brings to mind a day Dad and I spent roofing the house.

Hands can bring into coincidence the arc of a swing with the straight line of time; something trigonometry, with all its transformations, cannot do. So I swing, and remember, and come to love the thing I work on as an extension of myself. I pour myself into it, but the men who have taught and mentored me are poured in as well. Their stern, careful hands guide my own.

I recently had the pleasure of listening to a Rabbit Room podcast that speaks about work and its importance.

Saturday, April 11, 2009

Day 2: Removing the Engine

I had to delay removing the engine due to snow. I'm a big wimp when it comes to working in the cold. I have never enjoyed it, but working with numb fingers, trying to manipulate small parts, while laying on cold concrete is too much for me. I waited until it warmed up.


Yesterday was just warm enough where I could go outside without a jacket, so I took a crack at the engine. It was somewhat of a chore to get the engine out. I think the studs that held the engine to the bell housing were not fully installed at some point, because the were finger tight. The car slipped off of the jack during one scary moment, but the safety jacks I had in place caught the car after only a inch or two of travel....short enough where no damage was caused, far enough to make me go change my shorts.

The best part of the day was when I found out the reason for the engine seizure. In the picture to the left you can see the remains of a spring plate arm return spring. It broke off of the arm and became caught in the gears. That spring traveled up into the starter motor pinion, and got wedged between the flywheel gear and the starter - instant stuck engine. As soon as I freed the flywheel, the motor turned freely again. Take a look at the spring plate below. See the spring wrapped around one of the arms? Well, there used to be one on each of the arms. That was my problem.

I'm also going to replace the throw out bearing and control arm for good measure. The parts are cheap and I've already got the engine out, so its an opportune time to do this.

I'm debating on whether or not to replace the flywheel. At the minimum it needs to be resurfaced. A new one costs almost the same as resurfacing. Its a sign of our times. Everything costs the same amount to fix as it does to just throw away the old one and replace it. I think I might keep it just on principle.