ShowUsYour<Blog>

Irregular expressions regularly

December 2004 - Posts

New blogging tools

I just read on - .NET Blog - Chris Frazier Style - about a new release of PostXING and a new aggregator plug-in which allows you to blog about items in your aggregator via a right-click action.  The plug-in is called BlogThisUsingPostXINGPlugin and requires the latest version of PostXING to work. 

I highly recommed both tools (this post was made using both).

PostXING:
Project Distributor :: Blue Fenix :: PostXING :: 1.1.4363.1

BlogThisUsingPostXINGPlugin:
Project Distributor :: Blue Fenix :: BlogThisUsingPostXINGPlugin :: 1.0.4365.1

Posted: Dec 31 2004, 10:18 AM by digory | with 2 comment(s)
Filed under:
My New Year's Resolutions for 2005
  1. Drink more water
  2. Excercise more consistently
Posted: Dec 30 2004, 08:17 PM by digory | with 1 comment(s)
Filed under:
Introduction to C# Anonymous Methods

Bookmark to read this later:

     Introduction to C# Anonymous Methods 

Posted: Dec 30 2004, 08:06 PM by digory | with 4 comment(s)
Filed under:
Webcast - How InfoPath supports ADO.NET DataSet's

I just finished watching a WebCast about support for ADO.NET DataSet's in InfoPath:
    
    Hagen Green - MSDN Webcast: Database Connectivity in InfoPath Through ADO.NET

This is a long webcast - about a 110 mins - and I thoroughly suggest skipping the first 50 minutes which is pretty basic stuff.  The second half is quite good as it provides insight into how ADO.NET DataSet support is implemented within InfoPath which means that, when using DataSet's you get out of the box support for: constraints, auto-incrementing fields and readonly fields.

There's also an article which discusses some of those meaty ADO.NET bits on Msdn here:

    Using DataSets in InfoPath 2003 

  

InfoPath book

Ordered myself some reading material for those long flights between Canberra and Adelaide today:

   

InfoPath NEWBIE mistake #1

OK, so I've made my first major InfoPath blunder.  Being a javascript afficionado I decided that I'd create my InfoPath forms using javascript as the codebehind model as opposed to using the new, .NET model which comes with the Infopath 2003 Toolkit for Visual Studio.Net. 

It was a simple mistake; basically I thought that, because InfoPath forms are quite "lightweight" that scripting would be ideal and that it would be a perfect way to keep my js skills intact.

I guess that I must've forgotten about the BCL and how so much of the repetitive code that we write has been abstracted behind this monolithic wall of classes.

Need some examples? 

  • Adding days to a Date
  • Writing to a file
  • Working with Xml
  • Getting a Windows login account name
  • Working with DataSets

I guess that I'll spend at least part of the Christmas break porting my work over :-)

New tool for assisting with access namespaced xml elements

Using InfoPath lately has really made me sharpen up my knowledge of working with Xml such as querying it with XPath.  Prior to the last week or so, all of the Xml that I've queried has been non-namespaced.  Adding namespaces to Xml documents and nodes means that you need to set some attributes on the underlying namespace manager of the XmlDocument when you need to query it using XPath.  In C# this would look similar to this:


