Wednesday, January 28, 2009

Anonymous Form Submission to Form Library with InfoPath in MOSS

Here's a bit of a trick I ran across while helping to develop some MOSS2007 solutions.

I needed to configure InfoPath so that it could submit documents to a site that the submitter would not be able to access. In SharePoint, this is not directly possible.

A common work-around is to set up incoming email for the target list, and submit by email to that. Unfortunately, my client is part-way through a Notes to Exchange migration, so this wasn't practical in the given time frame.

The solution... create two sites, one that is accessible to the submitter, and the other that is not. On the accessible site, create a new, "hidden" list that the user can submit to. Add an event receiver to that list, such that whenever a new item is added, the item is moved to the real intended target using elevated privileges.

Using VSeWSS extensions, create a List Definition project that has something like this in the ItemEventReciever.cs file:


using System;
using System.Security.Permissions;
using System.Runtime.InteropServices;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using VSeWSS;

namespace AutoForwardingFormLibrary
public class AutoForwardingFormLibraryItemEventReceiver : SPItemEventReceiver
private SPListItem addedItem = null;

/// Initializes a new instance of the Microsoft.SharePoint.SPItemEventReceiver class.

public AutoForwardingFormLibraryItemEventReceiver()

/// Asynchronous after event that occurs after a new item has been added to its containing object.

/// A Microsoft.SharePoint.SPItemEventProperties object that represents properties of the event handler.
public override void ItemAdded(SPItemEventProperties properties)
addedItem = properties.ListItem;
if (addedItem == null)
throw new ArgumentNullException("properties.ListItem");
SPSecurity.CodeToRunElevated moveItem = moveItem_Elevated;

private void moveItem_Elevated()
addedItem.CopyTo(SPUrlUtility.CombineUrl("http://targetserver/sites/jimw/docs/formlibrary", addedItem.Name));

Sunday, January 11, 2009

"Rapture for the Geeks": Singularitarianism 101

My wife and I were at Barnes & Noble last week. While we were there, she walked over to me with a book, with a grin on her face, called "Rapture for the Geeks". She was making a personal joke with it, but I was too immediately intrigued... which made it all the more hilarious to her.

Being a spiritualist, optimist, scientist, technologist, and a sci-fi fan-boy (I believe the way Albert Einstein did: Everything is a miracle), all my life, I've felt like humanity's on the brink (in geological terms) of something fascinating... Needless to say, I bought it and read it.

The author, Richard Dooling, has done some fiction, but this was (mostly) non-fiction. It turns out to be an introduction to a concept called the "Technological Singularity" for para-technologists. Dooling doesn't offer any insights of his own, but brings together a lot of interesting view points from a lot of notable "Singularitarians", especially Ray Kurzweil, and Bill Joy.

The thing that I found most interesting about this book was not the ideas Dooling was relaying, but the fact that there appears to be a build-up of buzz around it. Even as the crescendo that is the "Moore's Law" prediction persists, so does the interest crescendo around The Singularity.

I remember having conversations with a wise, elder grand-uncle when I was a kid that bordered on philosophical regarding the progression of technology... back in the early 80's. I remember wondering what would happen when humanity's technology over-reached its own capacity to manage it. What would we really do, for example, if we eventually automated ourselves out of all of our "work"?

It's true... technology sure has come a long way in the past 35 years that I've been observing it (my whole life). When I was a pre-schooler, my folks had this awesome TI calculator... it had a red LED display, and did all four arithmetic functions. Almost a decade later, my first programmable computer was a Timex-Sinclair 1000 with 2K of RAM (expanded to 16K) and a cassette player for storage. Today, my preschool-age children play with "old" 1-gigahertz Pentium III machines while my own machine (a Christmas gift from my wife) is a commercial-off-the-shelf quad-core 2.3 gigahertz monster with 8GB RAM and a full Terabyte of disk space in a RAID 0 array.

With humanity's ability to abstract and build on its own technology, it's not a question of "if" we will hit some sort of existentially disruptive technology... the only important questions are "when" and "will life on Earth survive it?"

The really fun part is imagining how The Singularity might manifest itself... artificial intelligence gaining sentience? Discovering the truly united nature of time/space/matter/energy? Teleportation? Limitless energy? Immortality (via perfected nutrition, nano-technology, replicable parts, or even transference into "robotic" bodies) ? Inter-galactic travel? Perhaps God, the uber geek creator of this simulation we call life, will don His Holy "VR gear" to be present to witness the birth of His grandchild(ren). (I wonder which Cloud He might be riding in on... EC2? Blue Cloud? Surely not Azure... :) )

There's some good humor in the book, but the last few chapters are really hard trudging through. It suffers from more than a couple bouts with verbal diarrhea... one, for example, is a ten page rant about making sure you save your work as text. He also comes across as a programmatic poseur to someone who really is a programmer.

If you are already familiar with these ideas, you'll probably be insulted by this book. What kept me reading was the false hope that the author had some synthesis of his own on the subject. That said, if you're not a programmer, and are new to the topic, the first nine chapters are good, and the remaining chapters might be forgivable.

Of course, Dooling does suggest that heightened interest in The Singularity may also just be a symptom of a mid-life crisis. :)