April 2005 - Posts

Smart Client sessions at Microsoft Days
29 April 05 05:41 PM | madsn | with no comments

Yesterday I held three sessions at the quartely Microsoft Days (Microsoftdagene) event in Oslo. In three sessions we covered Smart Clients in the Service Oriented Architecture, todays technologystack, and the features of the upcoming technology stack from Microsoft with focus on VSTO 2005 and Windows Forms 2.0.

If you attended please feel free to post questions or feedback here on my blog.

Presentations are available for download here:

In the next weeks we will also be visiting Trondheim, Bergen and Stavanger. Check out the Microsoftdagene homepage for more details.

Dynamic InfoPath Forms Impossible?
08 April 05 06:07 PM | madsn | 7 comment(s)

UPDATE: The scenario gets less and less impossible:-)

I embarked on our first major InfoPath based solution looking forward to sunny days. My biggest mistake seems to be not leaving my ASP.NET mindset behind.

I started out creating a form that looks up data based on an id from a service and updates the data. I wanted the form to load data for editing on open, freeing users from having to query with the id manually. The form was supposed to be deployed on several Sharepoint sites, each with a different id for looking up the data. I figured that InfoPath must have some way of beein parameterisized, but no, not without somehow altering the xml of the source document. What I really wanted was some kind of QueryString.

My first hunch was to promote the id field from the form to the form library and the alter the value in the form library, but it's read-only. Editing the properties.xfp file in the Form Library Forms directory removes the read-only, but the value does not propagate two ways, only from the form to the library.

My second hunch was to relink the form in the form library, but this only changes the processing instruction of the xml document, doing nothing with the data connections in the template. Same applies for the Processing Instruction Update Tool in the InfoPath SDK.

There are solutions (or hacks) out there but they all seem a bit "ugly". I really don't want any additional deployment steps to support my forms because it sort of takes the whole point away.

I gave up passing data to the form dynamically and figured that the Sharepoint site could have a configuration list that the form could look up to get the id I needed through the InfoPath Sharepoint adapter. Worked out great! Now my InfoPath form would display the data correlating to the id configured in the current Sharepoint Configuration List that I'd created and included in the site template.

Final problem was to make the form relate dynamically to the Sharepoint site on which it is deployed. This seems like a trivial feature. "I'm creating a form that uses contextual data from the current Sharepoint site, that's obviously possible" I thought. Assumptions is the mother of all fuckups.

You see, the url of the current site is accessible from script through the XDocument.Solution.URI property, but the SiteUrl property of the SharepointListAdapter is read-only

Last resort was to modify the structural information of the form (manifest.xsf) with script. MSDN has a nice little article describing the process and I went ahead constucting XPath to manipulate my //xsf:dataObject/xsf:query/xsf:webServiceAdapter/xsf:operation/@serviceUrl through the XDocument.Solution.DOM property as instructed.

Guess what? When the Object Model property is readonly, so is it's xml based data. Trying to alter the text property of the nodes resulted in an exception saying "InfoPath cannot update the data because the form is currently read-only."

Great stuff. It is seemingly not possible to create site-relative dynamic InfoPath forms. Any form you make must be irreversably tied to the url entered at design time. I really wish someone proves me wrong here.

So what did we do? As of now, nothing. This is a frustration-outburst-post. My plan however is to reconstruct the entire logic of the form to include the standard Query View to retreive the data. We no longer deploy the form to multiple sites, but leave all forms in one location. This still forces us to redesign the form and rehook all connections each time we do another deployment of the site template. Sucks, but it's at least a one-time-per-deployment-affair. Then we save each instance of the form to the form library so that users only have to query once for each id. The rest of the time we can simply link to the existing xml file. Of course the form itself needs to include logic to show the query view only when no id is selected, but that's a breeze.

 

 

Filed under:
Anders Hejlsberg visits Oslo
05 April 05 05:15 PM | madsn | with no comments

Today we've had the pleasure of having Anders Hejlsberg on a visit to Oslo and he's been touring press, academic foras, NNUG, JavaBin, and a Microsoft hosted event. My colleague Trond Brande followed mr. Hejlsberg with two talks on upcoming SQL Server 2005, and I finished the day at Folkets Hus with two sessions on Best Practices for development, and Visual Studio Team System.

Although some were there only for the main attraction, most stuck around all the way through Team System and we had several interesting questions. I've made my presentations available here and here, and they'll also be available at Microsoft somewhere pretty soon.

Watch out for the Microsoft Days coming up soon all around Norway:

Oslo:             27th - 28th of April
Trondheim:    3rd - 3th of May
Bergen:          10th - 11th of May
Stavanger:      12th - 13th of May

More Posts

This Blog

<a name="MyWork">!My work!</a>

Funstuff

Goodies

MSCRM Blogs

Sharepoint

Useful reading

Weblogs

Syndication