1XmlDocument xml = new XmlDocument() ;
2xml.Load(@"C:\Temp\Groups.xml") ;
3XmlNamespaceManager mgr = new XmlNamespaceManager(xml.NameTable) ;
4
5// ADD THE NAMESPACE
6mgr.AddNamespace("tns", @"http://MarkItUp.com/ProjectDistributor/WebServices/ProjectDistributor") ;
7// SO THAT I CAN USE IT IN THIS QUERY
8XmlNodeList nodes = xml.SelectNodes(@"//tns:Group", mgr) ;
9
10mgr = new XmlNamespaceManager(xml.NameTable) ;
11// ADD THE NAMESPACE
12mgr.AddNamespace("tns", @"http://MarkItUp.com/ProjectDistributor/WebServices/ProjectDistributor") ;
13
14for (int i=0; i<nodes.Count; i++) {
15 // SO THAT I CAN USE IT IN THIS QUERY
16 Console.WriteLine(nodes[i].SelectSingleNode("tns:DisplayName", mgr).InnerText) ;


There is a similar syntax when querying xml documents from within javascript queries in InfoPath - such as when you have javascript in a custom task pane although the syntax is slightly different.  Here is the javascript version of the above code:


1var ns2 = "xmlns:tns='http://MarkItUp.com/ProjectDistributor/WebServices/ProjectDistributor'";
2
3myXmlDoc.setProperty("SelectionNamespaces", ns2);
4var nodes = myXmlDoc.selectNodes("//tns:Group") ;
5
6for (var i=0; i<nodes.length; i++) {
7 s += 'Group: ' + nodes[i].selectSingleNode("tns:DisplayName").text ;
8}
9document.getElementById("groupsDIV").innerHTML = s ;

As you can see, you need to get the setProperty code right and also transpose the correct xmlns namespace information.  Today I wrote a little console tool which allows you to load the xml from an InfoPath form, enter the name of the node that you are looking for and it will return the correct syntax for creating the selection namespace code and querying the value from that node.  Here is the output after loading an xml document with a node named my:txtUsername:


1XDocument.DOM.setProperty("SelectionNamespaces",
2 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-12-17T00-31-40"')
3var str = XDocument.DOM.selectSingleNode("//my:txtUsername")

This is a dirt simple tool - I wrote it on the bus on the way to work :-) but, I've uploaded it my ProjectDistributor account and it is available from here:

     Project Distributor :: MarkItUp :: InfoPathXmlParser :: 1.0.0.0

Future plans will be to create a webpage which provides a simple UI for running that tool without having to have it on your own system.  What would be nice is, after loading the xml, I should display it in a TreeView and allow the user to click on nodes and retrieve the code that way instead of having to type in a raw node name.

The benefits of fully trusted InfoPath forms

You can create fully trusted InfoPath forms which have a higher privilege level than the default.  There are some simple steps to follow when you need to go down this path and they are all well explained within this document:

 

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/ipsdkUnderstandingFullyTrustedForms.asp

 

The important things to take away from that article are that fully trusted forms are A) Urn based as opposed to Url based, B) The xDocument attribute can be modified to include the "requireFullTrust" attribute setting and C) these types of forms are "Registered" on the target PC.

 

As also mentioned within the article, if you are heading down this path then you really must look into using the RegForm command-line utility to simplify the package and deployment process into a no-brainer.  RegForm has some neat options for making and packaging trusted InfoPath forms.  This tool makes it simple to package Urn based forms in an .msi to facilitate simple installation on a users computer.

 

One of the benefits of urn based, custom installed forms is that you can target Xml documents to be opened with that form template by including the urn in a processing instruction within your Xml document.

Canberra Geek Dinner #1 - The Canberra scene

As mentioned by Mitch the other day we had a Geek dinner in Canberra the other night.  It had been my intention to start these up in Adelaide next year but, now that I'm a Canberra'n it looks as though we'll have to have them here instead :-)

At this stage I think that we'll probably have them every 6-8 weeks.

The other night there were 5 of us present (including Mitch and I) and we had a topic/theme for the night of "The Canberra scene".  As always happens when you mix half a dozen geeks with beer, wine and food, the conversation was lively and varied.  We covered topics ranging from User Group meetings to Architecture (thanks to Nils) through to Host Integration Server.

 

[ Currently Playing : King's Crossing - Elliott Smith - From a Basement on the Hill (04:58) ]

ProjectDistributor - features in the next release

ProjectDistributor has been "open source" for a couple of weeks now and, in that time I've received a few e-mails highlighting bugs and also mentioning new features which should get added.  I've rolled all of those requests into the code base so, you'll see that stuff in the next release.

 

There's also some pretty major new functionality which will appear in the next release:

 

  • Application Roles
  • Announcements
  • Enhanced Rss feeds

 

 

Application Roles

In the current release there is no notion of roles.  The next application will provide functionality for adding users to roles at the application level.  This was required so that I can open up a whole slew of management API's via the web services layer such as creating users and adding them to Groups.

 

Announcements

Announcements are notes which can be added to either a project, or, to the application.  This allows the site administrator to send out "notifications" advising subscribers about important application-specific information and allows Group members to send out "notifications" advising their subscribers about important things specific to an individual project. 

 

This is cool because, imagine that you have a tool which you have uploaded and haven't worked on it for a while.  Suddenly you see a window of opportunity to spend some time working on the tool.  What you can do with announcements is to send out an announcement letting your subscribers know that you have time to spend on the tool and that you'd like some feedback about features that your users would like to see.

 

Enhanced Rss Feeds

Currently the Rss feeds are pretty cruddy as they only display information relating to new Projects which get added to the application.

 

The new Rss feeds will display items relating to:

 

  • Group changes - such as name changes or members added
  • Project changes - new projects, alterations to project details
  • Release changes - such as new Releases against a Project or, Release detail changes
  • Announcements - new announcements at group and application level.
Posted: Dec 14 2004, 05:20 PM by digory | with no comments
Filed under: ,
More Posts Next page »